	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib8096p_agc_startup
_dib8096p_agc_startup:                  ## @dib8096p_agc_startup
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movq	8(%r15), %r12
	callq	*(%r12)
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	leaq	-40(%rbp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	%rbx, %rdi
	callq	_dib0090_pwm_gain_reset
	movq	%rbx, %rdi
	callq	_dib0090_get_wbd_target
                                        ## kill: def $eax killed $eax def $rax
	leal	1(,%rax,8), %ecx
	shrl	$31, %ecx
	leal	(%rcx,%rax,8), %esi
	incl	%esi
	sarl	%esi
	movq	%rbx, %rdi
	callq	*24(%r12)
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_dib8096p_get_best_sampling
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	-52(%rbp), %rax
	movq	%rax, -40(%rbp)
	movl	(%r15), %edi
	movl	$200, %esi
	callq	_dib0700_set_i2c_speed
	movslq	(%rbx), %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	leaq	-40(%rbp), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	*16(%r12)
	movq	_DEMOD_TIMF_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-56(%rbp), %edx
	movq	%rbx, %rdi
	callq	*8(%r12)
	movl	(%r15), %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_dib0700_set_i2c_speed
	jmp	LBB0_4
LBB0_1:
	movl	%eax, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEMOD_TIMF_SET,4,2             ## @DEMOD_TIMF_SET
	.no_dead_strip	_dib8096p_agc_startup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib8096p_agc_startup
_dib8096p_agc_startup:                  ; @dib8096p_agc_startup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	ldr	x21, [x20, #8]
	ldr	x8, [x21]
	blr	x8
	tbnz	w0, #31, LBB0_3
; %bb.1:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	x0, x19
	bl	_dib0090_pwm_gain_reset
	mov	x0, x19
	bl	_dib0090_get_wbd_target
	mov	w8, #1
	bfi	w8, w0, #3, #29
	mov	w9, #2
	bfi	w9, w0, #3, #29
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #1
	ldr	x8, [x21, #24]
	mov	x0, x19
	blr	x8
	add	x1, sp, #8
	mov	x0, x19
	bl	_dib8096p_get_best_sampling
	mov	x8, x0
	mov	w0, #0
	cbnz	x8, LBB0_3
; %bb.2:
	ldur	d0, [sp, #12]
	str	d0, [sp, #24]
	ldr	w0, [x20]
	mov	w1, #200
	bl	_dib0700_set_i2c_speed
	ldr	x8, [x21, #16]
	ldrsw	x9, [x19]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w2, w9, w10
	add	x1, sp, #24
	mov	x0, x19
	mov	w3, #0
	blr	x8
	ldr	x8, [x21, #8]
Lloh0:
	adrp	x9, _DEMOD_TIMF_SET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DEMOD_TIMF_SET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	ldr	w2, [sp, #8]
	mov	x0, x19
	blr	x8
	ldr	w0, [x20]
	mov	w1, #1000
	bl	_dib0700_set_i2c_speed
	mov	w0, #0
LBB0_3:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DEMOD_TIMF_SET,4,2             ; @DEMOD_TIMF_SET
	.no_dead_strip	_dib8096p_agc_startup
.subsections_via_symbols
