	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_st5481_setup_usb               ## -- Begin function st5481_setup_usb
	.p2align	4, 0x90
_st5481_setup_usb:                      ## @st5481_setup_usb
	.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	%rdi, %r14
	movq	24(%rdi), %r15
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	%r15, %rdi
	callq	_usb_reset_configuration
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_ifnum_to_if
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	%rax, %rdi
	movl	$3, %esi
	callq	_usb_altnum_to_altsetting
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %r12
	movl	8(%rax), %esi
	cmpl	$7, %esi
	jne	LBB0_12
## %bb.4:
	movl	$32, %edi
	callq	___constant_cpu_to_le16
	movq	(%r12), %rcx
	movq	%rax, 56(%rcx)
	movl	$32, %edi
	callq	___constant_cpu_to_le16
	movq	(%r12), %rcx
	movq	%rax, 72(%rcx)
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_usb_set_interface
	testl	%eax, %eax
	js	LBB0_17
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_14
## %bb.6:
	movq	%rax, %r13
	movq	%rax, 16(%r14)
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_usb_ctrl_complete@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%r14
	pushq	%r10
	callq	_usb_fill_control_urb
	addq	$16, %rsp
	leaq	12(%r14), %r13
	movl	8(%r14), %edi
	callq	_ARRAY_SIZE
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_fifo_init
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_14
## %bb.7:
	movq	%rax, %r13
	movq	%rax, (%r14)
	movq	_INT_PKT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.8:
	movq	%rax, %rbx
	movq	(%r12), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	_EP_INT@GOTPCREL(%rip), %rax
	movslq	(%rax), %r12
	shlq	$4, %r12
	movl	-12(%r12,%rcx), %esi
	movq	%r15, %rdi
	callq	_usb_rcvintpipe
	movq	_INT_PKT_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_usb_int_complete@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	-16(%r12,%rcx), %r10d
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movq	%rbx, %rcx
	pushq	%r10
	pushq	%r14
	callq	_usb_fill_int_urb
	addq	$16, %rsp
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_9:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_10:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_11:
	movl	%ebx, %esi
	callq	_WARNING
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	callq	_WARNING
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_11
LBB0_18:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

L_.str.1:                               ## @.str.1
	.asciz	"reset_configuration failed,status=%d"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"expecting 7 got %d endpoints!"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"usb_set_interface failed,status=%d"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_usb_ctrl_complete,4,2          ## @usb_ctrl_complete
	.comm	_INT_PKT_SIZE,4,2               ## @INT_PKT_SIZE
	.comm	_EP_INT,4,2                     ## @EP_INT
	.comm	_usb_int_complete,4,2           ## @usb_int_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_st5481_setup_usb               ; -- Begin function st5481_setup_usb
	.p2align	2
_st5481_setup_usb:                      ; @st5481_setup_usb
	.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	x19, x0
	ldr	x20, [x0, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_DBG
	mov	x0, x20
	bl	_usb_reset_configuration
	tbnz	w0, #31, LBB0_10
; %bb.1:
	mov	x0, x20
	mov	w1, #0
	bl	_usb_ifnum_to_if
	cbz	x0, LBB0_9
; %bb.2:
	mov	w1, #3
	bl	_usb_altnum_to_altsetting
	cbz	x0, LBB0_9
; %bb.3:
	mov	x21, x0
	ldr	w1, [x0, #8]
	cmp	w1, #7
	b.ne	LBB0_12
; %bb.4:
	mov	w0, #32
	bl	___constant_cpu_to_le16
	ldr	x8, [x21]
	str	x0, [x8, #56]
	mov	w0, #32
	bl	___constant_cpu_to_le16
	ldr	x8, [x21]
	str	x0, [x8, #72]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #3
	bl	_usb_set_interface
	tbnz	w0, #31, LBB0_16
; %bb.5:
Lloh2:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_13
; %bb.6:
	mov	x22, x0
	str	x0, [x19, #16]
	mov	x0, x20
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x2, x0
Lloh4:
	adrp	x8, _usb_ctrl_complete@GOTPAGE
Lloh5:
	ldr	x8, [x8, _usb_ctrl_complete@GOTPAGEOFF]
Lloh6:
	ldr	w6, [x8]
	mov	x0, x22
	mov	x1, x20
	mov	x3, #0
	mov	x4, #0
	mov	w5, #0
	mov	x7, x19
	bl	_usb_fill_control_urb
	add	x22, x19, #12
	ldr	w0, [x19, #8]
	bl	_ARRAY_SIZE
	mov	x1, x0
	mov	x0, x22
	bl	_fifo_init
	ldr	w1, [x23]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_13
; %bb.7:
	mov	x22, x0
	str	x0, [x19]
Lloh7:
	adrp	x24, _INT_PKT_SIZE@GOTPAGE
Lloh8:
	ldr	x24, [x24, _INT_PKT_SIZE@GOTPAGEOFF]
	ldr	w0, [x24]
	ldr	w1, [x23]
	bl	_kmalloc
	cbz	x0, LBB0_13
; %bb.8:
	mov	x23, x0
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _EP_INT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EP_INT@GOTPAGEOFF]
Lloh11:
	ldrsw	x9, [x9]
	add	x21, x8, x9, lsl #4
	ldur	w1, [x21, #-12]
	mov	x0, x20
	bl	_usb_rcvintpipe
	mov	x2, x0
	ldr	w4, [x24]
Lloh12:
	adrp	x8, _usb_int_complete@GOTPAGE
Lloh13:
	ldr	x8, [x8, _usb_int_complete@GOTPAGEOFF]
Lloh14:
	ldr	w5, [x8]
	ldur	w7, [x21, #-16]
	mov	x0, x22
	mov	x1, x20
	mov	x3, x23
	mov	x6, x19
	bl	_usb_fill_int_urb
	mov	w22, #0
	b	LBB0_15
LBB0_9:
Lloh15:
	adrp	x8, _ENXIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
	mov	x22, x0
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	mov	x1, x22
	bl	_WARNING
	b	LBB0_15
LBB0_12:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARNING
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_15:
	mov	x0, x22
	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
LBB0_16:
	mov	x22, x0
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

l_.str.1:                               ; @.str.1
	.asciz	"reset_configuration failed,status=%d"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"expecting 7 got %d endpoints!"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"usb_set_interface failed,status=%d"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_usb_ctrl_complete,4,2          ; @usb_ctrl_complete
	.comm	_INT_PKT_SIZE,4,2               ; @INT_PKT_SIZE
	.comm	_EP_INT,4,2                     ; @EP_INT
	.comm	_usb_int_complete,4,2           ; @usb_int_complete
.subsections_via_symbols
