	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_open                    ## -- Begin function libusb_open
	.p2align	4, 0x90
_libusb_open:                           ## @libusb_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	8(%rdi), %r14
	movq	16(%rdi), %r15
	movq	$0, (%rsi)
	callq	_libusb_ref_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	movq	_LIBUSB_NUM_SW_ENDPOINTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_libusb20_dev_open
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_libusb_unref_device
	movq	_LIBUSB_ERROR_NO_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_1:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	callq	_libusb20_dev_get_fd
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	movq	_POLLOUT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	orl	(%rcx), %r8d
	movq	_POLLRDNORM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r8d
	movq	_POLLWRNORM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r8d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_libusb10_add_pollfd
	movq	%r15, %rdi
	callq	_libusb10_wakeup_event_loop
	movq	%r14, (%rbx)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ## @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_NUM_SW_ENDPOINTS,4,2    ## @LIBUSB_NUM_SW_ENDPOINTS
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ## @LIBUSB_ERROR_NO_MEM
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_POLLRDNORM,4,2                 ## @POLLRDNORM
	.comm	_POLLWRNORM,4,2                 ## @POLLWRNORM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_open                    ; -- Begin function libusb_open
	.p2align	2
_libusb_open:                           ; @libusb_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cbz	x1, LBB0_4
; %bb.1:
	mov	x19, x1
	ldp	x20, x21, [x0, #8]
	str	xzr, [x1]
	bl	_libusb_ref_device
	cbz	x0, LBB0_4
; %bb.2:
	mov	x22, x0
Lloh0:
	adrp	x8, _LIBUSB_NUM_SW_ENDPOINTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBUSB_NUM_SW_ENDPOINTS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_libusb20_dev_open
	cbz	w0, LBB0_5
; %bb.3:
	mov	x0, x22
	bl	_libusb_unref_device
Lloh3:
	adrp	x8, _LIBUSB_ERROR_NO_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LIBUSB_ERROR_NO_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	bl	_libusb20_dev_get_fd
	mov	x3, x0
Lloh9:
	adrp	x8, _POLLIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _POLLOUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _POLLOUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _POLLRDNORM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _POLLRDNORM@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _POLLWRNORM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _POLLWRNORM@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w4, w8, w9
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	bl	_libusb10_add_pollfd
	mov	x0, x21
	bl	_libusb10_wakeup_event_loop
	mov	w0, #0
	str	x20, [x19]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ; @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_NUM_SW_ENDPOINTS,4,2    ; @LIBUSB_NUM_SW_ENDPOINTS
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ; @LIBUSB_ERROR_NO_MEM
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_POLLRDNORM,4,2                 ; @POLLRDNORM
	.comm	_POLLWRNORM,4,2                 ; @POLLWRNORM
.subsections_via_symbols
