	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iio_dma_buffer_request_update  ## -- Begin function iio_dma_buffer_request_update
	.p2align	4, 0x90
_iio_dma_buffer_request_update:         ## @iio_dma_buffer_request_update
	.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
	callq	_iio_buffer_to_queue
	movq	%rax, %r12
	movq	%rax, %r14
	movl	44(%rax), %edi
	imull	40(%rax), %edi
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	8(%r12), %rdi
	callq	_PAGE_ALIGN
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_PAGE_ALIGN
	movq	%rax, %r13
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, 8(%r12)
	movq	$0, 24(%r12)
	leaq	32(%r12), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movq	16(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_IIO_BLOCK_STATE_DEAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movq	16(%r14), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	(%rax,%rbx,8), %r15
	testq	%r15, %r15
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_iio_dma_block_reusable
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r13, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_6
	jmp	LBB0_5
LBB0_7:
	leaq	36(%r12), %rdi
	callq	_INIT_LIST_HEAD
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irq
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
	movq	16(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_16
## %bb.8:
	xorl	%ebx, %ebx
	movq	_IIO_BLOCK_STATE_QUEUED@GOTPCREL(%rip), %r15
	movq	_IIO_BLOCK_STATE_DEAD@GOTPCREL(%rip), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%rax)
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r15), %rcx
	movq	%rcx, (%rax)
	addq	$16, %rax
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	incq	%rbx
	movq	16(%r14), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_16
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rax), %rcx
	cmpq	(%r13), %rcx
	jne	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, %rdi
	callq	_iio_buffer_block_put
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_iio_dma_buffer_alloc_block
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	jmp	LBB0_15
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_BLOCK_STATE_DEAD,8,3       ## @IIO_BLOCK_STATE_DEAD
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IIO_BLOCK_STATE_QUEUED,8,3     ## @IIO_BLOCK_STATE_QUEUED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iio_dma_buffer_request_update  ; -- Begin function iio_dma_buffer_request_update
	.p2align	2
_iio_dma_buffer_request_update:         ; @iio_dma_buffer_request_update
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	bl	_iio_buffer_to_queue
	mov	x19, x0
	ldp	w8, w9, [x0, #40]
	mul	w0, w9, w8
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	x0, [x19, #8]
	bl	_PAGE_ALIGN
	mov	x21, x0
	mov	x0, x20
	bl	_PAGE_ALIGN
	mov	x23, x0
	str	x20, [x19, #8]
	str	xzr, [x19, #24]
	add	x22, x19, #32
	mov	x0, x22
	bl	_spin_lock_irq
	ldr	x0, [x19, #16]
	bl	_ARRAY_SIZE
Lloh0:
	adrp	x25, _IIO_BLOCK_STATE_DEAD@GOTPAGE
Lloh1:
	ldr	x25, [x25, _IIO_BLOCK_STATE_DEAD@GOTPAGEOFF]
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x26, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x26, x26, #1
	ldr	x0, [x19, #16]
	bl	_ARRAY_SIZE
	cmp	x26, w0, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x24, [x8, x26, lsl #3]
	cbz	x24, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	bl	_iio_dma_block_reusable
	cmp	w0, #0
	ccmp	x21, x23, #0, ne
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25]
	str	x8, [x24]
	b	LBB0_2
LBB0_6:
	add	x0, x19, #36
	bl	_INIT_LIST_HEAD
	mov	x0, x22
	bl	_spin_unlock_irq
	add	x21, x19, #4
	mov	x0, x21
	bl	_INIT_LIST_HEAD
	ldr	x0, [x19, #16]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.7:
	mov	x22, #0
Lloh2:
	adrp	x23, _IIO_BLOCK_STATE_QUEUED@GOTPAGE
Lloh3:
	ldr	x23, [x23, _IIO_BLOCK_STATE_QUEUED@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	str	x20, [x0, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x23]
	str	x8, [x0], #16
	mov	x1, x21
	bl	_list_add_tail
	add	x22, x22, #1
	ldr	x0, [x19, #16]
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.ge	LBB0_15
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x22, lsl #3]
	cbz	x0, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x0]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	bl	_iio_buffer_block_put
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_iio_dma_buffer_alloc_block
	cbz	x0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x19, #16]
	str	x0, [x8, x22, lsl #3]
	b	LBB0_9
LBB0_15:
	mov	w20, #0
	b	LBB0_17
LBB0_16:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_BLOCK_STATE_DEAD,8,3       ; @IIO_BLOCK_STATE_DEAD
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IIO_BLOCK_STATE_QUEUED,8,3     ; @IIO_BLOCK_STATE_QUEUED
.subsections_via_symbols
