	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function libusb_parse_bos_descriptor
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_libusb_parse_bos_descriptor
	.p2align	4, 0x90
_libusb_parse_bos_descriptor:           ## @libusb_parse_bos_descriptor
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	jle	LBB0_29
## %bb.1:
	movq	%rdi, %r12
	testq	%rdi, %rdi
	je	LBB0_29
## %bb.2:
	testq	%rdx, %rdx
	je	LBB0_29
## %bb.3:
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	movl	$65535, %r14d                   ## imm = 0xFFFF
	cmovll	%esi, %r14d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	$0, (%rdx)
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r12,%rbx,4), %r12
	subl	%ebx, %r14d
	je	LBB0_30
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %ebx
	cmpl	$2, %ebx
	jl	LBB0_30
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%ebx, %r14d
	jl	LBB0_30
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r12), %r13d
	movq	_LIBUSB_DT_BOS_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_LIBUSB_DT_BOS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	testq	%r15, %r15
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	$88, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_36
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	_LIBUSB_DT_BOS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	%r13d, 4(%r15)
	movl	12(%r12), %eax
	shll	$8, %eax
	orl	8(%r12), %eax
	movl	%eax, 8(%r15)
	movl	16(%r12), %edi
	movl	%edi, 12(%r15)
	movl	$8, %esi
	callq	_calloc
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r15)
	movq	%rax, 32(%r15)
	testq	%rax, %rax
	je	LBB0_34
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	40(%r15), %r8
	movq	%r15, %rdi
	addq	$56, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$3, %ebx
	jb	LBB0_4
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	testq	%r15, %r15
	je	LBB0_4
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_LIBUSB_DT_DEVICE_CAPABILITY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_4
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	12(%r15), %esi
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	%ebx, %edi
	movq	%rsi, %r13
	callq	_malloc
	movq	%r13, %rdx
	movq	32(%r15), %rcx
	movslq	%edx, %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	32(%r15), %rax
	movq	(%rax,%rdx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_35
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	%r13, %rsi
	incl	%esi
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %r13d                ## 4-byte Reload
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%r12), %eax
	cmpl	$129, %eax
	je	LBB0_25
## %bb.20:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$128, %eax
	jne	LBB0_4
## %bb.21:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, 24(%r15)
	jne	LBB0_4
## %bb.22:                              ##   in Loop: Header=BB0_5 Depth=1
	testq	%r8, %r8
	je	LBB0_4
## %bb.23:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.24:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r8, 24(%r15)
	movl	%eax, (%r8)
	movl	%r13d, 4(%r8)
	movl	8(%r12), %eax
	movl	%eax, 8(%r8)
	movl	16(%r12), %eax
	movl	20(%r12), %ecx
	shll	$8, %eax
	orl	12(%r12), %eax
	shll	$16, %ecx
	movl	24(%r12), %edx
	shll	$24, %edx
	orl	%ecx, %edx
	orl	%eax, %edx
	movl	%edx, 12(%r8)
	jmp	LBB0_4
LBB0_25:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, 16(%r15)
	jne	LBB0_4
## %bb.26:                              ##   in Loop: Header=BB0_5 Depth=1
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.27:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.28:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdi, 16(%r15)
	movl	%eax, (%rdi)
	movl	%r13d, 4(%rdi)
	movl	8(%r12), %eax
	movl	%eax, 8(%rdi)
	movl	12(%r12), %eax
	movl	%eax, 12(%rdi)
	movl	20(%r12), %eax
	shll	$8, %eax
	orl	16(%r12), %eax
	movl	%eax, 16(%rdi)
	movl	24(%r12), %eax
	movl	%eax, 20(%rdi)
	movl	28(%r12), %eax
	movl	%eax, 24(%rdi)
	movl	36(%r12), %eax
	shll	$8, %eax
	orl	32(%r12), %eax
	movl	%eax, 28(%rdi)
	jmp	LBB0_4
LBB0_29:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_30:
	testq	%r15, %r15
	je	LBB0_32
## %bb.31:
	movl	%esi, 12(%r15)
	xorl	%eax, %eax
	jmp	LBB0_38
LBB0_32:
	movq	_LIBUSB_ERROR_IO@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_34:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_36
LBB0_35:
	movq	%r15, %rdi
	callq	_libusb_free_bos_descriptor
LBB0_36:
	movq	_LIBUSB_ERROR_NO_MEM@GOTPCREL(%rip), %rax
LBB0_37:
	movl	(%rax), %eax
LBB0_38:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ## @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_DT_BOS_SIZE,4,2         ## @LIBUSB_DT_BOS_SIZE
	.comm	_LIBUSB_DT_BOS,4,2              ## @LIBUSB_DT_BOS
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ## @LIBUSB_ERROR_NO_MEM
	.comm	_LIBUSB_DT_DEVICE_CAPABILITY,4,2 ## @LIBUSB_DT_DEVICE_CAPABILITY
	.comm	_LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE,4,2 ## @LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE
	.comm	_LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE,4,2 ## @LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE
	.comm	_LIBUSB_ERROR_IO,4,2            ## @LIBUSB_ERROR_IO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_parse_bos_descriptor    ; -- Begin function libusb_parse_bos_descriptor
	.p2align	2
_libusb_parse_bos_descriptor:           ; @libusb_parse_bos_descriptor
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	w1, #1
	b.lt	LBB0_25
; %bb.1:
	mov	x20, x0
	cbz	x0, LBB0_25
; %bb.2:
	mov	x19, x2
	cbz	x2, LBB0_25
