	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_audio_regs
_set_audio_regs:                        ## @set_audio_regs
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rsi), %edx
	movl	$1428, %esi                     ## imm = 0x594
	callq	_saa717x_write
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %r8d
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_v4l2_dbg
	movl	$65536, %edi                    ## imm = 0x10000
	subq	40(%r15), %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_min
	movl	%eax, %ebx
	imull	4(%r15), %ebx
	leal	32767(%rbx), %eax
	testl	%ebx, %ebx
	cmovsl	%eax, %ebx
	sarl	$15, %ebx
	movq	40(%r15), %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_min
	movl	%eax, %ecx
	imull	4(%r15), %ecx
	leal	32767(%rcx), %eax
	testl	%ecx, %ecx
	cmovsl	%eax, %ecx
	sarl	$15, %ecx
	shlq	$6, %rbx
	movabsq	$-9223231297218904063, %rdi     ## imm = 0x8000800080008001
	movq	%rbx, %rax
	mulq	%rdi
	movq	%rdx, %rsi
	shrq	$15, %rsi
	addq	$-40, %rsi
	shlq	$6, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rsi, 8(%r15)
	shrq	$15, %rdx
	addq	$-40, %rdx
	movq	%rdx, 16(%r15)
	shll	$8, %edx
	orl	%esi, %edx
	cmpq	$0, 32(%r15)
	movl	$44204, %eax                    ## imm = 0xACAC
	cmovnel	%eax, %edx
	movq	%r14, %rdi
	movl	$1152, %esi                     ## imm = 0x480
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_saa717x_write
	movl	24(%r15), %eax
	movl	28(%r15), %edx
	andl	$31, %eax
	andl	$31, %edx
	shll	$5, %edx
	orl	%eax, %edx
	movq	%r14, %rdi
	movl	$1160, %esi                     ## imm = 0x488
	callq	_saa717x_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set audio input %d\n"

	.no_dead_strip	_set_audio_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_audio_regs
_set_audio_regs:                        ; @set_audio_regs
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	ldr	w2, [x1]
	mov	w1, #1428
	bl	_saa717x_write
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w4, [x20]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	ldr	x8, [x20, #40]
	mov	w9, #65536
	sub	x0, x9, x8
	mov	w1, #32768
	bl	_min
	ldr	w8, [x20, #4]
	mul	w8, w8, w0
	mov	w21, #32767
	add	w9, w8, w21
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w22, w8, #15
	ldr	x0, [x20, #40]
	mov	w1, #32768
	bl	_min
	ldr	w8, [x20, #4]
	mul	w8, w8, w0
	add	w9, w8, w21
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #15
	lsl	x9, x22, #6
	mov	x10, #-9223231297218904064
	movk	x10, #32769
	umulh	x9, x9, x10
	lsr	x9, x9, #15
	sub	x9, x9, #40
	lsl	x8, x8, #6
	umulh	x8, x8, x10
	lsr	x8, x8, #15
	sub	x8, x8, #40
	stp	x9, x8, [x20, #8]
	ldr	x10, [x20, #32]
	orr	w8, w9, w8, lsl #8
	cmp	x10, #0
	mov	w9, #44204
	csel	w2, w8, w9, eq
	mov	x0, x19
	mov	w1, #1152
	bl	_saa717x_write
	ldp	w8, w9, [x20, #24]
	and	w2, w8, #0x1f
	bfi	w2, w9, #5, #5
	mov	x0, x19
	mov	w1, #1160
	bl	_saa717x_write
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set audio input %d\n"

	.no_dead_strip	_set_audio_regs
.subsections_via_symbols
