	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smsusb_init_device
_smsusb_init_device:                    ## @smsusb_init_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_usb_set_intfdata
	movq	%r14, %rdi
	callq	_interface_to_usbdev
	movq	%rax, 16(%r13)
	movl	%r15d, %edi
	callq	_sms_get_board
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	leal	-130(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_7
## %bb.3:
	cmpl	$128, %eax
	je	LBB0_7
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_6
## %bb.5:
	movq	_USB1_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r13)
	movq	_smsusb1_setmode@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)
	movq	_smsusb1_detectmode@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -52(%rbp)
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_sms_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_sms_err
LBB0_7:
	movq	_USB2_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r13)
	movq	16(%r13), %rax
	movq	8(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	addl	$-4, %eax
	movl	%eax, 28(%r13)
	movq	_SMS_DEVICE_FAMILY2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -56(%rbp)
	movl	24(%r13), %eax
LBB0_8:
	movq	16(%r13), %rdi
	movq	%rdi, -64(%rbp)
	movl	%eax, -72(%rbp)
	movq	_MAX_BUFFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	_smsusb_sendrequest@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movq	%r13, -88(%rbp)
	movl	-92(%rbp), %esi
	movl	$4, %edx
	callq	_usb_make_path
	leaq	-96(%rbp), %rdi
	movq	%r13, %rsi
	callq	_smscore_register_device
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	(%r13), %edi
	movl	%r15d, %esi
	callq	_smscore_set_board_id
	movq	_MAX_URBS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_13
## %bb.11:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rdi
	movq	%r13, 8(%rdi,%rbx)
	addq	%rbx, %rdi
	callq	_usb_init_urb
	incq	%r12
	movslq	(%r15), %rax
	addq	$16, %rbx
	cmpq	%rax, %r12
	jl	LBB0_12
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_sms_info
	movq	%r13, %rdi
	callq	_smsusb_start_streaming
	testl	%eax, %eax
	js	LBB0_14
## %bb.15:
	movl	(%r13), %edi
	callq	_smscore_start_device
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_16
## %bb.19:
	leaq	L_.str.6(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_sms_info
	jmp	LBB0_20
LBB0_9:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_sms_err
	jmp	LBB0_18
LBB0_14:
	movl	%eax, %r12d
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_17
LBB0_16:
	leaq	L_.str.5(%rip), %rdi
LBB0_17:
	xorl	%eax, %eax
	callq	_sms_err
LBB0_18:
	movq	%r14, %rdi
	callq	_smsusb_term_device
LBB0_20:
	movl	%r12d, %eax
	addq	$56, %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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kzalloc(sizeof(struct smsusb_device_t) failed"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_USB1_BUFFER_SIZE,4,2           ## @USB1_BUFFER_SIZE
	.comm	_smsusb1_setmode,4,2            ## @smsusb1_setmode
	.comm	_smsusb1_detectmode,4,2         ## @smsusb1_detectmode
L_.str.1:                               ## @.str.1
	.asciz	"Unspecified sms device type!"

	.comm	_USB2_BUFFER_SIZE,4,2           ## @USB2_BUFFER_SIZE
	.comm	_SMS_DEVICE_FAMILY2,4,2         ## @SMS_DEVICE_FAMILY2
	.comm	_MAX_BUFFERS,4,2                ## @MAX_BUFFERS
	.comm	_smsusb_sendrequest,4,2         ## @smsusb_sendrequest
L_.str.2:                               ## @.str.2
	.asciz	"smscore_register_device(...) failed, rc %d"

	.comm	_MAX_URBS,4,2                   ## @MAX_URBS
L_.str.3:                               ## @.str.3
	.asciz	"smsusb_start_streaming(...)."

L_.str.4:                               ## @.str.4
	.asciz	"smsusb_start_streaming(...) failed"

L_.str.5:                               ## @.str.5
	.asciz	"smscore_start_device(...) failed"

L_.str.6:                               ## @.str.6
	.asciz	"device %p created"

	.no_dead_strip	_smsusb_init_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smsusb_init_device
_smsusb_init_device:                    ; @smsusb_init_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	mov	x0, x19
	mov	x1, x20
	bl	_usb_set_intfdata
	mov	x0, x19
	bl	_interface_to_usbdev
	str	x0, [x20, #16]
	mov	x0, x21
	bl	_sms_get_board
	ldr	w8, [x0]
	str	w8, [sp, #8]
	sub	w9, w8, #130
	cmp	w9, #2
	b.lo	LBB0_7
; %bb.2:
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_6
; %bb.4:
Lloh3:
	adrp	x8, _USB1_BUFFER_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USB1_BUFFER_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20, #24]
Lloh6:
	adrp	x9, _smsusb1_setmode@GOTPAGE
Lloh7:
	ldr	x9, [x9, _smsusb1_setmode@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _smsusb1_detectmode@GOTPAGE
Lloh10:
	ldr	x10, [x10, _smsusb1_detectmode@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w10, w9, [sp, #52]
	b	LBB0_8
LBB0_5:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_sms_err
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_19
LBB0_6:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_sms_err
LBB0_7:
Lloh19:
	adrp	x8, _USB2_BUFFER_SIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _USB2_BUFFER_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x20, #24]
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	sub	w8, w0, #4
Lloh22:
	adrp	x9, _SMS_DEVICE_FAMILY2@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SMS_DEVICE_FAMILY2@GOTPAGEOFF]
	str	w8, [x20, #28]
Lloh24:
	ldr	w8, [x9]
	ldr	w9, [sp, #48]
	orr	w8, w9, w8
	str	w8, [sp, #48]
	ldr	w8, [x20, #24]
LBB0_8:
	ldr	x0, [x20, #16]
	str	x0, [sp, #40]
	str	w8, [sp, #32]
Lloh25:
	adrp	x8, _MAX_BUFFERS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MAX_BUFFERS@GOTPAGEOFF]
Lloh27:
	adrp	x9, _smsusb_sendrequest@GOTPAGE
Lloh28:
	ldr	x9, [x9, _smsusb_sendrequest@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
	str	x20, [sp, #16]
	ldr	w1, [sp, #12]
	mov	w2, #4
	bl	_usb_make_path
	add	x0, sp, #8
	mov	x1, x20
	bl	_smscore_register_device
	tbnz	w0, #31, LBB0_15
; %bb.9:
	ldr	w0, [x20]
	mov	x1, x21
	bl	_smscore_set_board_id
Lloh31:
	adrp	x21, _MAX_URBS@GOTPAGE
Lloh32:
	ldr	x21, [x21, _MAX_URBS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:
	mov	x22, #0
	mov	w23, #8
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x0, x8, x23
	str	x20, [x0], #-8
	bl	_usb_init_urb
	add	x22, x22, #1
	ldrsw	x8, [x21]
	add	x23, x23, #16
	cmp	x22, x8
	b.lt	LBB0_11
LBB0_12:
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_sms_info
	mov	x0, x20
	bl	_smsusb_start_streaming
	tbnz	w0, #31, LBB0_16
; %bb.13:
	ldr	w0, [x20]
	bl	_smscore_start_device
	mov	x22, x0
	tbnz	w0, #31, LBB0_17
; %bb.14:
	str	x20, [sp]
Lloh35:
	adrp	x0, l_.str.6@PAGE
Lloh36:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_sms_info
	b	LBB0_19
LBB0_15:
	mov	x22, x0
	str	x22, [sp]
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_16:
	mov	x22, x0
Lloh39:
	adrp	x0, l_.str.4@PAGE
Lloh40:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_17:
Lloh41:
	adrp	x0, l_.str.5@PAGE
Lloh42:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_18:
	bl	_sms_err
	mov	x0, x19
	bl	_smsusb_term_device
LBB0_19:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kzalloc(sizeof(struct smsusb_device_t) failed"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_USB1_BUFFER_SIZE,4,2           ; @USB1_BUFFER_SIZE
	.comm	_smsusb1_setmode,4,2            ; @smsusb1_setmode
	.comm	_smsusb1_detectmode,4,2         ; @smsusb1_detectmode
l_.str.1:                               ; @.str.1
	.asciz	"Unspecified sms device type!"

	.comm	_USB2_BUFFER_SIZE,4,2           ; @USB2_BUFFER_SIZE
	.comm	_SMS_DEVICE_FAMILY2,4,2         ; @SMS_DEVICE_FAMILY2
	.comm	_MAX_BUFFERS,4,2                ; @MAX_BUFFERS
	.comm	_smsusb_sendrequest,4,2         ; @smsusb_sendrequest
l_.str.2:                               ; @.str.2
	.asciz	"smscore_register_device(...) failed, rc %d"

	.comm	_MAX_URBS,4,2                   ; @MAX_URBS
l_.str.3:                               ; @.str.3
	.asciz	"smsusb_start_streaming(...)."

l_.str.4:                               ; @.str.4
	.asciz	"smsusb_start_streaming(...) failed"

l_.str.5:                               ; @.str.5
	.asciz	"smscore_start_device(...) failed"

l_.str.6:                               ; @.str.6
	.asciz	"device %p created"

	.no_dead_strip	_smsusb_init_device
.subsections_via_symbols
