	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_wnaf                      ## -- Begin function test_wnaf
	.p2align	4, 0x90
_test_wnaf:                             ## @test_wnaf
	.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	$1080, %rsp                     ## imm = 0x438
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-1076(%rbp), %rdi
	xorl	%esi, %esi
	callq	_secp256k1_scalar_set_int
	leaq	-1092(%rbp), %rdi
	movl	$2, %esi
	callq	_secp256k1_scalar_set_int
	leaq	-1072(%rbp), %rdi
	movl	$256, %esi                      ## imm = 0x100
	movq	%rbx, -1104(%rbp)               ## 8-byte Spill
	movq	%rbx, %rdx
	movl	%r14d, %r15d
	movl	%r14d, %ecx
	callq	_secp256k1_ecmult_wnaf
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$257, %eax                      ## imm = 0x101
	setl	%dil
	callq	_CHECK
	testl	%ebx, %ebx
	jle	LBB0_8
## %bb.1:
	movl	%r15d, %ecx
	decl	%ecx
	movl	$1, %eax
	shll	%cl, %eax
	movl	%eax, -1084(%rbp)               ## 4-byte Spill
	movl	$-2, %eax
	movl	%ecx, -1088(%rbp)               ## 4-byte Spill
                                        ## kill: def $cl killed $cl killed $ecx
	roll	%cl, %eax
	movl	%eax, -1080(%rbp)               ## 4-byte Spill
	movl	%ebx, %r12d
	incq	%r12
	movl	$-1, %r15d
	leaq	-1076(%rbp), %rbx
	leaq	-1108(%rbp), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	cmpl	$-1, %r15d
	setne	%dil
	callq	_CHECK
	incl	%r15d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_secp256k1_scalar_set_int
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_secp256k1_scalar_add
	decq	%r12
	cmpq	$1, %r12
	jbe	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%r12), %eax
	movl	-1072(%rbp,%rax,4), %r14d
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	leaq	-1092(%rbp), %rdx
	callq	_secp256k1_scalar_mul
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %r15d
	sete	%al
	cmpl	-1088(%rbp), %r15d              ## 4-byte Folded Reload
	setge	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_CHECK
	movl	%r14d, %edi
	andl	$1, %edi
	callq	_CHECK
	xorl	%edi, %edi
	cmpl	-1084(%rbp), %r14d              ## 4-byte Folded Reload
	setl	%dil
	callq	_CHECK
	xorl	%edi, %edi
	cmpl	-1080(%rbp), %r14d              ## 4-byte Folded Reload
	setge	%dil
	callq	_CHECK
	xorl	%r15d, %r15d
	testl	%r14d, %r14d
	jns	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	negl	%r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_secp256k1_scalar_set_int
	movq	%r13, %rdi
	movq	%r13, %rsi
	callq	_secp256k1_scalar_negate
	xorl	%r15d, %r15d
	jmp	LBB0_7
LBB0_8:
	leaq	-1076(%rbp), %rdi
	movq	-1104(%rbp), %rsi               ## 8-byte Reload
	callq	_secp256k1_scalar_eq
	movl	%eax, %edi
	callq	_CHECK
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	addq	$1080, %rsp                     ## imm = 0x438
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	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	_test_wnaf                      ; -- Begin function test_wnaf
	.p2align	2
_test_wnaf:                             ; @test_wnaf
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #1056
	mov	x20, 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, #-88]
	add	x0, sp, #20
	mov	w1, #0
	bl	_secp256k1_scalar_set_int
	add	x0, sp, #16
	mov	w1, #2
	bl	_secp256k1_scalar_set_int
	add	x22, sp, #24
	add	x0, sp, #24
	mov	w1, #256
	mov	x2, x19
	mov	x3, x20
	bl	_secp256k1_ecmult_wnaf
	mov	x21, x0
	cmp	w0, #257
	cset	w0, lt
	bl	_CHECK
	cmp	w21, #1
	b.lt	LBB0_9
; %bb.1:
	sub	w23, w20, #1
	mov	w8, #1
	lsl	w24, w8, w23
	mvn	w25, w24
	mov	w8, w21
	add	x21, x8, #1
	mov	w26, #-1
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	cset	w0, ne
	bl	_CHECK
	add	w26, w26, #1
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x0, sp, #12
	mov	x1, x20
	bl	_secp256k1_scalar_set_int
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x0, sp, #20
	add	x1, sp, #20
	add	x2, sp, #12
	bl	_secp256k1_scalar_add
	sub	x21, x21, #1
	cmp	x21, #1
	b.ls	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w21, #2
	ldr	w20, [x22, w8, uxtw #2]
	add	x0, sp, #20
	add	x1, sp, #20
	add	x2, sp, #16
	bl	_secp256k1_scalar_mul
	cmn	w26, #1
	cbz	w20, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ccmp	w26, w23, #0, ne
	cset	w0, ge
	bl	_CHECK
	and	w0, w20, #0x1
	bl	_CHECK
	cmp	w20, w24
	cset	w0, lt
	bl	_CHECK
	cmp	w20, w25
	cset	w0, ge
	bl	_CHECK
	tbnz	w20, #31, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w26, #0
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	neg	w1, w20
	add	x0, sp, #12
	bl	_secp256k1_scalar_set_int
	add	x0, sp, #12
	add	x1, sp, #12
	bl	_secp256k1_scalar_negate
	mov	w26, #0
	b	LBB0_4
LBB0_9:
	add	x0, sp, #20
	mov	x1, x19
	bl	_secp256k1_scalar_eq
	bl	_CHECK
	ldur	x8, [x29, #-88]
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_11
; %bb.10:
	add	sp, sp, #1056
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
