	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_back                      ## -- Begin function read_back
	.p2align	4, 0x90
_read_back:                             ## @read_back
	.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	%rdi, %r12
	movslq	%edx, %r15
	leaq	(%rsi,%r15), %r14
	testq	%rsi, %rsi
	cmoveq	%rsi, %r14
	xorl	%eax, %eax
	cmpl	$0, (%rdi)
	sete	%al
	movl	4(%rdi,%rax,4), %eax
	cmpl	%r15d, %eax
	cmovll	%eax, %r15d
	movq	48(%rdi), %r13
	movq	16(%r13), %rax
	cmpq	24(%r13), %rax
	jne	LBB0_3
## %bb.1:
	cmpq	%r12, %r13
	je	LBB0_3
## %bb.2:
	movq	48(%r13), %r13
LBB0_3:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	jle	LBB0_4
## %bb.5:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	movslq	(%r13), %rax
	cmpq	%rax, %rsi
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_6 Depth=1
	testl	%r15d, %r15d
	jle	LBB0_20
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%r13), %rax
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	16(%r13), %rsi
	movl	%esi, %ebx
	subl	%eax, %ebx
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%ebx, %eax
	subq	%rax, %rsi
	movq	%rsi, 16(%r13)
	testq	%r14, %r14
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	subq	%rax, %r14
	movl	%r14d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	16(%r13), %rsi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r14d, %r14d
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	subl	%ebx, %r15d
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	%rsi, 24(%r13)
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpq	%r12, %r13
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	48(%r13), %rbx
	xorl	%edi, %edi
	cmpq	$0, 40(%r12)
	setg	%dil
	callq	_assert
	movq	%r12, 56(%rbx)
	movq	%rbx, 48(%r12)
	movq	%r13, %rdi
	callq	_free_buffer
	decq	40(%r12)
	movq	%rbx, %r13
	testl	%r15d, %r15d
	jg	LBB0_6
	jmp	LBB0_20
LBB0_4:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_20
LBB0_15:
	movq	32(%r12), %rax
	movq	%rax, 16(%r13)
	movq	%rax, 24(%r12)
	cmpl	$0, (%r13)
	je	LBB0_20
## %bb.16:
	movl	%eax, (%r13)
LBB0_20:
	cmpl	$0, (%r12)
	je	LBB0_22
## %bb.21:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	subl	%eax, 4(%r12)
	jmp	LBB0_23
LBB0_22:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	subl	%eax, 8(%r12)
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_back                      ; -- Begin function read_back
	.p2align	2
_read_back:                             ; @read_back
	.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	x19, x0
	ldr	x20, [x0, #48]
	add	x8, x1, w2, sxtw
	cmp	x1, #0
	csel	x22, xzr, x8, eq
	ldr	w8, [x0]
	cmp	w8, #0
	mov	w8, #4
	mov	w9, #8
	csel	x8, x9, x8, eq
	ldr	w8, [x0, x8]
	cmp	w8, w2
	csel	w24, w8, w2, lt
	ldp	x8, x9, [x20, #16]
	cmp	x8, x9
	ccmp	x20, x0, #4, eq
	b.eq	LBB0_2
; %bb.1:
	ldr	x20, [x20, #48]
LBB0_2:
	cmp	w24, #1
	b.lt	LBB0_15
; %bb.3:
	mov	w21, #0
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldrsw	x8, [x20]
	cmp	x1, x8
	b.eq	LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w24, #0
	b.le	LBB0_18
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cbnz	w8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20, #24]
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x1, [x20, #16]
	sub	w8, w1, w8
	cmp	w24, w8
	csel	w23, w24, w8, lt
	cmp	w23, #1
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	x1, x1, x23
	str	x1, [x20, #16]
	cbz	x22, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	sub	x22, x22, x23
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x23
	bl	_memcpy
	ldr	x1, [x20, #16]
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w21, w23, w21
	sub	w24, w24, w23
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20, #24]
	cmp	x8, x1
	b.ne	LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	x20, x19
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x23, [x20, #48]
	ldr	x8, [x19, #40]
	cmp	x8, #0
	cset	w0, gt
	bl	_assert
	str	x19, [x23, #56]
	str	x23, [x19, #48]
	mov	x0, x20
	bl	_free_buffer
	ldr	x8, [x19, #40]
	sub	x8, x8, #1
	str	x8, [x19, #40]
	mov	x20, x23
	cmp	w24, #0
	b.gt	LBB0_6
	b	LBB0_18
LBB0_15:
	mov	w21, #0
	b	LBB0_18
LBB0_16:
	ldr	x8, [x19, #32]
	str	x8, [x20, #16]
	str	x8, [x19, #24]
	ldr	w9, [x20]
	cbz	w9, LBB0_18
; %bb.17:
	str	w8, [x20]
LBB0_18:
	ldr	w8, [x19]
	cbz	w8, LBB0_20
; %bb.19:
	ldr	w8, [x19, #4]
	sub	w8, w8, w21
	str	w8, [x19, #4]
	b	LBB0_21
LBB0_20:
	ldr	w8, [x19, #8]
	sub	w8, w8, w21
	str	w8, [x19, #8]
LBB0_21:
	mov	x0, x21
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
