	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function us5182d_write_event_config
_us5182d_write_event_config:            ## @us5182d_write_event_config
	.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	%r8d, %r15d
	movl	%ecx, %ebx
	movq	%rdi, %r13
	callq	_iio_priv
	movq	%rax, %r12
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$129, %ebx
	je	LBB0_7
## %bb.1:
	cmpl	$128, %ebx
	jne	LBB0_12
## %bb.2:
	xorl	%ebx, %ebx
	cmpl	%r15d, (%r12)
	je	LBB0_30
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.4:
	movq	_US5182D_CONTINUOUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r12)
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_us5182d_set_power_state
	testl	%eax, %eax
	js	LBB0_25
## %bb.5:
	movq	%r12, %rdi
	callq	_us5182d_px_enable
	testl	%eax, %eax
	js	LBB0_28
## %bb.6:
	movq	%r12, %rax
	addq	$32, %rax
	jmp	LBB0_14
LBB0_7:
	xorl	%ebx, %ebx
	cmpl	%r15d, 4(%r12)
	je	LBB0_30
## %bb.8:
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.9:
	movq	_US5182D_CONTINUOUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r12)
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_us5182d_set_power_state
	testl	%eax, %eax
	js	LBB0_25
## %bb.10:
	movq	%r12, %rdi
	callq	_us5182d_px_enable
	testl	%eax, %eax
	js	LBB0_28
## %bb.11:
	movq	%r12, %rax
	addq	$28, %rax
	jmp	LBB0_17
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_30
LBB0_13:
	movq	_US5182D_PXH_TH_DISABLE@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	$128, %esi
	callq	_us5182d_setup_prox
	testl	%eax, %eax
	js	LBB0_24
## %bb.15:
	movl	%r15d, (%r12)
	testl	%r15d, %r15d
	jne	LBB0_20
	jmp	LBB0_19
LBB0_16:
	movq	_US5182D_PXL_TH_DISABLE@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	$129, %esi
	callq	_us5182d_setup_prox
	testl	%eax, %eax
	js	LBB0_24
## %bb.18:
	movl	%r15d, 4(%r12)
	testl	%r15d, %r15d
	jne	LBB0_20
LBB0_19:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_us5182d_set_power_state
	testl	%eax, %eax
	js	LBB0_25
LBB0_20:
	xorl	%ebx, %ebx
	cmpl	$0, 4(%r12)
	jne	LBB0_30
## %bb.21:
	cmpl	$0, (%r12)
	jne	LBB0_30
## %bb.22:
	cmpl	$0, 24(%r12)
	jne	LBB0_30
## %bb.23:
	movq	_US5182D_ONESHOT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r12)
	jmp	LBB0_30
LBB0_25:
	movl	%eax, %ebx
	jmp	LBB0_30
LBB0_24:
	movl	%eax, %ebx
	testl	%r15d, %r15d
	jne	LBB0_29
	jmp	LBB0_30
LBB0_28:
	movl	%eax, %ebx
LBB0_29:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_us5182d_set_power_state
LBB0_30:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_US5182D_PXH_TH_DISABLE,4,2     ## @US5182D_PXH_TH_DISABLE
	.comm	_US5182D_CONTINUOUS,8,3         ## @US5182D_CONTINUOUS
	.comm	_US5182D_PXL_TH_DISABLE,4,2     ## @US5182D_PXL_TH_DISABLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_US5182D_ONESHOT,8,3            ## @US5182D_ONESHOT
	.no_dead_strip	_us5182d_write_event_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function us5182d_write_event_config
_us5182d_write_event_config:            ; @us5182d_write_event_config
	.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	x21, x4
	mov	x23, x3
	mov	x22, x0
	bl	_iio_priv
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	cmp	w23, #129
	b.eq	LBB0_7
; %bb.1:
	cmp	w23, #128
	b.ne	LBB0_12
; %bb.2:
	ldr	w8, [x20]
	cmp	w8, w21
	b.eq	LBB0_23
; %bb.3:
	cbz	w21, LBB0_13
; %bb.4:
Lloh0:
	adrp	x8, _US5182D_CONTINUOUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _US5182D_CONTINUOUS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x20, #16]
	mov	x0, x20
	mov	w1, #1
	bl	_us5182d_set_power_state
	tbnz	w0, #31, LBB0_25
; %bb.5:
	mov	x0, x20
	bl	_us5182d_px_enable
	tbnz	w0, #31, LBB0_27
; %bb.6:
	add	x8, x20, #32
	b	LBB0_14
LBB0_7:
	ldr	w8, [x20, #4]
	cmp	w8, w21
	b.eq	LBB0_23
; %bb.8:
	cbz	w21, LBB0_16
; %bb.9:
Lloh3:
	adrp	x8, _US5182D_CONTINUOUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _US5182D_CONTINUOUS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x20, #16]
	mov	x0, x20
	mov	w1, #1
	bl	_us5182d_set_power_state
	tbnz	w0, #31, LBB0_25
; %bb.10:
	mov	x0, x20
	bl	_us5182d_px_enable
	tbnz	w0, #31, LBB0_27
; %bb.11:
	add	x8, x20, #28
	b	LBB0_17
LBB0_12:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_24
LBB0_13:
Lloh9:
	adrp	x8, _US5182D_PXH_TH_DISABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _US5182D_PXH_TH_DISABLE@GOTPAGEOFF]
LBB0_14:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #128
	bl	_us5182d_setup_prox
	tbnz	w0, #31, LBB0_26
; %bb.15:
	str	w21, [x20]
	cbnz	w21, LBB0_20
	b	LBB0_19
LBB0_16:
Lloh11:
	adrp	x8, _US5182D_PXL_TH_DISABLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _US5182D_PXL_TH_DISABLE@GOTPAGEOFF]
LBB0_17:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #129
	bl	_us5182d_setup_prox
	tbnz	w0, #31, LBB0_26
; %bb.18:
	str	w21, [x20, #4]
	cbnz	w21, LBB0_20
LBB0_19:
	mov	x0, x20
	mov	w1, #0
	bl	_us5182d_set_power_state
	tbnz	w0, #31, LBB0_25
LBB0_20:
	ldr	w8, [x20, #4]
	cbnz	w8, LBB0_23
; %bb.21:
	ldr	w8, [x20]
	cbnz	w8, LBB0_23
; %bb.22:
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_29
LBB0_23:
	mov	w23, #0
LBB0_24:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	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_25:
	mov	x23, x0
	b	LBB0_24
LBB0_26:
	mov	x23, x0
	cbnz	w21, LBB0_28
	b	LBB0_24
LBB0_27:
	mov	x23, x0
LBB0_28:
	mov	x0, x20
	mov	w1, #0
	bl	_us5182d_set_power_state
	b	LBB0_24
LBB0_29:
	mov	w23, #0
Lloh13:
	adrp	x8, _US5182D_ONESHOT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _US5182D_ONESHOT@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	x8, [x20, #16]
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_US5182D_PXH_TH_DISABLE,4,2     ; @US5182D_PXH_TH_DISABLE
	.comm	_US5182D_CONTINUOUS,8,3         ; @US5182D_CONTINUOUS
	.comm	_US5182D_PXL_TH_DISABLE,4,2     ; @US5182D_PXL_TH_DISABLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_US5182D_ONESHOT,8,3            ; @US5182D_ONESHOT
	.no_dead_strip	_us5182d_write_event_config
.subsections_via_symbols
