	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_init                    ## -- Begin function libusb_init
	.p2align	4, 0x90
_libusb_init:                           ## @libusb_init
	.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, %r14
	movl	$72, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %r15
	movq	$0, (%r15)
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	movl	$10, %edx
	callq	_strtol
	movq	%rax, 64(%rbx)
	cmpq	$0, (%r15)
	jne	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rax
	cmpb	$0, (%rax)
	je	LBB0_15
LBB0_4:
	movq	$0, 64(%rbx)
LBB0_5:
	leaq	60(%rbx), %rdi
	callq	_TAILQ_INIT
	leaq	56(%rbx), %rdi
	callq	_TAILQ_INIT
	leaq	52(%rbx), %rdi
	callq	_TAILQ_INIT
	leaq	48(%rbx), %rdi
	callq	_TAILQ_INIT
	leaq	28(%rbx), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_pthread_mutex_init
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:
	leaq	24(%rbx), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pthread_mutex_init
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%r12, %rdi
	jmp	LBB0_11
LBB0_8:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_9:
	leaq	-44(%rbp), %rdi
	callq	_pthread_condattr_init
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movq	%r12, %rdi
	callq	_pthread_mutex_destroy
	movq	%r15, %rdi
LBB0_11:
	callq	_pthread_mutex_destroy
LBB0_12:
	movq	%rbx, %rdi
	callq	_free
	movq	_LIBUSB_ERROR_NO_MEM@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	$1, (%rbx)
	jmp	LBB0_5
LBB0_16:
	movq	_CLOCK_MONOTONIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	callq	_pthread_condattr_setclock
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	movq	%r12, %rdi
	callq	_pthread_mutex_destroy
	movq	%r15, %rdi
	callq	_pthread_mutex_destroy
	leaq	-44(%rbp), %rdi
	callq	_pthread_condattr_destroy
LBB0_18:
	movq	%rbx, %rdi
	callq	_free
	movq	_LIBUSB_ERROR_OTHER@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_19:
	leaq	20(%rbx), %r13
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	callq	_pthread_cond_init
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%r12, %rdi
	callq	_pthread_mutex_destroy
	movq	%r15, %rdi
	callq	_pthread_mutex_destroy
	leaq	-44(%rbp), %rdi
	callq	_pthread_condattr_destroy
	jmp	LBB0_12
LBB0_21:
	leaq	-44(%rbp), %rdi
	callq	_pthread_condattr_destroy
	movq	_NO_THREAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	movq	%rax, 32(%rbx)
	movq	8(%rbx), %rdi
	callq	_pipe
	testl	%eax, %eax
	js	LBB0_27
## %bb.22:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	callq	_libusb_set_nonblocking
	movq	8(%rbx), %rax
	movl	4(%rax), %edi
	callq	_libusb_set_nonblocking
	movq	%rbx, %rsi
	addq	$16, %rsi
	movq	8(%rbx), %rax
	movl	(%rax), %ecx
	movq	_POLLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_libusb10_add_pollfd
	movq	_default_context_lock@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_lock
	movq	_usbi_default_context@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_24
## %bb.23:
	movq	%rbx, (%rax)
LBB0_24:
	movq	_default_context_lock@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_unlock
	testq	%r14, %r14
	je	LBB0_26
## %bb.25:
	movq	%rbx, (%r14)
LBB0_26:
	movq	_LIBUSB_DEBUG_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_DPRINTF
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_27:
	movq	%r12, %rdi
	callq	_pthread_mutex_destroy
	movq	%r15, %rdi
	callq	_pthread_mutex_destroy
	movq	%r13, %rdi
	callq	_pthread_cond_destroy
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ## @LIBUSB_ERROR_INVALID_PARAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LIBUSB_DEBUG"

	.comm	_errno,8,3                      ## @errno
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ## @LIBUSB_ERROR_NO_MEM
	.comm	_CLOCK_MONOTONIC,4,2            ## @CLOCK_MONOTONIC
	.comm	_LIBUSB_ERROR_OTHER,4,2         ## @LIBUSB_ERROR_OTHER
	.comm	_NO_THREAD,8,3                  ## @NO_THREAD
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_default_context_lock,4,2       ## @default_context_lock
	.comm	_usbi_default_context,8,3       ## @usbi_default_context
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ## @LIBUSB_DEBUG_FUNCTION
L_.str.1:                               ## @.str.1
	.asciz	"libusb_init complete"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_init                    ; -- Begin function libusb_init
	.p2align	2
_libusb_init:                           ; @libusb_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	mov	w0, #72
	bl	_malloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	mov	w1, #0
	mov	w2, #72
	bl	_memset
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_5
; %bb.2:
Lloh2:
	adrp	x21, _errno@GOTPAGE
