	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgs8gxx_autolock_gi
_lgs8gxx_autolock_gi:                   ## @lgs8gxx_autolock_gi
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	$0, -44(%rbp)
	movq	_GI_945@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_2:
	movq	_GI_595@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_4:
	movq	_GI_420@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_7
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	callq	_dprintk
LBB0_7:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_LGS8GXX_PROD_LGS8G75@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$12, %esi
	callq	_lgs8gxx_read_reg
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_lgs8gxx_read_reg
	movq	_GI_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-40(%rbp), %edx
	orl	%r12d, %edx
	movl	%edx, -40(%rbp)
	movl	$254, %eax
	andl	-36(%rbp), %eax
	xorl	%ecx, %ecx
	testl	%r15d, %r15d
	setne	%cl
	orl	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movq	%rbx, %rdi
	movl	$12, %esi
	callq	_lgs8gxx_write_reg
	movl	-36(%rbp), %edx
	movq	%rbx, %rdi
	movl	$24, %esi
	jmp	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	movl	$4, %esi
	movl	%r12d, %edx
LBB0_10:
	callq	_lgs8gxx_write_reg
	movq	%rbx, %rdi
	callq	_lgs8gxx_soft_reset
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_lgs8gxx_wait_ca_lock
	testl	%eax, %eax
	je	LBB0_11
LBB0_17:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%eax, %eax
	cmpl	$0, (%r14)
	je	LBB0_17
## %bb.12:
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_lgs8gxx_is_autodetect_finished
	testl	%eax, %eax
	jne	LBB0_17
## %bb.13:
	cmpl	$0, -44(%rbp)
	je	LBB0_15
## %bb.14:
	leaq	L_.str.3(%rip), %rdi
	callq	_dprintk
	jmp	LBB0_16
LBB0_15:
	movl	$0, (%r14)
LBB0_16:
	xorl	%eax, %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_GI_945,4,2                     ## @GI_945
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"try GI 945\n"

	.comm	_GI_595,4,2                     ## @GI_595
L_.str.1:                               ## @.str.1
	.asciz	"try GI 595\n"

	.comm	_GI_420,4,2                     ## @GI_420
L_.str.2:                               ## @.str.2
	.asciz	"try GI 420\n"

	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ## @LGS8GXX_PROD_LGS8G75
	.comm	_GI_MASK,4,2                    ## @GI_MASK
L_.str.3:                               ## @.str.3
	.asciz	"auto detect finished\n"

	.no_dead_strip	_lgs8gxx_autolock_gi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lgs8gxx_autolock_gi
_lgs8gxx_autolock_gi:                   ; @lgs8gxx_autolock_gi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _GI_945@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GI_945@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
Lloh5:
	adrp	x8, _GI_595@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GI_595@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x8, _GI_420@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GI_420@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.5:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_dprintk
LBB0_7:
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _LGS8GXX_PROD_LGS8G75@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LGS8GXX_PROD_LGS8G75@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #12
	bl	_lgs8gxx_read_reg
	add	x2, sp, #4
	mov	x0, x20
	mov	w1, #24
	bl	_lgs8gxx_read_reg
Lloh18:
	adrp	x8, _GI_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GI_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [sp, #8]
	bic	w8, w9, w8
	orr	w2, w8, w21
	ldr	w8, [sp, #4]
	and	w8, w8, #0xfe
	cmp	w22, #0
	cset	w9, ne
	orr	w8, w8, w9
	stp	w8, w2, [sp, #4]
	mov	x0, x20
	mov	w1, #12
	bl	_lgs8gxx_write_reg
	ldr	w2, [sp, #4]
	mov	x0, x20
	mov	w1, #24
	b	LBB0_10
LBB0_9:
	mov	x0, x20
	mov	w1, #4
	mov	x2, x21
LBB0_10:
	bl	_lgs8gxx_write_reg
	mov	x0, x20
	bl	_lgs8gxx_soft_reset
	mov	x0, x20
	mov	x1, x19
	bl	_lgs8gxx_wait_ca_lock
	cbnz	w0, LBB0_16
; %bb.11:
	ldr	w8, [x19]
	cbz	w8, LBB0_15
; %bb.12:
	add	x1, sp, #12
	mov	x0, x20
	bl	_lgs8gxx_is_autodetect_finished
	cbnz	w0, LBB0_16
; %bb.13:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_17
; %bb.14:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dprintk
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
	add	sp, sp, #64
	ret
LBB0_17:
	mov	w0, #0
	str	wzr, [x19]
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GI_945,4,2                     ; @GI_945
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"try GI 945\n"

	.comm	_GI_595,4,2                     ; @GI_595
l_.str.1:                               ; @.str.1
	.asciz	"try GI 595\n"

	.comm	_GI_420,4,2                     ; @GI_420
l_.str.2:                               ; @.str.2
	.asciz	"try GI 420\n"

	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ; @LGS8GXX_PROD_LGS8G75
	.comm	_GI_MASK,4,2                    ; @GI_MASK
l_.str.3:                               ; @.str.3
	.asciz	"auto detect finished\n"

	.no_dead_strip	_lgs8gxx_autolock_gi
.subsections_via_symbols
