	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gp2ap020a00f_adjust_lux_mode
_gp2ap020a00f_adjust_lux_mode:          ## @gp2ap020a00f_adjust_lux_mode
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_GP2AP020A00F_FLAG_LUX_MODE_HI@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	8(%r14), %r13
	movq	%r13, %rsi
	callq	_test_bit
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	cmpl	$999, %r15d                     ## imm = 0x3E7
	jg	LBB0_21
## %bb.4:
	movl	(%r12), %edi
	movq	%r13, %rsi
	callq	_clear_bit
	movq	_GP2AP020A00F_RANGE_A_x8@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	cmpl	$16001, %r15d                   ## imm = 0x3E81
	jl	LBB0_21
## %bb.2:
	movl	(%r12), %edi
	movq	%r13, %rsi
	callq	_set_bit
	movq	_GP2AP020A00F_RANGE_A_x128@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r15d
	xorl	%ebx, %ebx
	cmpl	$255, %r15d
	je	LBB0_21
## %bb.6:
	movq	_GP2AP020A00F_THRESH_TH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_gp2ap020a00f_write_event_threshold
	leaq	L_.str(%rip), %r12
	testl	%eax, %eax
	js	LBB0_20
## %bb.7:
	movq	_GP2AP020A00F_THRESH_TL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_gp2ap020a00f_write_event_threshold
	testl	%eax, %eax
	js	LBB0_20
## %bb.8:
	movl	12(%r14), %edi
	movq	_GP2AP020A00F_OP_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GP2AP020A00F_OP3_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_GP2AP020A00F_OP3_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	12(%r14), %edi
	movq	_GP2AP020A00F_ALS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GP2AP020A00F_RANGE_A_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movl	12(%r14), %edi
	movq	_GP2AP020A00F_OP_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	_GP2AP020A00F_OP3_OPERATION@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	_GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_gp2ap020a00f_write_event_threshold
	testl	%eax, %eax
	js	LBB0_19
LBB0_16:
	movq	_GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	_GP2AP020A00F_THRESH_TL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %ebx
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_gp2ap020a00f_write_event_threshold
	testl	%eax, %eax
	jns	LBB0_21
LBB0_19:
	leaq	L_.str.4(%rip), %r12
	jmp	LBB0_20
LBB0_9:
	leaq	L_.str.1(%rip), %r12
	jmp	LBB0_20
LBB0_11:
	leaq	L_.str.2(%rip), %r12
	jmp	LBB0_20
LBB0_13:
	leaq	L_.str.3(%rip), %r12
LBB0_20:
	movq	(%r14), %rdi
	movq	%r12, %rsi
	callq	_dev_err
	xorl	%ebx, %ebx
LBB0_21:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	$1, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_GP2AP020A00F_FLAG_LUX_MODE_HI,4,2 ## @GP2AP020A00F_FLAG_LUX_MODE_HI
	.comm	_GP2AP020A00F_RANGE_A_x128,4,2  ## @GP2AP020A00F_RANGE_A_x128
	.comm	_GP2AP020A00F_RANGE_A_x8,4,2    ## @GP2AP020A00F_RANGE_A_x8
	.comm	_GP2AP020A00F_THRESH_TH,4,2     ## @GP2AP020A00F_THRESH_TH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Clearing als threshold register failed.\n"

	.comm	_GP2AP020A00F_THRESH_TL,4,2     ## @GP2AP020A00F_THRESH_TL
	.comm	_GP2AP020A00F_OP_REG,4,2        ## @GP2AP020A00F_OP_REG
	.comm	_GP2AP020A00F_OP3_MASK,4,2      ## @GP2AP020A00F_OP3_MASK
	.comm	_GP2AP020A00F_OP3_SHUTDOWN,4,2  ## @GP2AP020A00F_OP3_SHUTDOWN
L_.str.1:                               ## @.str.1
	.asciz	"Shutting down the device failed.\n"

	.comm	_GP2AP020A00F_ALS_REG,4,2       ## @GP2AP020A00F_ALS_REG
	.comm	_GP2AP020A00F_RANGE_A_MASK,4,2  ## @GP2AP020A00F_RANGE_A_MASK
L_.str.2:                               ## @.str.2
	.asciz	"Adjusting device lux mode failed.\n"

	.comm	_GP2AP020A00F_OP3_OPERATION,4,2 ## @GP2AP020A00F_OP3_OPERATION
L_.str.3:                               ## @.str.3
	.asciz	"Powering up the device failed.\n"

	.comm	_GP2AP020A00F_FLAG_ALS_RISING_EV,4,2 ## @GP2AP020A00F_FLAG_ALS_RISING_EV
L_.str.4:                               ## @.str.4
	.asciz	"Adjusting als threshold value failed.\n"

	.comm	_GP2AP020A00F_FLAG_ALS_FALLING_EV,4,2 ## @GP2AP020A00F_FLAG_ALS_FALLING_EV
	.no_dead_strip	_gp2ap020a00f_adjust_lux_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gp2ap020a00f_adjust_lux_mode
_gp2ap020a00f_adjust_lux_mode:          ; @gp2ap020a00f_adjust_lux_mode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _GP2AP020A00F_FLAG_LUX_MODE_HI@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GP2AP020A00F_FLAG_LUX_MODE_HI@GOTPAGEOFF]
	ldr	w0, [x22]
	add	x20, x19, #8
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_3
; %bb.1:
	cmp	w21, #999
	b.gt	LBB0_18
; %bb.2:
	ldr	w0, [x22]
	mov	x1, x20
	bl	_clear_bit
Lloh2:
	adrp	x8, _GP2AP020A00F_RANGE_A_x8@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GP2AP020A00F_RANGE_A_x8@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	mov	w8, #16001
	cmp	w21, w8
	b.lt	LBB0_18
