	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iio_channel_read_max
_iio_channel_read_max:                  ## @iio_channel_read_max
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rsi, %r14
	testq	%rdx, %rdx
	leaq	-44(%rbp), %rbx
	cmovneq	%rdx, %rbx
	leaq	-40(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdx
	callq	_iio_channel_read_avail
	cmpl	$130, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_12
## %bb.2:
	cmpl	$128, (%r15)
	movq	-40(%rbp), %rax
	jne	LBB0_10
## %bb.3:
	movl	8(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_11
LBB0_4:
	movslq	-28(%rbp), %rsi
	testq	%rsi, %rsi
	jle	LBB0_9
## %bb.5:
	cmpl	$128, (%r15)
	jne	LBB0_9
## %bb.6:
	movq	-40(%rbp), %rcx
	xorl	%eax, %eax
	movl	%esi, %edi
	decl	%edi
	movl	%edi, -28(%rbp)
	movl	(%rcx,%rdi,4), %edx
	movl	%edx, (%r14)
	je	LBB0_12
## %bb.7:
	testb	$1, %dil
	je	LBB0_15
## %bb.13:
	leaq	-2(%rsi), %rdi
	movl	%edi, -28(%rbp)
	movl	-8(%rcx,%rsi,4), %ebx
	cmpl	%edx, %ebx
	jle	LBB0_15
## %bb.14:
	movl	%ebx, (%r14)
	jmp	LBB0_16
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_10:
	movl	16(%rax), %ecx
	movl	%ecx, (%r14)
	movl	20(%rax), %eax
	movl	%eax, (%rbx)
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%edx, %ebx
LBB0_16:
	cmpl	$2, %esi
	je	LBB0_12
## %bb.17:
	leal	-1(%rdi), %esi
	addl	$-2, %edi
	movslq	%edi, %r8
	movslq	%esi, %rdi
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=1
	addl	$-2, %esi
	addq	$-8, %rcx
	cmpl	$-1, %esi
	je	LBB0_12
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	%esi, -28(%rbp)
	movl	(%rcx,%rdi,4), %edx
	cmpl	%ebx, %edx
	jle	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%edx, (%r14)
	movl	%edx, %ebx
LBB0_21:                                ##   in Loop: Header=BB0_19 Depth=1
	leal	-1(%rsi), %edx
	movl	%edx, -28(%rbp)
	movl	(%rcx,%r8,4), %edx
	cmpl	%ebx, %edx
	jle	LBB0_18
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%edx, (%r14)
	movl	%edx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_iio_channel_read_max
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iio_channel_read_max
_iio_channel_read_max:                  ; @iio_channel_read_max
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x3
	mov	x19, x1
	add	x8, sp, #28
	cmp	x2, #0
	csel	x21, x8, x2, eq
	add	x1, sp, #16
	add	x3, sp, #12
	mov	x2, x20
	bl	_iio_channel_read_avail
	cmp	w0, #130
	b.eq	LBB0_4
; %bb.1:
	cmp	w0, #129
	b.ne	LBB0_14
; %bb.2:
	ldr	w9, [x20]
	ldr	x8, [sp, #16]
	cmp	w9, #128
	b.ne	LBB0_12
; %bb.3:
	mov	w0, #0
	ldr	w8, [x8, #8]
	str	w8, [x19]
	b	LBB0_14
LBB0_4:
	ldr	w9, [sp, #12]
	cmp	w9, #0
	b.le	LBB0_11
; %bb.5:
	ldr	w8, [x20]
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.6:
	ldr	x10, [sp, #16]
	subs	w8, w9, #1
	str	w8, [sp, #12]
	ldr	w8, [x10, w8, uxtw #2]
	str	w8, [x19]
	b.eq	LBB0_13
; %bb.7:
	sub	w9, w9, #2
	add	x10, x10, w9, sxtw #2
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	sub	w9, w9, #1
	sub	x10, x10, #4
	cmn	w9, #1
	b.eq	LBB0_13
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	w9, [sp, #12]
	ldr	w11, [x10]
	cmp	w11, w8
	b.le	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	str	w11, [x19]
	mov	x8, x11
	b	LBB0_8
LBB0_11:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_12:
	mov	w0, #0
	ldr	w9, [x8, #16]
	str	w9, [x19]
	ldr	w8, [x8, #20]
	str	w8, [x21]
	b	LBB0_14
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_iio_channel_read_max
.subsections_via_symbols
