	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scratch_get
_scratch_get:                           ## @scratch_get
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r14
	movslq	(%rdi), %rsi
	leal	(%rsi,%r12), %eax
	movq	_scratch_buf_size@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	cmpl	%r13d, %eax
	jge	LBB0_2
## %bb.1:
	addq	8(%r14), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_memcpy
	movl	(%r14), %ebx
	addl	%r12d, %ebx
	jmp	LBB0_4
LBB0_2:
	subl	%esi, %r13d
	addq	8(%r14), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_memcpy
	xorl	%ebx, %ebx
	cmpl	%r12d, %r13d
	je	LBB0_4
## %bb.3:
	movslq	%r13d, %rax
	addq	%rax, %r15
	movq	8(%r14), %rsi
	movl	%r12d, %ebx
	subl	%r13d, %ebx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_memcpy
LBB0_4:
	movl	%ebx, (%r14)
	movq	_DBG_SCRATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	callq	_PDEBUG
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scratch_buf_size,4,2           ## @scratch_buf_size
	.comm	_DBG_SCRATCH,4,2                ## @DBG_SCRATCH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"len=%d, new read_ptr=%d\n"

	.no_dead_strip	_scratch_get
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scratch_get
_scratch_get:                           ; @scratch_get
	.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, x2
	mov	x21, x1
	mov	x20, x0
	ldrsw	x8, [x0]
Lloh0:
	adrp	x9, _scratch_buf_size@GOTPAGE
Lloh1:
	ldr	x9, [x9, _scratch_buf_size@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w8, w2
	cmp	w10, w9
	b.ge	LBB0_2
; %bb.1:
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	mov	x0, x21
	mov	x2, x19
	bl	_memcpy
	ldr	w8, [x20]
	add	w21, w8, w19
	b	LBB0_5
LBB0_2:
	sub	w22, w9, w8
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	mov	x0, x21
	mov	x2, x22
	bl	_memcpy
	cmp	w22, w19
	b.ne	LBB0_4
; %bb.3:
	mov	w21, #0
	b	LBB0_5
LBB0_4:
	add	x0, x21, w22, sxtw
	ldr	x1, [x20, #8]
	sub	w21, w19, w22
	mov	x2, x21
	bl	_memcpy
LBB0_5:
	str	w21, [x20]
Lloh3:
	adrp	x8, _DBG_SCRATCH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DBG_SCRATCH@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_PDEBUG
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_scratch_buf_size,4,2           ; @scratch_buf_size
	.comm	_DBG_SCRATCH,4,2                ; @DBG_SCRATCH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"len=%d, new read_ptr=%d\n"

	.no_dead_strip	_scratch_get
.subsections_via_symbols
