	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_prox_mode_control
_bh1770_prox_mode_control:              ## @bh1770_prox_mode_control
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	movl	$1, (%rbx)
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_bh1770_lux_rate
	movq	%rbx, %rdi
	callq	_bh1770_prox_set_threshold
	movq	%rbx, %rdi
	callq	_bh1770_led_cfg
	movq	_PROX_BELOW_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_bh1770_prox_rate
	movq	_BH1770_STANDALONE@GOTPCREL(%rip), %r14
	movq	_BH1770_ENABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	$0, 16(%rbx)
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_bh1770_lux_rate
	movq	_BH1770_STANDBY@GOTPCREL(%rip), %r14
	movq	_BH1770_DISABLE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_bh1770_prox_interrupt_control
	movl	4(%rbx), %edi
	movq	_BH1770_PS_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	callq	_i2c_smbus_write_byte_data
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PROX_BELOW_THRESHOLD,4,2       ## @PROX_BELOW_THRESHOLD
	.comm	_BH1770_ENABLE,4,2              ## @BH1770_ENABLE
	.comm	_BH1770_PS_CONTROL,4,2          ## @BH1770_PS_CONTROL
	.comm	_BH1770_STANDALONE,4,2          ## @BH1770_STANDALONE
	.comm	_BH1770_DISABLE,4,2             ## @BH1770_DISABLE
	.comm	_BH1770_STANDBY,4,2             ## @BH1770_STANDBY
	.no_dead_strip	_bh1770_prox_mode_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_prox_mode_control
_bh1770_prox_mode_control:              ; @bh1770_prox_mode_control
	.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	x8, [x0, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [x19]
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_bh1770_lux_rate
	mov	x0, x19
	bl	_bh1770_prox_set_threshold
	mov	x0, x19
	bl	_bh1770_led_cfg
Lloh0:
	adrp	x8, _PROX_BELOW_THRESHOLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PROX_BELOW_THRESHOLD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bh1770_prox_rate
Lloh3:
	adrp	x20, _BH1770_STANDALONE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _BH1770_STANDALONE@GOTPAGEOFF]
Lloh5:
	adrp	x8, _BH1770_ENABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BH1770_ENABLE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	str	xzr, [x19, #16]
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_bh1770_lux_rate
Lloh7:
	adrp	x20, _BH1770_STANDBY@GOTPAGE
Lloh8:
	ldr	x20, [x20, _BH1770_STANDBY@GOTPAGEOFF]
Lloh9:
	adrp	x8, _BH1770_DISABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BH1770_DISABLE@GOTPAGEOFF]
LBB0_3:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bh1770_prox_interrupt_control
	ldr	w0, [x19, #4]
Lloh11:
	adrp	x8, _BH1770_PS_CONTROL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BH1770_PS_CONTROL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w2, [x20]
	bl	_i2c_smbus_write_byte_data
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PROX_BELOW_THRESHOLD,4,2       ; @PROX_BELOW_THRESHOLD
	.comm	_BH1770_ENABLE,4,2              ; @BH1770_ENABLE
	.comm	_BH1770_PS_CONTROL,4,2          ; @BH1770_PS_CONTROL
	.comm	_BH1770_STANDALONE,4,2          ; @BH1770_STANDALONE
	.comm	_BH1770_DISABLE,4,2             ; @BH1770_DISABLE
	.comm	_BH1770_STANDBY,4,2             ; @BH1770_STANDBY
	.no_dead_strip	_bh1770_prox_mode_control
.subsections_via_symbols
