	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function go7007_usb_interface_reset
_go7007_usb_interface_reset:            ## @go7007_usb_interface_reset
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_STATUS_SHUTDOWN@GOTPCREL(%rip), %rcx
	movl	$-1, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.1:
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	movl	$1, %esi
	movl	$1, %edx
	callq	_go7007_write_interrupt
	testq	%rax, %rax
	js	LBB0_10
## %bb.2:
	movl	$100, %edi
	callq	_msleep
	movq	(%r15), %rax
	movq	_GO7007_USB_EZUSB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_7
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movl	$0, (%rsp)
	movq	%rbx, %rdi
	movl	$16, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_go7007_usb_vendor_request
	testq	%rax, %rax
	js	LBB0_10
## %bb.4:
	movl	$0, (%rsp)
	movq	%rbx, %rdi
	movl	$16, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_go7007_usb_vendor_request
	testq	%rax, %rax
	js	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_go7007_write_interrupt
	testq	%rax, %rax
	js	LBB0_10
## %bb.6:
	movl	$100, %edi
	callq	_msleep
LBB0_7:
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_go7007_read_interrupt
	testq	%rax, %rax
	js	LBB0_9
## %bb.8:
	movl	-28(%rbp), %eax
	andl	$-2, %eax
	xorl	%r14d, %r14d
	cmpl	$21930, %eax                    ## imm = 0x55AA
	je	LBB0_10
LBB0_9:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	$-1, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_SHUTDOWN,8,3            ## @STATUS_SHUTDOWN
	.comm	_GO7007_USB_EZUSB,4,2           ## @GO7007_USB_EZUSB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resetting EZ-USB buffers\n"

L_.str.1:                               ## @.str.1
	.asciz	"unable to reset the USB interface\n"

	.no_dead_strip	_go7007_usb_interface_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function go7007_usb_interface_reset
_go7007_usb_interface_reset:            ; @go7007_usb_interface_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _STATUS_SHUTDOWN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATUS_SHUTDOWN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #16]
	mov	w1, #1
	mov	w2, #1
	bl	_go7007_write_interrupt
	tbnz	x0, #63, LBB0_11
; %bb.2:
	mov	w0, #100
	bl	_msleep
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _GO7007_USB_EZUSB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GO7007_USB_EZUSB@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	mov	w1, #16
	mov	w2, #0
	mov	w3, #0
	mov	x4, #0
	mov	w5, #0
	mov	w6, #0
	bl	_go7007_usb_vendor_request
	tbnz	x0, #63, LBB0_11
; %bb.4:
	mov	x0, x19
	mov	w1, #16
	mov	w2, #0
	mov	w3, #0
	mov	x4, #0
	mov	w5, #0
	mov	w6, #0
	bl	_go7007_usb_vendor_request
	tbnz	x0, #63, LBB0_11
; %bb.5:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	bl	_go7007_write_interrupt
	tbnz	x0, #63, LBB0_11
; %bb.6:
	mov	w0, #100
	bl	_msleep
LBB0_7:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_go7007_read_interrupt
	tbnz	x0, #63, LBB0_10
; %bb.8:
	ldr	w8, [sp, #12]
	mov	w9, #10965
	cmp	w9, w8, lsr #1
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #0
	b	LBB0_12
LBB0_10:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_11:
	mov	w0, #-1
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_SHUTDOWN,8,3            ; @STATUS_SHUTDOWN
	.comm	_GO7007_USB_EZUSB,4,2           ; @GO7007_USB_EZUSB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resetting EZ-USB buffers\n"

l_.str.1:                               ; @.str.1
	.asciz	"unable to reset the USB interface\n"

	.no_dead_strip	_go7007_usb_interface_reset
.subsections_via_symbols
