	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xadc_write_event_config        ## -- Begin function xadc_write_event_config
	.p2align	4, 0x90
_xadc_write_event_config:               ## @xadc_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_xadc_get_alarm_mask
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_iio_priv
	movq	%rax, %r15
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.1:
	orl	(%r15), %ebx
	jmp	LBB0_3
LBB0_2:
	notl	%ebx
	andl	(%r15), %ebx
LBB0_3:
	movl	%ebx, (%r15)
	movq	8(%r15), %rax
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	*(%rax)
	movq	_XADC_REG_CONF1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	__xadc_read_adc_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movl	-36(%rbp), %eax
	movq	_XADC_CONF1_ALARM_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	movl	(%r15), %edx
	movl	%edx, %esi
	shll	$4, %esi
	andl	$3840, %esi                     ## imm = 0xF00
	movl	%edx, %edi
	shrl	$3, %edi
	andl	$1, %edi
	orl	%esi, %edi
	andl	$7, %edx
	leal	(%rdi,%rdx,2), %edx
	notl	%edx
	andl	%ecx, %edx
	movl	%edx, -36(%rbp)
	xorl	%ebx, %ebx
	cmpl	%edx, %eax
	je	LBB0_6
## %bb.5:
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	__xadc_write_adc_reg
	movl	%eax, %ebx
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XADC_REG_CONF1,4,2             ## @XADC_REG_CONF1
	.comm	_XADC_CONF1_ALARM_MASK,4,2      ## @XADC_CONF1_ALARM_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xadc_write_event_config        ; -- Begin function xadc_write_event_config
	.p2align	2
_xadc_write_event_config:               ; @xadc_write_event_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x4
	mov	x19, x0
	mov	x0, x1
	bl	_xadc_get_alarm_mask
	mov	x21, x0
	mov	x0, x19
	bl	_iio_priv
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	cbz	w22, LBB0_2
; %bb.1:
	ldr	w8, [x20]
	orr	w1, w8, w21
	b	LBB0_3
LBB0_2:
	ldr	w8, [x20]
	bic	w1, w8, w21
LBB0_3:
	str	w1, [x20]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
Lloh0:
	adrp	x22, _XADC_REG_CONF1@GOTPAGE
Lloh1:
	ldr	x22, [x22, _XADC_REG_CONF1@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	__xadc_read_adc_reg
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _XADC_CONF1_ALARM_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _XADC_CONF1_ALARM_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	w10, [x20]
	lsl	w11, w10, #4
	and	w11, w11, #0xf00
	bfxil	w11, w10, #3, #1
	bfi	w11, w10, #1, #3
	bic	w2, w9, w11
	str	w2, [sp, #12]
	cmp	w8, w2
	b.ne	LBB0_6
; %bb.5:
	mov	w21, #0
	b	LBB0_7
LBB0_6:
	ldr	w1, [x22]
	mov	x0, x20
	bl	__xadc_write_adc_reg
	mov	x21, x0
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_XADC_REG_CONF1,4,2             ; @XADC_REG_CONF1
	.comm	_XADC_CONF1_ALARM_MASK,4,2      ; @XADC_CONF1_ALARM_MASK
.subsections_via_symbols
