	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opt3001_irq
_opt3001_irq:                           ## @opt3001_irq
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rsi, %rdi
	callq	_iio_priv
	movq	%rax, %r15
	cmpl	$0, 16(%rax)
	jne	LBB0_2
## %bb.1:
	leaq	12(%r15), %rdi
	callq	_mutex_lock
LBB0_2:
	movl	24(%r15), %edi
	movq	_OPT3001_CONFIGURATION@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_i2c_smbus_read_word_swapped
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	movq	_OPT3001_CONFIGURATION_M_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_OPT3001_CONFIGURATION_M_CONTINUOUS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_9
## %bb.5:
	movq	_OPT3001_CONFIGURATION_FH@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_IIO_LIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IIO_EV_TYPE_THRESH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IIO_EV_DIR_RISING@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	callq	_IIO_UNMOD_EVENT_CODE
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_iio_get_time_ns
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_iio_push_event
LBB0_7:
	movq	_OPT3001_CONFIGURATION_FL@GOTPCREL(%rip), %rax
	movb	$1, %r12b
	testl	%ebx, (%rax)
	je	LBB0_13
## %bb.8:
	movq	_IIO_LIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IIO_EV_TYPE_THRESH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IIO_EV_DIR_FALLING@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	callq	_IIO_UNMOD_EVENT_CODE
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_iio_get_time_ns
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_iio_push_event
	cmpl	$0, 16(%r15)
	jne	LBB0_15
	jmp	LBB0_14
LBB0_3:
	movl	20(%r15), %edi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movb	$1, %r12b
	cmpl	$0, 16(%r15)
	jne	LBB0_15
	jmp	LBB0_14
LBB0_9:
	movq	_OPT3001_CONFIGURATION_CRF@GOTPCREL(%rip), %rax
	movb	$1, %r12b
	testl	%ebx, (%rax)
	je	LBB0_13
## %bb.10:
	movl	24(%r15), %edi
	movq	_OPT3001_RESULT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_i2c_smbus_read_word_swapped
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movl	%eax, (%r15)
	movl	$1, 4(%r15)
	xorl	%r12d, %r12d
LBB0_13:
	cmpl	$0, 16(%r15)
	je	LBB0_14
LBB0_15:
	testb	%r12b, %r12b
	jne	LBB0_17
LBB0_16:
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_wake_up
LBB0_17:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	20(%r15), %edi
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	cmpl	$0, 16(%r15)
	jne	LBB0_15
LBB0_14:
	leaq	12(%r15), %rdi
	callq	_mutex_unlock
	testb	%r12b, %r12b
	je	LBB0_16
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_OPT3001_CONFIGURATION,4,2      ## @OPT3001_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_M_MASK,4,2 ## @OPT3001_CONFIGURATION_M_MASK
	.comm	_OPT3001_CONFIGURATION_M_CONTINUOUS,4,2 ## @OPT3001_CONFIGURATION_M_CONTINUOUS
	.comm	_OPT3001_CONFIGURATION_FH,4,2   ## @OPT3001_CONFIGURATION_FH
	.comm	_IIO_LIGHT,4,2                  ## @IIO_LIGHT
	.comm	_IIO_EV_TYPE_THRESH,4,2         ## @IIO_EV_TYPE_THRESH
	.comm	_IIO_EV_DIR_RISING,4,2          ## @IIO_EV_DIR_RISING
	.comm	_OPT3001_CONFIGURATION_FL,4,2   ## @OPT3001_CONFIGURATION_FL
	.comm	_IIO_EV_DIR_FALLING,4,2         ## @IIO_EV_DIR_FALLING
	.comm	_OPT3001_CONFIGURATION_CRF,4,2  ## @OPT3001_CONFIGURATION_CRF
	.comm	_OPT3001_RESULT,4,2             ## @OPT3001_RESULT
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_opt3001_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opt3001_irq
_opt3001_irq:                           ; @opt3001_irq
	.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, x1
	mov	x0, x1
	bl	_iio_priv
	mov	x19, x0
	ldr	w8, [x0, #16]
	cbnz	w8, LBB0_2
; %bb.1:
	add	x0, x19, #12
	bl	_mutex_lock
LBB0_2:
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x22, _OPT3001_CONFIGURATION@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OPT3001_CONFIGURATION@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_i2c_smbus_read_word_swapped
	tbnz	w0, #31, LBB0_8
; %bb.3:
	mov	x21, x0
Lloh2:
	adrp	x8, _OPT3001_CONFIGURATION_M_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_M_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh5:
	adrp	x9, _OPT3001_CONFIGURATION_M_CONTINUOUS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OPT3001_CONFIGURATION_M_CONTINUOUS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.4:
Lloh8:
	adrp	x8, _OPT3001_CONFIGURATION_FH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_FH@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x23, _IIO_LIGHT@GOTPAGE
Lloh12:
	ldr	x23, [x23, _IIO_LIGHT@GOTPAGEOFF]
Lloh13:
	adrp	x24, _IIO_EV_TYPE_THRESH@GOTPAGE
Lloh14:
	ldr	x24, [x24, _IIO_EV_TYPE_THRESH@GOTPAGEOFF]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x23]
	ldr	w2, [x24]
