	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx231xx_set_video_alternate    ## -- Begin function cx231xx_set_video_alternate
	.p2align	4, 0x90
_cx231xx_set_video_alternate:           ## @cx231xx_set_video_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	leal	(%rax,%rax), %ecx
	leal	(%rax,%rax), %r14d
	addl	$4, %r14d
	imull	4(%rdi), %ecx
	cmpl	$345601, %ecx                   ## imm = 0x54601
	setge	%cl
	shll	%cl, %r14d
	movl	16(%rdi), %r15d
	movl	$3, %esi
	cmpl	$360, %eax                      ## imm = 0x168
	jg	LBB0_3
## %bb.1:
	movl	$2, %esi
	cmpl	$180, %eax
	jg	LBB0_3
## %bb.2:
	xorl	%esi, %esi
	testl	%eax, %eax
	setg	%sil
LBB0_3:
	xorl	%r12d, %r12d
	cmpq	$0, 8(%rbx)
	cmovel	%r12d, %esi
	movl	%esi, 16(%rbx)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_cx231xx_coredbg
	movl	16(%rbx), %edx
	cmpl	%r15d, %edx
	je	LBB0_9
## %bb.4:
	movq	48(%rbx), %rax
	movq	(%rax), %r15
	incq	%r15
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_cx231xx_coredbg
	movq	24(%rbx), %rax
	movslq	16(%rbx), %rsi
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	(%rax,%rsi,4), %edx
	movl	%edx, 32(%rbx)
	jmp	LBB0_7
LBB0_5:
	movl	32(%rbx), %edx
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_cx231xx_coredbg
	movl	16(%rbx), %edx
	movl	44(%rbx), %edi
	movq	%r15, %rsi
	callq	_usb_set_interface
	testl	%eax, %eax
	jns	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	movl	16(%rbx), %edx
	movl	40(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_err
	movl	%r14d, %r12d
LBB0_9:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev->video_mode.alt= %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 alt 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	_cx231xx_set_video_alternate    ; -- Begin function cx231xx_set_video_alternate
	.p2align	2
_cx231xx_set_video_alternate:           ; @cx231xx_set_video_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	w23, [x0, #16]
	ldp	w8, w9, [x0]
	lsl	w21, w8, #1
	mul	w9, w21, w9
	mov	w10, #17920
	movk	w10, #5, lsl #16
	cmp	w9, w10
	cset	w22, gt
	mov	w9, #3
	mov	w10, #2
	cmp	w8, #0
	cset	w11, gt
	cmp	w8, #180
	csel	w10, w10, w11, gt
	cmp	w8, #360
	csel	w8, w9, w10, gt
	ldr	x9, [x0, #8]
	cmp	x9, #0
	csel	w1, wzr, w8, eq
	str	w1, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_cx231xx_coredbg
	mov	w20, #0
	ldr	w8, [x19, #16]
	cmp	w8, w23
	b.eq	LBB0_7
; %bb.1:
	add	w9, w21, #4
	lsl	w1, w9, w22
	ldr	x9, [x19, #48]
	ldr	x9, [x9]
	add	x20, x9, #1
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_cx231xx_coredbg
	ldr	x8, [x19, #24]
	ldrsw	x1, [x19, #16]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x8, x1, lsl #2]
	str	w8, [x19, #32]
	b	LBB0_4
LBB0_3:
	ldr	w8, [x19, #32]
LBB0_4:
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_cx231xx_coredbg
	ldr	w0, [x19, #44]
	ldr	w2, [x19, #16]
	mov	x1, x20
	bl	_usb_set_interface
	tbnz	w0, #31, LBB0_6
; %bb.5:
	mov	w20, #0
	b	LBB0_7
LBB0_6:
	mov	x20, x0
	ldr	w0, [x19, #40]
	ldr	w2, [x19, #16]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x3, x20
	bl	_dev_err
LBB0_7:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev->video_mode.alt= %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 alt number to %d (error=%i)\n"

.subsections_via_symbols
