	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opt3001_get_lux
_opt3001_get_lux:                       ## @opt3001_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	%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, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	cmpq	$0, 40(%rdi)
	je	LBB0_3
## %bb.1:
	movl	32(%r12), %edi
	movq	_OPT3001_LOW_LIMIT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_OPT3001_LOW_LIMIT_EOC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i2c_smbus_write_word_swapped
	testl	%eax, %eax
	js	LBB0_24
## %bb.2:
	movl	$1, (%r12)
LBB0_3:
	movl	$0, 4(%r12)
	movl	32(%r12), %edi
	movq	_OPT3001_CONFIGURATION@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.4:
	movl	%ebx, -44(%rbp)
	movq	_OPT3001_CONFIGURATION_M_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_opt3001_set_mode
	movl	32(%r12), %edi
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	callq	_i2c_smbus_write_word_swapped
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	cmpq	$0, 40(%r12)
	je	LBB0_8
## %bb.6:
	movl	4(%r12), %r13d
	movl	48(%r12), %ebx
	movq	_OPT3001_RESULT_READY_LONG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_msecs_to_jiffies
	movl	%ebx, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_7:
	movl	%eax, %ebx
	movl	28(%r12), %edi
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_16
LBB0_8:
	movq	8(%r12), %rax
	movq	_OPT3001_INT_TIME_SHORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_OPT3001_RESULT_READY_SHORT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_OPT3001_RESULT_READY_LONG@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rdi
	callq	_msleep
	movl	32(%r12), %edi
	movl	(%r13), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.12:
	movq	_OPT3001_CONFIGURATION_CRF@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_27
## %bb.13:
	movl	32(%r12), %edi
	movq	_OPT3001_RESULT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	movl	%ebx, 16(%r12)
	movl	$1, 4(%r12)
	jmp	LBB0_17
LBB0_15:
	movl	28(%r12), %edi
	movl	(%r13), %edx
	leaq	L_.str.1(%rip), %rsi
LBB0_16:
	callq	_dev_err
LBB0_17:
	movq	40(%r12), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movl	$0, (%r12)
LBB0_19:
	testl	%ebx, %ebx
	je	LBB0_25
## %bb.20:
	js	LBB0_26
## %bb.21:
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movl	20(%r12), %edx
	movl	32(%r12), %edi
	shll	$12, %edx
	orl	24(%r12), %edx
	movq	_OPT3001_LOW_LIMIT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_i2c_smbus_write_word_swapped
	testl	%eax, %eax
	js	LBB0_24
LBB0_23:
	movl	16(%r12), %edi
	callq	_OPT3001_REG_EXPONENT
	movl	%eax, %ebx
	movl	16(%r12), %edi
	callq	_OPT3001_REG_MANTISSA
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_opt3001_to_iio_ret
	movq	_IIO_VAL_INT_PLUS_MICRO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_26
LBB0_24:
	movl	%eax, %ebx
	movl	28(%r12), %edi
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_26
LBB0_25:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_OPT3001_LOW_LIMIT,4,2          ## @OPT3001_LOW_LIMIT
	.comm	_OPT3001_LOW_LIMIT_EOC_ENABLE,4,2 ## @OPT3001_LOW_LIMIT_EOC_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to write register %02x\n"

	.comm	_OPT3001_CONFIGURATION,4,2      ## @OPT3001_CONFIGURATION
