	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sx9500_read_proximity
_sx9500_read_proximity:                 ## @sx9500_read_proximity
	.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, %r13
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_sx9500_inc_chan_users
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	callq	_sx9500_inc_data_rdy_users
	testl	%eax, %eax
	js	LBB0_14
## %bb.2:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	jle	LBB0_6
## %bb.3:
	movq	%r12, %rdi
	callq	_wait_for_completion_interruptible
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_6:
	movq	%r12, %rdi
	callq	_sx9500_wait_for_sample
LBB0_7:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	js	LBB0_13
## %bb.8:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_sx9500_read_prox_data
	testl	%eax, %eax
	js	LBB0_12
## %bb.9:
	movq	%r12, %rdi
	callq	_sx9500_dec_data_rdy_users
	testl	%eax, %eax
	js	LBB0_14
## %bb.10:
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_sx9500_dec_chan_users
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_16
## %bb.11:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_16
LBB0_14:
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_12:
	movl	%eax, %ebx
LBB0_13:
	movq	%r12, %rdi
	callq	_sx9500_dec_data_rdy_users
LBB0_15:
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_sx9500_dec_chan_users
LBB0_16:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_reinit_completion
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.no_dead_strip	_sx9500_read_proximity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sx9500_read_proximity
_sx9500_read_proximity:                 ; @sx9500_read_proximity
	.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	x23, x2
	mov	x21, x1
	mov	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sx9500_inc_chan_users
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_sx9500_inc_data_rdy_users
	tbnz	w0, #31, LBB0_10
; %bb.2:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.3:
	bl	_wait_for_completion_interruptible
	b	LBB0_6
LBB0_4:
	mov	x22, x0
	b	LBB0_14
LBB0_5:
	bl	_sx9500_wait_for_sample
LBB0_6:
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_lock
	tbnz	w22, #31, LBB0_12
; %bb.7:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	bl	_sx9500_read_prox_data
	tbnz	w0, #31, LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_sx9500_dec_data_rdy_users
	tbnz	w0, #31, LBB0_10
; %bb.9:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sx9500_dec_chan_users
Lloh0:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w22, w0, w8, lt
	b	LBB0_14
LBB0_10:
	mov	x22, x0
	b	LBB0_13
LBB0_11:
	mov	x22, x0
LBB0_12:
	mov	x0, x19
	bl	_sx9500_dec_data_rdy_users
LBB0_13:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sx9500_dec_chan_users
LBB0_14:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_reinit_completion
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.no_dead_strip	_sx9500_read_proximity
.subsections_via_symbols
