	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_levels            ## -- Begin function ch7006_setup_levels
	.p2align	4, 0x90
_ch7006_setup_levels:                   ## @ch7006_setup_levels
	.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
	callq	_drm_i2c_encoder_get_client
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_ch7006_priv
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	16(%rbx), %r15
	movq	_ch7006_tv_norms@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_fixed1@GOTPCREL(%rip), %rdx
	imull	$339, (%rdx), %edx              ## imm = 0x153
	movslq	%edx, %rdx
	imulq	$274877907, %rdx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rdx
	shrq	$63, %rdx
	sarq	$38, %rsi
	addl	%edx, %esi
	movq	_CH7006_INPUT_FORMAT_DAC_GAIN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%esi, (%rcx,%rax,4)
	jge	LBB0_2
## %bb.1:
	movq	_CH7006_INPUT_FORMAT@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	orl	%edx, (%r15,%rsi,4)
	movl	$76, %r12d
	jmp	LBB0_3
LBB0_2:
	notl	%edx
	movq	_CH7006_INPUT_FORMAT@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	andl	%edx, (%r15,%rsi,4)
	movl	$71, %r12d
LBB0_3:
	imull	$26625, (%rcx,%rax,4), %edi     ## imm = 0x6801
	callq	_round_fixed
	cltd
	idivl	%r12d
	movl	8(%rbx), %ecx
	movl	$90, %edi
	movl	%eax, %esi
	movl	$208, %edx
	callq	_interpolate
	movl	%eax, %ebx
	movq	_CH7006_BLACK_LEVEL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_bitf
	movq	_CH7006_BLACK_LEVEL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%r15,%rcx,4)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ch7006_dbg                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ch7006_tv_norms,8,3            ## @ch7006_tv_norms
	.comm	_fixed1,4,2                     ## @fixed1
	.comm	_CH7006_INPUT_FORMAT_DAC_GAIN,4,2 ## @CH7006_INPUT_FORMAT_DAC_GAIN
	.comm	_CH7006_INPUT_FORMAT,8,3        ## @CH7006_INPUT_FORMAT
	.comm	_CH7006_BLACK_LEVEL_0,4,2       ## @CH7006_BLACK_LEVEL_0
	.comm	_CH7006_BLACK_LEVEL,8,3         ## @CH7006_BLACK_LEVEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"black level: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_levels            ; -- Begin function ch7006_setup_levels
	.p2align	2
_ch7006_setup_levels:                   ; @ch7006_setup_levels
	.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, x0
	bl	_drm_i2c_encoder_get_client
	mov	x19, x0
	mov	x0, x20
	bl	_to_ch7006_priv
	mov	x20, x0
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x8, _ch7006_tv_norms@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ch7006_tv_norms@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0]
	ldr	w11, [x8, x9, lsl #2]
Lloh3:
	adrp	x10, _fixed1@GOTPAGE
Lloh4:
	ldr	x10, [x10, _fixed1@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	mov	w12, #339
	mul	w10, w10, w12
	mov	w12, #19923
	movk	w12, #4194, lsl #16
	smull	x10, w10, w12
	lsr	x12, x10, #63
	asr	x13, x10, #38
Lloh6:
	adrp	x10, _CH7006_INPUT_FORMAT_DAC_GAIN@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CH7006_INPUT_FORMAT_DAC_GAIN@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	add	w12, w13, w12
	cmp	w11, w12
	b.ge	LBB0_2
; %bb.1:
Lloh9:
	adrp	x11, _CH7006_INPUT_FORMAT@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CH7006_INPUT_FORMAT@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	lsl	x11, x11, #2
	ldr	w12, [x21, x11]
	orr	w10, w12, w10
	str	w10, [x21, x11]
	mov	w22, #76
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x11, _CH7006_INPUT_FORMAT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CH7006_INPUT_FORMAT@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	lsl	x11, x11, #2
	ldr	w12, [x21, x11]
	bic	w10, w12, w10
	str	w10, [x21, x11]
	mov	w22, #71
LBB0_3:
	ldr	w8, [x8, x9, lsl #2]
	mov	w9, #26625
	mul	w0, w8, w9
	bl	_round_fixed
	ldr	w3, [x20, #8]
	sdiv	w1, w0, w22
	mov	w0, #90
	mov	w2, #208
	bl	_interpolate
	mov	x20, x0
Lloh15:
	adrp	x8, _CH7006_BLACK_LEVEL_0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CH7006_BLACK_LEVEL_0@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_bitf
Lloh18:
	adrp	x8, _CH7006_BLACK_LEVEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CH7006_BLACK_LEVEL@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	w0, [x21, x8, lsl #2]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	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
	b	_ch7006_dbg
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ch7006_tv_norms,8,3            ; @ch7006_tv_norms
	.comm	_fixed1,4,2                     ; @fixed1
	.comm	_CH7006_INPUT_FORMAT_DAC_GAIN,4,2 ; @CH7006_INPUT_FORMAT_DAC_GAIN
	.comm	_CH7006_INPUT_FORMAT,8,3        ; @CH7006_INPUT_FORMAT
	.comm	_CH7006_BLACK_LEVEL_0,4,2       ; @CH7006_BLACK_LEVEL_0
	.comm	_CH7006_BLACK_LEVEL,8,3         ; @CH7006_BLACK_LEVEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"black level: %d\n"

.subsections_via_symbols
