	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function build_isoc_ep_tb
_build_isoc_ep_tb:                      ## @build_isoc_ep_tb
	.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
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movq	_MAX_ALT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	$480000000, (%rdx)              ## imm = 0x1C9C3800
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	leaq	(,%rcx,4), %r15
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_pr_err
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=2
	incl	%r13d
	addq	$4, %r12
	cmpq	%r12, %r15
	je	LBB0_15
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	addq	%r12, %rdi
	movq	_USB_ENDPOINT_XFER_ISOC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %edx
	callq	_alt_xfer
	testq	%rax, %rax
	je	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%rax, %r14
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	4(%r14), %edi
	callq	_le16_to_cpu
	movl	%eax, %ecx
	andl	$2047, %ecx                     ## imm = 0x7FF
	shrl	$11, %eax
	andl	$3, %eax
	incl	%eax
	imull	%ecx, %eax
	movq	(%rbx), %rcx
	movq	(%rcx), %rcx
	movq	_USB_SPEED_HIGH@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	_USB_SPEED_SUPER@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	imull	$8000, %eax, %eax               ## imm = 0x1F40
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=2
	movzbl	(%r14), %ecx
	decb	%cl
	movl	$1, %esi
	shll	%cl, %esi
	xorl	%edx, %edx
	idivl	%esi
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	(%rcx), %eax
	jge	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	%r13d, 4(%rcx)
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_D_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rdx
	xorl	%eax, %eax
	callq	_gspca_dbg
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	incl	%r12d
	leaq	8(%r14), %rax
	movl	(%r14), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	$480000000, 8(%r14)             ## imm = 0x1C9C3800
	movq	%rax, %r14
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testl	%ecx, %ecx
	jg	LBB0_3
## %bb.18:
	movq	%rax, %r14
	cmpq	$0, 8(%rbx)
	jne	LBB0_20
	jmp	LBB0_24
LBB0_1:
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	cmpq	$0, 8(%rbx)
	jne	LBB0_20
	jmp	LBB0_24
LBB0_16:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	cmpq	$0, 8(%rbx)
	je	LBB0_24
LBB0_20:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_USB_SPEED_FULL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.21:
	cmpl	$1000000, -44(%rbp)             ## 4-byte Folded Reload
                                        ## imm = 0xF4240
	jl	LBB0_24
## %bb.22:
	cmpl	$2, %r12d
	jb	LBB0_24
## %bb.23:
	movq	_D_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_gspca_dbg
	decl	%r12d
	addq	$-8, %r14
LBB0_24:
	movq	%rbx, %rdi
	callq	_which_bandwidth
	cmpl	$2, %r12d
	jl	LBB0_29
## %bb.25:
	addq	$-16, %r14
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, (%r14)
	jl	LBB0_29
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=1
	leal	-1(%r12), %ecx
	addq	$-8, %r14
	cmpl	$2, %r12d
	movl	%ecx, %r12d
	jg	LBB0_26
## %bb.28:
	movl	$1, %r12d
LBB0_29:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ALT,4,2                    ## @MAX_ALT
	.comm	_USB_ENDPOINT_XFER_ISOC,4,2     ## @USB_ENDPOINT_XFER_ISOC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"alt %d iso endp with 0 interval\n"

	.comm	_USB_SPEED_HIGH,8,3             ## @USB_SPEED_HIGH
	.comm	_USB_SPEED_SUPER,8,3            ## @USB_SPEED_SUPER
	.comm	_D_STREAM,4,2                   ## @D_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"alt %d bandwidth %d\n"

	.comm	_USB_SPEED_FULL,8,3             ## @USB_SPEED_FULL
L_.str.2:                               ## @.str.2
	.asciz	"dev has usb audio, skipping highest alt\n"

	.no_dead_strip	_build_isoc_ep_tb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function build_isoc_ep_tb
_build_isoc_ep_tb:                      ; @build_isoc_ep_tb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x20, x2
	mov	x21, x0
	mov	w10, #14336
	movk	w10, #7324, lsl #16
Lloh0:
	adrp	x8, _MAX_ALT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_ALT@GOTPAGEOFF]
	ldr	w9, [x1]
Lloh2:
	ldr	w8, [x8]
	cmp	w9, w8
	csel	w8, w9, w8, lt
	str	w10, [x2]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x22, x1
	mov	w27, #0
	mov	w19, #0
