// File: /workspace/github_c_makefile_star2_O2/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: fe_invert
static void fe_invert(fe out, const fe z)
{
    fe t0, t1, t2, t3;
    fe_sq(t0, z );
    fe_sq(t1, t0);
    fe_sq(t1, t1);
    fe_mul(t1,  z, t1);
    fe_mul(t0, t0, t1);
    fe_sq(t2, t0);                                fe_mul(t1 , t1, t2);
    fe_sq(t2, t1); FOR (i, 1,   5) fe_sq(t2, t2); fe_mul(t1 , t2, t1);
    fe_sq(t2, t1); FOR (i, 1,  10) fe_sq(t2, t2); fe_mul(t2 , t2, t1);
    fe_sq(t3, t2); FOR (i, 1,  20) fe_sq(t3, t3); fe_mul(t2 , t3, t2);
    fe_sq(t2, t2); FOR (i, 1,  10) fe_sq(t2, t2); fe_mul(t1 , t2, t1);
    fe_sq(t2, t1); FOR (i, 1,  50) fe_sq(t2, t2); fe_mul(t2 , t2, t1);
    fe_sq(t3, t2); FOR (i, 1, 100) fe_sq(t3, t3); fe_mul(t2 , t3, t2);
    fe_sq(t2, t2); FOR (i, 1,  50) fe_sq(t2, t2); fe_mul(t1 , t2, t1);
    fe_sq(t1, t1); FOR (i, 1,   5) fe_sq(t1, t1); fe_mul(out, t1, t0);
    WIPE_BUFFER(t0);
    WIPE_BUFFER(t1);
    WIPE_BUFFER(t2);
    WIPE_BUFFER(t3);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0x4cf6
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x4cf6
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4509
movq %r12, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x4509
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x4cf6
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4509
movq %r15, %rdi
movq %r14, %rsi
callq 0x4cf6
pushq $0x4
popq %r14
subq $0x1, %r14
jb 0x5275
movq %r15, %rdi
movq %r15, %rsi
callq 0x4cf6
jmp 0x5262
movq %rsp, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4509
movq %r14, %rdi
movq %r15, %rsi
callq 0x4cf6
pushq $0x9
popq %r15
subq $0x1, %r15
jb 0x52ad
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x529a
movq %rsp, %r15
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x4509
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4cf6
pushq $0x13
popq %r15
subq $0x1, %r15
jb 0x52e7
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x52d4
leaq 0x60(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4509
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
pushq $0x9
popq %r15
subq $0x1, %r15
jb 0x531c
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x5309
movq %rsp, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4509
movq %r14, %rdi
movq %r15, %rsi
callq 0x4cf6
pushq $0x31
popq %r15
subq $0x1, %r15
jb 0x5354
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x5341
movq %rsp, %r15
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x4509
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4cf6
pushq $0x63
popq %r15
subq $0x1, %r15
jb 0x538e
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x537b
leaq 0x60(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4509
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
pushq $0x31
popq %r15
subq $0x1, %r15
jb 0x53c3
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x53b0
movq %rsp, %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4509
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
pushq $0x4
popq %r15
subq $0x1, %r15
jb 0x53f8
movq %r14, %rdi
movq %r14, %rsi
callq 0x4cf6
jmp 0x53e5
leaq 0x30(%rsp), %r14
leaq 0x90(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4509
pushq $0x28
popq %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1734
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1734
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x1734
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x1734
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq