	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xadc_write_event_value         ## -- Begin function xadc_write_event_value
	.p2align	4, 0x90
_xadc_write_event_value:                ## @xadc_write_event_value
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movl	%ecx, %esi
	callq	_xadc_get_threshold_offset
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_iio_priv
	movq	%rax, %rbx
	movq	_XADC_THRESHOLD_VALUE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r13d
	cmpl	$65536, %r13d                   ## imm = 0x10000
	jae	LBB0_1
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r14
	addq	$12, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$128, %r15d
	je	LBB0_5
## %bb.3:
	cmpl	$129, %r15d
	jne	LBB0_4
## %bb.7:
	movq	%rbx, %rdx
	movl	%r13d, 8(%rbx)
	movq	(%r12), %rax
	movq	_IIO_TEMP@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.8:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%rdx, %r12
	movq	(%rdx), %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%edi, %ecx
	movl	(%rax,%rcx,4), %ecx
	movl	%r13d, %edx
	jmp	LBB0_9
LBB0_5:
	movq	(%rbx), %rax
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, (%rax,%rcx,4)
	movq	(%r12), %rcx
	movq	_IIO_TEMP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.6:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	8(%rbx), %edx
	movl	%r13d, %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %r12
LBB0_9:
	xorl	%esi, %esi
	subl	%edx, %ecx
	cmovll	%esi, %ecx
	leal	4(%rdi), %ebx
	movl	%ecx, (%rax,%rbx,4)
	movl	%ebx, %edi
	callq	_XADC_REG_THRESHOLD
	movq	(%r12), %rcx
	movl	(%rcx,%rbx,4), %edx
	movq	%r12, %r15
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	__xadc_write_adc_reg
	movl	%eax, %ebx
	cmpl	$128, -44(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_13
## %bb.10:
	testl	%ebx, %ebx
	jne	LBB0_13
## %bb.11:
	orl	$3, %r13d
	movq	%r15, %rbx
LBB0_12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_XADC_REG_THRESHOLD
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	__xadc_write_adc_reg
	movl	%eax, %ebx
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_14
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XADC_THRESHOLD_VALUE_SHIFT,4,2 ## @XADC_THRESHOLD_VALUE_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_TEMP,8,3                   ## @IIO_TEMP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xadc_write_event_value         ; -- Begin function xadc_write_event_value
	.p2align	2
_xadc_write_event_value:                ; @xadc_write_event_value
	.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	x19, x5
	mov	x23, x4
	mov	x24, x1
	mov	x20, x0
	mov	x0, x1
	mov	x1, x3
	bl	_xadc_get_threshold_offset
	mov	x21, x0
	mov	x0, x20
	bl	_iio_priv
Lloh0:
	adrp	x8, _XADC_THRESHOLD_VALUE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XADC_THRESHOLD_VALUE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w22, w19, w8
	cmp	w22, #16, lsl #12               ; =65536
	b.hs	LBB0_12
; %bb.1:
	mov	x20, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
	cmp	w23, #128
	b.eq	LBB0_5
; %bb.2:
	cmp	w23, #129
	b.ne	LBB0_11
; %bb.3:
	str	w22, [x20, #8]
	ldr	x8, [x24]
Lloh3:
	adrp	x9, _IIO_TEMP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IIO_TEMP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.4:
	ldr	x8, [x20]
	ldr	w9, [x8, w21, uxtw #2]
	mov	x10, x22
	b	LBB0_7
LBB0_5:
	ldr	x8, [x20]
	str	w22, [x8, w21, uxtw #2]
	ldr	x9, [x24]
Lloh6:
	adrp	x10, _IIO_TEMP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IIO_TEMP@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_10
; %bb.6:
	ldr	w10, [x20, #8]
	mov	x9, x22
LBB0_7:
	subs	w9, w9, w10
	csel	w9, wzr, w9, lt
	add	w0, w21, #4
	lsl	x24, x0, #2
	str	w9, [x8, x24]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_XADC_REG_THRESHOLD
	mov	x1, x0
	ldr	x8, [x20]
	ldr	w2, [x8, x24]
	mov	x0, x20
	bl	__xadc_write_adc_reg
	mov	x24, x0
	cmp	w23, #128
	b.ne	LBB0_14
; %bb.8:
	cbnz	w24, LBB0_14
; %bb.9:
	orr	w22, w22, #0x3
LBB0_10:
	mov	x0, x21
	bl	_XADC_REG_THRESHOLD
	mov	x1, x0
	mov	x0, x20
	mov	x2, x22
	bl	__xadc_write_adc_reg
	mov	x24, x0
	b	LBB0_14
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_12:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_13:
	mov	w24, #0
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x24
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_XADC_THRESHOLD_VALUE_SHIFT,4,2 ; @XADC_THRESHOLD_VALUE_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_TEMP,8,3                   ; @IIO_TEMP
.subsections_via_symbols
