	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm36651_read_output
_cm36651_read_output:                   ## @cm36651_read_output
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rdi, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	(%rsi), %eax
	cmpl	$128, %eax
	je	LBB0_5
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_9
## %bb.2:
	movq	16(%r14), %r14
	movl	4(%rsi), %esi
	movq	%r14, %rdi
	callq	_i2c_smbus_read_word_data
	movl	%eax, (%r15)
	testl	%eax, %eax
	js	LBB0_9
## %bb.3:
	movq	_CM36651_CS_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM36651_ALS_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_4
	jmp	LBB0_9
LBB0_5:
	movq	(%r14), %rdi
	callq	_i2c_smbus_read_byte
	movl	%eax, (%r15)
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	movq	_CM36651_PROXIMITY_EV_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r14), %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_4
## %bb.7:
	movq	(%r14), %rdi
	movq	_CM36651_PS_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM36651_PS_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_8
LBB0_4:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CM36651_CS_CONF1,4,2           ## @CM36651_CS_CONF1
	.comm	_CM36651_ALS_DISABLE,4,2        ## @CM36651_ALS_DISABLE
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_CM36651_PROXIMITY_EV_EN,4,2    ## @CM36651_PROXIMITY_EV_EN
	.comm	_CM36651_PS_CONF1,4,2           ## @CM36651_PS_CONF1
	.comm	_CM36651_PS_DISABLE,4,2         ## @CM36651_PS_DISABLE
	.no_dead_strip	_cm36651_read_output
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm36651_read_output
_cm36651_read_output:                   ; @cm36651_read_output
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	ldr	w8, [x1]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.2:
	ldr	x20, [x20, #16]
	ldr	w1, [x1, #4]
	mov	x0, x20
	bl	_i2c_smbus_read_word_data
	str	w0, [x21]
	tbnz	w0, #31, LBB0_8
; %bb.3:
Lloh3:
	adrp	x8, _CM36651_CS_CONF1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM36651_CS_CONF1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _CM36651_ALS_DISABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CM36651_ALS_DISABLE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
Lloh9:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w19, w0, w8, lt
	b	LBB0_8
LBB0_4:
	ldr	x0, [x20]
	bl	_i2c_smbus_read_byte
	str	w0, [x21]
	tbnz	w0, #31, LBB0_8
; %bb.5:
Lloh12:
	adrp	x8, _CM36651_PROXIMITY_EV_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CM36651_PROXIMITY_EV_EN@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	add	x1, x20, #8
	bl	_test_bit
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x0, [x20]
Lloh15:
	adrp	x8, _CM36651_PS_CONF1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CM36651_PS_CONF1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _CM36651_PS_DISABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CM36651_PS_DISABLE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_9
LBB0_7:
Lloh21:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh23:
	ldr	w19, [x8]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x19, x0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CM36651_CS_CONF1,4,2           ; @CM36651_CS_CONF1
	.comm	_CM36651_ALS_DISABLE,4,2        ; @CM36651_ALS_DISABLE
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_CM36651_PROXIMITY_EV_EN,4,2    ; @CM36651_PROXIMITY_EV_EN
	.comm	_CM36651_PS_CONF1,4,2           ; @CM36651_PS_CONF1
	.comm	_CM36651_PS_DISABLE,4,2         ; @CM36651_PS_DISABLE
	.no_dead_strip	_cm36651_read_output
.subsections_via_symbols
