	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sca3000_write_event_value
_sca3000_write_event_value:             ## @sca3000_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movq	%rsi, %r14
	callq	_iio_priv
	movq	%rax, %r15
	movq	(%r14), %rcx
	movq	_IIO_MOD_Y@GOTPCREL(%rip), %rdx
	movq	8(%rax), %rax
	cmpq	(%rdx), %rcx
	jne	LBB0_9
## %bb.1:
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.2:
	movq	8(%r15), %rcx
	movq	(%rcx), %r10
	movl	%eax, %r11d
	cmpl	$1, %eax
	je	LBB0_11
## %bb.3:
	leal	-2(%rax), %r8d
	decl	%eax
	movl	%r11d, %r9d
	andl	$-2, %r9d
	negq	%r9
	xorl	%edx, %edx
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	orl	%edi, %r12d
	subl	%ecx, %r13d
	addq	$-2, %rdx
	cmpq	%rdx, %r9
	je	LBB0_20
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r11,%rdx), %edi
	decl	%edi
	leal	(%rax,%rdx), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	(%r10,%rdi,4), %ebx
	movl	$0, %ecx
	movl	$0, %edi
	cmpl	%ebx, %r13d
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %ecx
	movl	%esi, %edi
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	orl	%edi, %r12d
	subl	%ecx, %r13d
	leal	(%r11,%rdx), %edi
	addl	$-2, %edi
	leal	(%r8,%rdx), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	(%r10,%rdi,4), %ebx
	movl	$0, %ecx
	movl	$0, %edi
	cmpl	%ebx, %r13d
	jl	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %ecx
	movl	%esi, %edi
	jmp	LBB0_4
LBB0_9:
	movq	8(%rax), %rdi
	callq	_ARRAY_SIZE
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.10:
	movq	8(%r15), %rcx
	movq	8(%rcx), %r10
	movl	%eax, %r11d
	cmpl	$1, %eax
	jne	LBB0_14
LBB0_11:
	xorl	%r12d, %r12d
	movq	%r11, %rdx
	testb	$1, %r11b
	jne	LBB0_21
	jmp	LBB0_22
LBB0_13:
	xorl	%r12d, %r12d
	jmp	LBB0_22
LBB0_14:
	leal	-2(%rax), %r8d
	decl	%eax
	movl	%r11d, %r9d
	andl	$-2, %r9d
	negq	%r9
	xorl	%edx, %edx
	xorl	%r12d, %r12d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=1
	orl	%edi, %r12d
	subl	%ecx, %r13d
	addq	$-2, %rdx
	cmpq	%rdx, %r9
	je	LBB0_20
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r11,%rdx), %edi
	decl	%edi
	leal	(%rax,%rdx), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	(%r10,%rdi,4), %ecx
	movl	$0, %ebx
	movl	$0, %edi
	cmpl	%ecx, %r13d
	jl	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%ecx, %ebx
	movl	%esi, %edi
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	orl	%edi, %r12d
	subl	%ebx, %r13d
	leal	(%r11,%rdx), %edi
	addl	$-2, %edi
	leal	(%r8,%rdx), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	(%r10,%rdi,4), %ebx
	movl	$0, %ecx
	movl	$0, %edi
	cmpl	%ebx, %r13d
	jl	LBB0_15
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%ebx, %ecx
	movl	%esi, %edi
	jmp	LBB0_15
LBB0_20:
	addq	%r11, %rdx
	testb	$1, %r11b
	je	LBB0_22
LBB0_21:
	decq	%rdx
	movl	$1, %eax
	movl	%edx, %ecx
	shll	%cl, %eax
	movl	%edx, %ecx
	xorl	%edx, %edx
	cmpl	(%r10,%rcx,4), %r13d
	cmovgel	%eax, %edx
	orl	%edx, %r12d
LBB0_22:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_sca3000_addresses@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r14), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	4(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_sca3000_write_ctrl_reg
	movl	%eax, %ebx
	movq	%r15, %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	_IIO_MOD_Y,8,3                  ## @IIO_MOD_Y
	.comm	_sca3000_addresses,8,3          ## @sca3000_addresses
	.no_dead_strip	_sca3000_write_event_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sca3000_write_event_value
_sca3000_write_event_value:             ; @sca3000_write_event_value
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x5
	mov	x20, x1
	bl	_iio_priv
	mov	x19, x0
	ldr	x9, [x20]
Lloh0:
	adrp	x8, _IIO_MOD_Y@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_MOD_Y@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
	ldr	x8, [x0, #8]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.1:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.2:
	mov	w22, #0
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	w9, w0
	mov	w10, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	subs	x11, x9, #1
	ldr	w12, [x8, w11, uxtw #2]
	lsl	w11, w10, w11
	cmp	w21, w12
	csel	w12, wzr, w12, lt
	csel	w11, wzr, w11, lt
	sub	w21, w21, w12
	orr	w22, w11, w22
	subs	x9, x9, #1
	b.hi	LBB0_3
	b	LBB0_8
LBB0_4:
	ldr	x0, [x8, #8]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w22, #0
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	mov	w9, w0
	mov	w10, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	subs	x11, x9, #1
	ldr	w12, [x8, w11, uxtw #2]
	lsl	w11, w10, w11
	cmp	w21, w12
	csel	w12, wzr, w12, lt
	csel	w11, wzr, w11, lt
	sub	w21, w21, w12
	orr	w22, w11, w22
	subs	x9, x9, #1
	b.hi	LBB0_6
	b	LBB0_8
LBB0_7:
	mov	w22, #0
LBB0_8:
	mov	x0, x19
	bl	_mutex_lock
Lloh3:
	adrp	x8, _sca3000_addresses@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sca3000_addresses@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w1, [x8, #4]
	mov	x0, x19
	mov	x2, x22
	bl	_sca3000_write_ctrl_reg
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_MOD_Y,8,3                  ; @IIO_MOD_Y
	.comm	_sca3000_addresses,8,3          ; @sca3000_addresses
	.no_dead_strip	_sca3000_write_event_value
.subsections_via_symbols
