	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usb_suspend_resume_test        ## -- Begin function usb_suspend_resume_test
	.p2align	4, 0x90
_usb_suspend_resume_test:               ## @usb_suspend_resume_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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movl	%edi, %r12d
	movl	$1, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	leaq	-48(%rbp), %rcx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$4, %r8d
	callq	_sysctlbyname
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_2:
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_find_usb_device
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_libusb20_dev_open
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_str.7(%rip), %rdi
	callq	_puts
	jmp	LBB0_17
LBB0_3:
	leaq	L_str.8(%rip), %rdi
	callq	_puts
	jmp	LBB0_18
LBB0_6:
	movq	%rbx, %rdi
	callq	_libusb20_dev_get_power_mode
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_printf
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movq	-56(%rbp), %r13
	movq	%rbx, %rdi
	callq	_libusb20_dev_check_connected
	testq	%rax, %rax
	je	LBB0_7
LBB0_15:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_16:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_libusb20_dev_set_power_mode
LBB0_17:
	movq	%rbx, %rdi
	callq	_libusb20_dev_free
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movslq	%r14d, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	-64(%rbp), %r15
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_libusb20_dev_set_power_mode
	cmpl	$1, %eax
	sbbl	$-1, %r14d
	xorl	%eax, %eax
	callq	_usb_ts_rand_noise
	movl	%eax, %ecx
	imulq	$1125899907, %rcx, %rcx         ## imm = 0x431BDE83
	shrq	$51, %rcx
	imull	$2000000, %ecx, %ecx            ## imm = 0x1E8480
	subl	%ecx, %eax
	leal	4100000(%rax), %edi
	callq	_usleep
	incl	%r12d
	movq	%rbx, %rdi
	callq	_libusb20_dev_check_connected
	testq	%rax, %rax
	jne	LBB0_15
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	cmpq	-64(%rbp), %r13
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.6(%rip), %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_printf
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
	movq	-64(%rbp), %r13
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	leaq	-56(%rbp), %rsi
	leaq	-80(%rbp), %rdx
	callq	_timersub
	movq	-80(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	-72(%rbp), %rax                 ## 8-byte Folded Reload
	jge	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_LIBUSB20_POWER_ON@GOTPCREL(%rip), %rax
	testb	$1, %r12b
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_LIBUSB20_POWER_SAVE@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hw.usb.power_timeout"

L_.str.1:                               ## @.str.1
	.asciz	"WARNING: Could not set power timeout to 1 (error=%d) \n"

	.comm	_errno,4,2                      ## @errno
L_.str.4:                               ## @.str.4
	.asciz	"Starting suspend and resume test for VID=0x%04x PID=0x%04x\n"

L_.str.6:                               ## @.str.6
	.asciz	"STATUS: ID=%u, ERR=%u\n"

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

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

L_str.8:                                ## @str.8
	.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_suspend_resume_test        ; -- Begin function usb_suspend_resume_test
	.p2align	2
_usb_suspend_resume_test:               ; @usb_suspend_resume_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x23, x1
	mov	x22, x0
	mov	w8, #1
	str	w8, [sp, #20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	add	x3, sp, #20
	mov	x1, #0
	mov	x2, #0
	mov	w4, #4
	bl	_sysctlbyname
	cbz	w0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _errno@GOTPAGE
Lloh3:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
LBB0_2:
	mov	x0, x22
	mov	x1, x23
	bl	_find_usb_device
	cbz	x0, LBB0_5
; %bb.3:
	mov	x19, x0
	mov	w1, #0
	bl	_libusb20_dev_open
	cbz	w0, LBB0_6
; %bb.4:
Lloh7:
	adrp	x0, l_str.7@PAGE
Lloh8:
	add	x0, x0, l_str.7@PAGEOFF
	bl	_puts
	b	LBB0_15
LBB0_5:
Lloh9:
	adrp	x0, l_str.8@PAGE
Lloh10:
	add	x0, x0, l_str.8@PAGEOFF
	bl	_puts
	b	LBB0_16
LBB0_6:
	mov	x0, x19
	bl	_libusb20_dev_get_power_mode
	str	w0, [sp, #16]                   ; 4-byte Folded Spill
	stp	x22, x23, [sp]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	add	x0, sp, #32
	mov	w1, #0
	bl	_gettimeofday
	ldr	x25, [sp, #32]
	mov	x0, x19
	bl	_libusb20_dev_check_connected
	cbnz	x0, LBB0_13
; %bb.7:
	mov	w22, #0
	mov	w23, #0
	sxtw	x24, w21
Lloh13:
	adrp	x26, _LIBUSB20_POWER_ON@GOTPAGE
Lloh14:
	ldr	x26, [x26, _LIBUSB20_POWER_ON@GOTPAGEOFF]
Lloh15:
	adrp	x27, _LIBUSB20_POWER_SAVE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _LIBUSB20_POWER_SAVE@GOTPAGEOFF]
	mov	w28, #56963
	movk	w28, #17179, lsl #16
	mov	w20, #33920
	movk	w20, #30, lsl #16
	mov	w21, #36768
	movk	w21, #62, lsl #16
LBB0_8:                                 ; =>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_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	stp	x23, x22, [sp]
Lloh17:
	adrp	x0, l_.str.6@PAGE
Lloh18:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
Lloh19:
	adrp	x8, _stdout@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_fflush
	ldr	x25, [sp, #40]
LBB0_10:                                ;   in Loop: Header=BB0_8 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.11:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	x8, x24
	b.ge	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	tst	w23, #0x1
	csel	x8, x27, x26, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_libusb20_dev_set_power_mode
	cmp	w0, #0
	cinc	w22, w22, ne
	bl	_usb_ts_rand_noise
	and	x8, x0, #0xffffffff
	mul	x8, x8, x28
	lsr	x8, x8, #51
	msub	w8, w8, w20, w0
	add	w0, w8, w21
	bl	_usleep
	add	w23, w23, #1
	mov	x0, x19
	bl	_libusb20_dev_check_connected
	cbz	x0, LBB0_8
LBB0_13:
Lloh22:
	adrp	x0, l_str@PAGE
Lloh23:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_14:
	mov	x0, x19
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	bl	_libusb20_dev_set_power_mode
LBB0_15:
	mov	x0, x19
	bl	_libusb20_dev_free
LBB0_16:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hw.usb.power_timeout"

l_.str.1:                               ; @.str.1
	.asciz	"WARNING: Could not set power timeout to 1 (error=%d) \n"

	.comm	_errno,4,2                      ; @errno
l_.str.4:                               ; @.str.4
	.asciz	"Starting suspend and resume test for VID=0x%04x PID=0x%04x\n"

l_.str.6:                               ; @.str.6
	.asciz	"STATUS: ID=%u, ERR=%u\n"

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

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

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

.subsections_via_symbols
