	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function secp256k1_wnaf_fixed
_secp256k1_wnaf_fixed:                  ## @secp256k1_wnaf_fixed
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_secp256k1_scalar_is_zero
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	LBB0_24
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, (%r14,%rbx,4)
	incq	%rbx
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_24
LBB0_4:
	movq	%rbx, %rdi
	callq	_secp256k1_scalar_is_even
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_secp256k1_scalar_get_bits_var
	addl	%r12d, %eax
	movl	%eax, (%r14)
	movq	_WNAF_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	movl	%eax, %r13d
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	cmpl	$2, %eax
	jl	LBB0_24
## %bb.5:
	movl	%eax, %ebx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	decl	%r13d
	imull	%r15d, %r13d
	subl	%r13d, -44(%rbp)                ## 4-byte Folded Spill
	movl	%eax, %r12d
	decl	%ebx
	imull	%r15d, %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r12
	movl	%r15d, %edx
	cmovel	-44(%rbp), %edx                 ## 4-byte Folded Reload
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_secp256k1_scalar_get_bits_var
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	decq	%r12
	movl	%r12d, %eax
	movl	$0, (%r14,%rax,4)
	movq	%r12, %rax
	incq	%rax
	subl	%r15d, %ebx
	cmpq	$2, %rax
	ja	LBB0_6
	jmp	LBB0_23
LBB0_8:
	cmpl	$2, %r12d
	jl	LBB0_23
## %bb.9:
	movl	$-1, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	$1, %eax
	shll	%cl, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_WNAF_SIZE
	cmpl	$2, %eax
	movl	%r15d, %edx
	cmovel	-44(%rbp), %edx                 ## 4-byte Folded Reload
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_secp256k1_scalar_get_bits_var
	testb	$1, %al
	jne	LBB0_11
## %bb.10:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addl	%ecx, (%r14)
	incl	%eax
LBB0_11:
	movl	%eax, 4(%r14)
	cmpl	$2, %r12d
	jne	LBB0_12
LBB0_23:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
LBB0_24:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leal	(%r15,%r15), %r13d
	movl	%r12d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	$2, %ebx
	movabsq	$4294967296, %r12               ## imm = 0x100000000
	jmp	LBB0_13
LBB0_18:                                ##   in Loop: Header=BB0_13 Depth=1
	addl	-60(%rbp), %ecx                 ## 4-byte Folded Reload
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%ecx, (%r14,%rax,4)
	movl	$0, -4(%r14,%rbx,4)
LBB0_22:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	incq	%r12
	addl	%r15d, %r13d
	cmpq	%rbx, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_23
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_WNAF_SIZE
                                        ## kill: def $eax killed $eax def $rax
	decl	%eax
	cmpq	%rax, %rbx
	movl	%r15d, %edx
	cmovel	-44(%rbp), %edx                 ## 4-byte Folded Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_secp256k1_scalar_get_bits_var
	testb	$1, %al
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addl	%ecx, -4(%r14,%rbx,4)
	incl	%eax
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%eax, (%r14,%rbx,4)
	movl	-4(%r14,%rbx,4), %eax
	cmpl	$-1, %eax
	je	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	$1, %eax
	jne	LBB0_22
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%r12d, %eax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jns	LBB0_22
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%r12d, %eax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jle	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_13 Depth=1
	addl	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_WNAF_BITS,4,2                  ## @WNAF_BITS
	.no_dead_strip	_secp256k1_wnaf_fixed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function secp256k1_wnaf_fixed
