	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_get_config_descriptor_by_value ## -- Begin function libusb_get_config_descriptor_by_value
	.p2align	4, 0x90
_libusb_get_config_descriptor_by_value: ## @libusb_get_config_descriptor_by_value
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %r13
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	callq	_libusb20_dev_get_device_desc
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.4:
	movq	%rax, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r13, %rdx
	callq	_libusb_get_config_descriptor
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r13), %rdi
	cmpq	%r14, (%rdi)
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	callq	_libusb_free_config_descriptor
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_5
LBB0_9:
	movq	$0, (%r13)
	movq	_LIBUSB_ERROR_NOT_FOUND@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_2:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_11
	.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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_get_config_descriptor_by_value ; -- Begin function libusb_get_config_descriptor_by_value
	.p2align	2
_libusb_get_config_descriptor_by_value: ; @libusb_get_config_descriptor_by_value
	.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
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_8
; %bb.2:
	mov	x20, x1
	mov	x21, x0
	ldr	x0, [x0]
	bl	_libusb20_dev_get_device_desc
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x22, x0
	mov	w23, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x19
	bl	_libusb_get_config_descriptor
	cbnz	w0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19]
	ldr	x8, [x0]
	cmp	x8, x20
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_libusb_free_config_descriptor
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.lt	LBB0_4
LBB0_7:
	str	xzr, [x19]
Lloh0:
	adrp	x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh2:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
LBB0_10:
	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_11:
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.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
.subsections_via_symbols