; %bb.4:
	ldr	w0, [x22]
	mov	x1, x20
	bl	_set_bit
Lloh4:
	adrp	x8, _GP2AP020A00F_RANGE_A_x128@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GP2AP020A00F_RANGE_A_x128@GOTPAGEOFF]
LBB0_5:
	ldr	w21, [x8]
	cmp	w21, #255
	b.eq	LBB0_18
; %bb.6:
Lloh6:
	adrp	x23, _GP2AP020A00F_THRESH_TH@GOTPAGE
Lloh7:
	ldr	x23, [x23, _GP2AP020A00F_THRESH_TH@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_gp2ap020a00f_write_event_threshold
	tbnz	w0, #31, LBB0_16
; %bb.7:
Lloh8:
	adrp	x22, _GP2AP020A00F_THRESH_TL@GOTPAGE
Lloh9:
	ldr	x22, [x22, _GP2AP020A00F_THRESH_TL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_gp2ap020a00f_write_event_threshold
	tbnz	w0, #31, LBB0_16
; %bb.8:
	ldr	w0, [x19, #12]
Lloh10:
	adrp	x24, _GP2AP020A00F_OP_REG@GOTPAGE
Lloh11:
	ldr	x24, [x24, _GP2AP020A00F_OP_REG@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh12:
	adrp	x25, _GP2AP020A00F_OP3_MASK@GOTPAGE
Lloh13:
	ldr	x25, [x25, _GP2AP020A00F_OP3_MASK@GOTPAGEOFF]
	ldr	w2, [x25]
Lloh14:
	adrp	x8, _GP2AP020A00F_OP3_SHUTDOWN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GP2AP020A00F_OP3_SHUTDOWN@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_20
; %bb.9:
	ldr	w0, [x19, #12]
Lloh17:
	adrp	x8, _GP2AP020A00F_ALS_REG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GP2AP020A00F_ALS_REG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _GP2AP020A00F_RANGE_A_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GP2AP020A00F_RANGE_A_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x3, x21
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_21
; %bb.10:
	ldr	w0, [x19, #12]
	ldr	w1, [x24]
	ldr	w2, [x25]
Lloh23:
	adrp	x8, _GP2AP020A00F_OP3_OPERATION@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GP2AP020A00F_OP3_OPERATION@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_22
; %bb.11:
Lloh26:
	adrp	x8, _GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_13
; %bb.12:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #1
	bl	_gp2ap020a00f_write_event_threshold
	tbnz	w0, #31, LBB0_15
LBB0_13:
Lloh29:
	adrp	x8, _GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_23
; %bb.14:
	ldr	w1, [x22]
	mov	w20, #1
	mov	x0, x19
	mov	w2, #1
	bl	_gp2ap020a00f_write_event_threshold
	tbz	w0, #31, LBB0_19
LBB0_15:
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh34:
	adrp	x1, l_.str@PAGE
Lloh35:
	add	x1, x1, l_.str@PAGEOFF
LBB0_17:
	ldr	x0, [x19]
	bl	_dev_err
LBB0_18:
	mov	w20, #0
LBB0_19:
	mov	x0, x20
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_21:
Lloh38:
	adrp	x1, l_.str.2@PAGE
Lloh39:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_22:
Lloh40:
	adrp	x1, l_.str.3@PAGE
Lloh41:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_23:
	mov	w20, #1
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_GP2AP020A00F_FLAG_LUX_MODE_HI,4,2 ; @GP2AP020A00F_FLAG_LUX_MODE_HI
	.comm	_GP2AP020A00F_RANGE_A_x128,4,2  ; @GP2AP020A00F_RANGE_A_x128
	.comm	_GP2AP020A00F_RANGE_A_x8,4,2    ; @GP2AP020A00F_RANGE_A_x8
	.comm	_GP2AP020A00F_THRESH_TH,4,2     ; @GP2AP020A00F_THRESH_TH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Clearing als threshold register failed.\n"

	.comm	_GP2AP020A00F_THRESH_TL,4,2     ; @GP2AP020A00F_THRESH_TL
	.comm	_GP2AP020A00F_OP_REG,4,2        ; @GP2AP020A00F_OP_REG
	.comm	_GP2AP020A00F_OP3_MASK,4,2      ; @GP2AP020A00F_OP3_MASK
	.comm	_GP2AP020A00F_OP3_SHUTDOWN,4,2  ; @GP2AP020A00F_OP3_SHUTDOWN
l_.str.1:                               ; @.str.1
	.asciz	"Shutting down the device failed.\n"

	.comm	_GP2AP020A00F_ALS_REG,4,2       ; @GP2AP020A00F_ALS_REG
	.comm	_GP2AP020A00F_RANGE_A_MASK,4,2  ; @GP2AP020A00F_RANGE_A_MASK
l_.str.2:                               ; @.str.2
	.asciz	"Adjusting device lux mode failed.\n"

	.comm	_GP2AP020A00F_OP3_OPERATION,4,2 ; @GP2AP020A00F_OP3_OPERATION
l_.str.3:                               ; @.str.3
	.asciz	"Powering up the device failed.\n"

	.comm	_GP2AP020A00F_FLAG_ALS_RISING_EV,4,2 ; @GP2AP020A00F_FLAG_ALS_RISING_EV
l_.str.4:                               ; @.str.4
	.asciz	"Adjusting als threshold value failed.\n"

	.comm	_GP2AP020A00F_FLAG_ALS_FALLING_EV,4,2 ; @GP2AP020A00F_FLAG_ALS_FALLING_EV
	.no_dead_strip	_gp2ap020a00f_adjust_lux_mode
.subsections_via_symbols