_secp256k1_wnaf_fixed:                  ; @secp256k1_wnaf_fixed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_secp256k1_scalar_is_zero
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_WNAF_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [x20, x21, lsl #2]
	add	x21, x21, #1
	mov	x0, x19
	bl	_WNAF_SIZE
	cmp	x21, w0, sxtw
	b.lt	LBB0_3
LBB0_4:
	mov	w22, #0
	b	LBB0_13
LBB0_5:
	mov	x0, x21
	bl	_secp256k1_scalar_is_even
	mov	x22, x0
	mov	x0, x21
	mov	w1, #0
	mov	x2, x19
	bl	_secp256k1_scalar_get_bits_var
	cmp	x22, #0
	cset	w22, ne
	cinc	w8, w0, ne
	str	w8, [x20]
Lloh0:
	adrp	x8, _WNAF_BITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WNAF_BITS@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x19
	bl	_WNAF_SIZE
	mov	x23, x0
	mov	x0, x19
	bl	_WNAF_SIZE
	cmp	w0, #2
	b.lt	LBB0_13
; %bb.6:
	sub	w8, w23, #1
	msub	w24, w8, w19, w24
	mov	w28, w0
	sub	w8, w0, #1
	mul	w23, w19, w8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_WNAF_SIZE
	cmp	x28, w0, uxtw
	csel	w2, w24, w19, eq
	mov	x0, x21
	mov	x1, x23
	bl	_secp256k1_scalar_get_bits_var
	cbnz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	x28, x28, #1
	str	wzr, [x20, w28, uxtw #2]
	add	x8, x28, #1
	sub	w23, w23, w19
	cmp	x8, #2
	b.hi	LBB0_7
	b	LBB0_13
LBB0_9:
	cmp	w28, #2
	b.lt	LBB0_13
; %bb.10:
	mov	w8, #-1
	lsl	w25, w8, w19
	mov	x0, x19
	bl	_WNAF_SIZE
	cmp	w0, #2
	csel	w2, w24, w19, eq
	mov	x0, x21
	mov	x1, x19
	bl	_secp256k1_scalar_get_bits_var
	tbnz	w0, #0, LBB0_12
; %bb.11:
	ldr	w8, [x20]
	add	w8, w8, w25
	str	w8, [x20]
	add	w0, w0, #1
LBB0_12:
	str	w0, [x20, #4]
	cmp	w28, #2
	b.ne	LBB0_14
LBB0_13:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
	mov	x26, #0
	mov	w8, #1
	lsl	w8, w8, w19
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	lsl	w23, w19, #1
	and	x8, x28, #0xffffffff
	sub	x28, x8, #2
	b	LBB0_18
LBB0_15:                                ;   in Loop: Header=BB0_18 Depth=1
	and	x10, x26, #0xffffffff
	ldr	w11, [sp, #12]                  ; 4-byte Folded Reload
	add	w9, w9, w11
LBB0_16:                                ;   in Loop: Header=BB0_18 Depth=1
	str	w9, [x20, x10, lsl #2]
	str	wzr, [x8, #4]
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x26, x26, #1
	add	w23, w23, w19
	cmp	x28, x26
	b.eq	LBB0_13
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x27, x26, #2
	mov	x0, x19
	bl	_WNAF_SIZE
	sub	w8, w0, #1
	cmp	x27, x8
	csel	w2, w24, w19, eq
	mov	x0, x21
	mov	x1, x23
	bl	_secp256k1_scalar_get_bits_var
	tbnz	w0, #0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x8, x20, x26, lsl #2
	ldr	w9, [x8, #4]
	add	w9, w9, w25
	str	w9, [x8, #4]
	add	w0, w0, #1
LBB0_20:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x8, x20, x26, lsl #2
	str	w0, [x8, #8]
	ldr	w9, [x8, #4]
	cmn	w9, #1
	b.eq	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=1
	cmp	w9, #1
	b.ne	LBB0_17
; %bb.22:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w9, [x20, w26, uxtw #2]
	tbz	w9, #31, LBB0_17
	b	LBB0_15
LBB0_23:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w9, [x20, w26, uxtw #2]
	cmp	w9, #0
	b.le	LBB0_17
; %bb.24:                               ;   in Loop: Header=BB0_18 Depth=1
	and	x10, x26, #0xffffffff
	add	w9, w9, w25
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_WNAF_BITS,4,2                  ; @WNAF_BITS
	.no_dead_strip	_secp256k1_wnaf_fixed
.subsections_via_symbols
