	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgs8gxx_set_mode_auto
_lgs8gxx_set_mode_auto:                 ## @lgs8gxx_set_mode_auto
	.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	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	_LGS8GXX_PROD_LGS8913@GOTPCREL(%rip), %r12
	cmpq	(%r12), %r15
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$198, %esi
	movl	$1, %edx
	callq	_lgs8gxx_write_reg
LBB0_2:
	movq	_LGS8GXX_PROD_LGS8G75@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_4
## %bb.3:
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$12, %esi
	callq	_lgs8gxx_read_reg
	movq	-40(%rbp), %rdx
	andq	$-5, %rdx
	movq	%rdx, -40(%rbp)
	orl	$128, %edx
	movq	%rbx, %rdi
	movl	$12, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_lgs8gxx_write_reg
	movq	%rbx, %rdi
	movl	$57, %esi
	xorl	%edx, %edx
	callq	_lgs8gxx_write_reg
	movq	%rbx, %rdi
	movl	$61, %esi
	movl	$4, %edx
	jmp	LBB0_10
LBB0_4:
	cmpq	(%r12), %r15
	je	LBB0_9
## %bb.5:
	movq	_LGS8GXX_PROD_LGS8GL5@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_9
## %bb.6:
	movq	_LGS8GXX_PROD_LGS8G42@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_9
## %bb.7:
	movq	_LGS8GXX_PROD_LGS8G52@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_9
## %bb.8:
	movq	_LGS8GXX_PROD_LGS8G54@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_11
LBB0_9:
	leaq	-40(%rbp), %r14
	movq	%rbx, %rdi
	movl	$126, %esi
	movq	%r14, %rdx
	callq	_lgs8gxx_read_reg
	movl	-40(%rbp), %edx
	orl	$1, %edx
	movq	%rbx, %rdi
	movl	$126, %esi
	callq	_lgs8gxx_write_reg
	movq	%rbx, %rdi
	movl	$197, %esi
	movq	%r14, %rdx
	callq	_lgs8gxx_read_reg
	movl	$224, %edx
	andl	-40(%rbp), %edx
	movq	%rbx, %rdi
	movl	$197, %esi
LBB0_10:
	callq	_lgs8gxx_write_reg
LBB0_11:
	cmpq	(%r12), %r15
	jne	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	movl	$193, %esi
	movl	$3, %edx
	callq	_lgs8gxx_write_reg
	leaq	-40(%rbp), %r14
	movq	%rbx, %rdi
	movl	$124, %esi
	movq	%r14, %rdx
	callq	_lgs8gxx_read_reg
	movq	-40(%rbp), %rdx
	andl	$140, %edx
	orq	$3, %rdx
	movq	%rdx, -40(%rbp)
	movq	%rbx, %rdi
	movl	$124, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_lgs8gxx_write_reg
	movq	%rbx, %rdi
	movl	$195, %esi
	movq	%r14, %rdx
	callq	_lgs8gxx_read_reg
	movzbl	-40(%rbp), %edx
	orq	$16, %rdx
	movq	%rdx, -40(%rbp)
	movq	%rbx, %rdi
	movl	$195, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_lgs8gxx_write_reg
LBB0_13:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_LGS8GXX_PROD_LGS8G52@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	movl	$217, %esi
	movl	$64, %edx
	callq	_lgs8gxx_write_reg
LBB0_15:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LGS8GXX_PROD_LGS8913,8,3       ## @LGS8GXX_PROD_LGS8913
	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ## @LGS8GXX_PROD_LGS8G75
	.comm	_LGS8GXX_PROD_LGS8GL5,8,3       ## @LGS8GXX_PROD_LGS8GL5
	.comm	_LGS8GXX_PROD_LGS8G42,8,3       ## @LGS8GXX_PROD_LGS8G42
	.comm	_LGS8GXX_PROD_LGS8G52,8,3       ## @LGS8GXX_PROD_LGS8G52
	.comm	_LGS8GXX_PROD_LGS8G54,8,3       ## @LGS8GXX_PROD_LGS8G54
	.no_dead_strip	_lgs8gxx_set_mode_auto
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lgs8gxx_set_mode_auto
_lgs8gxx_set_mode_auto:                 ; @lgs8gxx_set_mode_auto
	.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, x0
	ldr	x8, [x0]
	ldr	x21, [x8]
Lloh0:
	adrp	x22, _LGS8GXX_PROD_LGS8913@GOTPAGE