; %bb.3:
	mov	w23, #0
	mov	x27, #0
	mov	x28, #0
	mov	x21, #0
	mov	w8, #65535
	cmp	w1, w8
	csel	w24, w1, w8, lt
	str	xzr, [x19]
Lloh0:
	adrp	x25, _LIBUSB_DT_BOS_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _LIBUSB_DT_BOS_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGE
Lloh3:
	ldr	x11, [x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, x22, lsl #2
	subs	w24, w24, w22
	b.eq	LBB0_26
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x20]
	cmp	w22, #2
	ccmp	w24, w22, #8, ge
	b.lt	LBB0_26
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w26, [x20, #4]
	ldr	w8, [x25]
	cmp	w22, w8
	b.lt	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh4:
	adrp	x8, _LIBUSB_DT_BOS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _LIBUSB_DT_BOS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w26, w8
	ccmp	x21, #0, #0, eq
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #88
	bl	_malloc
	cbz	x0, LBB0_31
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	str	x0, [x19]
	ldr	w8, [x25]
	stp	w8, w26, [x0]
	ldp	w8, w9, [x20, #8]
	orr	w8, w8, w9, lsl #8
	str	w8, [x0, #8]
	ldr	w0, [x20, #16]
	str	w0, [x21, #12]
	mov	w1, #8
	bl	_calloc
	stp	xzr, xzr, [x21, #16]
	str	x0, [x21, #32]
	cbz	x0, LBB0_29
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	add	x28, x21, #40
	add	x27, x21, #56
Lloh7:
	adrp	x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGE
Lloh8:
	ldr	x11, [x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGEOFF]
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x11]
	cmp	w22, #3
	ccmp	x21, #0, #4, hs
	ccmp	w26, w8, #0, ne
	b.ne	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x21, #12]
	cmp	w23, w8
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_malloc
	ldr	x8, [x21, #32]
	sbfiz	x9, x23, #3, #32
	str	x0, [x8, x9]
	ldr	x8, [x21, #32]
	ldr	x0, [x8, x9]
	cbz	x0, LBB0_30
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x20
	mov	x2, x22
	bl	_memcpy
	add	w23, w23, #1
Lloh9:
	adrp	x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGE
Lloh10:
	ldr	x11, [x11, _LIBUSB_DT_DEVICE_CAPABILITY@GOTPAGEOFF]
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #8]
	cmp	w8, #129
	b.eq	LBB0_21
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #128
	b.ne	LBB0_4
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_4
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	cbz	x28, LBB0_4
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh11:
	adrp	x8, _LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w22, w8
	b.lt	LBB0_4
; %bb.20:                               ;   in Loop: Header=BB0_5 Depth=1
	str	x28, [x21, #24]
	stp	w8, w26, [x28]
	ldr	w8, [x20, #8]
	str	w8, [x28, #8]
	ldp	w8, w9, [x20, #12]
	orr	w8, w8, w9, lsl #8
	ldp	w9, w10, [x20, #20]
	orr	w8, w8, w9, lsl #16
	orr	w8, w8, w10, lsl #24
	str	w8, [x28, #12]
	b	LBB0_4
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_4
; %bb.22:                               ;   in Loop: Header=BB0_5 Depth=1
	cbz	x27, LBB0_4
; %bb.23:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh14:
	adrp	x8, _LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w22, w8
	b.lt	LBB0_4
; %bb.24:                               ;   in Loop: Header=BB0_5 Depth=1
	str	x27, [x21, #16]
	stp	w8, w26, [x27]
	ldr	w8, [x20, #8]
	str	w8, [x27, #8]
	ldr	w8, [x20, #12]
	str	w8, [x27, #12]
	ldp	w8, w9, [x20, #16]
	orr	w8, w8, w9, lsl #8
	str	w8, [x27, #16]
	ldr	w8, [x20, #24]
	str	w8, [x27, #20]
	ldr	w8, [x20, #28]
	str	w8, [x27, #24]
	ldp	w8, w9, [x20, #32]
	orr	w8, w8, w9, lsl #8
	str	w8, [x27, #28]
	b	LBB0_4
LBB0_25:
Lloh17:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
	b	LBB0_32
LBB0_26:
	cbz	x21, LBB0_28
; %bb.27:
	mov	w0, #0
	str	w23, [x21, #12]
	b	LBB0_33
LBB0_28:
Lloh19:
	adrp	x8, _LIBUSB_ERROR_IO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LIBUSB_ERROR_IO@GOTPAGEOFF]
	b	LBB0_32
LBB0_29:
	mov	x0, x21
	bl	_free
	b	LBB0_31
LBB0_30:
	mov	x0, x21
	bl	_libusb_free_bos_descriptor
LBB0_31:
Lloh21:
	adrp	x8, _LIBUSB_ERROR_NO_MEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LIBUSB_ERROR_NO_MEM@GOTPAGEOFF]
LBB0_32:
	ldr	w0, [x8]
LBB0_33:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ; @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_DT_BOS_SIZE,4,2         ; @LIBUSB_DT_BOS_SIZE
	.comm	_LIBUSB_DT_BOS,4,2              ; @LIBUSB_DT_BOS
	.comm	_LIBUSB_ERROR_NO_MEM,4,2        ; @LIBUSB_ERROR_NO_MEM
	.comm	_LIBUSB_DT_DEVICE_CAPABILITY,4,2 ; @LIBUSB_DT_DEVICE_CAPABILITY
	.comm	_LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE,4,2 ; @LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE
	.comm	_LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE,4,2 ; @LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE
	.comm	_LIBUSB_ERROR_IO,4,2            ; @LIBUSB_ERROR_IO
.subsections_via_symbols
