	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k6aa_configure_pixel_clocks
_s5k6aa_configure_pixel_clocks:         ## @s5k6aa_configure_pixel_clocks
	.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	%rdi, %r15
	addq	$16, %rdi
	callq	_v4l2_get_subdevdata
	movslq	(%r15), %rcx
	imulq	$274877907, %rcx, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rcx
	shrq	$63, %rcx
	sarq	$38, %rbx
	addl	%ecx, %ebx
	movslq	%ebx, %rdx
	movq	_MIN_MCLK_FREQ_KHZ@GOTPCREL(%rip), %rcx
	cmpq	%rdx, (%rcx)
	seta	%cl
	movq	_MAX_MCLK_FREQ_KHZ@GOTPCREL(%rip), %rsi
	cmpq	%rdx, (%rsi)
	movq	%rax, %r14
	setb	%al
	orb	%cl, %al
	movzbl	%al, %edi
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_2:
	movq	_PCLK_FREQ_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_PCLK_FREQ_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_SYS_PLL_OUT_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	_REG_I_INCLK_FREQ_H@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	sarl	$16, %edx
	movq	%r14, %rdi
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movq	_REG_I_INCLK_FREQ_L@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzwl	%bx, %edx
	movq	%r14, %rdi
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	_REG_I_USE_NPVI_CLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	xorl	%edi, %edi
	callq	_REG_I_OPCLK_4KHZ
	movl	12(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	xorl	%edi, %edi
	callq	_REG_I_MIN_OUTRATE_4KHZ
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	xorl	%edi, %edi
	callq	_REG_I_MAX_OUTRATE_4KHZ
	movl	8(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	_REG_I_INIT_PARAMS_UPDATED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_s5k6aa_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	_REG_I_ERROR_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_s5k6aa_read
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	cmpq	$0, -32(%rbp)
	cmovel	%edx, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIN_MCLK_FREQ_KHZ,8,3          ## @MIN_MCLK_FREQ_KHZ
	.comm	_MAX_MCLK_FREQ_KHZ,8,3          ## @MAX_MCLK_FREQ_KHZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid clock frequency: %ld\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCLK_FREQ_MIN,4,2              ## @PCLK_FREQ_MIN
	.comm	_PCLK_FREQ_MAX,4,2              ## @PCLK_FREQ_MAX
	.comm	_SYS_PLL_OUT_FREQ,4,2           ## @SYS_PLL_OUT_FREQ
	.comm	_REG_I_INCLK_FREQ_H,4,2         ## @REG_I_INCLK_FREQ_H
	.comm	_REG_I_INCLK_FREQ_L,4,2         ## @REG_I_INCLK_FREQ_L
	.comm	_REG_I_USE_NPVI_CLOCKS,4,2      ## @REG_I_USE_NPVI_CLOCKS
	.comm	_REG_I_INIT_PARAMS_UPDATED,4,2  ## @REG_I_INIT_PARAMS_UPDATED
	.comm	_REG_I_ERROR_INFO,4,2           ## @REG_I_ERROR_INFO
	.no_dead_strip	_s5k6aa_configure_pixel_clocks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k6aa_configure_pixel_clocks
_s5k6aa_configure_pixel_clocks:         ; @s5k6aa_configure_pixel_clocks
	.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	x20, x0
	add	x0, x0, #16
	bl	_v4l2_get_subdevdata
	mov	x19, x0
	ldrsw	x8, [x20]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
	sxtw	x2, w21
Lloh0:
	adrp	x8, _MIN_MCLK_FREQ_KHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIN_MCLK_FREQ_KHZ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
Lloh3:
	adrp	x8, _MAX_MCLK_FREQ_KHZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_MCLK_FREQ_KHZ@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ccmp	x8, x2, #0, ls
	cset	w0, lo
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	cbz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_2:
Lloh11:
	adrp	x8, _PCLK_FREQ_MIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PCLK_FREQ_MIN@GOTPAGEOFF]
Lloh13:
	adrp	x9, _PCLK_FREQ_MAX@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PCLK_FREQ_MAX@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	ldr	w9, [x9]
	stp	w8, w9, [x20, #4]
Lloh17:
	adrp	x8, _SYS_PLL_OUT_FREQ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SYS_PLL_OUT_FREQ@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x20, #12]
Lloh20:
	adrp	x8, _REG_I_INCLK_FREQ_H@GOTPAGE
Lloh21:
	ldr	x8, [x8, _REG_I_INCLK_FREQ_H@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	asr	w2, w21, #16
	mov	x0, x19
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.3:
Lloh23:
	adrp	x8, _REG_I_INCLK_FREQ_L@GOTPAGE
Lloh24:
	ldr	x8, [x8, _REG_I_INCLK_FREQ_L@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	and	w2, w21, #0xffff
	mov	x0, x19
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.4:
Lloh26:
	adrp	x8, _REG_I_USE_NPVI_CLOCKS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _REG_I_USE_NPVI_CLOCKS@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.5:
	bl	_REG_I_OPCLK_4KHZ
	mov	x1, x0
	ldr	w2, [x20, #12]
	mov	x0, x19
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.6:
	bl	_REG_I_MIN_OUTRATE_4KHZ
	mov	x1, x0
	ldr	w2, [x20, #4]
	mov	x0, x19
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.7:
	bl	_REG_I_MAX_OUTRATE_4KHZ
	mov	x1, x0
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.8:
Lloh29:
	adrp	x8, _REG_I_INIT_PARAMS_UPDATED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _REG_I_INIT_PARAMS_UPDATED@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_s5k6aa_write
	cbnz	w0, LBB0_11
; %bb.9:
Lloh32:
	adrp	x8, _REG_I_ERROR_INFO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _REG_I_ERROR_INFO@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_s5k6aa_read
	cbnz	w0, LBB0_11
; %bb.10:
	ldr	x8, [sp, #8]
Lloh35:
	adrp	x9, _EINVAL@GOTPAGE
Lloh36:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	x8, #0
	csneg	w0, wzr, w9, eq
LBB0_11:
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_MIN_MCLK_FREQ_KHZ,8,3          ; @MIN_MCLK_FREQ_KHZ
	.comm	_MAX_MCLK_FREQ_KHZ,8,3          ; @MAX_MCLK_FREQ_KHZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid clock frequency: %ld\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCLK_FREQ_MIN,4,2              ; @PCLK_FREQ_MIN
	.comm	_PCLK_FREQ_MAX,4,2              ; @PCLK_FREQ_MAX
	.comm	_SYS_PLL_OUT_FREQ,4,2           ; @SYS_PLL_OUT_FREQ
	.comm	_REG_I_INCLK_FREQ_H,4,2         ; @REG_I_INCLK_FREQ_H
	.comm	_REG_I_INCLK_FREQ_L,4,2         ; @REG_I_INCLK_FREQ_L
	.comm	_REG_I_USE_NPVI_CLOCKS,4,2      ; @REG_I_USE_NPVI_CLOCKS
	.comm	_REG_I_INIT_PARAMS_UPDATED,4,2  ; @REG_I_INIT_PARAMS_UPDATED
	.comm	_REG_I_ERROR_INFO,4,2           ; @REG_I_ERROR_INFO
	.no_dead_strip	_s5k6aa_configure_pixel_clocks
.subsections_via_symbols
