	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smscore_register_device        ## -- Begin function smscore_register_device
	.p2align	4, 0x90
_smscore_register_device:               ## @smscore_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$136, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%rax), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_INIT_LIST_HEAD
	leaq	128(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	124(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	120(%rbx), %rdi
	callq	_spin_lock_init
	leaq	116(%rbx), %rdi
	callq	_spin_lock_init
	leaq	112(%rbx), %rdi
	callq	_init_completion
	leaq	108(%rbx), %rdi
	callq	_init_completion
	leaq	104(%rbx), %rdi
	callq	_init_completion
	leaq	100(%rbx), %rdi
	callq	_init_completion
	leaq	96(%rbx), %rdi
	callq	_init_completion
	leaq	92(%rbx), %rdi
	callq	_init_completion
	leaq	88(%rbx), %rdi
	callq	_init_completion
	leaq	84(%rbx), %rdi
	callq	_init_completion
	leaq	80(%rbx), %rdi
	callq	_init_completion
	leaq	76(%rbx), %rdi
	callq	_init_completion
	leaq	72(%rbx), %rdi
	callq	_init_waitqueue_head
	movl	4(%r15), %esi
	imull	(%r15), %esi
	movl	%esi, (%rbx)
	movq	%rbx, %r12
	addq	$60, %r12
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r14), %ecx
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	movq	%r12, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 64(%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	%rax, %r14
	movq	8(%rbx), %rsi
	movslq	4(%r15), %rax
	cmpq	%rax, %rsi
	jge	LBB0_8
## %bb.3:
	movl	(%r12), %edx
	movq	%r14, %rdi
	movq	%r14, %rsi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	callq	_smscore_createbuffer
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_smscore_putbuffer
	movq	8(%rbx), %rsi
	incq	%rsi
	movq	%rsi, 8(%rbx)
	movslq	4(%r15), %rax
	cmpq	%rax, %rsi
	jge	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	(%r15), %rax
	leaq	(%r14,%rax,4), %r14
	movq	64(%rbx), %rsi
	movl	60(%rbx), %edx
	movq	%r14, %rdi
	jmp	LBB0_4
LBB0_7:
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_sms_info
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_sms_info
	movq	_DEVICE_MODE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movups	32(%r15), %xmm0
	movups	%xmm0, 40(%rbx)
	movups	16(%r15), %xmm0
	movups	%xmm0, 24(%rbx)
	movl	20(%rbx), %edi
	movl	12(%r15), %esi
	callq	_strcpy
	movl	20(%rbx), %edi
	movl	8(%r15), %esi
	callq	_smscore_registry_settype
	movq	_g_smscore_deviceslock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_kmutex_lock
	movq	_g_smscore_devices@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_list_add
	movq	%r14, %rdi
	callq	_kmutex_unlock
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_sms_info
	jmp	LBB0_12
LBB0_9:
	movq	%rbx, %rdi
	callq	_smscore_unregister_device
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%rbx, %rdi
	callq	_smscore_unregister_device
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kzalloc(...) failed"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
L_.str.1:                               ## @.str.1
	.asciz	"allocated %d buffers"

	.comm	_DEVICE_MODE_NONE,4,2           ## @DEVICE_MODE_NONE
	.comm	_g_smscore_deviceslock,4,2      ## @g_smscore_deviceslock
	.comm	_g_smscore_devices,4,2          ## @g_smscore_devices
L_.str.2:                               ## @.str.2
	.asciz	"device %p created"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smscore_register_device        ; -- Begin function smscore_register_device
	.p2align	2
_smscore_register_device:               ; @smscore_register_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #136
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	add	x22, x0, #16
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	add	x0, x20, #128
	bl	_INIT_LIST_HEAD
	add	x0, x20, #124
	bl	_INIT_LIST_HEAD
	add	x0, x20, #120
	bl	_spin_lock_init
	add	x0, x20, #116
	bl	_spin_lock_init
	add	x0, x20, #112
	bl	_init_completion
	add	x0, x20, #108
	bl	_init_completion
	add	x0, x20, #104
	bl	_init_completion
	add	x0, x20, #100
	bl	_init_completion
	add	x0, x20, #96
	bl	_init_completion
	add	x0, x20, #92
	bl	_init_completion
	add	x0, x20, #88
	bl	_init_completion
	add	x0, x20, #84
	bl	_init_completion
	add	x0, x20, #80
	bl	_init_completion
	add	x0, x20, #76
	bl	_init_completion
	add	x0, x20, #72
	bl	_init_waitqueue_head
	ldp	w8, w9, [x21]
	mul	w1, w9, w8
	str	w1, [x20]
	add	x24, x20, #60
	ldr	w8, [x23]
Lloh2:
	adrp	x9, _GFP_DMA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GFP_DMA@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, #0
	mov	x2, x24
	bl	_dma_alloc_coherent
	str	x0, [x20, #64]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	x8, [x20, #8]
	ldrsw	x9, [x21, #4]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.3:
	mov	x23, x0
	ldr	w2, [x24]
	mov	x1, x0
	bl	_smscore_createbuffer
	cbz	x0, LBB0_7
; %bb.4:
	mov	x1, x0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_smscore_putbuffer
	ldr	x8, [x20, #8]
	add	x8, x8, #1
	str	x8, [x20, #8]
	ldrsw	x9, [x21, #4]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrsw	x8, [x21]
	add	x23, x23, x8, lsl #2
	ldr	x1, [x20, #64]
	ldr	w2, [x20, #60]
	mov	x0, x23
	bl	_smscore_createbuffer
	mov	x1, x0
	cbnz	x0, LBB0_5
LBB0_7:
	mov	x0, x20
	bl	_smscore_unregister_device
	b	LBB0_9
LBB0_8:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_sms_info
LBB0_9:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_10:
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_sms_info
Lloh12:
	adrp	x8, _DEVICE_MODE_NONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEVICE_MODE_NONE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x20, #56]
	ldr	q0, [x21, #32]
	stur	q0, [x20, #40]
	ldr	q0, [x21, #16]
	stur	q0, [x20, #24]
	ldr	w0, [x20, #20]
	ldr	w1, [x21, #12]
	bl	_strcpy
	ldr	w0, [x20, #20]
	ldr	w1, [x21, #8]
	bl	_smscore_registry_settype
Lloh15:
	adrp	x21, _g_smscore_deviceslock@GOTPAGE
Lloh16:
	ldr	x21, [x21, _g_smscore_deviceslock@GOTPAGEOFF]
	mov	x0, x21
	bl	_kmutex_lock
Lloh17:
	adrp	x1, _g_smscore_devices@GOTPAGE
Lloh18:
	ldr	x1, [x1, _g_smscore_devices@GOTPAGEOFF]
	mov	x0, x22
	bl	_list_add
	mov	x0, x21
	bl	_kmutex_unlock
	str	x20, [x19]
	str	x20, [sp]
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_sms_info
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kzalloc(...) failed"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
l_.str.1:                               ; @.str.1
	.asciz	"allocated %d buffers"

	.comm	_DEVICE_MODE_NONE,4,2           ; @DEVICE_MODE_NONE
	.comm	_g_smscore_deviceslock,4,2      ; @g_smscore_deviceslock
	.comm	_g_smscore_devices,4,2          ; @g_smscore_devices
l_.str.2:                               ; @.str.2
	.asciz	"device %p created"

.subsections_via_symbols
