	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_secp256k1_ecdsa_sign           ## -- Begin function secp256k1_ecdsa_sign
	.p2align	4, 0x90
_secp256k1_ecdsa_sign:                  ## @secp256k1_ecdsa_sign
	.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
	subq	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -128(%rbp)                 ## 8-byte Spill
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -84(%rbp)
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_VERIFY_CHECK
	movq	%r12, %rdi
	callq	_secp256k1_ecmult_gen_context_is_built
	movl	%eax, %edi
	callq	_ARG_CHECK
	xorl	%edi, %edi
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	testq	%rbx, %rbx
	setne	%dil
	callq	_ARG_CHECK
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_ARG_CHECK
	xorl	%edi, %edi
	testq	%r13, %r13
	setne	%dil
	callq	_ARG_CHECK
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	testq	%r14, %r14
	jne	LBB0_2
## %bb.1:
	movq	_secp256k1_nonce_function_default@GOTPCREL(%rip), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
LBB0_2:
	leaq	-92(%rbp), %rdi
	leaq	-84(%rbp), %rdx
	movq	%r13, %rsi
	callq	_secp256k1_scalar_set_b32
	cmpl	$0, -84(%rbp)
	jne	LBB0_12
## %bb.3:
	leaq	-92(%rbp), %rdi
	callq	_secp256k1_scalar_is_zero
	testl	%eax, %eax
	je	LBB0_4
LBB0_12:
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_memset
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r14d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r12, -144(%rbp)                ## 8-byte Spill
	movq	%r15, -136(%rbp)                ## 8-byte Spill
	xorl	%r14d, %r14d
	leaq	-96(%rbp), %rdi
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_secp256k1_scalar_set_b32
	leaq	-80(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movq	-128(%rbp), %r8                 ## 8-byte Reload
	xorl	%r9d, %r9d
	callq	*-104(%rbp)                     ## 8-byte Folded Reload
	testl	%eax, %eax
	je	LBB0_10
## %bb.5:
	movl	%eax, %r12d
	movl	$1, %r15d
	leaq	-80(%rbp), %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movq	-128(%rbp), %r8                 ## 8-byte Reload
	movl	%r15d, %r9d
	callq	*-104(%rbp)                     ## 8-byte Folded Reload
	movl	%eax, %r12d
	incl	%r15d
	testl	%eax, %eax
	je	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-88(%rbp), %rdi
	movq	%rbx, %rsi
	leaq	-84(%rbp), %rdx
	callq	_secp256k1_scalar_set_b32
	cmpl	$0, -84(%rbp)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	-88(%rbp), %rdi
	callq	_secp256k1_scalar_is_zero
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	$0, (%rsp)
	movq	-144(%rbp), %rdi                ## 8-byte Reload
	leaq	-112(%rbp), %rsi
	leaq	-108(%rbp), %rdx
	leaq	-92(%rbp), %rcx
	leaq	-96(%rbp), %r8
	leaq	-88(%rbp), %r9
	callq	_secp256k1_ecdsa_sig_sign
	movl	%r12d, %r14d
	testq	%rax, %rax
	je	LBB0_9
LBB0_10:
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	leaq	-96(%rbp), %rdi
	callq	_secp256k1_scalar_clear
	leaq	-88(%rbp), %rdi
	callq	_secp256k1_scalar_clear
	leaq	-92(%rbp), %rdi
	callq	_secp256k1_scalar_clear
	testl	%r14d, %r14d
	movq	-136(%rbp), %r15                ## 8-byte Reload
	je	LBB0_12
## %bb.11:
	leaq	-112(%rbp), %rsi
	leaq	-108(%rbp), %rdx
	movq	%r15, %rdi
	callq	_secp256k1_ecdsa_signature_save
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_secp256k1_ecdsa_sign           ; -- Begin function secp256k1_ecdsa_sign
	.p2align	2
_secp256k1_ecdsa_sign:                  ; @secp256k1_ecdsa_sign
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x5
	mov	x24, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	str	wzr, [sp]
	cmp	x0, #0
	cset	w0, ne
	bl	_VERIFY_CHECK
	mov	x0, x23
	bl	_secp256k1_ecmult_gen_context_is_built
	bl	_ARG_CHECK
	cmp	x22, #0
	cset	w0, ne
	bl	_ARG_CHECK
	cmp	x19, #0
	cset	w0, ne
	bl	_ARG_CHECK
	cmp	x21, #0
	cset	w0, ne
	bl	_ARG_CHECK
Lloh3:
	adrp	x8, _secp256k1_nonce_function_default@GOTPAGE
Lloh4:
	ldr	x8, [x8, _secp256k1_nonce_function_default@GOTPAGEOFF]
	cmp	x24, #0
	csel	x26, x8, x24, eq
	add	x0, sp, #12
	mov	x2, sp
	mov	x1, x21
	bl	_secp256k1_scalar_set_b32
	ldr	w8, [sp]
	cbnz	w8, LBB0_2
; %bb.1:
	add	x0, sp, #12
	bl	_secp256k1_scalar_is_zero
	cbz	w0, LBB0_5
LBB0_2:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	bl	_memset
	mov	w24, #0
LBB0_3:
	ldr	x8, [sp, #56]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.4:
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_5:
	add	x0, sp, #4
	mov	x1, x22
	mov	x2, #0
	bl	_secp256k1_scalar_set_b32
	add	x0, sp, #24
	mov	x1, x22
	mov	x2, x21
	mov	x3, #0
	mov	x4, x20
	mov	w5, #0
	blr	x26
	mov	x24, x0
	cbz	w0, LBB0_11
; %bb.6:
	mov	w25, #1
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x0, sp, #24
	mov	x1, x22
	mov	x2, x21
	mov	x3, #0
	mov	x4, x20
	mov	x5, x25
	blr	x26
	mov	x24, x0
	add	w25, w25, #1
	cbz	w0, LBB0_11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	add	x1, sp, #24
	mov	x2, sp
	bl	_secp256k1_scalar_set_b32
	ldr	w8, [sp]
	cbnz	w8, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x0, sp, #8
	bl	_secp256k1_scalar_is_zero
	cbnz	w0, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x1, sp, #20
	add	x2, sp, #16
	add	x3, sp, #12
	add	x4, sp, #4
	add	x5, sp, #8
	mov	x0, x23
	mov	x6, #0
	bl	_secp256k1_ecdsa_sig_sign
	cbz	x0, LBB0_7
LBB0_11:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	add	x0, sp, #4
	bl	_secp256k1_scalar_clear
	add	x0, sp, #8
	bl	_secp256k1_scalar_clear
	add	x0, sp, #12
	bl	_secp256k1_scalar_clear
	cbz	w24, LBB0_2
; %bb.12:
	add	x1, sp, #20
	add	x2, sp, #16
	mov	x0, x19
	bl	_secp256k1_ecdsa_signature_save
	b	LBB0_3
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
