	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm36651_read_channel
_cm36651_read_channel:                  ## @cm36651_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
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	(%rdi), %r14
	movq	(%rsi), %rax
	movq	_IIO_LIGHT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_CM36651_CMD_READ_RAW_LIGHT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_IIO_PROXIMITY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.3:
	movq	_CM36651_CMD_READ_RAW_PROXIMITY@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_cm36651_set_operation_mode
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	$50, %edi
	callq	_msleep
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_cm36651_read_output
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_8:
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_9
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_LIGHT,8,3                  ## @IIO_LIGHT
	.comm	_CM36651_CMD_READ_RAW_LIGHT,4,2 ## @CM36651_CMD_READ_RAW_LIGHT
	.comm	_IIO_PROXIMITY,8,3              ## @IIO_PROXIMITY
	.comm	_CM36651_CMD_READ_RAW_PROXIMITY,4,2 ## @CM36651_CMD_READ_RAW_PROXIMITY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CM36651 set operation mode failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"CM36651 read output failed\n"

	.no_dead_strip	_cm36651_read_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm36651_read_channel
_cm36651_read_channel:                  ; @cm36651_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
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x19, [x0]
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _IIO_LIGHT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IIO_LIGHT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _CM36651_CMD_READ_RAW_LIGHT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM36651_CMD_READ_RAW_LIGHT@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x9, _IIO_PROXIMITY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IIO_PROXIMITY@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.3:
Lloh8:
	adrp	x8, _CM36651_CMD_READ_RAW_PROXIMITY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CM36651_CMD_READ_RAW_PROXIMITY@GOTPAGEOFF]
LBB0_4:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_cm36651_set_operation_mode
	tbnz	w0, #31, LBB0_7
; %bb.5:
	mov	w0, #50
	bl	_msleep
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_cm36651_read_output
	mov	x23, x0
	tbz	w0, #31, LBB0_10
; %bb.6:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
	mov	x23, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	mov	x0, x23
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_LIGHT,8,3                  ; @IIO_LIGHT
	.comm	_CM36651_CMD_READ_RAW_LIGHT,4,2 ; @CM36651_CMD_READ_RAW_LIGHT
	.comm	_IIO_PROXIMITY,8,3              ; @IIO_PROXIMITY
	.comm	_CM36651_CMD_READ_RAW_PROXIMITY,4,2 ; @CM36651_CMD_READ_RAW_PROXIMITY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CM36651 set operation mode failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"CM36651 read output failed\n"

	.no_dead_strip	_cm36651_read_channel
.subsections_via_symbols
