// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rdi, %rbx
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x51c2
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x51c2
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
movq %r14, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x4992
movq %r15, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4992
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x51c2
movq %r14, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4992
movq %r12, %rdi
movq %r14, %rsi
callq 0x51c2
movl $0x4, %r14d
movq %r12, %rdi
movq %r12, %rsi
callq 0x51c2
decq %r14
jne 0x5731
movq %rsp, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4992
movq %r14, %rdi
movq %r15, %rsi
callq 0x51c2
movl $0x9, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x5768
movq %rsp, %r15
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x4992
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x51c2
movl $0x13, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x57a1
leaq 0x60(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4992
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
movl $0x9, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x57d5
movq %rsp, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4992
movq %r14, %rdi
movq %r15, %rsi
callq 0x51c2
movl $0x31, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x580c
movq %rsp, %r15
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x4992
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x51c2
movl $0x63, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x5845
leaq 0x60(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4992
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
movl $0x31, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x5879
movq %rsp, %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r14, %rdx
callq 0x4992
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
movl $0x4, %r15d
movq %r14, %rdi
movq %r14, %rsi
callq 0x51c2
decq %r15
jne 0x58ad
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x4992
xorl %eax, %eax
movb $0x0, 0x90(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x58d4
xorl %eax, %eax
movb $0x0, 0x30(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x58e7
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x58f7
xorl %eax, %eax
movb $0x0, 0x60(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x5906
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq