	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_irq
_bh1770_irq:                            ## @bh1770_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	%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	%rsi, %rbx
	leaq	24(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	32(%rbx), %rdi
	movq	_BH1770_ALS_PS_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r12d
	movq	32(%rbx), %rdi
	movq	_BH1770_INTERRUPT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_i2c_smbus_read_byte_data
	movq	_BH1770_INT_ALS_DATA@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_bh1770_lux_get_result
	movl	(%rbx), %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	$0, (%rbx)
	leaq	48(%rbx), %rdi
	callq	_wake_up
	movl	40(%rbx), %edx
	movl	44(%rbx), %esi
	movq	%rbx, %rdi
	callq	_bh1770_lux_update_thresholds
LBB0_3:
	movq	32(%rbx), %rdi
	movl	(%r13), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_i2c_smbus_write_byte_data
	movq	_BH1770_INT_ALS_INT@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_5
## %bb.4:
	movq	32(%rbx), %rdi
	leaq	L_.str(%rip), %rdx
	xorl	%esi, %esi
	callq	_sysfs_notify
LBB0_5:
	movl	4(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	_BH1770_INT_LEDS_INT@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_9
## %bb.8:
	movq	_prox_rates_ms@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	movl	(%rax,%rcx,4), %r15d
	movq	%rbx, %rdi
	callq	_bh1770_prox_read_result
	movl	4(%rbx), %eax
	jmp	LBB0_9
LBB0_6:
	xorl	%eax, %eax
LBB0_9:
	movq	32(%rbx), %rdi
	movl	(%r13), %esi
	movl	16(%rbx), %edx
	addl	%edx, %edx
	orl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.10:
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_cancel_delayed_work_sync
	addl	$50, %r15d
	movl	%r15d, %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_schedule_delayed_work
LBB0_11:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BH1770_ALS_PS_STATUS,4,2       ## @BH1770_ALS_PS_STATUS
	.comm	_BH1770_INTERRUPT,4,2           ## @BH1770_INTERRUPT
	.comm	_BH1770_INT_ALS_DATA,4,2        ## @BH1770_INT_ALS_DATA
	.comm	_BH1770_INT_ALS_INT,4,2         ## @BH1770_INT_ALS_INT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lux0_input"

	.comm	_BH1770_INT_LEDS_INT,4,2        ## @BH1770_INT_LEDS_INT
	.comm	_prox_rates_ms,8,3              ## @prox_rates_ms
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_bh1770_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_irq
_bh1770_irq:                            ; @bh1770_irq
	.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	x19, x1
	add	x20, x1, #24
	mov	x0, x20
	bl	_mutex_lock
	ldr	x0, [x19, #32]
Lloh0:
	adrp	x8, _BH1770_ALS_PS_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BH1770_ALS_PS_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	ldr	x0, [x19, #32]
Lloh3:
	adrp	x22, _BH1770_INTERRUPT@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BH1770_INTERRUPT@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_i2c_smbus_read_byte_data
Lloh5:
	adrp	x8, _BH1770_INT_ALS_DATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BH1770_INT_ALS_DATA@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_bh1770_lux_get_result
	ldr	w0, [x19]
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
	str	wzr, [x19]
	add	x0, x19, #48
	bl	_wake_up
	ldp	w2, w1, [x19, #40]
	mov	x0, x19
	bl	_bh1770_lux_update_thresholds
LBB0_3:
	ldr	x0, [x19, #32]
	ldr	w1, [x22]
	mov	w2, #0
	bl	_i2c_smbus_write_byte_data
Lloh8:
	adrp	x8, _BH1770_INT_ALS_INT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BH1770_INT_ALS_INT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.4:
	ldr	x0, [x19, #32]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, #0
	bl	_sysfs_notify
LBB0_5:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_8
; %bb.6:
Lloh13:
	adrp	x9, _BH1770_INT_LEDS_INT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _BH1770_INT_LEDS_INT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w21
	b.eq	LBB0_8
; %bb.7:
Lloh16:
	adrp	x8, _prox_rates_ms@GOTPAGE
Lloh17:
	ldr	x8, [x8, _prox_rates_ms@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	ldr	w21, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_bh1770_prox_read_result
	ldr	w8, [x19, #4]
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	ldr	x0, [x19, #32]
	ldr	w1, [x22]
	ldr	w9, [x19, #16]
	orr	w2, w8, w9, lsl #1
	bl	_i2c_smbus_write_byte_data
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w21, LBB0_11
; %bb.10:
	add	x19, x19, #20
	mov	x0, x19
	bl	_cancel_delayed_work_sync
	add	w0, w21, #50
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x19
	bl	_schedule_delayed_work
LBB0_11:
Lloh19:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BH1770_ALS_PS_STATUS,4,2       ; @BH1770_ALS_PS_STATUS
	.comm	_BH1770_INTERRUPT,4,2           ; @BH1770_INTERRUPT
	.comm	_BH1770_INT_ALS_DATA,4,2        ; @BH1770_INT_ALS_DATA
	.comm	_BH1770_INT_ALS_INT,4,2         ; @BH1770_INT_ALS_INT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lux0_input"

	.comm	_BH1770_INT_LEDS_INT,4,2        ; @BH1770_INT_LEDS_INT
	.comm	_prox_rates_ms,8,3              ; @prox_rates_ms
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_bh1770_irq
.subsections_via_symbols
