	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_prox_read_result
_bh1770_prox_read_result:               ## @bh1770_prox_read_result
	.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	%rdi, %r14
	movq	40(%rdi), %rdi
	movq	_BH1770_PS_DATA_LED1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	xorl	%r15d, %r15d
	cmpl	(%r14), %ebx
	setg	%r15b
	movq	8(%r14), %rax
	movq	_PROX_IGNORE_LUX_LIMIT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	cmovgl	%edx, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_bh1770_psraw_to_adjusted
	movl	%eax, 48(%r14)
	cmpl	52(%r14), %eax
	jge	LBB0_3
## %bb.2:
	cmpl	$0, 16(%r14)
	je	LBB0_4
LBB0_3:
	movq	32(%r14), %rax
	movq	%rax, 24(%r14)
LBB0_4:
	movl	$0, 16(%r14)
	movl	%r15d, %edi
	callq	_likely
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	24(%r14), %rax
	cmpq	32(%r14), %rax
	jge	LBB0_6
## %bb.7:
	incq	%rax
	movq	%rax, 24(%r14)
	movq	_ENODATA@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	movq	$0, 24(%r14)
	movq	_PROX_BELOW_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, 48(%r14)
	jmp	LBB0_9
LBB0_6:
	movq	_PROX_ABOVE_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_9:
	movq	%r14, %rdi
	callq	_bh1770_prox_rate
	movq	40(%r14), %rdi
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_sysfs_notify
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BH1770_PS_DATA_LED1,4,2        ## @BH1770_PS_DATA_LED1
	.comm	_PROX_IGNORE_LUX_LIMIT,8,3      ## @PROX_IGNORE_LUX_LIMIT
	.comm	_ENODATA,4,2                    ## @ENODATA
	.comm	_PROX_ABOVE_THRESHOLD,4,2       ## @PROX_ABOVE_THRESHOLD
	.comm	_PROX_BELOW_THRESHOLD,4,2       ## @PROX_BELOW_THRESHOLD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prox0_raw"

	.no_dead_strip	_bh1770_prox_read_result
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_prox_read_result
_bh1770_prox_read_result:               ; @bh1770_prox_read_result
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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	x0, [x0, #40]
Lloh0:
	adrp	x8, _BH1770_PS_DATA_LED1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BH1770_PS_DATA_LED1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	w8, [x19]
	cmp	w0, w8
	cset	w20, gt
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _PROX_IGNORE_LUX_LIMIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PROX_IGNORE_LUX_LIMIT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	w1, wzr, w0, gt
	mov	x0, x19
	bl	_bh1770_psraw_to_adjusted
	str	w0, [x19, #48]
	ldr	w8, [x19, #52]
	cmp	w0, w8
	b.ge	LBB0_3
; %bb.2:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_4
LBB0_3:
	ldr	x8, [x19, #32]
	str	x8, [x19, #24]
LBB0_4:
	str	wzr, [x19, #16]
	mov	x0, x20
	bl	_likely
	cbz	x0, LBB0_7
; %bb.5:
	ldp	x8, x9, [x19, #24]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.6:
	add	x8, x8, #1
	str	x8, [x19, #24]
Lloh6:
	adrp	x8, _ENODATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_7:
	str	xzr, [x19, #24]
Lloh9:
	adrp	x8, _PROX_BELOW_THRESHOLD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PROX_BELOW_THRESHOLD@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	str	wzr, [x19, #48]
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x8, _PROX_ABOVE_THRESHOLD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PROX_ABOVE_THRESHOLD@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
LBB0_9:
	mov	x0, x19
	bl	_bh1770_prox_rate
	ldr	x0, [x19, #40]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, #0
	bl	_sysfs_notify
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_BH1770_PS_DATA_LED1,4,2        ; @BH1770_PS_DATA_LED1
	.comm	_PROX_IGNORE_LUX_LIMIT,8,3      ; @PROX_IGNORE_LUX_LIMIT
	.comm	_ENODATA,4,2                    ; @ENODATA
	.comm	_PROX_ABOVE_THRESHOLD,4,2       ; @PROX_ABOVE_THRESHOLD
	.comm	_PROX_BELOW_THRESHOLD,4,2       ; @PROX_BELOW_THRESHOLD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prox0_raw"

	.no_dead_strip	_bh1770_prox_read_result
.subsections_via_symbols
