	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function savage_bci_get_buffers
_savage_bci_get_buffers:                ## @savage_bci_get_buffers
	.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
	movslq	(%rdx), %r14
	xorl	%eax, %eax
	cmpl	4(%rdx), %r14d
	jge	LBB0_10
## %bb.1:
	movq	%rdx, %r13
	movq	%rdi, %r12
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leaq	(,%r14,4), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_savage_freelist_get
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movq	16(%r13), %rdi
	addq	%r15, %rdi
	movq	%rbx, %rsi
	addq	$4, %rsi
	movl	$4, %edx
	callq	_DRM_COPY_TO_USER
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r13), %rdi
	addq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_DRM_COPY_TO_USER
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	(%r13)
	incq	%r14
	movslq	4(%r13), %rax
	addq	$4, %r15
	cmpq	%rax, %r14
	jl	LBB0_2
## %bb.9:
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_6:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_3:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_savage_bci_get_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function savage_bci_get_buffers
_savage_bci_get_buffers:                ; @savage_bci_get_buffers
	.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
	ldp	w23, w8, [x2]
                                        ; kill: def $w23 killed $w23 def $x23
	sxtw	x23, w23
	cmp	w23, w8
	b.ge	LBB0_6
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	lsl	x24, x23, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_savage_freelist_get
	cbz	x0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	str	x20, [x0, #8]
	ldr	x8, [x19, #16]
	add	x0, x8, x24
	add	x1, x22, #4
	mov	w2, #4
	bl	_DRM_COPY_TO_USER
	cbnz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x24
	mov	x1, x22
	mov	w2, #4
	bl	_DRM_COPY_TO_USER
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	w8, w9, [x19]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	add	w8, w8, #1
	str	w8, [x19]
	add	x23, x23, #1
	add	x24, x24, #4
	cmp	x23, x9
	b.lt	LBB0_2
LBB0_6:
	mov	w0, #0
	b	LBB0_10
LBB0_7:
Lloh0:
	adrp	x8, _EFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_savage_bci_get_buffers
.subsections_via_symbols
