	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function secp256k1_scratch_alloc
_secp256k1_scratch_alloc:               ## @secp256k1_scratch_alloc
	.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, %r15
	movq	%rdi, %rbx
	movq	%rdx, %rdi
	callq	_ROUND_TO_ALIGN
	movq	%rax, %r14
	movl	24(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	$8, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_secp256k1_callback_call
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	(%r15), %rax
	movq	8(%r15), %rbx
	subq	%rbx, %rax
	cmpq	%rax, %r14
	jbe	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_4:
	addq	16(%r15), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_memset
	addq	%r14, 8(%r15)
LBB0_5:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scratch"

L_.str.1:                               ## @.str.1
	.asciz	"invalid scratch space"

	.no_dead_strip	_secp256k1_scratch_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function secp256k1_scratch_alloc
_secp256k1_scratch_alloc:               ; @secp256k1_scratch_alloc
	.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	x21, x0
	mov	x0, x2
	bl	_ROUND_TO_ALIGN
	mov	x20, x0
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #8
	bl	_memcmp
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_secp256k1_callback_call
	mov	x21, #0
	b	LBB0_5
LBB0_2:
	ldp	x9, x8, [x19]
	sub	x9, x9, x8
	cmp	x20, x9
	b.ls	LBB0_4
; %bb.3:
	mov	x21, #0
	b	LBB0_5
LBB0_4:
	ldr	x9, [x19, #16]
	add	x21, x9, x8
	mov	x0, x21
	mov	w1, #0
	mov	x2, x20
	bl	_memset
	ldr	x8, [x19, #8]
	add	x8, x8, x20
	str	x8, [x19, #8]
LBB0_5:
	mov	x0, x21
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scratch"

l_.str.1:                               ; @.str.1
	.asciz	"invalid scratch space"

	.no_dead_strip	_secp256k1_scratch_alloc
.subsections_via_symbols
