	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isl29501_write_ext
_isl29501_write_ext:                    ## @isl29501_write_ext
	.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
	movq	%r8, %r14
	movq	%rcx, %rbx
	movq	%rsi, %r12
	callq	_iio_priv
	movq	%rax, %r15
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_kstrtouint
	testl	%eax, %eax
	jne	LBB0_23
## %bb.1:
	leal	-129(%r12), %eax
	cmpl	$4, %eax
	jae	LBB0_2
## %bb.7:
	movl	-44(%rbp), %edx
	movq	_U8_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ISL29501_MAX_EXP_VAL@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	cmpl	%eax, %edx
	ja	LBB0_4
## %bb.8:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_isl29501_set_shadow_coeff
	testl	%eax, %eax
	js	LBB0_23
## %bb.9:
	movq	_COEFF_MAX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.13:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%r12,4), %ebx
	movq	_ISL29501_MAX_EXP_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_U8_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shrl	%edx
	movl	%ebx, %edi
	callq	_isl29501_find_corr_exp
	movl	%eax, %r14d
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	_max
	movl	%eax, %r13d
	incq	%r12
	movq	_COEFF_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jl	LBB0_14
## %bb.11:
	movq	_COEFF_MAX@GOTPCREL(%rip), %r12
	testl	%eax, %eax
	jle	LBB0_12
## %bb.15:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_20
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rcx
	movl	(%rcx,%rbx,4), %edx
	testl	%edx, %edx
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%r13d, %ecx
	sarl	%cl, %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_isl29501_write_coeff
	testl	%eax, %eax
	js	LBB0_23
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r12), %eax
	jmp	LBB0_19
LBB0_2:
	cmpl	$128, %r12d
	jne	LBB0_24
## %bb.3:
	movl	-44(%rbp), %edx
	movq	_U16_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jbe	LBB0_6
LBB0_4:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_24:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_23
LBB0_6:
	movq	%r15, %rdi
	movl	$128, %esi
	jmp	LBB0_21
LBB0_10:
	xorl	%r13d, %r13d
	jmp	LBB0_20
LBB0_12:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_20:
	movq	_REG_PHASE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
LBB0_21:
	callq	_isl29501_register_write
	testl	%eax, %eax
	js	LBB0_23
## %bb.22:
	movl	%r14d, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_U16_MAX,4,2                    ## @U16_MAX
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_U8_MAX,4,2                     ## @U8_MAX
	.comm	_ISL29501_MAX_EXP_VAL,4,2       ## @ISL29501_MAX_EXP_VAL
	.comm	_COEFF_MAX,4,2                  ## @COEFF_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"found exp of corr(%d) = %d\n"

	.comm	_REG_PHASE_EXP,4,2              ## @REG_PHASE_EXP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_isl29501_write_ext
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isl29501_write_ext
_isl29501_write_ext:                    ; @isl29501_write_ext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x22, x3
	mov	x21, x1
	bl	_iio_priv
	mov	x20, x0
	add	x2, sp, #12
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtouint
	cbnz	w0, LBB0_21
; %bb.1:
	sub	w8, w21, #129
	cmp	w8, #4
	b.hs	LBB0_13
; %bb.2:
	ldr	w2, [sp, #12]
Lloh0:
	adrp	x26, _U8_MAX@GOTPAGE
Lloh1:
	ldr	x26, [x26, _U8_MAX@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh2:
	adrp	x27, _ISL29501_MAX_EXP_VAL@GOTPAGE
Lloh3:
	ldr	x27, [x27, _ISL29501_MAX_EXP_VAL@GOTPAGEOFF]
	ldr	w9, [x27]
	lsl	w8, w8, w9
	cmp	w2, w8
	b.hi	LBB0_15
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	bl	_isl29501_set_shadow_coeff
	tbnz	w0, #31, LBB0_21
; %bb.4:
Lloh4:
	adrp	x25, _COEFF_MAX@GOTPAGE
Lloh5:
	ldr	x25, [x25, _COEFF_MAX@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.5:
	mov	x28, #0
	mov	w21, #0
Lloh6:
	adrp	x22, l_.str@PAGE
Lloh7:
	add	x22, x22, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	w23, [x8, x28, lsl #2]
	ldr	w1, [x27]
	ldr	w8, [x26]
	lsr	w2, w8, #1
	mov	x0, x23
	bl	_isl29501_find_corr_exp
	mov	x24, x0
	ldr	x0, [x20, #8]
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	bl	_dev_dbg
	mov	x0, x21
	mov	x1, x24
	bl	_max
	mov	x21, x0
	add	x28, x28, #1
	ldrsw	x8, [x25]
	cmp	x28, x8
	b.lt	LBB0_6
; %bb.7:
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.8:
	mov	x22, #0
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x25]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20]
	ldr	w9, [x9, x22, lsl #2]
	cbz	w9, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	asr	w2, w9, w21
	mov	x0, x20
	mov	x1, x22
	bl	_isl29501_write_coeff
	tbz	w0, #31, LBB0_9
	b	LBB0_21
LBB0_13:
	cmp	w21, #128
	b.ne	LBB0_16
; %bb.14:
	ldr	w2, [sp, #12]
Lloh8:
	adrp	x8, _U16_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _U16_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ls	LBB0_22
LBB0_15:
Lloh11:
	adrp	x8, _ERANGE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_18:
	mov	w21, #0
LBB0_19:
Lloh15:
	adrp	x8, _REG_PHASE_EXP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REG_PHASE_EXP@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_isl29501_register_write
	tbnz	w0, #31, LBB0_21
LBB0_20:
	mov	x0, x19
LBB0_21:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_22:
	mov	x0, x20
	mov	w1, #128
	bl	_isl29501_register_write
	tbz	w0, #31, LBB0_20
	b	LBB0_21
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_U16_MAX,4,2                    ; @U16_MAX
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_U8_MAX,4,2                     ; @U8_MAX
	.comm	_ISL29501_MAX_EXP_VAL,4,2       ; @ISL29501_MAX_EXP_VAL
	.comm	_COEFF_MAX,4,2                  ; @COEFF_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"found exp of corr(%d) = %d\n"

	.comm	_REG_PHASE_EXP,4,2              ; @REG_PHASE_EXP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_isl29501_write_ext
.subsections_via_symbols
