	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function go7007_usb_ezusb_write_interrupt
_go7007_usb_ezusb_write_interrupt:      ## @go7007_usb_ezusb_write_interrupt
	.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	%rdi, %r12
	movq	16(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	callq	_pr_debug
	movl	$100, %r15d
	movq	_HPI_STATUS_ADDR@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	(%r13), %r9d
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$20, %edx
	xorl	%r8d, %r8d
	pushq	$500                            ## imm = 0x1F4
	pushq	$4
	pushq	8(%r12)
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movl	%eax, %ebx
	testb	$16, %bl
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_msleep
	decl	%r15d
	jne	LBB0_1
## %bb.4:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movl	$-1, %ebx
	jmp	LBB0_8
LBB0_5:
	movl	(%r14), %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %r15
	orl	(%r15), %ecx
	movq	_INT_PARAM_ADDR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	subq	$8, %rsp
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	movl	$18, %edx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	pushq	$500                            ## imm = 0x1F4
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movl	(%r14), %r14d
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	movq	_INT_INDEX_ADDR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	subq	$8, %rsp
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	$18, %edx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	pushq	$500                            ## imm = 0x1F4
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	jns	LBB0_8
LBB0_7:
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WriteInterrupt: %04x %04x\n"

	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_HPI_STATUS_ADDR,4,2            ## @HPI_STATUS_ADDR
L_.str.1:                               ## @.str.1
	.asciz	"device is hung, status reg = 0x%04x\n"

	.comm	_INT_PARAM_ADDR,4,2             ## @INT_PARAM_ADDR
	.comm	_INT_INDEX_ADDR,4,2             ## @INT_INDEX_ADDR
L_.str.2:                               ## @.str.2
	.asciz	"error in WriteInterrupt: %d\n"

	.no_dead_strip	_go7007_usb_ezusb_write_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function go7007_usb_ezusb_write_interrupt
_go7007_usb_ezusb_write_interrupt:      ; @go7007_usb_ezusb_write_interrupt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x19, x0
	ldr	x23, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
	bl	_pr_debug
Lloh2:
	adrp	x24, _USB_TYPE_VENDOR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh4:
	adrp	x25, _USB_RECIP_DEVICE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _USB_RECIP_DEVICE@GOTPAGEOFF]
	mov	w26, #100
Lloh6:
	adrp	x27, _USB_DIR_IN@GOTPAGE
Lloh7:
	ldr	x27, [x27, _USB_DIR_IN@GOTPAGEOFF]
	mov	w28, #500
Lloh8:
	adrp	x20, _HPI_STATUS_ADDR@GOTPAGE
Lloh9:
	ldr	x20, [x20, _HPI_STATUS_ADDR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x23]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x27]
	orr	w3, w8, w9
	ldr	w5, [x20]
	ldr	x6, [x19, #8]
	str	w28, [sp]
	mov	x0, x22
	mov	w2, #20
	mov	w4, #0
	mov	w7, #4
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	tbz	w0, #4, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x22, x0
	mov	w0, #10
	bl	_msleep
	subs	w26, w26, #1
	b.ne	LBB0_1
; %bb.4:
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	mov	w22, #-1
	b	LBB0_8
LBB0_5:
	ldr	w22, [x23]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w3, w9, w8
Lloh12:
	adrp	x8, _INT_PARAM_ADDR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INT_PARAM_ADDR@GOTPAGEOFF]
Lloh14:
	ldr	w5, [x8]
	mov	w20, #500
	str	w20, [sp]
	mov	x0, x22
	mov	w2, #18
	mov	x4, x21
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_7
; %bb.6:
	ldr	w21, [x23]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w3, w9, w8
Lloh15:
	adrp	x8, _INT_INDEX_ADDR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _INT_INDEX_ADDR@GOTPAGEOFF]
Lloh17:
	ldr	w5, [x8]
	str	w20, [sp]
	mov	x0, x21
	mov	w2, #18
	ldr	w4, [sp, #12]                   ; 4-byte Folded Reload
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	mov	w22, #0
	tbz	w0, #31, LBB0_8
LBB0_7:
	mov	x22, x0
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_err
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WriteInterrupt: %04x %04x\n"

	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_HPI_STATUS_ADDR,4,2            ; @HPI_STATUS_ADDR
l_.str.1:                               ; @.str.1
	.asciz	"device is hung, status reg = 0x%04x\n"

	.comm	_INT_PARAM_ADDR,4,2             ; @INT_PARAM_ADDR
	.comm	_INT_INDEX_ADDR,4,2             ; @INT_INDEX_ADDR
l_.str.2:                               ; @.str.2
	.asciz	"error in WriteInterrupt: %d\n"

	.no_dead_strip	_go7007_usb_ezusb_write_interrupt
.subsections_via_symbols
