// File: /workspace/github_c_makefile_star2_O2/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: fe_mul
static void fe_mul(fe h, const fe f, const fe g)
{
    // Everything is unrolled and put in temporary variables.
    // We could roll the loop, but that would make curve25519 twice as slow.
    i32 f0 = f[0]; i32 f1 = f[1]; i32 f2 = f[2]; i32 f3 = f[3]; i32 f4 = f[4];
    i32 f5 = f[5]; i32 f6 = f[6]; i32 f7 = f[7]; i32 f8 = f[8]; i32 f9 = f[9];
    i32 g0 = g[0]; i32 g1 = g[1]; i32 g2 = g[2]; i32 g3 = g[3]; i32 g4 = g[4];
    i32 g5 = g[5]; i32 g6 = g[6]; i32 g7 = g[7]; i32 g8 = g[8]; i32 g9 = g[9];
    i32 F1 = f1*2; i32 F3 = f3*2; i32 F5 = f5*2; i32 F7 = f7*2; i32 F9 = f9*2;
    i32 G1 = g1*19;  i32 G2 = g2*19;  i32 G3 = g3*19;
    i32 G4 = g4*19;  i32 G5 = g5*19;  i32 G6 = g6*19;
    i32 G7 = g7*19;  i32 G8 = g8*19;  i32 G9 = g9*19;

    i64 h0 = f0*(i64)g0 + F1*(i64)G9 + f2*(i64)G8 + F3*(i64)G7 + f4*(i64)G6
        +    F5*(i64)G5 + f6*(i64)G4 + F7*(i64)G3 + f8*(i64)G2 + F9*(i64)G1;
    i64 h1 = f0*(i64)g1 + f1*(i64)g0 + f2*(i64)G9 + f3*(i64)G8 + f4*(i64)G7
        +    f5*(i64)G6 + f6*(i64)G5 + f7*(i64)G4 + f8*(i64)G3 + f9*(i64)G2;
    i64 h2 = f0*(i64)g2 + F1*(i64)g1 + f2*(i64)g0 + F3*(i64)G9 + f4*(i64)G8
        +    F5*(i64)G7 + f6*(i64)G6 + F7*(i64)G5 + f8*(i64)G4 + F9*(i64)G3;
    i64 h3 = f0*(i64)g3 + f1*(i64)g2 + f2*(i64)g1 + f3*(i64)g0 + f4*(i64)G9
        +    f5*(i64)G8 + f6*(i64)G7 + f7*(i64)G6 + f8*(i64)G5 + f9*(i64)G4;
    i64 h4 = f0*(i64)g4 + F1*(i64)g3 + f2*(i64)g2 + F3*(i64)g1 + f4*(i64)g0
        +    F5*(i64)G9 + f6*(i64)G8 + F7*(i64)G7 + f8*(i64)G6 + F9*(i64)G5;
    i64 h5 = f0*(i64)g5 + f1*(i64)g4 + f2*(i64)g3 + f3*(i64)g2 + f4*(i64)g1
        +    f5*(i64)g0 + f6*(i64)G9 + f7*(i64)G8 + f8*(i64)G7 + f9*(i64)G6;
    i64 h6 = f0*(i64)g6 + F1*(i64)g5 + f2*(i64)g4 + F3*(i64)g3 + f4*(i64)g2
        +    F5*(i64)g1 + f6*(i64)g0 + F7*(i64)G9 + f8*(i64)G8 + F9*(i64)G7;
    i64 h7 = f0*(i64)g7 + f1*(i64)g6 + f2*(i64)g5 + f3*(i64)g4 + f4*(i64)g3
        +    f5*(i64)g2 + f6*(i64)g1 + f7*(i64)g0 + f8*(i64)G9 + f9*(i64)G8;
    i64 h8 = f0*(i64)g8 + F1*(i64)g7 + f2*(i64)g6 + F3*(i64)g5 + f4*(i64)g4
        +    F5*(i64)g3 + f6*(i64)g2 + F7*(i64)g1 + f8*(i64)g0 + F9*(i64)G9;
    i64 h9 = f0*(i64)g9 + f1*(i64)g8 + f2*(i64)g7 + f3*(i64)g6 + f4*(i64)g5
        +    f5*(i64)g4 + f6*(i64)g3 + f7*(i64)g2 + f8*(i64)g1 + f9*(i64)g0;

#define CARRY                                                             \
    i64 c0, c1, c2, c3, c4, c5, c6, c7, c8, c9;                           \
    c0 = (h0 + (i64) (1<<25)) >> 26; h1 += c0;      h0 -= c0 * (1 << 26); \
    c4 = (h4 + (i64) (1<<25)) >> 26; h5 += c4;      h4 -= c4 * (1 << 26); \
    c1 = (h1 + (i64) (1<<24)) >> 25; h2 += c1;      h1 -= c1 * (1 << 25); \
    c5 = (h5 + (i64) (1<<24)) >> 25; h6 += c5;      h5 -= c5 * (1 << 25); \
    c2 = (h2 + (i64) (1<<25)) >> 26; h3 += c2;      h2 -= c2 * (1 << 26); \
    c6 = (h6 + (i64) (1<<25)) >> 26; h7 += c6;      h6 -= c6 * (1 << 26); \
    c3 = (h3 + (i64) (1<<24)) >> 25; h4 += c3;      h3 -= c3 * (1 << 25); \
    c7 = (h7 + (i64) (1<<24)) >> 25; h8 += c7;      h7 -= c7 * (1 << 25); \
    c4 = (h4 + (i64) (1<<25)) >> 26; h5 += c4;      h4 -= c4 * (1 << 26); \
    c8 = (h8 + (i64) (1<<25)) >> 26; h9 += c8;      h8 -= c8 * (1 << 26); \
    c9 = (h9 + (i64) (1<<24)) >> 25; h0 += c9 * 19; h9 -= c9 * (1 << 25); \
    c0 = (h0 + (i64) (1<<25)) >> 26; h1 += c0;      h0 -= c0 * (1 << 26); \
    h[0]=(i32)h0;  h[1]=(i32)h1;  h[2]=(i32)h2;  h[3]=(i32)h3;  h[4]=(i32)h4; \
    h[5]=(i32)h5;  h[6]=(i32)h6;  h[7]=(i32)h7;  h[8]=(i32)h8;  h[9]=(i32)h9; \

    CARRY;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movslq 0x8(%rsi), %r10
movq %r10, -0x40(%rsp)
movslq 0xc(%rsi), %rax
movq %rax, -0x50(%rsp)
movslq 0x10(%rsi), %r11
movq %r11, -0x38(%rsp)
movslq 0x18(%rdx), %rcx
movq %rcx, 0x68(%rsp)
movslq 0x1c(%rdx), %r9
movq %r9, 0x78(%rsp)
movslq 0x20(%rdx), %rdi
movq %rdi, 0x88(%rsp)
leaq (%rax,%rax), %r8
movq %r8, 0x48(%rsp)
imulq $0x13, %rcx, %rbx
movq %rbx, 0x8(%rsp)
imulq $0x13, %r9, %rax
movq %rax, -0x78(%rsp)
imulq $0x13, %rdi, %rcx
movq %rcx, -0x80(%rsp)
imulq %r8, %rax
imulq %r11, %rbx
addq %rax, %rbx
movq %rcx, %rax
imulq %r10, %rax
addq %rax, %rbx
movslq 0x4(%rsi), %rcx
movq %rcx, -0x58(%rsp)
movslq 0x24(%rdx), %rax
movq %rax, 0x80(%rsp)
leaq (%rcx,%rcx), %rdi
movq %rdi, -0x28(%rsp)
imulq $0x13, %rax, %r13
movq %r13, %rax
movq %r13, -0x68(%rsp)
imulq %rdi, %rax
addq %rax, %rbx
movslq 0x18(%rsi), %rbp
movslq 0x10(%rdx), %rax
movq %rax, 0x50(%rsp)
imulq $0x13, %rax, %rax
movq %rax, 0x18(%rsp)
imulq %rbp, %rax
movq %rbp, 0x30(%rsp)
movslq 0x1c(%rsi), %rcx
movq %rcx, -0x60(%rsp)
movslq 0xc(%rdx), %rdi
movq %rdi, 0x40(%rsp)
addq %rcx, %rcx
movq %rcx, -0x20(%rsp)
imulq $0x13, %rdi, %r14
movq %r14, 0x20(%rsp)
imulq %rcx, %r14
addq %rax, %r14
movslq 0x14(%rsi), %r15
movslq 0x14(%rdx), %rax
movq %rax, 0x58(%rsp)
leaq (%r15,%r15), %rdi
movq %rdi, -0x18(%rsp)
movq %r15, -0x8(%rsp)
imulq $0x13, %rax, %r11
movq %r11, %rax
movq %r11, 0x10(%rsp)
imulq %rdi, %rax
addq %rax, %r14
movslq (%rsi), %rax
movslq (%rdx), %r9
movq %r9, %r8
movq %r9, -0x70(%rsp)
imulq %rax, %r8
movq %rax, %r10
movq %rax, 0x38(%rsp)
movslq 0x20(%rsi), %rax
movq %rax, 0x28(%rsp)
movslq 0x8(%rdx), %rcx
movq %rcx, -0x30(%rsp)
imulq $0x13, %rcx, %r12
movq %r12, %rdi
imulq %rax, %rdi
addq %r8, %rdi
movslq 0x24(%rsi), %rcx
movslq 0x4(%rdx), %rsi
movq %rsi, -0x48(%rsp)
leaq (%rcx,%rcx), %r8
movq %r8, (%rsp)
movq %rcx, -0x10(%rsp)
movq %rsi, %rdx
imulq %r8, %rdx
imulq $0x13, %rdx, %rax
addq %rdi, %rax
addq %r14, %rax
addq %rbx, %rax
movq %rax, 0x60(%rsp)
movq %rsi, %rdi
imulq %r10, %rdi
imulq -0x58(%rsp), %r9
addq %rdi, %r9
movq -0x40(%rsp), %rdx
imulq %rdx, %r13
movq -0x80(%rsp), %r14
imulq -0x50(%rsp), %r14
addq %r13, %r14
movq 0x8(%rsp), %r10
movq %r10, %rdi
imulq %r15, %rdi
movq %r11, %r8
imulq %rbp, %r8
addq %rdi, %r8
movq -0x78(%rsp), %rsi
movq %rsi, %rdi
movq -0x38(%rsp), %rax
imulq %rax, %rdi
addq %rdi, %r8
movq 0x18(%rsp), %r11
movq %r11, %rdi
imulq -0x60(%rsp), %rdi
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %r13
imulq %r13, %rbp
addq %rdi, %rbp
imulq %rcx, %r12
addq %r9, %r12
addq %rbp, %r12
addq %r8, %r12
addq %r14, %r12
movq %r12, 0x70(%rsp)
movq -0x30(%rsp), %rdi
movq 0x38(%rsp), %r9
imulq %r9, %rdi
movq -0x70(%rsp), %rbx
imulq %rdx, %rbx
movq %rdx, %r15
addq %rdi, %rbx
movq -0x48(%rsp), %r12
movq %r12, %rdi
movq -0x28(%rsp), %rcx
imulq %rcx, %rdi
addq %rdi, %rbx
movq %rsi, %rdi
imulq -0x18(%rsp), %rdi
movq 0x30(%rsp), %rcx
imulq %rcx, %r10
addq %rdi, %r10
movq -0x80(%rsp), %rbp
movq %rbp, %rdi
imulq %rax, %rdi
addq %rdi, %r10
movq 0x10(%rsp), %rsi
movq %rsi, %rdi
imulq -0x20(%rsp), %rdi
imulq %r13, %r11
addq %rdi, %r11
movq 0x20(%rsp), %r13
imulq (%rsp), %r13
addq %rbx, %r13
addq %r11, %r13
addq %r10, %r13
movq -0x68(%rsp), %rdx
movq %rdx, %rdi
movq 0x48(%rsp), %r11
imulq %r11, %rdi
addq %rdi, %r13
movq %r13, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq %rax, %rdi
imulq %r9, %rdi
movq %r9, %r10
movq -0x30(%rsp), %r9
movq %r9, %r8
imulq -0x58(%rsp), %r8
addq %rdi, %r8
movq %r12, %rdi
imulq %r15, %rdi
movq -0x70(%rsp), %rbx
imulq -0x50(%rsp), %rbx
addq %rdi, %rbx
addq %r8, %rbx
movq %rbp, %rdi
imulq -0x8(%rsp), %rdi
movq -0x78(%rsp), %r8
imulq %rcx, %r8
addq %rdi, %r8
movq %rdx, %rdi
movq %rdx, %r15
movq -0x38(%rsp), %rbp
imulq %rbp, %rdi
addq %rdi, %r8
movq 0x8(%rsp), %r12
movq %r12, %rdi
imulq -0x60(%rsp), %rdi
movq %rsi, %r14
movq 0x28(%rsp), %rsi
imulq %rsi, %r14
addq %rdi, %r14
movq 0x18(%rsp), %rdx
imulq -0x10(%rsp), %rdx
addq %rbx, %rdx
addq %r14, %rdx
addq %r8, %rdx
movq %rdx, 0x18(%rsp)
movq 0x50(%rsp), %r13
movq %r13, %rdi
imulq %r10, %rdi
imulq -0x28(%rsp), %rax
addq %rdi, %rax
movq %r9, %rdi
movq -0x40(%rsp), %r9
imulq %r9, %rdi
movq -0x70(%rsp), %rbx
movq %rbp, %rdx
imulq %rbp, %rbx
addq %rdi, %rbx
movq -0x48(%rsp), %rcx
movq %rcx, %rdi
imulq %r11, %rdi
addq %rdi, %rbx
addq %rax, %rbx
movq %r15, %rdi
imulq -0x18(%rsp), %rdi
movq -0x80(%rsp), %r11
movq %r11, %r8
imulq 0x30(%rsp), %r8
addq %rdi, %r8
movq -0x78(%rsp), %r15
movq %r15, %rdi
imulq -0x20(%rsp), %rdi
movq %r12, %r14
movq %rsi, %rbp
imulq %rsi, %r14
addq %rdi, %r14
movq 0x10(%rsp), %rax
imulq (%rsp), %rax
addq %rbx, %rax
addq %r14, %rax
addq %r8, %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movq %r10, %rsi
imulq %r10, %rdi
imulq -0x58(%rsp), %r13
addq %rdi, %r13
movq 0x40(%rsp), %r10
movq %r10, %rdi
imulq %r9, %rdi
movq -0x30(%rsp), %rbx
imulq -0x50(%rsp), %rbx
addq %rdi, %rbx
imulq %rdx, %rcx
movq -0x70(%rsp), %r9
movq %r9, %r14
imulq -0x8(%rsp), %r14
addq %rcx, %r14
addq %rbx, %r14
addq %r13, %r14
movq %r11, %rdi
imulq -0x60(%rsp), %rdi
imulq %rbp, %r15
addq %rdi, %r15
movq %r12, %rax
imulq -0x10(%rsp), %rax
addq %r14, %rax
addq %r15, %rax
movq -0x68(%rsp), %r12
movq %r12, %rdi
movq 0x30(%rsp), %rdx
imulq %rdx, %rdi
addq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %r13
movq %r13, %rdi
imulq %rsi, %rdi
movq 0x58(%rsp), %rax
movq %rax, %r8
imulq -0x28(%rsp), %r8
addq %rdi, %r8
movq 0x50(%rsp), %rcx
movq %rcx, %rdi
movq -0x40(%rsp), %r11
imulq %r11, %rdi
movq %r10, %rbx
imulq 0x48(%rsp), %rbx
addq %rdi, %rbx
movq -0x30(%rsp), %r10
movq %r10, %rdi
movq -0x38(%rsp), %rsi
imulq %rsi, %rdi
movq %r9, %r14
imulq %rdx, %r14
movq %rdx, %r9
addq %rdi, %r14
movq -0x48(%rsp), %r15
movq %r15, %rdi
imulq -0x18(%rsp), %rdi
addq %rdi, %r14
addq %rbx, %r14
addq %r8, %r14
movq -0x80(%rsp), %rdi
imulq %rbp, %rdi
movq -0x78(%rsp), %rdx
imulq (%rsp), %rdx
addq %rdi, %rdx
addq %r14, %rdx
movq %r12, %rdi
imulq -0x20(%rsp), %rdi
addq %rdi, %rdx
movq %rdx, -0x78(%rsp)
movq %rax, %rdi
movq %r11, %rax
imulq %r11, %rdi
movq %rcx, %r8
imulq -0x50(%rsp), %r8
addq %rdi, %r8
movq %r13, %rdi
movq %r13, %rbp
imulq -0x58(%rsp), %rdi
addq %rdi, %r8
movq 0x40(%rsp), %rcx
movq %rcx, %rdi
imulq %rsi, %rdi
movq %r10, %rbx
imulq -0x8(%rsp), %rbx
addq %rdi, %rbx
movq %r15, %rdi
imulq %r9, %rdi
movq -0x70(%rsp), %r11
movq %r11, %r14
imulq -0x60(%rsp), %r14
addq %rdi, %r14
addq %rbx, %r14
addq %r8, %r14
movq 0x78(%rsp), %rdx
movq %rdx, %rdi
imulq 0x38(%rsp), %rdi
addq %rdi, %r14
movq 0x28(%rsp), %r13
imulq %r13, %r12
movq -0x80(%rsp), %rsi
imulq -0x10(%rsp), %rsi
addq %r12, %rsi
addq %r14, %rsi
movq %rsi, -0x80(%rsp)
movq %rbp, %rdi
imulq %rax, %rdi
movq 0x48(%rsp), %r8
movq 0x58(%rsp), %r15
imulq %r15, %r8
addq %rdi, %r8
movq -0x28(%rsp), %rax
imulq %rdx, %rax
movq %rdx, %rbp
addq %rax, %r8
movq %r8, %rdx
movq 0x50(%rsp), %rsi
movq %rsi, %rdi
movq -0x38(%rsp), %rax
imulq %rax, %rdi
movq %rcx, %r14
movq -0x18(%rsp), %rcx
imulq %r14, %rcx
addq %rdi, %rcx
movq %rcx, %rbx
movq %r10, %rdi
imulq %r9, %rdi
movq %r11, %r8
imulq %r13, %r8
addq %rdi, %r8
movq -0x20(%rsp), %rcx
movq -0x48(%rsp), %r12
imulq %r12, %rcx
addq %rcx, %r8
addq %rbx, %r8
addq %rdx, %r8
movq -0x68(%rsp), %rdx
imulq (%rsp), %rdx
movq 0x88(%rsp), %rbx
movq %rbx, %rdi
movq 0x38(%rsp), %rcx
imulq %rcx, %rdi
addq %rdi, %rdx
addq %r8, %rdx
movq %rdx, -0x68(%rsp)
movq 0x80(%rsp), %rdi
imulq %rcx, %rdi
imulq -0x58(%rsp), %rbx
imulq -0x40(%rsp), %rbp
addq %rbx, %rbp
addq %rdi, %rbp
movq 0x68(%rsp), %rdi
imulq -0x50(%rsp), %rdi
imulq %rax, %r15
imulq -0x8(%rsp), %rsi
addq %r15, %rsi
addq %rdi, %rsi
imulq %r9, %r14
imulq -0x60(%rsp), %r10
addq %r14, %r10
movq %r12, %rax
imulq %r13, %rax
imulq -0x10(%rsp), %r11
addq %rax, %r11
addq %r10, %r11
addq %rsi, %r11
addq %rbp, %r11
movl $0x2000000, %eax        # imm = 0x2000000
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax), %rsi
movq %rsi, %rdx
sarq $0x1a, %rdx
addq 0x70(%rsp), %rdx
movq $-0x4000000, %rdi       # imm = 0xFC000000
andq %rdi, %rsi
subq %rsi, %rcx
movq %rcx, 0x60(%rsp)
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax), %rsi
movq %rsi, %r13
sarq $0x1a, %r13
addq 0x8(%rsp), %r13
andq %rdi, %rsi
subq %rsi, %rcx
movl $0x1000000, %ebx        # imm = 0x1000000
leaq (%rdx,%rbx), %rdi
movq %rdi, %rsi
sarq $0x19, %rsi
addq 0x20(%rsp), %rsi
movl $0xfe000000, %r8d       # imm = 0xFE000000
andl %r8d, %edi
subl %edi, %edx
leaq (%rbx,%r13), %r14
movq %r14, %rdi
sarq $0x19, %rdi
addq -0x78(%rsp), %rdi
andl %r8d, %r14d
subl %r14d, %r13d
leaq (%rsi,%rax), %r15
movq %r15, %r9
sarq $0x1a, %r9
addq 0x18(%rsp), %r9
movl $0xfc000000, %r14d      # imm = 0xFC000000
andl %r14d, %r15d
subl %r15d, %esi
leaq (%rdi,%rax), %r12
movq %r12, %r15
sarq $0x1a, %r15
addq -0x80(%rsp), %r15
andl %r14d, %r12d
subl %r12d, %edi
leaq (%r9,%rbx), %rbp
movq %rbp, %r12
sarq $0x19, %r12
addq %rcx, %r12
andl %r8d, %ebp
subl %ebp, %r9d
leaq (%r15,%rbx), %rbp
movq %rbp, %r10
sarq $0x19, %r10
addq -0x68(%rsp), %r10
andl %r8d, %ebp
subl %ebp, %r15d
leaq (%r12,%rax), %rbp
movq %rbp, %rcx
shrq $0x1a, %rcx
addl %r13d, %ecx
andl %r14d, %ebp
subl %ebp, %r12d
leaq (%r10,%rax), %rbp
movq %rbp, %r13
sarq $0x1a, %r13
addq %r11, %r13
andl %r14d, %ebp
subl %ebp, %r10d
addq %r13, %rbx
movq %rbx, %r11
sarq $0x19, %r11
imulq $0x13, %r11, %r11
addq 0x60(%rsp), %r11
andl %r8d, %ebx
subl %ebx, %r13d
addq %r11, %rax
movq %rax, %r8
shrq $0x1a, %r8
addl %edx, %r8d
andl %r14d, %eax
subl %eax, %r11d
movq 0x90(%rsp), %rax
movl %r11d, (%rax)
movl %r8d, 0x4(%rax)
movl %esi, 0x8(%rax)
movl %r9d, 0xc(%rax)
movl %r12d, 0x10(%rax)
movl %ecx, 0x14(%rax)
movl %edi, 0x18(%rax)
movl %r15d, 0x1c(%rax)
movl %r10d, 0x20(%rax)
movl %r13d, 0x24(%rax)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq