	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uECC_sign_with_k
_uECC_sign_with_k:                      ## @uECC_sign_with_k
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movl	%edx, -108(%rbp)                ## 4-byte Spill
	movq	%rsi, -128(%rbp)                ## 8-byte Spill
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_uECC_MAX_WORDS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rbx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)
	movq	%rax, %r13
	movq	%rax, -56(%rbp)
	leal	(%r14,%r14), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -104(%rbp)                ## 8-byte Spill
	movl	(%r15), %ebx
	movl	4(%r15), %edi
	callq	_BITS_TO_WORDS
	movl	%eax, -112(%rbp)                ## 4-byte Spill
	movl	4(%r15), %r14d
	movq	%r12, -136(%rbp)                ## 8-byte Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_uECC_vli_isZero
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_9
## %bb.1:
	movl	%r14d, %r12d
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %edi
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rsi
	movl	-112(%rbp), %r14d               ## 4-byte Reload
	movl	%r14d, %edx
	callq	_uECC_vli_cmp
	xorl	%ecx, %ecx
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.2:
	movq	%rbx, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	%r15, %rcx
	callq	_regularize_k
	movl	20(%r15), %esi
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movq	-64(%rbp,%rcx,8), %rdx
	movl	%r12d, %r8d
	incl	%r8d
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	movq	%r15, %r9
	callq	_EccPoint_mult
	movq	%r13, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_uECC_vli_isZero
	testq	%rax, %rax
	je	LBB0_3
LBB0_8:
	xorl	%ecx, %ecx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ecx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r14d, %r12d
	movq	_g_rng_function@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
## %bb.7:
	movl	16(%r15), %esi
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_uECC_generate_random_int
	testl	%eax, %eax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_5
	jmp	LBB0_8
LBB0_4:
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_uECC_vli_clear
	movl	$1, (%r13)
	movq	-88(%rbp), %r14                 ## 8-byte Reload
LBB0_5:
	movl	16(%r15), %ecx
	movq	%r13, %rdx
	movq	%rbx, %r13
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movq	%rdx, %rbx
	movl	%r12d, %r8d
	callq	_uECC_vli_modMult
	movl	16(%r15), %edx
	movq	%r13, %rdi
	movq	%r13, %rsi
	movl	%r12d, %ecx
	callq	_uECC_vli_modInv
	movl	16(%r15), %ecx
	movq	%r13, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	%r12d, %r8d
	callq	_uECC_vli_modMult
	movq	8(%r15), %rsi
	movq	%r14, %rdi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	callq	_uECC_vli_nativeToBytes
	movl	4(%r15), %edi
	callq	_BITS_TO_BYTES
	movq	%rbx, %rdi
	movq	%rbx, %r14
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	movq	%rax, %rdx
	callq	_uECC_vli_bytesToNative
	movslq	%r12d, %rax
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	$0, -4(%rbx,%rax,4)
	movq	%rbx, %rdi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	_uECC_vli_set
	movl	16(%r15), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	%r12d, %r8d
	callq	_uECC_vli_modMult
	movq	%r14, %rdi
	movq	-128(%rbp), %rsi                ## 8-byte Reload
	movl	-108(%rbp), %edx                ## 4-byte Reload
	movq	%r15, %rcx
	callq	_bits2int
	movl	16(%r15), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	%r12d, %r8d
	callq	_uECC_vli_modAdd
	movl	16(%r15), %ecx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movl	%r12d, %r8d
	callq	_uECC_vli_modMult
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_uECC_vli_numBits
	movq	8(%r15), %rsi
	leal	(,%rsi,8), %ecx
	cmpl	%ecx, %eax
	movl	$0, %ecx
	jg	LBB0_9
## %bb.6:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rsi,4), %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_uECC_vli_nativeToBytes
	movl	$1, %ecx
	jmp	LBB0_9
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_uECC_MAX_WORDS,4,2             ## @uECC_MAX_WORDS
	.comm	_g_rng_function,4,2             ## @g_rng_function
	.no_dead_strip	_uECC_sign_with_k
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uECC_sign_with_k
_uECC_sign_with_k:                      ; @uECC_sign_with_k
	.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, #64
	mov	x20, x5
	stur	x4, [x29, #-112]                ; 8-byte Folded Spill
	mov	x21, x3
	stur	w2, [x29, #-116]                ; 4-byte Folded Spill
	mov	x26, x1
	mov	x28, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _uECC_MAX_WORDS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _uECC_MAX_WORDS@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x13, x10, #0x7fffffff0
	sub	x19, x9, x13
	mov	sp, x19
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x24, x8, x13
	mov	sp, x24
	stp	x19, x24, [x29, #-104]
	lsl	w8, w12, #1
	lsl	x8, x8, #2
	mov	x9, x8
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	ldp	w25, w0, [x5]
	bl	_BITS_TO_WORDS
	mov	x27, x0
	ldr	w23, [x20, #4]
	mov	x0, x21
	mov	x1, x25
	bl	_uECC_vli_isZero
	cbnz	x0, LBB0_5
; %bb.1:
	stp	x22, x19, [x29, #-136]          ; 16-byte Folded Spill
	ldr	w0, [x20, #16]
	mov	x1, x21
	mov	x2, x27
	bl	_uECC_vli_cmp
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x21
	ldur	x1, [x29, #-128]                ; 8-byte Folded Reload
	mov	x22, x24
	mov	x2, x24
	mov	x3, x20
	bl	_regularize_k
	ldr	w1, [x20, #20]
	cmp	w0, #0
	cset	w8, eq
	sub	x9, x29, #104
	ldr	x2, [x9, w8, uxtw #3]
	add	w4, w23, #1
	ldur	x19, [x29, #-136]               ; 8-byte Folded Reload
	mov	x0, x19
	mov	w3, #0
	mov	x5, x20
	bl	_EccPoint_mult
	mov	x0, x19
	mov	x24, x25
	mov	x1, x25
	bl	_uECC_vli_isZero
	mov	x8, x0
	mov	w0, #0
	cbnz	x8, LBB0_6
; %bb.3:
Lloh12:
	adrp	x8, _g_rng_function@GOTPAGE
Lloh13:
	ldr	x8, [x8, _g_rng_function@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cbz	w8, LBB0_8
; %bb.4:
	ldr	w1, [x20, #16]
	ldur	x25, [x29, #-128]               ; 8-byte Folded Reload
	mov	x0, x25
	mov	x2, x27
	bl	_uECC_generate_random_int
	ldur	x23, [x29, #-112]               ; 8-byte Folded Reload
	cbnz	w0, LBB0_9
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldur	x8, [x29, #-88]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.7:
	sub	sp, x29, #80
	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_8:
	ldur	x25, [x29, #-128]               ; 8-byte Folded Reload
	mov	x0, x25
	mov	x1, x27
	bl	_uECC_vli_clear
	mov	w8, #1
	str	w8, [x25]
	ldur	x23, [x29, #-112]               ; 8-byte Folded Reload
LBB0_9:
	ldr	w3, [x20, #16]
	mov	x0, x21
	mov	x1, x21
	mov	x2, x25
	mov	x4, x27
	bl	_uECC_vli_modMult
	ldr	w2, [x20, #16]
	mov	x0, x21
	mov	x1, x21
	mov	x3, x27
	bl	_uECC_vli_modInv
	ldr	w3, [x20, #16]
	mov	x0, x21
	mov	x1, x21
	mov	x2, x25
	mov	x4, x27
	bl	_uECC_vli_modMult
	ldr	x1, [x20, #8]
	mov	x0, x23
	ldur	x23, [x29, #-136]               ; 8-byte Folded Reload
	mov	x2, x23
	bl	_uECC_vli_nativeToBytes
	ldr	w0, [x20, #4]
	bl	_BITS_TO_BYTES
	mov	x2, x0
	mov	x0, x25
	mov	x1, x28
	bl	_uECC_vli_bytesToNative
	sub	w8, w27, #1
	str	wzr, [x22, w8, sxtw #2]
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_uECC_vli_set
	ldr	w3, [x20, #16]
	mov	x0, x22
	mov	x1, x25
	mov	x2, x22
	mov	x4, x27
	bl	_uECC_vli_modMult
	mov	x0, x25
	mov	x1, x26
	ldur	w2, [x29, #-116]                ; 4-byte Folded Reload
	mov	x3, x20
	bl	_bits2int
	ldr	w3, [x20, #16]
	mov	x0, x22
	mov	x1, x25
	mov	x2, x22
	mov	x4, x27
	bl	_uECC_vli_modAdd
	ldr	w3, [x20, #16]
	mov	x0, x22
	mov	x1, x22
	mov	x2, x21
	mov	x4, x27
	bl	_uECC_vli_modMult
	mov	x0, x22
	mov	x1, x27
	bl	_uECC_vli_numBits
	mov	x8, x0
	mov	w0, #0
	ldr	x1, [x20, #8]
	cmp	w8, w1, lsl #3
	b.gt	LBB0_6
; %bb.10:
	ldur	x8, [x29, #-112]                ; 8-byte Folded Reload
	add	x0, x8, x1, lsl #2
	mov	x2, x22
	bl	_uECC_vli_nativeToBytes
	mov	w0, #1
	b	LBB0_6
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_uECC_MAX_WORDS,4,2             ; @uECC_MAX_WORDS
	.comm	_g_rng_function,4,2             ; @g_rng_function
	.no_dead_strip	_uECC_sign_with_k
.subsections_via_symbols
