	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_set_alternate           ## -- Begin function em28xx_set_alternate
	.p2align	4, 0x90
_em28xx_set_alternate:                  ## @em28xx_set_alternate
	.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
	movq	%rdi, %r13
	movl	(%rdi), %r15d
	movl	4(%rdi), %ecx
	leal	4(%rcx,%rcx), %r14d
	movq	_alt@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	8(%rdi), %eax
	testl	%edx, %edx
	je	LBB0_3
## %bb.1:
	cmpl	%eax, %edx
	jge	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_em28xx_coredbg
	movl	(%r12), %edx
	movl	%edx, (%r13)
	jmp	LBB0_12
LBB0_3:
	addl	%ecx, %ecx
	imull	12(%r13), %ecx
	cmpl	$345601, %ecx                   ## imm = 0x54601
	setge	%cl
	shll	%cl, %r14d
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movq	16(%r13), %rsi
	xorl	%ecx, %ecx
	movl	%r15d, %edx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	je	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rcx,4), %edi
	cmpl	%r14d, %edi
	jae	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movslq	%edx, %rbx
	cmpl	(%rsi,%rbx,4), %edi
	jbe	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%ecx, (%r13)
	movl	%ecx, %edx
	jmp	LBB0_11
LBB0_4:
	xorl	%r12d, %r12d
	jmp	LBB0_15
LBB0_7:
	movl	%ecx, %edx
	movl	%ecx, (%r13)
LBB0_12:
	xorl	%r12d, %r12d
	cmpl	%r15d, %edx
	je	LBB0_15
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_em28xx_coredbg
	movq	16(%r13), %rax
	movslq	(%r13), %rsi
	movl	(%rax,%rsi,4), %edx
	movl	%edx, 24(%r13)
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_em28xx_coredbg
	movl	(%r13), %edx
	movl	28(%r13), %edi
	xorl	%esi, %esi
	callq	_usb_set_interface
	testl	%eax, %eax
	jns	LBB0_15
## %bb.14:
	movl	%eax, %r14d
	movl	(%r13), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %edx
	callq	_em28xx_errdev
	movl	%r14d, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_alt,4,2                        ## @alt
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"alternate forced to %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"minimum isoc packet size: %u (alt=%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"setting alternate %d with wMaxPacketSize=%u\n"

L_.str.3:                               ## @.str.3
	.asciz	"cannot change alternate number to %d (error=%i)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_set_alternate           ; -- Begin function em28xx_set_alternate
	.p2align	2
_em28xx_set_alternate:                  ; @em28xx_set_alternate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldp	w21, w8, [x0]
	lsl	w8, w8, #1
	add	w20, w8, #4
Lloh0:
	adrp	x22, _alt@GOTPAGE
Lloh1:
	ldr	x22, [x22, _alt@GOTPAGEOFF]
	ldr	w10, [x22]
	ldr	w9, [x0, #8]
	cmp	w10, #0
	ccmp	w10, w9, #0, ne
	b.lt	LBB0_7
; %bb.1:
	ldr	w10, [x19, #12]
	mul	w8, w10, w8
	mov	w10, #17920
	movk	w10, #5, lsl #16
	cmp	w8, w10
	cset	w8, gt
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x10, #0
	lsl	w20, w20, w8
	ldr	x11, [x19, #16]
	mov	x8, x21
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x10, x10, #1
	cmp	x9, x10
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, x10, lsl #2]
	cmp	w12, w20
	b.hs	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w13, [x11, w8, sxtw #2]
	cmp	w12, w13
	b.ls	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w10, [x19]
	mov	x8, x10
	b	LBB0_3
LBB0_7:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_em28xx_coredbg
	ldr	w8, [x22]
	str	w8, [x19]
LBB0_8:
	cmp	w8, w21
	b.ne	LBB0_11
LBB0_9:
	mov	w0, #0
	b	LBB0_13
LBB0_10:
	mov	x8, x10
	str	w10, [x19]
	cmp	w8, w21
	b.eq	LBB0_9
LBB0_11:
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_em28xx_coredbg
	ldr	x8, [x19, #16]
	ldrsw	x1, [x19]
	ldr	w8, [x8, x1, lsl #2]
	str	w8, [x19, #24]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_em28xx_coredbg
	ldr	w0, [x19, #28]
	ldr	w2, [x19]
	mov	w1, #0
	bl	_usb_set_interface
	mov	x20, x0
	mov	w0, #0
	tbz	w20, #31, LBB0_13
; %bb.12:
	ldr	w1, [x19]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x2, x20
	bl	_em28xx_errdev
	mov	x0, x20
LBB0_13:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_alt,4,2                        ; @alt
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alternate forced to %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"minimum isoc packet size: %u (alt=%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"setting alternate %d with wMaxPacketSize=%u\n"

l_.str.3:                               ; @.str.3
	.asciz	"cannot change alternate number to %d (error=%i)\n"

.subsections_via_symbols