Lloh15:
	adrp	x8, _IIO_EV_DIR_RISING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IIO_EV_DIR_RISING@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	mov	w1, #0
	bl	_IIO_UNMOD_EVENT_CODE
	mov	x22, x0
	mov	x0, x20
	bl	_iio_get_time_ns
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	_iio_push_event
LBB0_6:
Lloh18:
	adrp	x8, _OPT3001_CONFIGURATION_FL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_FL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_13
; %bb.7:
	ldr	w0, [x23]
	ldr	w2, [x24]
Lloh21:
	adrp	x8, _IIO_EV_DIR_FALLING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IIO_EV_DIR_FALLING@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	w1, #0
	bl	_IIO_UNMOD_EVENT_CODE
	mov	x21, x0
	mov	x0, x20
	bl	_iio_get_time_ns
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_iio_push_event
	b	LBB0_13
LBB0_8:
	ldr	w0, [x19, #20]
	ldr	w2, [x22]
LBB0_9:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_10:
Lloh26:
	adrp	x8, _OPT3001_CONFIGURATION_CRF@GOTPAGE
Lloh27:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_CRF@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_13
; %bb.11:
	ldr	w0, [x19, #24]
Lloh29:
	adrp	x20, _OPT3001_RESULT@GOTPAGE
Lloh30:
	ldr	x20, [x20, _OPT3001_RESULT@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_i2c_smbus_read_word_swapped
	tbnz	w0, #31, LBB0_18
; %bb.12:
	mov	w20, #0
	mov	w8, #1
	stp	w0, w8, [x19]
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_14
	b	LBB0_17
LBB0_13:
	mov	w20, #1
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_17
LBB0_14:
	tbnz	w20, #0, LBB0_16
LBB0_15:
	add	x0, x19, #8
	bl	_wake_up
LBB0_16:
Lloh31:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh32:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	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
LBB0_17:
	add	x0, x19, #12
	bl	_mutex_unlock
	tbnz	w20, #0, LBB0_16
	b	LBB0_15
LBB0_18:
	ldr	w0, [x19, #20]
	ldr	w2, [x20]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_OPT3001_CONFIGURATION,4,2      ; @OPT3001_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_M_MASK,4,2 ; @OPT3001_CONFIGURATION_M_MASK
	.comm	_OPT3001_CONFIGURATION_M_CONTINUOUS,4,2 ; @OPT3001_CONFIGURATION_M_CONTINUOUS
	.comm	_OPT3001_CONFIGURATION_FH,4,2   ; @OPT3001_CONFIGURATION_FH
	.comm	_IIO_LIGHT,4,2                  ; @IIO_LIGHT
	.comm	_IIO_EV_TYPE_THRESH,4,2         ; @IIO_EV_TYPE_THRESH
	.comm	_IIO_EV_DIR_RISING,4,2          ; @IIO_EV_DIR_RISING
	.comm	_OPT3001_CONFIGURATION_FL,4,2   ; @OPT3001_CONFIGURATION_FL
	.comm	_IIO_EV_DIR_FALLING,4,2         ; @IIO_EV_DIR_FALLING
	.comm	_OPT3001_CONFIGURATION_CRF,4,2  ; @OPT3001_CONFIGURATION_CRF
	.comm	_OPT3001_RESULT,4,2             ; @OPT3001_RESULT
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_opt3001_irq
.subsections_via_symbols
