	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usb_port_reset_test            ## -- Begin function usb_port_reset_test
	.p2align	4, 0x90
_usb_port_reset_test:                   ## @usb_port_reset_test
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	callq	_find_usb_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_libusb20_dev_open
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_libusb20_dev_free
	leaq	L_str.4(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_str.5(%rip), %rdi
LBB0_2:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_puts                           ## TAILCALL
LBB0_5:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movq	-48(%rbp), %r12
	movslq	%r14d, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	-56(%rbp), %r15
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_libusb20_dev_check_connected
	incl	%r13d
	testq	%rax, %rax
	jne	LBB0_13
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	cmpq	-56(%rbp), %r12
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_printf
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
	movq	-56(%rbp), %r12
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	leaq	-48(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	callq	_timersub
	movq	-72(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	jge	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_libusb20_dev_reset
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	incl	%r14d
	movl	$50000, %edi                    ## imm = 0xC350
	callq	_usleep
	jmp	LBB0_12
LBB0_13:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_14:
	movq	%rbx, %rdi
	callq	_libusb20_dev_reset
	movq	%rbx, %rdi
	callq	_libusb20_dev_free
	addq	$40, %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.2:                               ## @.str.2
	.asciz	"STATUS: ID=%u, ERR=%u\n"

	.comm	_stdout,4,2                     ## @stdout
L_str:                                  ## @str
	.asciz	"Device disconnected"

L_str.4:                                ## @str.4
	.asciz	"Could not open USB device"

L_str.5:                                ## @str.5
	.asciz	"USB device not found"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usb_port_reset_test            ; -- Begin function usb_port_reset_test
	.p2align	2
_usb_port_reset_test:                   ; @usb_port_reset_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	bl	_find_usb_device
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w1, #0
	bl	_libusb20_dev_open
	cbz	w0, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_libusb20_dev_free
Lloh0:
	adrp	x0, l_str.4@PAGE
Lloh1:
	add	x0, x0, l_str.4@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x0, l_str.5@PAGE
Lloh3:
	add	x0, x0, l_str.5@PAGEOFF
LBB0_4:
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_puts
LBB0_5:
	add	x0, sp, #32
	mov	w1, #0
	bl	_gettimeofday
	mov	w21, #0
	mov	w22, #0
	ldr	x25, [sp, #32]
	sxtw	x23, w20
Lloh4:
	adrp	x24, _stdout@GOTPAGE
Lloh5:
	ldr	x24, [x24, _stdout@GOTPAGEOFF]
Lloh6:
	adrp	x20, l_.str.2@PAGE
Lloh7:
	add	x20, x20, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_libusb20_dev_check_connected
	add	w21, w21, #1
	cbnz	x0, LBB0_13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #40
	mov	w1, #0
	bl	_gettimeofday
	ldr	x8, [sp, #40]
	cmp	x25, x8
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	stp	x21, x22, [sp]
	mov	x0, x20
	bl	_printf
	ldr	w0, [x24]
	bl	_fflush
	ldr	x25, [sp, #40]
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #40
	add	x1, sp, #32
	add	x2, sp, #24
	bl	_timersub
	ldr	x8, [sp, #24]
	tbnz	x8, #63, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	x8, x23
	b.ge	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_libusb20_dev_reset
	cbz	x0, LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w22, #1
	mov	w0, #50000
	bl	_usleep
	b	LBB0_6
LBB0_13:
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_14:
	mov	x0, x19
	bl	_libusb20_dev_reset
	mov	x0, x19
	bl	_libusb20_dev_free
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str.2:                               ; @.str.2
	.asciz	"STATUS: ID=%u, ERR=%u\n"

	.comm	_stdout,4,2                     ; @stdout
l_str:                                  ; @str
	.asciz	"Device disconnected"

l_str.4:                                ; @str.4
	.asciz	"Could not open USB device"

l_str.5:                                ; @str.5
	.asciz	"USB device not found"

.subsections_via_symbols
