	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gp2ap020a00f_read_channel
_gp2ap020a00f_read_channel:             ## @gp2ap020a00f_read_channel
	.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	(%rsi), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r12
	cltq
	leaq	l_switch.table.gp2ap020a00f_read_channel(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %r15d
	movl	%r15d, %esi
	callq	_gp2ap020a00f_exec_cmd
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	4(%r13), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_gp2ap020a00f_read_output
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	movq	(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_6:
	movq	_GP2AP020A00F_OPMODE_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_gp2ap020a00f_set_operation_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.7:
	movq	(%r12), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
LBB0_8:
	movq	_GP2AP020A00F_CMD_READ_RAW_CLEAR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	je	LBB0_10
## %bb.9:
	movq	_GP2AP020A00F_CMD_READ_RAW_IR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_gp2ap020a00f_output_to_lux
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movl	%eax, %ebx
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GP2AP020A00F_CMD_READ_RAW_CLEAR,4,2 ## @GP2AP020A00F_CMD_READ_RAW_CLEAR
	.comm	_GP2AP020A00F_CMD_READ_RAW_IR,4,2 ## @GP2AP020A00F_CMD_READ_RAW_IR
	.comm	_GP2AP020A00F_CMD_READ_RAW_PROXIMITY,4,2 ## @GP2AP020A00F_CMD_READ_RAW_PROXIMITY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gp2ap020a00f_exec_cmd failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"gp2ap020a00f_read_output failed\n"

	.comm	_GP2AP020A00F_OPMODE_SHUTDOWN,4,2 ## @GP2AP020A00F_OPMODE_SHUTDOWN
L_.str.2:                               ## @.str.2
	.asciz	"Failed to shut down the device.\n"

	.no_dead_strip	_gp2ap020a00f_read_channel
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.gp2ap020a00f_read_channel
l_switch.table.gp2ap020a00f_read_channel:
	.quad	_GP2AP020A00F_CMD_READ_RAW_PROXIMITY
	.quad	_GP2AP020A00F_CMD_READ_RAW_IR
	.quad	_GP2AP020A00F_CMD_READ_RAW_CLEAR

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gp2ap020a00f_read_channel
_gp2ap020a00f_read_channel:             ; @gp2ap020a00f_read_channel
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	w8, [x1]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_8
; %bb.1:
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x9, l_switch.table.gp2ap020a00f_read_channel@PAGE
Lloh1:
	add	x9, x9, l_switch.table.gp2ap020a00f_read_channel@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w21, [x8]
	mov	x1, x21
	bl	_gp2ap020a00f_exec_cmd
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	w1, [x23, #4]
	mov	x0, x20
	mov	x2, x19
	bl	_gp2ap020a00f_read_output
	tbz	w0, #31, LBB0_4
; %bb.3:
	ldr	x0, [x20]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_4:
Lloh4:
	adrp	x8, _GP2AP020A00F_OPMODE_SHUTDOWN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GP2AP020A00F_OPMODE_SHUTDOWN@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_gp2ap020a00f_set_operation_mode
	mov	x22, x0
	tbz	w0, #31, LBB0_6
; %bb.5:
	ldr	x0, [x20]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
LBB0_6:
Lloh9:
	adrp	x8, _GP2AP020A00F_CMD_READ_RAW_CLEAR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GP2AP020A00F_CMD_READ_RAW_CLEAR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _GP2AP020A00F_CMD_READ_RAW_IR@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GP2AP020A00F_CMD_READ_RAW_IR@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_10
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_gp2ap020a00f_output_to_lux
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_9:
	mov	x22, x0
	ldr	x0, [x20]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_10:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GP2AP020A00F_CMD_READ_RAW_CLEAR,4,2 ; @GP2AP020A00F_CMD_READ_RAW_CLEAR
	.comm	_GP2AP020A00F_CMD_READ_RAW_IR,4,2 ; @GP2AP020A00F_CMD_READ_RAW_IR
	.comm	_GP2AP020A00F_CMD_READ_RAW_PROXIMITY,4,2 ; @GP2AP020A00F_CMD_READ_RAW_PROXIMITY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gp2ap020a00f_exec_cmd failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"gp2ap020a00f_read_output failed\n"

	.comm	_GP2AP020A00F_OPMODE_SHUTDOWN,4,2 ; @GP2AP020A00F_OPMODE_SHUTDOWN
l_.str.2:                               ; @.str.2
	.asciz	"Failed to shut down the device.\n"

	.no_dead_strip	_gp2ap020a00f_read_channel
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.gp2ap020a00f_read_channel
l_switch.table.gp2ap020a00f_read_channel:
	.quad	_GP2AP020A00F_CMD_READ_RAW_PROXIMITY
	.quad	_GP2AP020A00F_CMD_READ_RAW_IR
	.quad	_GP2AP020A00F_CMD_READ_RAW_CLEAR

.subsections_via_symbols
