	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function secp256k1_ecdsa_sig_serialize
_secp256k1_ecdsa_sig_serialize:         ## @secp256k1_ecdsa_sig_serialize
	.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	%rcx, %r14
	movq	%rsi, -152(%rbp)                ## 8-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-96(%rbp), %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movb	$0, -64(%rbp)
	leaq	-64(%rbp), %r13
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movb	$0, -112(%rbp)
	leaq	-95(%rbp), %rdi
	movq	%rdx, %rsi
	callq	_secp256k1_scalar_get_b32
	leaq	-143(%rbp), %rdi
	movq	%r14, %rsi
	callq	_secp256k1_scalar_get_b32
	movl	$33, %r15d
	xorl	%eax, %eax
	movb	-96(%rbp), %cl
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testb	%cl, %cl
	jne	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$0, -95(%rbp,%rax)
	js	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	jne	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$0, -94(%rbp,%rax)
	js	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	jne	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$0, -93(%rbp,%rax)
	js	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movzbl	-92(%rbp,%rax), %ecx
	testb	%cl, %cl
	js	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	addq	$4, %rbx
	addq	$-4, %r15
	addq	$4, %rax
	cmpq	$32, %rax
	jne	LBB0_1
## %bb.11:
	movl	$1, %r15d
	movq	%r13, %rsi
	jmp	LBB0_16
LBB0_14:
	leaq	(%rax,%rbp), %rsi
	addq	$-95, %rsi
	movl	$32, %r15d
	subq	%rax, %r15
	jmp	LBB0_16
LBB0_13:
	leaq	(%rax,%rbp), %rsi
	addq	$-94, %rsi
	movl	$31, %r15d
	subq	%rax, %r15
	jmp	LBB0_16
LBB0_12:
	leaq	(%rax,%rbp), %rsi
	addq	$-93, %rsi
	movl	$30, %r15d
	subq	%rax, %r15
	jmp	LBB0_16
LBB0_2:
	movq	%rbx, %rsi
	jmp	LBB0_16
LBB0_15:
	leaq	(%rax,%rbp), %rsi
	addq	$-96, %rsi
LBB0_16:
	leaq	-144(%rbp), %rcx
	leaq	-112(%rbp), %r13
	movl	$33, %r14d
	movb	-144(%rbp), %dl
	xorl	%eax, %eax
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	testb	%dl, %dl
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpb	$0, -143(%rbp,%rax)
	js	LBB0_31
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	jne	LBB0_30
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpb	$0, -142(%rbp,%rax)
	js	LBB0_30
## %bb.22:                              ##   in Loop: Header=BB0_17 Depth=1
	jne	LBB0_29
## %bb.23:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpb	$0, -141(%rbp,%rax)
	js	LBB0_29
## %bb.24:                              ##   in Loop: Header=BB0_17 Depth=1
	jne	LBB0_28
## %bb.25:                              ##   in Loop: Header=BB0_17 Depth=1
	movzbl	-140(%rbp,%rax), %edx
	testb	%dl, %dl
	js	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_17 Depth=1
	addq	$4, %rcx
	addq	$-4, %r14
	addq	$4, %rax
	cmpq	$32, %rax
	jne	LBB0_17
## %bb.27:
	movl	$1, %r14d
	jmp	LBB0_32
LBB0_30:
	leaq	(%rax,%rbp), %r13
	addq	$-143, %r13
	movl	$32, %r14d
	subq	%rax, %r14
	jmp	LBB0_32
LBB0_29:
	leaq	(%rax,%rbp), %r13
	addq	$-142, %r13
	movl	$31, %r14d
	subq	%rax, %r14
	jmp	LBB0_32
LBB0_28:
	leaq	(%rax,%rbp), %r13
	addq	$-141, %r13
	movl	$30, %r14d
	subq	%rax, %r14
	jmp	LBB0_32
LBB0_18:
	movq	%rcx, %r13
	jmp	LBB0_32
LBB0_31:
	leaq	(%rax,%rbp), %r13
	addq	$-144, %r13
LBB0_32:
	leaq	(%r14,%r15), %rcx
	addq	$6, %rcx
	xorl	%eax, %eax
	movq	-152(%rbp), %rdx                ## 8-byte Reload
	cmpq	%rcx, (%rdx)
	movq	%rcx, (%rdx)
	jb	LBB0_34
## %bb.33:
	movb	$48, (%r12)
	leaq	4(%r15), %rax
	addl	%r14d, %eax
	movb	%al, 1(%r12)
	movb	$2, 2(%r12)
	movb	%r15b, 3(%r12)
	leaq	4(%r12), %rdi
	movq	%r15, %rdx
	callq	_memcpy
	movb	$2, 4(%r12,%r15)
	movb	%r14b, 5(%r12,%r15)
	leaq	(%r12,%r15), %rdi
	addq	$6, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_memcpy
	movl	$1, %eax
LBB0_34:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_36
## %bb.35:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_secp256k1_ecdsa_sig_serialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function secp256k1_ecdsa_sig_serialize
_secp256k1_ecdsa_sig_serialize:         ; @secp256k1_ecdsa_sig_serialize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x22, x3
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	add	x23, sp, #48
	strb	wzr, [sp, #80]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #48]
	add	x20, x23, #32
	strb	wzr, [sp, #32]
	stp	q0, q0, [sp]
	orr	x0, x23, #0x1
	mov	x1, x2
	bl	_secp256k1_scalar_get_b32
	mov	x8, sp
	orr	x0, x8, #0x1
	mov	x1, x22
	bl	_secp256k1_scalar_get_b32
	ldrb	w8, [sp, #48]
	mov	w22, #33
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	w8, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x9, x23
	ldrsb	w8, [x9, #1]!
	tbnz	w8, #31, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w8, w8, #0xff
	sub	x22, x22, #1
	mov	x23, x9
	cmp	x22, #1
	b.ne	LBB0_1
	b	LBB0_5
LBB0_4:
	mov	x20, x23
LBB0_5:
	mov	x8, sp
	add	x23, x8, #32
	ldrb	w9, [sp]
	mov	w24, #33
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	w9, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x10, x8
	ldrsb	w9, [x10, #1]!
	tbnz	w9, #31, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	and	w9, w9, #0xff
	sub	x24, x24, #1
	mov	x8, x10
	cmp	x24, #1
	b.ne	LBB0_6
	b	LBB0_10
LBB0_9:
	mov	x23, x8
LBB0_10:
	ldr	x8, [x21]
	add	x9, x24, x22
	add	x9, x9, #6
	str	x9, [x21]
	cmp	x8, x9
	b.hs	LBB0_12
; %bb.11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
	mov	w8, #48
	strb	w8, [x19]
	add	x21, x22, #4
	add	w8, w21, w24
	strb	w8, [x19, #1]
	mov	w25, #2
	strb	w25, [x19, #2]
	strb	w22, [x19, #3]
	add	x0, x19, #4
	mov	x1, x20
	mov	x2, x22
	bl	_memcpy
	strb	w25, [x19, x21]
	add	x8, x19, x22
	strb	w24, [x8, #5]
	add	x0, x8, #6
	mov	x1, x23
	mov	x2, x24
	bl	_memcpy
	mov	w0, #1
LBB0_13:
	ldur	x8, [x29, #-72]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_secp256k1_ecdsa_sig_serialize
.subsections_via_symbols
