	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cosm_register_device           ## -- Begin function cosm_register_device
	.p2align	4, 0x90
_cosm_register_device:                  ## @cosm_register_device
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %r14
	addq	$8, %r14
	movq	%r12, 32(%rax)
	movq	_cosm_release_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	%r15, 40(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	movq	_cosm_bus@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rbx)
	movl	(%r13), %ecx
	movq	_cosm_index_ida@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ida_simple_get
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movl	%r15d, (%rbx)
	movl	%r15d, 8(%rbx)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_dev_set_name
	movq	%r14, %rdi
	callq	_device_register
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movl	%eax, %r15d
	movl	(%rbx), %esi
	movq	_cosm_index_ida@GOTPCREL(%rip), %rdi
	callq	_ida_simple_remove
LBB0_5:
	movq	%r14, %rdi
	callq	_put_device
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_7:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_cosm_release_dev,4,2           ## @cosm_release_dev
	.comm	_cosm_bus,4,2                   ## @cosm_bus
	.comm	_cosm_index_ida,4,2             ## @cosm_index_ida
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cosm-dev%u"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cosm_register_device           ; -- Begin function cosm_register_device
	.p2align	2
_cosm_register_device:                  ; @cosm_register_device
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	add	x19, x0, #8
Lloh2:
	adrp	x8, _cosm_release_dev@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cosm_release_dev@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x0, #24]
	stp	x22, x21, [x0, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_dev_set_drvdata
Lloh5:
	adrp	x8, _cosm_bus@GOTPAGE
Lloh6:
	ldr	x8, [x8, _cosm_bus@GOTPAGEOFF]
	str	x8, [x20, #16]
	ldr	w3, [x23]
Lloh7:
	adrp	x0, _cosm_index_ida@GOTPAGE
Lloh8:
	ldr	x0, [x0, _cosm_index_ida@GOTPAGEOFF]
	mov	w1, #0
	mov	w2, #0
	bl	_ida_simple_get
	mov	x21, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
	str	w21, [x20]
	str	w21, [x20, #8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_set_name
	mov	x0, x19
	bl	_device_register
	cbz	w0, LBB0_7
; %bb.3:
	mov	x21, x0
	ldr	w1, [x20]
Lloh11:
	adrp	x0, _cosm_index_ida@GOTPAGE
Lloh12:
	ldr	x0, [x0, _cosm_index_ida@GOTPAGEOFF]
	bl	_ida_simple_remove
LBB0_4:
	mov	x0, x19
	bl	_put_device
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_cosm_release_dev,4,2           ; @cosm_release_dev
	.comm	_cosm_bus,4,2                   ; @cosm_bus
	.comm	_cosm_index_ida,4,2             ; @cosm_index_ida
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cosm-dev%u"

.subsections_via_symbols
