	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgs8gxx_auto_lock
_lgs8gxx_auto_lock:                     ## @lgs8gxx_auto_lock
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	$2, -28(%rbp)
	movl	$0, -20(%rbp)
	leaq	-20(%rbp), %rsi
	leaq	-28(%rbp), %rdx
	callq	_lgs8gxx_auto_detect
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_3
LBB0_2:
	movl	-20(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_3:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	_LGS8GXX_PROD_LGS8913@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_5
## %bb.4:
	movl	-20(%rbp), %ecx
	movq	_TIM_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%ecx, %edx
	movq	_TIM_MIDDLE@GOTPCREL(%rip), %rsi
	xorl	%edi, %edi
	cmpl	(%rsi), %edx
	sete	%dil
	movq	_CF_MASK@GOTPCREL(%rip), %rdx
	movq	_SC_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	shll	$5, %edi
	movq	_LGS_FEC_MASK@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	andl	%ecx, %esi
	orl	%edi, %esi
	orl	$64, %esi
	movl	%esi, -20(%rbp)
LBB0_5:
	movq	_LGS8GXX_PROD_LGS8G75@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$25, %esi
	callq	_lgs8gxx_read_reg
	movl	$129, %eax
	andl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	addl	%edx, %edx
	orl	%eax, %edx
	movl	%edx, -24(%rbp)
	movq	%rbx, %rdi
	movl	$25, %esi
	jmp	LBB0_9
LBB0_7:
	movl	-20(%rbp), %edx
	movq	%rbx, %rdi
	movl	$125, %esi
	callq	_lgs8gxx_write_reg
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	jne	LBB0_10
## %bb.8:
	movl	-20(%rbp), %edx
	movq	%rbx, %rdi
	movl	$192, %esi
LBB0_9:
	callq	_lgs8gxx_write_reg
LBB0_10:
	movq	%rbx, %rdi
	callq	_lgs8gxx_set_mode_manual
	movl	-28(%rbp), %eax
	cmpl	$129, %eax
	movl	$595, %ecx                      ## imm = 0x253
	movl	$945, %edx                      ## imm = 0x3B1
	cmovel	%ecx, %edx
	cmpl	$130, %eax
	movl	$420, %eax                      ## imm = 0x1A4
	cmovnel	%edx, %eax
	movl	%eax, (%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lgs8gxx_auto_detect failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"detected param = 0x%02X\n"

	.comm	_LGS8GXX_PROD_LGS8913,8,3       ## @LGS8GXX_PROD_LGS8913
	.comm	_TIM_MASK,4,2                   ## @TIM_MASK
	.comm	_TIM_MIDDLE,4,2                 ## @TIM_MIDDLE
	.comm	_CF_MASK,4,2                    ## @CF_MASK
	.comm	_SC_MASK,4,2                    ## @SC_MASK
	.comm	_LGS_FEC_MASK,4,2               ## @LGS_FEC_MASK
	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ## @LGS8GXX_PROD_LGS8G75
	.no_dead_strip	_lgs8gxx_auto_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lgs8gxx_auto_lock
_lgs8gxx_auto_lock:                     ; @lgs8gxx_auto_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	mov	w8, #2
	stur	w8, [x29, #-20]
	str	wzr, [sp, #24]
	add	x1, sp, #24
	sub	x2, x29, #20
	bl	_lgs8gxx_auto_detect
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:
	ldr	w8, [sp, #24]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_3:
	bl	_dprintk
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh4:
	adrp	x20, _LGS8GXX_PROD_LGS8913@GOTPAGE
Lloh5:
	ldr	x20, [x20, _LGS8GXX_PROD_LGS8913@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x9, _TIM_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TIM_MASK@GOTPAGEOFF]
	ldr	w10, [sp, #24]
Lloh8:
	ldr	w9, [x9]
	and	w9, w9, w10
Lloh9:
	adrp	x11, _TIM_MIDDLE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _TIM_MIDDLE@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	mov	w12, #64
	mov	w13, #96
	cmp	w9, w11
	csel	w9, w13, w12, eq
Lloh12:
	adrp	x11, _CF_MASK@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CF_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
Lloh15:
	adrp	x12, _SC_MASK@GOTPAGE
Lloh16:
	ldr	x12, [x12, _SC_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w12, [x12]
Lloh18:
	adrp	x13, _LGS_FEC_MASK@GOTPAGE
Lloh19:
	ldr	x13, [x13, _LGS_FEC_MASK@GOTPAGEOFF]
	orr	w11, w12, w11
Lloh20:
	ldr	w12, [x13]
	orr	w11, w11, w12
	and	w10, w11, w10
	orr	w9, w10, w9
	str	w9, [sp, #24]
LBB0_5:
Lloh21:
	adrp	x9, _LGS8GXX_PROD_LGS8G75@GOTPAGE
Lloh22:
	ldr	x9, [x9, _LGS8GXX_PROD_LGS8G75@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	add	x2, sp, #20
	mov	x0, x19
	mov	w1, #25
	bl	_lgs8gxx_read_reg
	ldr	w8, [sp, #20]
	mov	w9, #129
	and	w8, w8, w9
	ldr	w9, [sp, #24]
	orr	w2, w8, w9, lsl #1
	str	w2, [sp, #20]
	mov	x0, x19
	mov	w1, #25
	b	LBB0_9
LBB0_7:
	ldr	w2, [sp, #24]
	mov	x0, x19
	mov	w1, #125
	bl	_lgs8gxx_write_reg
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	ldr	w2, [sp, #24]
	mov	x0, x19
	mov	w1, #192
LBB0_9:
	bl	_lgs8gxx_write_reg
LBB0_10:
	mov	x0, x19
	bl	_lgs8gxx_set_mode_manual
	ldur	w8, [x29, #-20]
	mov	w9, #945
	mov	w10, #595
	cmp	w8, #129
	csel	w9, w10, w9, eq
	mov	w10, #420
	cmp	w8, #130
	csel	w8, w10, w9, eq
	str	w8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lgs8gxx_auto_detect failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"detected param = 0x%02X\n"

	.comm	_LGS8GXX_PROD_LGS8913,8,3       ; @LGS8GXX_PROD_LGS8913
	.comm	_TIM_MASK,4,2                   ; @TIM_MASK
	.comm	_TIM_MIDDLE,4,2                 ; @TIM_MIDDLE
	.comm	_CF_MASK,4,2                    ; @CF_MASK
	.comm	_SC_MASK,4,2                    ; @SC_MASK
	.comm	_LGS_FEC_MASK,4,2               ; @LGS_FEC_MASK
	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ; @LGS8GXX_PROD_LGS8G75
	.no_dead_strip	_lgs8gxx_auto_lock
.subsections_via_symbols
