	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_set_interface_alt_setting ## -- Begin function libusb_set_interface_alt_setting
	.p2align	4, 0x90
_libusb_set_interface_alt_setting:      ## @libusb_set_interface_alt_setting
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_libusb_get_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpl	$32, %r12d
	jb	LBB0_3
LBB0_1:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r13d
LBB0_8:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rax, %rbx
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	8(%rax), %edi
	callq	_CTX_LOCK
	movq	_LIBUSB_ERROR_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	(%rbx), %r15d
	movl	8(%rbx), %edi
	callq	_CTX_UNLOCK
	btl	%r12d, %r15d
	jb	LBB0_5
## %bb.4:
	testl	%r13d, %r13d
	jne	LBB0_8
LBB0_5:
	movq	%rbx, %rdi
	callq	_libusb10_cancel_all_transfer
	movl	8(%rbx), %edi
	movq	%rbx, %r15
	addq	$4, %r15
	movq	%r15, %rsi
	callq	_libusb10_remove_pollfd
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_libusb20_dev_set_alt_index
	movl	%eax, %r13d
	movl	8(%rbx), %ebx
	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
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_libusb10_add_pollfd
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.6:
	movq	_LIBUSB_ERROR_OTHER@GOTPCREL(%rip), %rax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ## @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_ERROR_NOT_FOUND,4,2     ## @LIBUSB_ERROR_NOT_FOUND
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_POLLRDNORM,4,2                 ## @POLLRDNORM
	.comm	_POLLWRNORM,4,2                 ## @POLLWRNORM
	.comm	_LIBUSB_ERROR_OTHER,4,2         ## @LIBUSB_ERROR_OTHER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_set_interface_alt_setting ; -- Begin function libusb_set_interface_alt_setting
	.p2align	2
_libusb_set_interface_alt_setting:      ; @libusb_set_interface_alt_setting
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x21, x1
	mov	x19, x0
	bl	_libusb_get_device
	cbz	x0, LBB0_2
; %bb.1:
	cmp	w21, #32
	b.lo	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
LBB0_3:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x22, x0
	ldr	w0, [x0, #8]
	bl	_CTX_LOCK
	ldr	w24, [x22]
Lloh3:
	adrp	x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	ldr	w0, [x22, #8]
	bl	_CTX_UNLOCK
	lsr	w8, w24, w21
	tbnz	w8, #0, LBB0_6
; %bb.5:
	cbnz	w23, LBB0_3
LBB0_6:
	mov	x0, x22
	bl	_libusb10_cancel_all_transfer
	ldr	w0, [x22, #8]
	add	x23, x22, #4
	mov	x1, x23
	bl	_libusb10_remove_pollfd
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_libusb20_dev_set_alt_index
	mov	x20, x0
	ldr	w21, [x22, #8]
	mov	x0, x19
	bl	_libusb20_dev_get_fd
	mov	x3, x0
Lloh6:
	adrp	x8, _POLLIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _POLLOUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _POLLOUT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _POLLRDNORM@GOTPAGE
Lloh13:
	ldr	x9, [x9, _POLLRDNORM@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _POLLWRNORM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _POLLWRNORM@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w4, w8, w9
	mov	x0, x21
	mov	x1, x23
	mov	x2, x19
	bl	_libusb10_add_pollfd
Lloh18:
	adrp	x8, _LIBUSB_ERROR_OTHER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LIBUSB_ERROR_OTHER@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w23, wzr, w8, eq
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ; @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_ERROR_NOT_FOUND,4,2     ; @LIBUSB_ERROR_NOT_FOUND
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_POLLRDNORM,4,2                 ; @POLLRDNORM
	.comm	_POLLWRNORM,4,2                 ; @POLLWRNORM
	.comm	_LIBUSB_ERROR_OTHER,4,2         ; @LIBUSB_ERROR_OTHER
.subsections_via_symbols