L_.str.1:                               ## @.str.1
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_M_SINGLE,4,2 ## @OPT3001_CONFIGURATION_M_SINGLE
	.comm	_OPT3001_RESULT_READY_LONG,8,3  ## @OPT3001_RESULT_READY_LONG
	.comm	_OPT3001_INT_TIME_SHORT,8,3     ## @OPT3001_INT_TIME_SHORT
	.comm	_OPT3001_RESULT_READY_SHORT,8,3 ## @OPT3001_RESULT_READY_SHORT
	.comm	_OPT3001_CONFIGURATION_CRF,4,2  ## @OPT3001_CONFIGURATION_CRF
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_OPT3001_RESULT,4,2             ## @OPT3001_RESULT
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ## @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_opt3001_get_lux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opt3001_get_lux
_opt3001_get_lux:                       ; @opt3001_get_lux
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w0, [x20, #32]
Lloh0:
	adrp	x23, _OPT3001_LOW_LIMIT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _OPT3001_LOW_LIMIT@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _OPT3001_LOW_LIMIT_EOC_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPT3001_LOW_LIMIT_EOC_ENABLE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_i2c_smbus_write_word_swapped
	tbnz	w0, #31, LBB0_20
; %bb.2:
	mov	w8, #1
	str	w8, [x20]
LBB0_3:
	str	wzr, [x20, #4]
	ldr	w0, [x20, #32]
Lloh5:
	adrp	x23, _OPT3001_CONFIGURATION@GOTPAGE
Lloh6:
	ldr	x23, [x23, _OPT3001_CONFIGURATION@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_i2c_smbus_read_word_swapped
	mov	x22, x0
	tbnz	w0, #31, LBB0_12
; %bb.4:
	str	w22, [sp, #12]
Lloh7:
	adrp	x8, _OPT3001_CONFIGURATION_M_SINGLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_M_SINGLE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x20
	bl	_opt3001_set_mode
	ldr	w0, [x20, #32]
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	bl	_i2c_smbus_write_word_swapped
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	w22, [x20, #48]
	ldr	w23, [x20, #4]
Lloh10:
	adrp	x8, _OPT3001_RESULT_READY_LONG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OPT3001_RESULT_READY_LONG@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x8]
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_timeout
	mov	x22, x0
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_14
	b	LBB0_15
LBB0_7:
	mov	x22, x0
	ldr	w0, [x20, #28]
	ldr	w2, [x23]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_8:
	ldr	x8, [x20, #8]
Lloh15:
	adrp	x9, _OPT3001_INT_TIME_SHORT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _OPT3001_INT_TIME_SHORT@GOTPAGEOFF]
Lloh17:
	adrp	x10, _OPT3001_RESULT_READY_SHORT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _OPT3001_RESULT_READY_SHORT@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
Lloh20:
	adrp	x11, _OPT3001_RESULT_READY_LONG@GOTPAGE
Lloh21:
	ldr	x11, [x11, _OPT3001_RESULT_READY_LONG@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	x0, [x8]
	bl	_msleep
	ldr	w0, [x20, #32]
	ldr	w1, [x23]
	bl	_i2c_smbus_read_word_swapped
	mov	x22, x0
	tbnz	w0, #31, LBB0_12
; %bb.9:
Lloh22:
	adrp	x8, _OPT3001_CONFIGURATION_CRF@GOTPAGE
Lloh23:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_CRF@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_23
; %bb.10:
	ldr	w0, [x20, #32]
Lloh25:
	adrp	x23, _OPT3001_RESULT@GOTPAGE
Lloh26:
	ldr	x23, [x23, _OPT3001_RESULT@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_i2c_smbus_read_word_swapped
	mov	x22, x0
	tbnz	w0, #31, LBB0_12
; %bb.11:
	str	w22, [x20, #16]
	mov	w8, #1
	str	w8, [x20, #4]
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_14
	b	LBB0_15
LBB0_12:
	ldr	w0, [x20, #28]
	ldr	w2, [x23]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_13:
	bl	_dev_err
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_15
LBB0_14:
	str	wzr, [x20]
LBB0_15:
	cbz	w22, LBB0_21
; %bb.16:
	tbnz	w22, #31, LBB0_22
; %bb.17:
	cbz	x8, LBB0_19
; %bb.18:
	ldp	w8, w9, [x20, #20]
	orr	w2, w9, w8, lsl #12
	ldr	w0, [x20, #32]
Lloh29:
	adrp	x23, _OPT3001_LOW_LIMIT@GOTPAGE
Lloh30:
	ldr	x23, [x23, _OPT3001_LOW_LIMIT@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_i2c_smbus_write_word_swapped
	tbnz	w0, #31, LBB0_20
LBB0_19:
	ldr	w0, [x20, #16]
	bl	_OPT3001_REG_EXPONENT
	mov	x22, x0
	ldr	w0, [x20, #16]
	bl	_OPT3001_REG_MANTISSA
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	mov	x4, x19
	bl	_opt3001_to_iio_ret
Lloh31:
	adrp	x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGEOFF]
Lloh33:
	ldr	w22, [x8]
	b	LBB0_22
LBB0_20:
	mov	x22, x0
	ldr	w0, [x20, #28]
	ldr	w2, [x23]
Lloh34:
	adrp	x1, l_.str@PAGE
Lloh35:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_22
LBB0_21:
Lloh36:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_22:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_23:
Lloh39:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_14
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_OPT3001_LOW_LIMIT,4,2          ; @OPT3001_LOW_LIMIT
	.comm	_OPT3001_LOW_LIMIT_EOC_ENABLE,4,2 ; @OPT3001_LOW_LIMIT_EOC_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to write register %02x\n"

	.comm	_OPT3001_CONFIGURATION,4,2      ; @OPT3001_CONFIGURATION
l_.str.1:                               ; @.str.1
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_M_SINGLE,4,2 ; @OPT3001_CONFIGURATION_M_SINGLE
	.comm	_OPT3001_RESULT_READY_LONG,8,3  ; @OPT3001_RESULT_READY_LONG
	.comm	_OPT3001_INT_TIME_SHORT,8,3     ; @OPT3001_INT_TIME_SHORT
	.comm	_OPT3001_RESULT_READY_SHORT,8,3 ; @OPT3001_RESULT_READY_SHORT
	.comm	_OPT3001_CONFIGURATION_CRF,4,2  ; @OPT3001_CONFIGURATION_CRF
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_OPT3001_RESULT,4,2             ; @OPT3001_RESULT
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ; @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_opt3001_get_lux
.subsections_via_symbols
