	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgdt3305_set_agc_power_ref
_lgdt3305_set_agc_power_ref:            ## @lgdt3305_set_agc_power_ref
	.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
	movl	(%rsi), %eax
	cmpl	$130, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$129, %eax
	je	LBB0_6
## %bb.2:
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.3:
	movq	(%r15), %rax
	jmp	LBB0_7
LBB0_4:
	movq	(%r15), %rax
	addq	$8, %rax
	jmp	LBB0_7
LBB0_6:
	movq	(%r15), %rax
	addq	$4, %rax
LBB0_7:
	movl	(%rax), %ebx
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_lg_dbg
	movq	_LGDT3305_AGC_CTRL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$3, %edx
	movl	$1, %ecx
	callq	_lgdt3305_set_reg_bit
	movq	_LGDT3305_AGC_POWER_REF_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bh, %edx
	movq	%r15, %rdi
	callq	_lgdt3305_write_reg
	movq	_LGDT3305_AGC_POWER_REF_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r15, %rdi
	callq	_lgdt3305_write_reg
	jmp	LBB0_9
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set manual mode: 0x%04x\n"

	.comm	_LGDT3305_AGC_CTRL_1,4,2        ## @LGDT3305_AGC_CTRL_1
	.comm	_LGDT3305_AGC_POWER_REF_1,4,2   ## @LGDT3305_AGC_POWER_REF_1
	.comm	_LGDT3305_AGC_POWER_REF_2,4,2   ## @LGDT3305_AGC_POWER_REF_2
	.no_dead_strip	_lgdt3305_set_agc_power_ref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lgdt3305_set_agc_power_ref
_lgdt3305_set_agc_power_ref:            ; @lgdt3305_set_agc_power_ref
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x1]
	cmp	w8, #130
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x19]
	ldr	w20, [x8]
	cbnz	w20, LBB0_6
	b	LBB0_7
LBB0_4:
	ldr	x8, [x19]
	add	x8, x8, #8
	ldr	w20, [x8]
	cbnz	w20, LBB0_6
	b	LBB0_7
LBB0_5:
	ldr	x8, [x19]
	add	x8, x8, #4
	ldr	w20, [x8]
	cbz	w20, LBB0_7
LBB0_6:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_lg_dbg
Lloh2:
	adrp	x8, _LGDT3305_AGC_CTRL_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LGDT3305_AGC_CTRL_1@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	mov	w3, #1
	bl	_lgdt3305_set_reg_bit
Lloh5:
	adrp	x8, _LGDT3305_AGC_POWER_REF_1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LGDT3305_AGC_POWER_REF_1@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ubfx	w2, w20, #8, #8
	mov	x0, x19
	bl	_lgdt3305_write_reg
Lloh8:
	adrp	x8, _LGDT3305_AGC_POWER_REF_2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LGDT3305_AGC_POWER_REF_2@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	and	w2, w20, #0xff
	mov	x0, x19
	bl	_lgdt3305_write_reg
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set manual mode: 0x%04x\n"

	.comm	_LGDT3305_AGC_CTRL_1,4,2        ; @LGDT3305_AGC_CTRL_1
	.comm	_LGDT3305_AGC_POWER_REF_1,4,2   ; @LGDT3305_AGC_POWER_REF_1
	.comm	_LGDT3305_AGC_POWER_REF_2,4,2   ; @LGDT3305_AGC_POWER_REF_2
	.no_dead_strip	_lgdt3305_set_agc_power_ref
.subsections_via_symbols
