	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function us5182d_write_thresh
_us5182d_write_thresh:                  ## @us5182d_write_thresh
	.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
	movl	%r9d, %r12d
	movl	%ecx, %ebx
	movq	%rdi, %r15
	callq	_iio_priv
	testl	%r12d, %r12d
	js	LBB0_3
## %bb.1:
	cmpl	$0, 16(%rbp)
	jne	LBB0_3
## %bb.2:
	movq	%rax, %r14
	movq	_USHRT_MAX@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jl	LBB0_3
## %bb.4:
	cmpl	$129, %ebx
	je	LBB0_12
## %bb.5:
	cmpl	$128, %ebx
	jne	LBB0_3
## %bb.6:
	leaq	8(%r14), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpl	$0, 16(%r14)
	je	LBB0_10
## %bb.7:
	movq	%r15, %rdi
	movl	$128, %esi
	movl	%r12d, %edx
	callq	_us5182d_setup_prox
	testl	%eax, %eax
	js	LBB0_8
LBB0_10:
	movl	%r12d, (%r14)
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	8(%r14), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpl	$0, 12(%r14)
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	movl	$129, %esi
	movl	%r12d, %edx
	callq	_us5182d_setup_prox
	testl	%eax, %eax
	js	LBB0_8
LBB0_14:
	movl	%r12d, 4(%r14)
LBB0_11:
	movq	%r13, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %ebx
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_USHRT_MAX,4,2                  ## @USHRT_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_us5182d_write_thresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function us5182d_write_thresh
_us5182d_write_thresh:                  ; @us5182d_write_thresh
	.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, x6
	mov	x20, x5
	mov	x22, x3
	mov	x21, x0
	bl	_iio_priv
	tbnz	w20, #31, LBB0_8
; %bb.1:
	cbnz	w23, LBB0_8
; %bb.2:
Lloh0:
	adrp	x8, _USHRT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USHRT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.lt	LBB0_8
; %bb.3:
	mov	x19, x0
	cmp	w22, #129
	b.eq	LBB0_10
; %bb.4:
	cmp	w22, #128
	b.ne	LBB0_8
; %bb.5:
	add	x22, x19, #8
	mov	x0, x22
	bl	_mutex_lock
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_7
; %bb.6:
	mov	x0, x21
	mov	w1, #128
	mov	x2, x20
	bl	_us5182d_setup_prox
	tbnz	w0, #31, LBB0_14
LBB0_7:
	str	w20, [x19]
	b	LBB0_13
LBB0_8:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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_10:
	add	x22, x19, #8
	mov	x0, x22
	bl	_mutex_lock
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_12
; %bb.11:
	mov	x0, x21
	mov	w1, #129
	mov	x2, x20
	bl	_us5182d_setup_prox
	tbnz	w0, #31, LBB0_14
LBB0_12:
	str	w20, [x19, #4]
LBB0_13:
	mov	x0, x22
	bl	_mutex_unlock
	mov	w21, #0
	b	LBB0_9
LBB0_14:
	mov	x21, x0
	add	x0, x19, #8
	bl	_mutex_unlock
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_USHRT_MAX,4,2                  ; @USHRT_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_us5182d_write_thresh
.subsections_via_symbols