Lloh1:
	ldr	x22, [x22, _LGS8GXX_PROD_LGS8913@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x21, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #198
	mov	w2, #1
	bl	_lgs8gxx_write_reg
LBB0_2:
Lloh2:
	adrp	x8, _LGS8GXX_PROD_LGS8G75@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LGS8GXX_PROD_LGS8G75@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x20, _LGS8GXX_PROD_LGS8G52@GOTPAGE
Lloh6:
	ldr	x20, [x20, _LGS8GXX_PROD_LGS8G52@GOTPAGEOFF]
	cmp	x21, x8
	b.ne	LBB0_4
; %bb.3:
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #12
	bl	_lgs8gxx_read_reg
	ldr	x8, [sp, #8]
	and	x8, x8, #0xfffffffffffffffb
	str	x8, [sp, #8]
	orr	w2, w8, #0x80
	mov	x0, x19
	mov	w1, #12
	bl	_lgs8gxx_write_reg
	mov	x0, x19
	mov	w1, #57
	mov	w2, #0
	bl	_lgs8gxx_write_reg
	mov	x0, x19
	mov	w1, #61
	mov	w2, #4
	b	LBB0_6
LBB0_4:
	ldr	x8, [x22]
Lloh7:
	adrp	x9, _LGS8GXX_PROD_LGS8GL5@GOTPAGE
Lloh8:
	ldr	x9, [x9, _LGS8GXX_PROD_LGS8GL5@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
Lloh10:
	adrp	x10, _LGS8GXX_PROD_LGS8G42@GOTPAGE
Lloh11:
	ldr	x10, [x10, _LGS8GXX_PROD_LGS8G42@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	ldr	x11, [x20]
Lloh13:
	adrp	x12, _LGS8GXX_PROD_LGS8G54@GOTPAGE
Lloh14:
	ldr	x12, [x12, _LGS8GXX_PROD_LGS8G54@GOTPAGEOFF]
Lloh15:
	ldr	x12, [x12]
	cmp	x21, x8
	ccmp	x21, x9, #4, ne
	ccmp	x21, x10, #4, ne
	ccmp	x21, x11, #4, ne
	ccmp	x21, x12, #4, ne
	b.ne	LBB0_7
; %bb.5:
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #126
	bl	_lgs8gxx_read_reg
	ldr	w8, [sp, #8]
	orr	w2, w8, #0x1
	mov	x0, x19
	mov	w1, #126
	bl	_lgs8gxx_write_reg
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #197
	bl	_lgs8gxx_read_reg
	ldr	w8, [sp, #8]
	and	w2, w8, #0xe0
	mov	x0, x19
	mov	w1, #197
LBB0_6:
	bl	_lgs8gxx_write_reg
LBB0_7:
	ldr	x8, [x22]
	cmp	x21, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #193
	mov	w2, #3
	bl	_lgs8gxx_write_reg
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #124
	bl	_lgs8gxx_read_reg
	ldr	x8, [sp, #8]
	mov	w9, #140
	and	x8, x8, x9
	orr	x2, x8, #0x3
	str	x2, [sp, #8]
	mov	x0, x19
	mov	w1, #124
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_lgs8gxx_write_reg
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #195
	bl	_lgs8gxx_read_reg
	ldr	x8, [sp, #8]
	and	x8, x8, #0xff
	orr	x2, x8, #0x10
	str	x2, [sp, #8]
	mov	x0, x19
	mov	w1, #195
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_lgs8gxx_write_reg
LBB0_9:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	mov	w1, #217
	mov	w2, #64
	bl	_lgs8gxx_write_reg
LBB0_11:
	mov	w0, #0
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LGS8GXX_PROD_LGS8913,8,3       ; @LGS8GXX_PROD_LGS8913
	.comm	_LGS8GXX_PROD_LGS8G75,8,3       ; @LGS8GXX_PROD_LGS8G75
	.comm	_LGS8GXX_PROD_LGS8GL5,8,3       ; @LGS8GXX_PROD_LGS8GL5
	.comm	_LGS8GXX_PROD_LGS8G42,8,3       ; @LGS8GXX_PROD_LGS8G42
	.comm	_LGS8GXX_PROD_LGS8G52,8,3       ; @LGS8GXX_PROD_LGS8G52
	.comm	_LGS8GXX_PROD_LGS8G54,8,3       ; @LGS8GXX_PROD_LGS8G54
	.no_dead_strip	_lgs8gxx_set_mode_auto
.subsections_via_symbols
