	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_scratch_buffer
_alloc_scratch_buffer:                  ## @alloc_scratch_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	cmpl	$6, (%rdi)
	jne	LBB0_3
## %bb.1:
	cmpq	$0, (%r14)
	jne	LBB0_3
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_6
LBB0_3:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_max
	movl	%eax, %r15d
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	callq	_max
	movq	_STRIPE_SECTORS@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_scribble_alloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_free_scratch_buffer
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_4:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_STRIPE_SECTORS,4,2             ## @STRIPE_SECTORS
	.no_dead_strip	_alloc_scratch_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_scratch_buffer
_alloc_scratch_buffer:                  ; @alloc_scratch_buffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	cmp	w8, #6
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x22]
	bl	_alloc_page
	str	x0, [x19]
	cbz	x0, LBB0_5
LBB0_3:
	ldp	w1, w0, [x20, #12]
	bl	_max
	mov	x21, x0
	ldp	w1, w0, [x20, #4]
	bl	_max
Lloh2:
	adrp	x8, _STRIPE_SECTORS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STRIPE_SECTORS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sdiv	w2, w0, w8
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_scribble_alloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	bl	_free_scratch_buffer
LBB0_5:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_STRIPE_SECTORS,4,2             ; @STRIPE_SECTORS
	.no_dead_strip	_alloc_scratch_buffer
.subsections_via_symbols
