	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_wait_for_event          ## -- Begin function libusb_wait_for_event
	.p2align	4, 0x90
_libusb_wait_for_event:                 ## @libusb_wait_for_event
	.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	%rsi, %rbx
	callq	_GET_CONTEXT
	movq	%rax, %r14
	movq	_LIBUSB_DEBUG_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_DPRINTF
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	_CLOCK_MONOTONIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rsi
	callq	_clock_gettime
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	-32(%rbp), %rax
	addq	8(%rbx), %rax
	movq	%rax, -32(%rbp)
	imull	$1000, (%rbx), %ecx             ## imm = 0x3E8
	addl	-40(%rbp), %ecx
	movl	%ecx, -40(%rbp)
	cmpl	$1000000000, %ecx               ## imm = 0x3B9ACA00
	jl	LBB0_7
## %bb.6:
	addl	$-1000000000, %ecx              ## imm = 0xC4653600
	movl	%ecx, -40(%rbp)
	incq	%rax
	movq	%rax, -32(%rbp)
LBB0_7:
	leaq	12(%r14), %rdi
	movq	%r14, %rsi
	addq	$8, %rsi
	leaq	-40(%rbp), %rdx
	callq	_pthread_cond_timedwait
	movl	%eax, %r15d
	movq	(%r14), %rax
	movq	_NO_THREAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_pthread_self
	movq	%rax, (%r14)
LBB0_9:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	(%rax), %r15d
	sete	%bl
	jmp	LBB0_10
LBB0_1:
	leaq	12(%r14), %rdi
	movq	%r14, %rsi
	addq	$8, %rsi
	callq	_pthread_cond_wait
	movq	(%r14), %rax
	movq	_NO_THREAD@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pthread_self
	movq	%rax, (%r14)
	jmp	LBB0_10
LBB0_4:
	movq	_LIBUSB_ERROR_OTHER@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ## @LIBUSB_DEBUG_FUNCTION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"libusb_wait_for_event enter"

	.comm	_NO_THREAD,8,3                  ## @NO_THREAD
	.comm	_CLOCK_MONOTONIC,4,2            ## @CLOCK_MONOTONIC
	.comm	_LIBUSB_ERROR_OTHER,4,2         ## @LIBUSB_ERROR_OTHER
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_wait_for_event          ; -- Begin function libusb_wait_for_event
	.p2align	2
_libusb_wait_for_event:                 ; @libusb_wait_for_event
	.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
	mov	x20, x1
	bl	_GET_CONTEXT
	mov	x19, x0
Lloh0:
	adrp	x8, _LIBUSB_DEBUG_FUNCTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBUSB_DEBUG_FUNCTION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_DPRINTF
	cbz	x20, LBB0_7
; %bb.1:
Lloh5:
	adrp	x8, _CLOCK_MONOTONIC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CLOCK_MONOTONIC@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, sp
	bl	_clock_gettime
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	x8, [x20, #8]
	ldr	x9, [sp, #8]
	add	x8, x9, x8
	str	x8, [sp, #8]
	ldr	w9, [x20]
	mov	w10, #1000
	ldr	w11, [sp]
	madd	w9, w9, w10, w11
	str	w9, [sp]
	mov	w10, #51712
	movk	w10, #15258, lsl #16
	cmp	w9, w10
	b.lt	LBB0_4
; %bb.3:
	mov	w10, #13824
	movk	w10, #50277, lsl #16
	add	w9, w9, w10
	str	w9, [sp]
	add	x8, x8, #1
	str	x8, [sp, #8]
LBB0_4:
	add	x0, x19, #12
	add	x1, x19, #8
	mov	x2, sp
	bl	_pthread_cond_timedwait
	mov	x20, x0
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _NO_THREAD@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NO_THREAD@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	bl	_pthread_self
	str	x0, [x19]
LBB0_6:
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w20, w8
	cset	w0, eq
	b	LBB0_11
LBB0_7:
	add	x0, x19, #12
	add	x1, x19, #8
	bl	_pthread_cond_wait
	ldr	x8, [x19]
Lloh14:
	adrp	x9, _NO_THREAD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _NO_THREAD@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	bl	_pthread_self
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_11
LBB0_9:
Lloh17:
	adrp	x8, _LIBUSB_ERROR_OTHER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LIBUSB_ERROR_OTHER@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ; @LIBUSB_DEBUG_FUNCTION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"libusb_wait_for_event enter"

	.comm	_NO_THREAD,8,3                  ; @NO_THREAD
	.comm	_CLOCK_MONOTONIC,4,2            ; @CLOCK_MONOTONIC
	.comm	_LIBUSB_ERROR_OTHER,4,2         ; @LIBUSB_ERROR_OTHER
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