Lloh3:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	str	xzr, [x21]
	mov	x1, sp
	mov	w2, #10
	bl	_strtol
	str	x0, [x19, #64]
	ldr	x8, [x21]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [sp]
	ldrb	w8, [x8]
	cbz	w8, LBB0_15
LBB0_4:
	str	xzr, [x19, #64]
LBB0_5:
	add	x0, x19, #60
	bl	_TAILQ_INIT
	add	x0, x19, #56
	bl	_TAILQ_INIT
	add	x0, x19, #52
	bl	_TAILQ_INIT
	add	x0, x19, #48
	bl	_TAILQ_INIT
	add	x22, x19, #28
	mov	x0, x22
	mov	x1, #0
	bl	_pthread_mutex_init
	cbnz	x0, LBB0_12
; %bb.6:
	add	x21, x19, #24
	mov	x0, x21
	mov	x1, #0
	bl	_pthread_mutex_init
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x22
	b	LBB0_11
LBB0_8:
Lloh4:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
	add	x0, sp, #12
	bl	_pthread_condattr_init
	cbz	x0, LBB0_16
; %bb.10:
	mov	x0, x22
	bl	_pthread_mutex_destroy
	mov	x0, x21
LBB0_11:
	bl	_pthread_mutex_destroy
LBB0_12:
	mov	x0, x19
	bl	_free
Lloh6:
	adrp	x8, _LIBUSB_ERROR_NO_MEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LIBUSB_ERROR_NO_MEM@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_5
LBB0_16:
Lloh8:
	adrp	x8, _CLOCK_MONOTONIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CLOCK_MONOTONIC@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_pthread_condattr_setclock
	cbz	x0, LBB0_19
; %bb.17:
	mov	x0, x22
	bl	_pthread_mutex_destroy
	mov	x0, x21
	bl	_pthread_mutex_destroy
	add	x0, sp, #12
	bl	_pthread_condattr_destroy
LBB0_18:
	mov	x0, x19
	bl	_free
Lloh11:
	adrp	x8, _LIBUSB_ERROR_OTHER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LIBUSB_ERROR_OTHER@GOTPAGEOFF]
	b	LBB0_13
LBB0_19:
	add	x23, x19, #20
	add	x1, sp, #12
	mov	x0, x23
	bl	_pthread_cond_init
	cbz	x0, LBB0_21
; %bb.20:
	mov	x0, x22
	bl	_pthread_mutex_destroy
	mov	x0, x21
	bl	_pthread_mutex_destroy
	add	x0, sp, #12
	bl	_pthread_condattr_destroy
	b	LBB0_12
LBB0_21:
	add	x0, sp, #12
	bl	_pthread_condattr_destroy
Lloh13:
	adrp	x8, _NO_THREAD@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NO_THREAD@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	stp	x8, x8, [x19, #32]
	ldr	x0, [x19, #8]
	bl	_pipe
	tbnz	w0, #31, LBB0_27
; %bb.22:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_libusb_set_nonblocking
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #4]
	bl	_libusb_set_nonblocking
	add	x1, x19, #16
	ldr	x8, [x19, #8]
	ldr	w3, [x8]
Lloh16:
	adrp	x8, _POLLIN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_libusb10_add_pollfd
Lloh19:
	adrp	x0, _default_context_lock@GOTPAGE
Lloh20:
	ldr	x0, [x0, _default_context_lock@GOTPAGEOFF]
	bl	_pthread_mutex_lock
Lloh21:
	adrp	x8, _usbi_default_context@GOTPAGE
Lloh22:
	ldr	x8, [x8, _usbi_default_context@GOTPAGEOFF]
	ldr	x9, [x8]
	cbnz	x9, LBB0_24
; %bb.23:
	str	x19, [x8]
LBB0_24:
Lloh23:
	adrp	x0, _default_context_lock@GOTPAGE
Lloh24:
	ldr	x0, [x0, _default_context_lock@GOTPAGEOFF]
	bl	_pthread_mutex_unlock
	cbz	x20, LBB0_26
; %bb.25:
	str	x19, [x20]
LBB0_26:
Lloh25:
	adrp	x8, _LIBUSB_DEBUG_FUNCTION@GOTPAGE
Lloh26:
	ldr	x8, [x8, _LIBUSB_DEBUG_FUNCTION@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x2, l_.str.1@PAGE
Lloh29:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_DPRINTF
	mov	w0, #0
	b	LBB0_14
LBB0_27:
	mov	x0, x22
	bl	_pthread_mutex_destroy
	mov	x0, x21
	bl	_pthread_mutex_destroy
	mov	x0, x23
	bl	_pthread_cond_destroy
	b	LBB0_18
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ; @LIBUSB_ERROR_INVALID_PARAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LIBUSB_DEBUG"

	.comm	_errno,8,3                      ; @errno
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ; @LIBUSB_ERROR_NO_MEM
	.comm	_CLOCK_MONOTONIC,4,2            ; @CLOCK_MONOTONIC
	.comm	_LIBUSB_ERROR_OTHER,4,2         ; @LIBUSB_ERROR_OTHER
	.comm	_NO_THREAD,8,3                  ; @NO_THREAD
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_default_context_lock,4,2       ; @default_context_lock
	.comm	_usbi_default_context,8,3       ; @usbi_default_context
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ; @LIBUSB_DEBUG_FUNCTION
l_.str.1:                               ; @.str.1
	.asciz	"libusb_init complete"

.subsections_via_symbols
