	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_data_buffer
_get_data_buffer:                       ## @get_data_buffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	movq	_XFER_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_1
## %bb.3:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	movq	8(%rbx), %rcx
	movq	(%rax), %r8
	cmpq	%r8, %rcx
	jae	LBB0_6
## %bb.7:
	movq	%rdx, %r14
	movq	8(%rax), %rax
	leaq	(%rax,%rcx,4), %rdi
	movl	(%rax,%rcx,4), %eax
	movl	%eax, (%rsi)
	callq	_sg_virt
	movq	%rax, (%r14)
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rax
	incq	%rcx
	movq	%rcx, 8(%rbx)
	movq	_dbg_sg@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	(%rax), %rax
	movq	(%rax), %r8
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_dbg
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	_dbg_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_NONE,8,3                  ## @XFER_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_dbg_debug,4,2                  ## @dbg_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no more buffers (%i/%i)\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_dbg_sg,4,2                     ## @dbg_sg
L_.str.1:                               ## @.str.1
	.asciz	"new buffer (%i/%i)\n"

	.no_dead_strip	_get_data_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_data_buffer
_get_data_buffer:                       ; @get_data_buffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _XFER_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XFER_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x3, [x19, #8]
	ldr	x4, [x8]
	cmp	x3, x4
	b.hs	LBB0_8
; %bb.4:
	mov	x20, x2
	ldr	x8, [x8, #8]
	add	x0, x8, x3, lsl #2
	ldr	w8, [x0]
	str	w8, [x1]
	bl	_sg_virt
	str	x0, [x20]
	ldp	x8, x9, [x19, #8]
	add	x3, x8, #1
	str	x3, [x19, #8]
Lloh3:
	adrp	x8, _dbg_sg@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dbg_sg@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x8, [x9]
	ldr	x4, [x8]
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dbg
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh10:
	adrp	x8, _dbg_debug@GOTPAGE
Lloh11:
	ldr	x8, [x8, _dbg_debug@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dbg
Lloh15:
	adrp	x8, _EBUSY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_NONE,8,3                  ; @XFER_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_dbg_debug,4,2                  ; @dbg_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no more buffers (%i/%i)\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_dbg_sg,4,2                     ; @dbg_sg
l_.str.1:                               ; @.str.1
	.asciz	"new buffer (%i/%i)\n"

	.no_dead_strip	_get_data_buffer
.subsections_via_symbols
