	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function dib0070_captrim
LCPI0_0:
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	3000                            ## 0xbb8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_dib0070_captrim:                       ## @dib0070_captrim
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rsi), %ecx
	movq	_CT_TUNER_STEP_0@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$15, %esi
	movl	$60688, %edx                    ## imm = 0xED10
	callq	_dib0070_write_reg
	movq	%rbx, %rdi
	movl	$23, %esi
	movl	$52, %edx
	callq	_dib0070_write_reg
	movq	%rbx, %rdi
	movl	$24, %esi
	movl	$50, %edx
	callq	_dib0070_write_reg
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [64,64,64,3000]
	movups	%xmm0, (%rbx)
	movl	$20, %eax
	movq	_CT_TUNER_STEP_1@GOTPCREL(%rip), %r13
	jmp	LBB0_12
LBB0_2:
	movq	_CT_TUNER_STEP_1@GOTPCREL(%rip), %r13
	cmpl	(%r13), %ecx
	jne	LBB0_4
## %bb.3:
	movl	(%rbx), %eax
	movl	4(%rbx), %edx
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, (%rbx)
	orl	16(%rbx), %edx
	movq	%rbx, %rdi
	movl	$20, %esi
	callq	_dib0070_write_reg
	movl	$15, %eax
	movq	_CT_TUNER_STEP_2@GOTPCREL(%rip), %r13
	jmp	LBB0_12
LBB0_4:
	movq	_CT_TUNER_STEP_2@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	movl	$25, %esi
	callq	_dib0070_read_reg
	movl	%eax, %r15d
	leal	-400(%r15), %eax
	negl	%eax
	leal	-400(%r15), %r12d
	cmpl	$400, %r15d                     ## imm = 0x190
	cmovll	%eax, %r12d
	movl	4(%rbx), %esi
	imull	$1800, %r15d, %eax              ## imm = 0x708
	leal	1023(%rax), %ecx
	testl	%eax, %eax
	leaq	L_.str(%rip), %rdi
	cmovnsl	%eax, %ecx
	sarl	$10, %ecx
	movl	%r15d, %edx
	callq	_dprintk
	movl	4(%rbx), %esi
	movl	12(%rbx), %ecx
	cmpl	%ecx, %r12d
	jge	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %edx
	callq	_dprintk
	movl	%r12d, 12(%rbx)
	movl	4(%rbx), %esi
	movl	%esi, 8(%rbx)
LBB0_7:
	movl	(%rbx), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmpl	$400, %r15d                     ## imm = 0x190
	cmovll	%eax, %ecx
	addl	%esi, %ecx
	movl	%ecx, 4(%rbx)
	testl	%eax, %eax
	jg	LBB0_9
## %bb.8:
	movq	_CT_TUNER_STEP_3@GOTPCREL(%rip), %r13
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_10:
	movq	_CT_TUNER_STEP_3@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpl	(%rdx), %ecx
	jne	LBB0_13
## %bb.11:
	movl	8(%rbx), %edx
	orl	16(%rbx), %edx
	movq	%rbx, %rdi
	movl	$20, %esi
	callq	_dib0070_write_reg
	movq	%rbx, %rdi
	movl	$24, %esi
	movl	$2047, %edx                     ## imm = 0x7FF
	callq	_dib0070_write_reg
	xorl	%eax, %eax
	movq	_CT_TUNER_STEP_4@GOTPCREL(%rip), %r13
LBB0_12:
	movl	(%r13), %ecx
	movl	%ecx, (%r14)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CT_TUNER_STEP_0,4,2            ## @CT_TUNER_STEP_0
	.comm	_CT_TUNER_STEP_1,4,2            ## @CT_TUNER_STEP_1
	.comm	_CT_TUNER_STEP_2,4,2            ## @CT_TUNER_STEP_2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CAPTRIM=%hd; ADC = %hd (ADC) & %dmV\n"

