	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em28xx_set_alternate
_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, %rbx
	movq	32(%rdi), %rdi
	movq	56(%rbx), %r12
	callq	_interface_to_usbdev
	movq	%rax, %r14
	movl	(%r12), %eax
	leal	(%rax,%rax), %r15d
	addl	$4, %r15d
	movl	$0, (%rbx)
	movq	_alt@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	testq	%rcx, %rcx
	jle	LBB0_2
## %bb.1:
	cmpq	8(%rbx), %rcx
	jge	LBB0_2
## %bb.13:
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_em28xx_videodbg
	movl	(%r13), %eax
	movl	%eax, (%rbx)
	cmpq	$0, 48(%rbx)
	je	LBB0_9
## %bb.14:
	movq	_EM28XX_BULK_PACKET_MULTIPLIER@GOTPCREL(%rip), %rcx
	movl	$512, %edx                      ## imm = 0x200
	jmp	LBB0_15
LBB0_2:
	cmpq	$0, 48(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_EM28XX_BULK_PACKET_MULTIPLIER@GOTPCREL(%rip), %rcx
	movl	$512, %edx                      ## imm = 0x200
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_4:
	addl	%eax, %eax
	imull	4(%r12), %eax
	cmpl	$345601, %eax                   ## imm = 0x54601
	setge	%cl
	shll	%cl, %r15d
	movq	8(%rbx), %r8
	testq	%r8, %r8
	jle	LBB0_5
## %bb.6:
	movq	16(%rbx), %rsi
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rdx
	cmpq	%rdx, %r8
	je	LBB0_9
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rdx,4), %edi
	cmpl	%r15d, %edi
	jae	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	%eax, %rcx
	cmpl	(%rsi,%rcx,4), %edi
	jbe	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%edx, (%rbx)
	movl	%edx, %eax
	jmp	LBB0_12
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_8:
	movl	%edx, (%rbx)
	movl	%edx, %eax
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_em28xx_videodbg
	movq	16(%rbx), %rcx
	movslq	(%rbx), %rax
	movl	(%rcx,%rax,4), %edx
	movq	_EM28XX_NUM_ISOC_PACKETS@GOTPCREL(%rip), %rcx
LBB0_15:
	movl	(%rcx), %ecx
	movl	%edx, 24(%rbx)
	movl	%ecx, 44(%rbx)
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_em28xx_videodbg
	movl	(%rbx), %edx
	movl	40(%rbx), %esi
	movq	%r14, %rdi
	callq	_usb_set_interface
	testl	%eax, %eax
	jns	LBB0_17
## %bb.16:
	movl	%eax, %r14d
	movq	32(%rbx), %rdi
	movl	(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_err
	movl	%r14d, %r15d
LBB0_17:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_alt,8,3                        ## @alt
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"alternate forced to %d\n"

	.comm	_EM28XX_BULK_PACKET_MULTIPLIER,4,2 ## @EM28XX_BULK_PACKET_MULTIPLIER
L_.str.1:                               ## @.str.1
	.asciz	"minimum isoc packet size: %u (alt=%d)\n"

	.comm	_EM28XX_NUM_ISOC_PACKETS,4,2    ## @EM28XX_NUM_ISOC_PACKETS
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"

	.no_dead_strip	_em28xx_set_alternate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em28xx_set_alternate
_em28xx_set_alternate:                  ; @em28xx_set_alternate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	ldr	x22, [x0, #56]
	ldr	x0, [x0, #32]
	bl	_interface_to_usbdev
	mov	x20, x0
	ldr	w8, [x22]
	lsl	w8, w8, #1
	add	w21, w8, #4
	str	wzr, [x19]
Lloh0:
	adrp	x23, _alt@GOTPAGE
Lloh1:
	ldr	x23, [x23, _alt@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x9, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x10, [x19, #8]
	cmp	x9, x10
	b.ge	LBB0_3
; %bb.2:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	bl	_em28xx_videodbg
	ldr	w1, [x23]
	str	w1, [x19]
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_5
	b	LBB0_14
LBB0_3:
	ldr	x9, [x19, #48]
	cbz	x9, LBB0_6
; %bb.4:
	mov	w1, #0
LBB0_5:
Lloh4:
	adrp	x9, _EM28XX_BULK_PACKET_MULTIPLIER@GOTPAGE
Lloh5:
	ldr	x9, [x9, _EM28XX_BULK_PACKET_MULTIPLIER@GOTPAGEOFF]
	mov	w8, #512
	b	LBB0_15
LBB0_6:
	ldr	w9, [x22, #4]
	mul	w8, w9, w8
	mov	w9, #17920
	movk	w9, #5, lsl #16
	cmp	w8, w9
	cset	w8, gt
	lsl	w21, w21, w8
	ldr	x9, [x19, #8]
	cmp	x9, #1
	b.lt	LBB0_12
; %bb.7:
	mov	w1, #0
	mov	x8, #0
	ldr	x10, [x19, #16]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x8, #1
	cmp	x9, x8
	b.eq	LBB0_14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x8, lsl #2]
	cmp	w11, w21
	b.hs	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w12, [x10, w1, sxtw #2]
	cmp	w11, w12
	b.ls	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	str	w8, [x19]
	mov	x1, x8
	b	LBB0_8
LBB0_12:
	mov	w1, #0
	b	LBB0_14
LBB0_13:
	str	w8, [x19]
	mov	x1, x8
LBB0_14:
	str	x1, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_em28xx_videodbg
	ldr	x8, [x19, #16]
	ldrsw	x1, [x19]
	ldr	w8, [x8, x1, lsl #2]
Lloh8:
	adrp	x9, _EM28XX_NUM_ISOC_PACKETS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EM28XX_NUM_ISOC_PACKETS@GOTPAGEOFF]
                                        ; kill: def $w1 killed $w1 killed $x1 def $x1
LBB0_15:
	ldr	w9, [x9]
	str	w8, [x19, #24]
	str	w9, [x19, #44]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_em28xx_videodbg
	ldr	w1, [x19, #40]
	ldr	w2, [x19]
	mov	x0, x20
	bl	_usb_set_interface
	tbnz	w0, #31, LBB0_17
; %bb.16:
	mov	w20, #0
	b	LBB0_18
LBB0_17:
	mov	x20, x0
	ldr	x0, [x19, #32]
	ldr	w2, [x19]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x3, x20
	bl	_dev_err
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_alt,8,3                        ; @alt
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alternate forced to %d\n"

	.comm	_EM28XX_BULK_PACKET_MULTIPLIER,4,2 ; @EM28XX_BULK_PACKET_MULTIPLIER
l_.str.1:                               ; @.str.1
	.asciz	"minimum isoc packet size: %u (alt=%d)\n"

	.comm	_EM28XX_NUM_ISOC_PACKETS,4,2    ; @EM28XX_NUM_ISOC_PACKETS
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"

	.no_dead_strip	_em28xx_set_alternate
.subsections_via_symbols