Lloh3:
	adrp	x28, _USB_ENDPOINT_XFER_ISOC@GOTPAGE
Lloh4:
	ldr	x28, [x28, _USB_ENDPOINT_XFER_ISOC@GOTPAGEOFF]
	lsl	x23, x8, #2
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	str	w19, [sp, #28]                  ; 4-byte Folded Spill
	mov	x19, #0
	mov	w25, #0
	mov	w24, #0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=2
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	bl	_pr_err
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w25, w25, #1
	add	x19, x19, #4
	cmp	x23, x19
	b.eq	LBB0_14
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #8]
	add	x0, x8, x19
	ldr	w1, [x28]
	ldr	w2, [x21, #16]
	bl	_alt_xfer
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x26, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w0, [x26, #4]
	bl	_le16_to_cpu
	and	w8, w0, #0x7ff
	ubfx	w9, w0, #11, #2
	madd	w8, w8, w9, w8
	ldr	x9, [x21]
	ldr	x9, [x9]
Lloh7:
	adrp	x10, _USB_SPEED_HIGH@GOTPAGE
Lloh8:
	ldr	x10, [x10, _USB_SPEED_HIGH@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
Lloh10:
	adrp	x10, _USB_SPEED_SUPER@GOTPAGE
Lloh11:
	ldr	x10, [x10, _USB_SPEED_SUPER@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w9, #1000
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w9, #8000
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=2
	mul	w8, w8, w9
	ldr	w9, [x26]
	sub	w9, w9, #1
	mov	w10, #1
	lsl	w9, w10, w9
	sdiv	w8, w8, w9
	cmp	w8, w27
	b.le	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	ldr	w9, [x20]
	cmp	w8, w9
	b.ge	LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=2
	stp	w8, w25, [x20]
	mov	w24, #1
	b	LBB0_4
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	w24, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh13:
	adrp	x8, _D_STREAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _D_STREAM@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldp	w9, w8, [x20]
	stp	x8, x9, [sp]
	mov	x0, x21
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_gspca_dbg
	ldr	w27, [x20]
	ldr	w19, [sp, #28]                  ; 4-byte Folded Reload
	add	w19, w19, #1
	mov	w8, #14336
	movk	w8, #7324, lsl #16
	str	w8, [x20, #8]!
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	cmp	w8, #0
	b.gt	LBB0_2
	b	LBB0_17
LBB0_16:
	mov	w19, #0
	mov	w27, #0
LBB0_17:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_19
	b	LBB0_21
LBB0_18:
	ldr	w19, [sp, #28]                  ; 4-byte Folded Reload
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_21
LBB0_19:
	ldr	x8, [x21]
Lloh18:
	adrp	x9, _USB_SPEED_FULL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _USB_SPEED_FULL@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #16960
	movk	w8, #15, lsl #16
	ccmp	w27, w8, #8, eq
	ccmp	w19, #2, #0, ge
	b.lo	LBB0_21
; %bb.20:
Lloh21:
	adrp	x8, _D_STREAM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _D_STREAM@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.2@PAGE
Lloh25:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_gspca_dbg
	sub	w19, w19, #1
	sub	x20, x20, #8
LBB0_21:
	mov	x0, x21
	bl	_which_bandwidth
	cmp	w19, #2
	b.lt	LBB0_26
; %bb.22:
	sub	x8, x20, #16
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x8]
	cmp	w9, w0
	b.lt	LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	sub	w9, w19, #1
	sub	x8, x8, #8
	cmp	w19, #2
	mov	x19, x9
	b.gt	LBB0_23
; %bb.25:
	mov	w19, #1
LBB0_26:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ALT,4,2                    ; @MAX_ALT
	.comm	_USB_ENDPOINT_XFER_ISOC,4,2     ; @USB_ENDPOINT_XFER_ISOC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alt %d iso endp with 0 interval\n"

	.comm	_USB_SPEED_HIGH,8,3             ; @USB_SPEED_HIGH
	.comm	_USB_SPEED_SUPER,8,3            ; @USB_SPEED_SUPER
	.comm	_D_STREAM,4,2                   ; @D_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"alt %d bandwidth %d\n"

	.comm	_USB_SPEED_FULL,8,3             ; @USB_SPEED_FULL
l_.str.2:                               ; @.str.2
	.asciz	"dev has usb audio, skipping highest alt\n"

	.no_dead_strip	_build_isoc_ep_tb
.subsections_via_symbols
