	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm3605_get_lux
_cm3605_get_lux:                        ## @cm3605_get_lux
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	leaq	-12(%rbp), %rsi
	callq	_iio_read_channel_processed
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movl	4(%rbx), %edi
	movl	-12(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	-12(%rbp), %edi
	xorl	%eax, %eax
	cmpl	$30, %edi
	jl	LBB0_5
## %bb.2:
	movq	_CM3605_AOUT_MAX_MV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jle	LBB0_4
## %bb.3:
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	-12(%rbp), %edi
LBB0_4:
	addl	$-30, %edi
	imull	(%rbx), %edi
	movq	_CM3605_AOUT_TYP_MAX_MV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_div64_s64
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read %d mV from ADC\n"

	.comm	_CM3605_AOUT_MAX_MV,4,2         ## @CM3605_AOUT_MAX_MV
L_.str.1:                               ## @.str.1
	.asciz	"device out of range\n"

	.comm	_CM3605_AOUT_TYP_MAX_MV,4,2     ## @CM3605_AOUT_TYP_MAX_MV
	.no_dead_strip	_cm3605_get_lux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm3605_get_lux
_cm3605_get_lux:                        ; @cm3605_get_lux
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #8]
	add	x1, sp, #12
	bl	_iio_read_channel_processed
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	w0, [x19, #4]
	ldr	w2, [sp, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [sp, #12]
	cmp	w8, #30
	b.ge	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x9, _CM3605_AOUT_MAX_MV@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CM3605_AOUT_MAX_MV@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_5
; %bb.4:
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w8, [sp, #12]
LBB0_5:
	sub	w8, w8, #30
	ldr	w9, [x19]
	mul	w0, w8, w9
Lloh7:
	adrp	x8, _CM3605_AOUT_TYP_MAX_MV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CM3605_AOUT_TYP_MAX_MV@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_div64_s64
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read %d mV from ADC\n"

	.comm	_CM3605_AOUT_MAX_MV,4,2         ; @CM3605_AOUT_MAX_MV
l_.str.1:                               ; @.str.1
	.asciz	"device out of range\n"

	.comm	_CM3605_AOUT_TYP_MAX_MV,4,2     ; @CM3605_AOUT_TYP_MAX_MV
	.no_dead_strip	_cm3605_get_lux
.subsections_via_symbols
