	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad8366_write_raw
_ad8366_write_raw:                      ## @ad8366_write_raw
	.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
	movq	%r8, %r12
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	callq	_iio_priv
	movq	%rax, %r13
	movq	24(%rax), %rcx
	imull	$1000, %r15d, %esi              ## imm = 0x3E8
	testl	%r15d, %r15d
	movl	$-1000, %eax                    ## imm = 0xFC18
	movl	$1000, %edi                     ## imm = 0x3E8
	cmovsl	%eax, %edi
	movl	%ebx, %eax
	cltd
	idivl	%edi
                                        ## kill: def $eax killed $eax def $rax
	addl	%esi, %eax
	cmpl	(%rcx), %eax
	jg	LBB0_2
## %bb.1:
	cmpl	4(%rcx), %eax
	jge	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_3:
	movq	%r13, %r15
	movl	(%r13), %ecx
	cmpl	$129, %ecx
	je	LBB0_8
## %bb.4:
	cmpl	$130, %ecx
	je	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	cmpl	$131, %ecx
	jne	LBB0_9
## %bb.6:
	movl	%eax, %ecx
	addl	$-4500, %ecx                    ## imm = 0xEE6C
	movslq	%ecx, %rcx
	imulq	$-2122019415, %rcx, %rcx        ## imm = 0x81848DA9
	shrq	$32, %rcx
	leal	(%rcx,%rax), %ebx
	addl	$-4500, %ebx                    ## imm = 0xEE6C
	movl	%ebx, %eax
	shrl	$31, %eax
	sarl	$7, %ebx
	addl	%eax, %ebx
	jmp	LBB0_9
LBB0_8:
	addl	$-20500, %eax                   ## imm = 0xAFEC
	cltq
	imulq	$274877907, %rax, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rax
	shrq	$63, %rax
	shrq	$37, %rbx
	addl	%eax, %ebx
	andl	$63, %ebx
	jmp	LBB0_9
LBB0_7:
	movl	$15000, %ecx                    ## imm = 0x3A98
	subl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
LBB0_9:
	addq	$16, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpq	$128, %r12
	jne	LBB0_11
## %bb.10:
	movq	8(%r15), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	%ebx, (%rax,%rcx,4)
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movq	%r14, %rdi
	callq	_ad8366_write
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ad8366_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad8366_write_raw
_ad8366_write_raw:                      ; @ad8366_write_raw
	.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	x24, x2
	mov	x20, x1
	mov	x19, x0
	bl	_iio_priv
	ldr	x9, [x0, #24]
	mov	w8, #1000
	cmp	w24, #0
	mov	w10, #-1000
	cneg	w10, w10, ge
	sdiv	w10, w23, w10
	madd	w8, w24, w8, w10
	ldr	w10, [x9]
	cmp	w8, w10
	b.gt	LBB0_2
; %bb.1:
	ldr	w9, [x9, #4]
	cmp	w8, w9
	b.ge	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_7
LBB0_3:
	mov	x22, x0
	ldr	w9, [x0]
	mov	w10, #-20500
	add	w10, w8, w10
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x10, w10, w11
	lsr	x12, x10, #63
	lsr	x10, x10, #37
	add	w10, w10, w12
	and	w10, w10, #0x3f
	mov	w12, #15000
	sub	w12, w12, w8
	smull	x11, w12, w11
	lsr	x12, x11, #63
	asr	x11, x11, #38
	add	w11, w11, w12
	mov	w12, #-4500
	mov	w13, #36265
	movk	w13, #33156, lsl #16
	add	w8, w8, w12
	smull	x12, w8, w13
	lsr	x12, x12, #32
	add	w8, w12, w8
	asr	w12, w8, #7
	add	w8, w12, w8, lsr #31
	cmp	w9, #131
	csel	w8, wzr, w8, ne
	cmp	w9, #130
	csel	w8, w11, w8, eq
	cmp	w9, #129
	csel	w24, w10, w8, eq
	add	x23, x0, #16
	mov	x0, x23
	bl	_mutex_lock
	cmp	x21, #128
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x22, #8]
	ldr	x9, [x20]
	str	w24, [x8, x9, lsl #2]
	ldp	w1, w2, [x8]
	mov	x0, x19
	bl	_ad8366_write
	mov	x19, x0
	b	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	mov	x0, x23
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x19
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ad8366_write_raw
.subsections_via_symbols