L_.str.1:                               ## @.str.1
	.asciz	"CAPTRIM=%hd is closer to target (%hd/%hd)\n"

	.comm	_CT_TUNER_STEP_3,4,2            ## @CT_TUNER_STEP_3
	.comm	_CT_TUNER_STEP_4,4,2            ## @CT_TUNER_STEP_4
	.no_dead_strip	_dib0070_captrim
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function dib0070_captrim
lCPI0_0:
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	3000                            ; 0xbb8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_dib0070_captrim:                       ; @dib0070_captrim
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _CT_TUNER_STEP_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CT_TUNER_STEP_0@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	w1, #15
	mov	w2, #60688
	bl	_dib0070_write_reg
	mov	x0, x20
	mov	w1, #23
	mov	w2, #52
	bl	_dib0070_write_reg
	mov	x0, x20
	mov	w1, #24
	mov	w2, #50
	bl	_dib0070_write_reg
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [x20]
	mov	w0, #20
Lloh5:
	adrp	x8, _CT_TUNER_STEP_1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CT_TUNER_STEP_1@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
Lloh7:
	adrp	x23, _CT_TUNER_STEP_1@GOTPAGE
Lloh8:
	ldr	x23, [x23, _CT_TUNER_STEP_1@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	ldp	w8, w9, [x20]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	w8, [x20]
	ldr	w8, [x20, #16]
	orr	w2, w9, w8
	mov	x0, x20
	mov	w1, #20
	bl	_dib0070_write_reg
	mov	w0, #15
Lloh9:
	adrp	x8, _CT_TUNER_STEP_2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CT_TUNER_STEP_2@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
Lloh11:
	adrp	x9, _CT_TUNER_STEP_2@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CT_TUNER_STEP_2@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x20
	mov	w1, #25
	bl	_dib0070_read_reg
	mov	x21, x0
	ldr	w1, [x20, #4]
	mov	w8, #1800
	mul	w8, w0, w8
	add	w9, w8, #1023
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w3, w8, #10
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dprintk
	sub	w8, w21, #400
	mov	w9, #400
	sub	w9, w9, w21
	cmp	w21, #399
	csel	w22, w8, w9, gt
	ldr	w3, [x20, #12]
	ldr	w1, [x20, #4]
	cmp	w22, w3
	b.ge	LBB0_7
; %bb.6:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dprintk
	ldr	w1, [x20, #4]
	stp	w1, w22, [x20, #8]
LBB0_7:
	mov	w0, #0
	ldr	w8, [x20]
	cmp	w21, #399
	cneg	w9, w8, gt
	add	w9, w1, w9
	str	w9, [x20, #4]
Lloh18:
	adrp	x9, _CT_TUNER_STEP_3@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CT_TUNER_STEP_3@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x23, x9, gt
	b	LBB0_10
LBB0_8:
Lloh20:
	adrp	x9, _CT_TUNER_STEP_3@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CT_TUNER_STEP_3@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.9:
	ldr	w8, [x20, #16]
	ldr	w9, [x20, #8]
	orr	w2, w9, w8
	mov	x0, x20
	mov	w1, #20
	bl	_dib0070_write_reg
	mov	x0, x20
	mov	w1, #24
	mov	w2, #2047
	bl	_dib0070_write_reg
	mov	w0, #0
Lloh23:
	adrp	x8, _CT_TUNER_STEP_4@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CT_TUNER_STEP_4@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	str	w8, [x19]
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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdrp	Lloh3, Lloh5
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CT_TUNER_STEP_0,4,2            ; @CT_TUNER_STEP_0
	.comm	_CT_TUNER_STEP_1,4,2            ; @CT_TUNER_STEP_1
	.comm	_CT_TUNER_STEP_2,4,2            ; @CT_TUNER_STEP_2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CAPTRIM=%hd; ADC = %hd (ADC) & %dmV\n"

l_.str.1:                               ; @.str.1
	.asciz	"CAPTRIM=%hd is closer to target (%hd/%hd)\n"

	.comm	_CT_TUNER_STEP_3,4,2            ; @CT_TUNER_STEP_3
	.comm	_CT_TUNER_STEP_4,4,2            ; @CT_TUNER_STEP_4
	.no_dead_strip	_dib0070_captrim
.subsections_via_symbols
