LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_blake2b_final
void crypto_blake2b_final(crypto_blake2b_ctx *ctx, u8 *hash)
{
    // Pad the end of the block with zeroes
    FOR (i, ctx->input_idx, 128) {
        blake2b_set_input(ctx, 0, i);
    }
    blake2b_incr(ctx);         // update the input offset
    blake2b_compress(ctx, -1); // compress the last block
    size_t nb_words = ctx->hash_size >> 3;
    FOR (i, 0, nb_words) {
        store64_le(hash + i*8, ctx->hash[i]);
    }
    FOR (i, nb_words * 8, ctx->hash_size) {
        hash[i] = (ctx->hash[i >> 3] >> (8 * (i & 7))) & 0xff;
    }
    WIPE_CTX(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x80, -0x18(%rbp)
jae 0x3386
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x3470
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x335f
movq -0x8(%rbp), %rdi
callq 0x3500
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3550
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rax
shrq $0x3, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x33f0
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x7ae0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x33b8
movq -0x20(%rbp), %rax
shlq $0x3, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xd8(%rcx), %rax
jae 0x344d
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
shrq $0x3, %rcx
movq (%rax,%rcx,8), %rax
movq -0x30(%rbp), %rcx
andq $0x7, %rcx
shlq $0x3, %rcx
shrq %cl, %rax
andq $0xff, %rax
movb %al, %dl
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x33fc
movq -0x8(%rbp), %rdi
movl $0xe0, %esi
callq 0x1b40
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: blake2b_set_input
static void blake2b_set_input(crypto_blake2b_ctx *ctx, u8 input, size_t index)
{
    if (index == 0) {
        FOR (i, 0, 16) {
            ctx->input[i] = 0;
        }
    }
    size_t word = index >> 3;
    size_t byte = index & 7;
    ctx->input[word] |= (u64)input << (byte << 3);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x34b9
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jae 0x34b7
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq $0x0, 0x50(%rax,%rcx,8)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3491
jmp 0x34b9
movq -0x18(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
movq %rax, -0x30(%rbp)
movzbl -0x9(%rbp), %eax
movl %eax, %edx
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
shlq %cl, %rdx
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
orq 0x50(%rax,%rcx,8), %rdx
movq %rdx, 0x50(%rax,%rcx,8)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: blake2b_incr
static void blake2b_incr(crypto_blake2b_ctx *ctx)
{
    u64   *x = ctx->input_offset;
    size_t y = ctx->input_idx;
    x[0] += y;
    if (x[0] < y) {
        x[1]++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jae 0x354e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: extended_hash
static void extended_hash(u8       *digest, u32 digest_size,
                          const u8 *input , u32 input_size)
{
    crypto_blake2b_ctx ctx;
    crypto_blake2b_general_init(&ctx, MIN(digest_size, 64), 0, 0);
    blake_update_32            (&ctx, digest_size);
    crypto_blake2b_update      (&ctx, input, input_size);
    crypto_blake2b_final       (&ctx, digest);

    if (digest_size > 64) {
        // the conversion to u64 avoids integer overflow on
        // ludicrously big hash sizes.
        u32 r   = (((u64)digest_size + 31) >> 5) - 2;
        u32 i   =  1;
        u32 in  =  0;
        u32 out = 32;
        while (i < r) {
            // Input and output overlap. This is intentional
            crypto_blake2b(digest + out, digest + in, 64);
            i   +=  1;
            in  += 32;
            out += 32;
        }
        crypto_blake2b_general(digest + out, digest_size - (32 * r),
                               0, 0, // no key
                               digest + in , 64);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x40, -0xc(%rbp)
ja 0x818a
movl -0xc(%rbp), %eax
movl %eax, -0x114(%rbp)
jmp 0x8197
movl $0x40, %eax
movl %eax, -0x114(%rbp)
jmp 0x8197
movl -0x114(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x100(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x2fe0
movl -0xc(%rbp), %esi
leaq -0x100(%rbp), %rdi
callq 0x8110
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
leaq -0x100(%rbp), %rdi
callq 0x30c0
movq -0x8(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x3340
cmpl $0x40, -0xc(%rbp)
jbe 0x82c4
movl -0xc(%rbp), %eax
addq $0x1f, %rax
shrq $0x5, %rax
subq $0x2, %rax
movl %eax, -0x104(%rbp)
movl $0x1, -0x108(%rbp)
movl $0x0, -0x10c(%rbp)
movl $0x20, -0x110(%rbp)
movl -0x108(%rbp), %eax
cmpl -0x104(%rbp), %eax
jae 0x8286
movq -0x8(%rbp), %rdi
movl -0x110(%rbp), %eax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movl -0x10c(%rbp), %eax
addq %rax, %rsi
movl $0x40, %edx
callq 0x7b90
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
movl -0x10c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x10c(%rbp)
movl -0x110(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x110(%rbp)
jmp 0x8225
movq -0x8(%rbp), %rdi
movl -0x110(%rbp), %eax
addq %rax, %rdi
movl -0xc(%rbp), %eax
movl -0x104(%rbp), %ecx
shll $0x5, %ecx
subl %ecx, %eax
movl %eax, %eax
movl %eax, %esi
movq -0x8(%rbp), %r8
movl -0x10c(%rbp), %eax
addq %rax, %r8
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r9d
movq %rcx, %rdx
callq 0x7b20
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: gidx_init
static void gidx_init(gidx_ctx *ctx,
                      u32 pass_number, u32 slice_number,
                      u32 nb_blocks,   u32 nb_iterations)
{
    ctx->pass_number   = pass_number;
    ctx->slice_number  = slice_number;
    ctx->nb_blocks     = nb_blocks;
    ctx->nb_iterations = nb_iterations;
    ctx->ctr           = 0;

    // Offset from the begining of the segment.  For the first slice
    // of the first pass, we start at the *third* block, so the offset
    // starts at 2, not 0.
    if (pass_number != 0 || slice_number != 0) {
        ctx->offset = 0;
    } else {
        ctx->offset = 2;
        ctx->ctr++;         // Compensates for missed lazy creation
        gidx_refresh(ctx);  // at the start of gidx_next()
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x400(%rax)
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x404(%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x408(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x40c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x410(%rax)
cmpl $0x0, -0xc(%rbp)
jne 0x8437
cmpl $0x0, -0x10(%rbp)
je 0x8447
movq -0x8(%rbp), %rax
movl $0x0, 0x414(%rax)
jmp 0x8471
movq -0x8(%rbp), %rax
movl $0x2, 0x414(%rax)
movq -0x8(%rbp), %rax
movl 0x410(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x410(%rax)
movq -0x8(%rbp), %rdi
callq 0xc5b0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: g_copy
static void g_copy(block *result, const block *x, const block *y, block* tmp)
{
    copy_block(tmp   , x  ); // tmp    = X
    xor_block (tmp   , y  ); // tmp    = X ^ Y = R
    copy_block(result, tmp); // result = R         (only difference with g_xor)
    g_rounds  (tmp);         // tmp    = Z
    xor_block (result, tmp); // result = R ^ Z
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8330
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xf570
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x8330
movq -0x20(%rbp), %rdi
callq 0xc6d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xf570
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_argon2i
void crypto_argon2i(u8       *hash,      u32 hash_size,
                    void     *work_area, u32 nb_blocks,
                    u32 nb_iterations,
                    const u8 *password,  u32 password_size,
                    const u8 *salt,      u32 salt_size)
{
    crypto_argon2i_general(hash, hash_size,
                           work_area, nb_blocks, nb_iterations,
                           password, password_size,
                           salt    , salt_size,
                           0, 0, 0, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %r11d
movq 0x18(%rbp), %r10
movl 0x20(%rbp), %eax
xorl %ebx, %ebx
xorl %ebx, %ebx
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
callq 0x7bd0
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: fe_cswap
static void fe_cswap(fe f, fe g, int b)
{
    FOR (i, 0, 10) {
        i32 x = (f[i] ^ g[i]) & -b;
        f[i] = f[i] ^ x;
        g[i] = g[i] ^ x;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0xa, -0x20(%rbp)
jae 0x90de
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
xorl (%rcx,%rdx,4), %eax
xorl %ecx, %ecx
subl -0x14(%rbp), %ecx
andl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
xorl -0x24(%rbp), %edx
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
xorl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x9077
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_sign_public_key
void crypto_sign_public_key(u8       public_key[32],
                            const u8 secret_key[32])
{
    u8 a[64];
    HASH(a, secret_key, 32);
    trim_scalar(a);
    ge A;
    ge_scalarmult_base(&A, a);
    ge_tobytes(public_key, &A);
    WIPE_BUFFER(a);
    WIPE_CTX(&A);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x20, %edx
callq 0x7b90
leaq -0x50(%rbp), %rdi
callq 0x8f20
leaq -0x50(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xad60
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0xb0a0
leaq -0x50(%rbp), %rdi
movl $0x40, %esi
callq 0x1b40
leaq -0xf0(%rbp), %rdi
movl $0xa0, %esi
callq 0x1b40
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_tobytes
static void ge_tobytes(u8 s[32], const ge *h)
{
    fe recip, x, y;
    fe_invert(recip, h->Z);
    fe_mul(x, h->X, recip);
    fe_mul(y, h->Y, recip);
    fe_tobytes(s, y);
    s[31] ^= fe_isnegative(x) << 7;

    WIPE_BUFFER(recip);
    WIPE_BUFFER(x);
    WIPE_BUFFER(y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x50, %rsi
callq 0xa5d0
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x9180
leaq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
leaq -0x40(%rbp), %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xa9b0
leaq -0x70(%rbp), %rdi
callq 0xfd80
movl %eax, %edx
shll $0x7, %edx
movq -0x8(%rbp), %rax
movzbl 0x1f(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x1f(%rax)
leaq -0x40(%rbp), %rdi
movl $0x28, %esi
callq 0x1b40
leaq -0x70(%rbp), %rdi
movl $0x28, %esi
callq 0x1b40
leaq -0xa0(%rbp), %rdi
movl $0x28, %esi
callq 0x1b40
addq $0xa0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_sign_init_first_pass
void crypto_sign_init_first_pass(crypto_sign_ctx *ctx,
                                 const u8  secret_key[32],
                                 const u8  public_key[32])
{
    u8 *a      = ctx->buf;
    u8 *prefix = ctx->buf + 32;
    HASH(a, secret_key, 32);
    trim_scalar(a);

    if (public_key == 0) {
        crypto_sign_public_key(ctx->pk, secret_key);
    } else {
        FOR (i, 0, 32) {
            ctx->pk[i] = public_key[i];
        }
    }

    // Constructs the "random" nonce from the secret key and message.
    // An actual random number would work just fine, and would save us
    // the trouble of hashing the message twice.  If we did that
    // however, the user could fuck it up and reuse the nonce.
    HASH_INIT  (&ctx->hash);
    HASH_UPDATE(&ctx->hash, prefix , 32);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
addq $0x20, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x20, %edx
callq 0x7b90
movq -0x20(%rbp), %rdi
callq 0x8f20
cmpq $0x0, -0x18(%rbp)
jne 0xb1bc
movq -0x8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movq -0x10(%rbp), %rsi
callq 0xace0
jmp 0xb1f5
movq $0x0, -0x30(%rbp)
cmpq $0x20, -0x30(%rbp)
jae 0xb1f3
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movb %dl, 0x140(%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xb1c4
jmp 0xb1f5
movq -0x8(%rbp), %rdi
callq 0x3200
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x20, %edx
callq 0x30c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_sign_init_second_pass
void crypto_sign_init_second_pass(crypto_sign_ctx *ctx)
{
    u8 *r        = ctx->buf + 32;
    u8 *half_sig = ctx->buf + 64;
    HASH_FINAL(&ctx->hash, r);
    reduce(r);

    // first half of the signature = "random" nonce times basepoint
    ge R;
    ge_scalarmult_base(&R, r);
    ge_tobytes(half_sig, &R);
    WIPE_CTX(&R);

    // Hash R, the public key, and the message together.
    // It cannot be done in parallel with the first hash.
    HASH_INIT  (&ctx->hash);
    HASH_UPDATE(&ctx->hash, half_sig, 32);
    HASH_UPDATE(&ctx->hash, ctx->pk , 32);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
addq $0x40, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3340
movq -0x10(%rbp), %rdi
callq 0xb310
movq -0x10(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xad60
movq -0x18(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xb0a0
leaq -0xb8(%rbp), %rdi
movl $0xa0, %esi
callq 0x1b40
movq -0x8(%rbp), %rdi
callq 0x3200
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x20, %edx
callq 0x30c0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x140, %rsi            # imm = 0x140
movl $0x20, %edx
callq 0x30c0
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: reduce
static void reduce(u8 r[64])
{
    i64 x[64];
    FOR (i, 0, 64) {
        x[i] = (u64) r[i];
        r[i] = 0;
    }
    modL(r, x);
    WIPE_BUFFER(x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq $0x0, -0x218(%rbp)
cmpq $0x40, -0x218(%rbp)
jae 0xb377
movq -0x8(%rbp), %rax
movq -0x218(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq -0x218(%rbp), %rax
movq %rcx, -0x210(%rbp,%rax,8)
movq -0x8(%rbp), %rax
movq -0x218(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x218(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x218(%rbp)
jmp 0xb32a
movq -0x8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0xfdc0
leaq -0x210(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1b40
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_sign_final
void crypto_sign_final(crypto_sign_ctx *ctx, u8 signature[64])
{
    u8 *a        = ctx->buf;
    u8 *r        = ctx->buf + 32;
    u8 *half_sig = ctx->buf + 64;
    u8 h_ram[64];
    HASH_FINAL(&ctx->hash, h_ram);
    reduce(h_ram);  // reduce the hash modulo L
    FOR (i, 0, 32) {
        signature[i] = half_sig[i];
    }
    mul_add(signature + 32, h_ram, a, r); // s = h_ram * a + r
    WIPE_CTX(ctx);
    WIPE_BUFFER(h_ram);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
addq $0x20, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3340
leaq -0x70(%rbp), %rdi
callq 0xb310
movq $0x0, -0x78(%rbp)
cmpq $0x20, -0x78(%rbp)
jae 0xb43e
movq -0x28(%rbp), %rax
movq -0x78(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq -0x78(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xb413
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xb480
movq -0x8(%rbp), %rdi
movl $0x160, %esi            # imm = 0x160
callq 0x1b40
leaq -0x70(%rbp), %rdi
movl $0x40, %esi
callq 0x1b40
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: mul_add
static void mul_add(u8 r[32], const u8 a[32], const u8 b[32], const u8 c[32])
{
    i64 s[64];
    FOR (i,  0, 32) { s[i] = (u64) c[i]; }
    FOR (i, 32, 64) { s[i] = 0;          }
    FOR (i,  0, 32) {
        FOR (j, 0, 32) {
            s[i+j] += a[i] * (u64) b[j];
        }
    }
    modL(r, s);
    WIPE_BUFFER(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x228(%rbp)
cmpq $0x20, -0x228(%rbp)
jae 0xb4e4
movq -0x20(%rbp), %rax
movq -0x228(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq -0x228(%rbp), %rax
movq %rcx, -0x220(%rbp,%rax,8)
movq -0x228(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x228(%rbp)
jmp 0xb4a6
movq $0x20, -0x230(%rbp)
cmpq $0x40, -0x230(%rbp)
jae 0xb520
movq -0x230(%rbp), %rax
movq $0x0, -0x220(%rbp,%rax,8)
movq -0x230(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x230(%rbp)
jmp 0xb4ef
movq $0x0, -0x238(%rbp)
cmpq $0x20, -0x238(%rbp)
jae 0xb5bd
movq $0x0, -0x240(%rbp)
cmpq $0x20, -0x240(%rbp)
jae 0xb5a4
movq -0x10(%rbp), %rax
movq -0x238(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq -0x240(%rbp), %rdx
movzbl (%rax,%rdx), %eax
imulq %rax, %rcx
movq -0x238(%rbp), %rax
addq -0x240(%rbp), %rax
addq -0x220(%rbp,%rax,8), %rcx
movq %rcx, -0x220(%rbp,%rax,8)
movq -0x240(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x240(%rbp)
jmp 0xb544
jmp 0xb5a6
movq -0x238(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x238(%rbp)
jmp 0xb52b
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0xfdc0
leaq -0x220(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1b40
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_sign
void crypto_sign(u8        signature[64],
                 const u8  secret_key[32],
                 const u8  public_key[32],
                 const u8 *message, size_t message_size)
{
    crypto_sign_ctx ctx;
    crypto_sign_init_first_pass (&ctx, secret_key, public_key);
    crypto_sign_update          (&ctx, message, message_size);
    crypto_sign_init_second_pass(&ctx);
    crypto_sign_update          (&ctx, message, message_size);
    crypto_sign_final           (&ctx, signature);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x188(%rbp), %rdi
callq 0xb150
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x188(%rbp), %rdi
callq 0xb220
leaq -0x188(%rbp), %rdi
callq 0xb250
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x188(%rbp), %rdi
callq 0xb220
movq -0x8(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0xb3b0
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_check_init
void crypto_check_init(crypto_check_ctx *ctx,
                      const u8 signature[64],
                      const u8 public_key[32])
{
    FOR (i, 0, 64) { ctx->sig[i] = signature [i]; }
    FOR (i, 0, 32) { ctx->pk [i] = public_key[i]; }
    HASH_INIT  (&ctx->hash);
    HASH_UPDATE(&ctx->hash, signature , 32);
    HASH_UPDATE(&ctx->hash, public_key, 32);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x40, -0x20(%rbp)
jae 0xb6bb
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movb %dl, 0xe0(%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xb68c
movq $0x0, -0x28(%rbp)
cmpq $0x20, -0x28(%rbp)
jae 0xb6f2
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movb %dl, 0x120(%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xb6c3
movq -0x8(%rbp), %rdi
callq 0x3200
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x20, %edx
callq 0x30c0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x20, %edx
callq 0x30c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_check_final
int crypto_check_final(crypto_check_ctx *ctx)
{
    ge diff, A;
    u8 h_ram[64], R_check[32];
    u8 *s = ctx->sig + 32;                       // s
    u8 *R = ctx->sig;                            // R
    if (ge_frombytes_neg_vartime(&A, ctx->pk) ||
        is_above_L(s)) { // prevent s malleability
        return -1;
    }
    HASH_FINAL(&ctx->hash, h_ram);
    reduce(h_ram);
    ge_double_scalarmult_vartime(&diff, &A, h_ram, s);
    ge_tobytes(R_check, &diff);                  // R_check = s*B - h_ram*A
    return crypto_verify32(R, R_check);          // R == R_check ? OK : fail
    // No secret, no wipe
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0xe0, %rax
addq $0x20, %rax
movq %rax, -0x1b8(%rbp)
movq -0x10(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x1c0(%rbp)
movq -0x10(%rbp), %rsi
addq $0x120, %rsi            # imm = 0x120
leaq -0x150(%rbp), %rdi
callq 0xb840
cmpl $0x0, %eax
jne 0xb7c2
movq -0x1b8(%rbp), %rdi
callq 0xba30
cmpl $0x0, %eax
je 0xb7cb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb831
movq -0x10(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x3340
leaq -0x190(%rbp), %rdi
callq 0xb310
leaq -0x190(%rbp), %rdx
movq -0x1b8(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xbab0
leaq -0x1b0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xb0a0
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x1a40
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: is_above_L
static int is_above_L(const u8 a[32])
{
    for (int i = 31; i >= 0; i--) {
        if (a[i] > L[i]) { return 1; }
        if (a[i] < L[i]) { return 0; }
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl $0x1f, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xba9e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq -0x14(%rbp), %rdx
leaq 0x7454(%rip), %rcx      # 0x12eb0
cmpq (%rcx,%rdx,8), %rax
jbe 0xba6b
movl $0x1, -0x4(%rbp)
jmp 0xbaa5
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq -0x14(%rbp), %rdx
leaq 0x742e(%rip), %rcx      # 0x12eb0
cmpq (%rcx,%rdx,8), %rax
jae 0xba91
movl $0x0, -0x4(%rbp)
jmp 0xbaa5
jmp 0xba93
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xba3f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_key_exchange
int crypto_key_exchange(u8       shared_key[32],
                        const u8 your_secret_key [32],
                        const u8 their_public_key[32])
{
    u8 raw_shared_secret[32];
    int status = crypto_x25519(raw_shared_secret,
                               your_secret_key, their_public_key);
    crypto_chacha20_H(shared_key, raw_shared_secret, zero);
    WIPE_BUFFER(raw_shared_secret);
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8790
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq 0x6659(%rip), %rdx      # 0x12590
callq 0x1b90
leaq -0x40(%rbp), %rdi
movl $0x20, %esi
callq 0x1b40
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_lock_init
void crypto_lock_init(crypto_lock_ctx *ctx,
                      const u8 key[32], const u8 nonce[24])
{
    u8 auth_key[64]; // "Wasting" the whole Chacha block is faster
    ctx->ad_phase     = 1;
    ctx->ad_size      = 0;
    ctx->message_size = 0;
    crypto_chacha20_x_init(&ctx->chacha, key, nonce);
    crypto_chacha20_stream(&ctx->chacha, auth_key, 64);
    crypto_poly1305_init  (&ctx->poly  , auth_key);
    WIPE_BUFFER(auth_key);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0x1, 0xe8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xd8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xe0(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x23c0
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
callq 0x2700
movq -0x8(%rbp), %rdi
addq $0x88, %rdi
leaq -0x60(%rbp), %rsi
callq 0x2730
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
callq 0x1b40
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_lock_final
void crypto_lock_final(crypto_lock_ctx *ctx, u8 mac[16])
{
    lock_ad_padding(ctx);
    u8 sizes[16]; // Not secret, not wiped
    store64_le(sizes + 0, ctx->ad_size);
    store64_le(sizes + 8, ctx->message_size);
    crypto_poly1305_update(&ctx->poly, zero, ALIGN(ctx->message_size, 16));
    crypto_poly1305_update(&ctx->poly, sizes, 16);
    crypto_poly1305_final (&ctx->poly, mac);
    WIPE_CTX(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xc0a0
leaq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rsi
callq 0x7ae0
leaq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rsi
callq 0x7ae0
movq -0x8(%rbp), %rdi
addq $0x88, %rdi
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdx
xorq $-0x1, %rdx
addq $0x1, %rdx
andq $0xf, %rdx
leaq 0x63d2(%rip), %rsi      # 0x12590
callq 0x28a0
movq -0x8(%rbp), %rdi
addq $0x88, %rdi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0x28a0
movq -0x8(%rbp), %rdi
addq $0x88, %rdi
movq -0x10(%rbp), %rsi
callq 0x2da0
movq -0x8(%rbp), %rdi
movl $0xf0, %esi
callq 0x1b40
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_unlock_final
int crypto_unlock_final(crypto_lock_ctx *ctx, const u8 mac[16])
{
    u8 real_mac[16];
    crypto_lock_final(ctx, real_mac);
    int mismatch = crypto_verify16(real_mac, mac);
    WIPE_BUFFER(real_mac);
    return mismatch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xc150
leaq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1960
movl %eax, -0x24(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x10, %esi
callq 0x1b40
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_lock_aead
void crypto_lock_aead(u8        mac[16],
                      u8       *cipher_text,
                      const u8  key[32],
                      const u8  nonce[24],
                      const u8 *ad        , size_t ad_size,
                      const u8 *plain_text, size_t text_size)
{
    crypto_lock_ctx ctx;
    crypto_lock_init   (&ctx, key, nonce);
    crypto_lock_auth_ad(&ctx, ad, ad_size);
    crypto_lock_update (&ctx, cipher_text, plain_text, text_size);
    crypto_lock_final  (&ctx, mac);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0xbf60
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0xbff0
movq -0x10(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq 0x18(%rbp), %rcx
leaq -0x120(%rbp), %rdi
callq 0xc100
movq -0x8(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0xc150
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_unlock_aead
int crypto_unlock_aead(u8       *plain_text,
                       const u8  key[32],
                       const u8  nonce[24],
                       const u8  mac[16],
                       const u8 *ad         , size_t ad_size,
                       const u8 *cipher_text, size_t text_size)
{
    crypto_unlock_ctx ctx;
    crypto_unlock_init        (&ctx, key, nonce);
    crypto_unlock_auth_ad     (&ctx, ad, ad_size);
    crypto_unlock_auth_message(&ctx, cipher_text, text_size);
    crypto_chacha_ctx chacha_ctx = ctx.chacha; // avoid the wiping...
    if (crypto_unlock_final(&ctx, mac)) {      // ...that occurs here
        WIPE_CTX(&chacha_ctx);
        return -1; // reject forgeries before wasting our time decrypting
    }
    crypto_chacha20_encrypt(&chacha_ctx, plain_text, cipher_text, text_size);
    WIPE_CTX(&chacha_ctx);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x128(%rbp), %rdi
callq 0xbf60
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x128(%rbp), %rdi
callq 0xbff0
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
leaq -0x128(%rbp), %rdi
callq 0xc040
leaq -0x128(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
movl $0x88, %edx
callq 0x1090
movq -0x28(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0xc260
cmpl $0x0, %eax
je 0xc3ee
leaq -0x1b0(%rbp), %rdi
movl $0x88, %esi
callq 0x1b40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc41e
movq -0x10(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq 0x18(%rbp), %rcx
leaq -0x1b0(%rbp), %rdi
callq 0x2410
leaq -0x1b0(%rbp), %rdi
movl $0x88, %esi
callq 0x1b40
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: chacha20_pool_byte
static u8 chacha20_pool_byte(crypto_chacha_ctx *ctx)
{
    u32 pool_word = ctx->pool[ctx->pool_idx >> 2];
    u8  pool_byte = pool_word >> (8*(ctx->pool_idx & 3));
    ctx->pool_idx++;
    return pool_byte;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x80(%rcx), %rcx
shrq $0x2, %rcx
movl 0x40(%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x80(%rcx), %rcx
andq $0x3, %rcx
shlq $0x3, %rcx
shrl %cl, %eax
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x80(%rax)
movb -0xd(%rbp), %al
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: gidx_refresh
static void gidx_refresh(gidx_ctx *ctx)
{
    // seed the begining of the block...
    ctx->b.a[0] = ctx->pass_number;
    ctx->b.a[1] = 0;  // lane number (we have only one)
    ctx->b.a[2] = ctx->slice_number;
    ctx->b.a[3] = ctx->nb_blocks;
    ctx->b.a[4] = ctx->nb_iterations;
    ctx->b.a[5] = 1;  // type: Argon2i
    ctx->b.a[6] = ctx->ctr;
    FOR (i, 7, 128) { ctx->b.a[i] = 0; } // ...then zero the rest out

    // Shuffle the block thus: ctx->b = G((G(ctx->b, zero)), zero)
    // (G "square" function), to get cheap pseudo-random numbers.
    unary_g(&ctx->b);
    unary_g(&ctx->b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x400(%rax), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x404(%rax), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x408(%rax), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x40c(%rax), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x1, 0x28(%rax)
movq -0x8(%rbp), %rax
movl 0x410(%rax), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq $0x7, -0x10(%rbp)
cmpq $0x80, -0x10(%rbp)
jae 0xc667
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xc63f
movq -0x8(%rbp), %rdi
callq 0xc680
movq -0x8(%rbp), %rdi
callq 0xc680
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: unary_g
static void unary_g(block *work_block)
{
    // work_block == R
    block tmp;
    copy_block(&tmp, work_block); // tmp        = R
    g_rounds(work_block);         // work_block = Z
    xor_block(work_block, &tmp);  // work_block = Z ^ R
    wipe_block(&tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x408(%rbp), %rdi
callq 0x8330
movq -0x8(%rbp), %rdi
callq 0xc6d0
movq -0x8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0xf570
leaq -0x408(%rbp), %rdi
callq 0x8380
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_zero
static void ge_zero(ge *p)
{
    fe_0(p->X);
    fe_1(p->Y);
    fe_1(p->Z);
    fe_0(p->T);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8fa0
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x8f60
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
callq 0x8f60
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
callq 0x8fa0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_double
static void ge_double(ge *s, const ge *p, ge *q)
{
    fe_sq (q->X, p->X);
    fe_sq (q->Y, p->Y);
    fe_sq2(q->Z, p->Z);
    fe_add(q->T, p->X, p->Y);
    fe_sq (s->T, q->T);
    fe_add(q->T, q->Y, q->X);
    fe_sub(q->Y, q->Y, q->X);
    fe_sub(q->X, s->T, q->T);
    fe_sub(q->Z, q->Z, q->Y);

    fe_mul(s->X, q->X , q->Z);
    fe_mul(s->Y, q->T , q->Y);
    fe_mul(s->Z, q->Y , q->Z);
    fe_mul(s->T, q->X , q->T);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9d80
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x9d80
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rsi
addq $0x50, %rsi
callq 0xfd40
movq -0x18(%rbp), %rdi
addq $0x78, %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x28, %rdx
callq 0x9130
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
addq $0x78, %rsi
callq 0x9d80
movq -0x18(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
movq -0x18(%rbp), %rdx
callq 0x9130
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
movq -0x18(%rbp), %rdx
callq 0x90e0
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x78, %rsi
movq -0x18(%rbp), %rdx
addq $0x78, %rdx
callq 0x90e0
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
movq -0x18(%rbp), %rdx
addq $0x28, %rdx
callq 0x90e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x50, %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x78, %rsi
movq -0x18(%rbp), %rdx
addq $0x28, %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
movq -0x18(%rbp), %rdx
addq $0x50, %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x78, %rdx
callq 0x9180
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_madd
static void ge_madd(ge *s, const ge *p, const fe yp, const fe ym, const fe t2,
                    fe a, fe b)
{
    fe_add(a   , p->Y, p->X );
    fe_sub(b   , p->Y, p->X );
    fe_mul(a   , a   , yp   );
    fe_mul(b   , b   , ym   );
    fe_add(s->Y, a   , b    );
    fe_sub(s->X, a   , b    );

    fe_add(s->Z, p->Z, p->Z );
    fe_mul(s->T, p->T, t2   );
    fe_add(a   , s->Z, s->T );
    fe_sub(b   , s->Z, s->T );

    fe_mul(s->T, s->X, s->Y);
    fe_mul(s->X, s->X, b   );
    fe_mul(s->Y, s->Y, a   );
    fe_mul(s->Z, a   , b   );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
movq -0x10(%rbp), %rdx
callq 0x9130
movq 0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
movq -0x10(%rbp), %rdx
callq 0x90e0
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9180
movq 0x10(%rbp), %rdi
movq 0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x9130
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x90e0
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rsi
addq $0x50, %rsi
movq -0x10(%rbp), %rdx
addq $0x50, %rdx
callq 0x9130
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x10(%rbp), %rsi
addq $0x78, %rsi
movq -0x28(%rbp), %rdx
callq 0x9180
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x50, %rsi
movq -0x8(%rbp), %rdx
addq $0x78, %rdx
callq 0x9130
movq 0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x50, %rsi
movq -0x8(%rbp), %rdx
addq $0x78, %rdx
callq 0x90e0
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x28, %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movq -0x8(%rbp), %rsi
addq $0x28, %rsi
movq -0x30(%rbp), %rdx
callq 0x9180
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movq -0x30(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x9180
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: fe_isnegative
static int fe_isnegative(const fe f)
{
    u8 s[32];
    fe_tobytes(s, f);
    u8 isneg = s[0] & 1;
    WIPE_BUFFER(s);
    return isneg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa9b0
movzbl -0x30(%rbp), %eax
andl $0x1, %eax
movb %al, -0x31(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x20, %esi
callq 0x1b40
movzbl -0x31(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: fe_isnonzero
static int fe_isnonzero(const fe f)
{
    u8 s[32];
    fe_tobytes(s, f);
    u8 isnonzero = zerocmp32(s);
    WIPE_BUFFER(s);
    return isnonzero;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa9b0
leaq -0x30(%rbp), %rdi
callq 0xac80
movb %al, -0x31(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x20, %esi
callq 0x1b40
movzbl -0x31(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_precompute
static void ge_precompute(ge_cached lut[8], const ge *P1)
{
    ge P2, tmp;
    ge_double(&P2, P1, &tmp);
    ge_cache(&lut[0], P1);
    FOR (i, 0, 7) {
        ge_add(&tmp, &P2, &lut[i]);
        ge_cache(&lut[i+1], &tmp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
leaq -0x150(%rbp), %rdx
callq 0xf9d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x107f0
movq $0x0, -0x158(%rbp)
cmpq $0x7, -0x158(%rbp)
jae 0x1044a
movq -0x8(%rbp), %rdx
imulq $0xa0, -0x158(%rbp), %rax
addq %rax, %rdx
leaq -0x150(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x105e0
movq -0x8(%rbp), %rdi
movq -0x158(%rbp), %rax
addq $0x1, %rax
imulq $0xa0, %rax, %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
callq 0x107f0
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x103e2
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: slide
static void slide(i8 adds[258], const u8 scalar[32])
{
    FOR (i,   0, 256) { adds[i] = scalar_bit(scalar, i); }
    FOR (i, 256, 258) { adds[i] = 0;                     }
    FOR (i, 0, 254) {
        if (adds[i] != 0) {
            // base value of the 5-bit window
            FOR (j, 1, 5) {
                adds[i  ] |= adds[i+j] << j;
                adds[i+j]  = 0;
            }
            if (adds[i] > 16) {
                // go back to [-15, 15], propagate carry.
                adds[i] -= 32;
                int j = i + 5;
                while (adds[j] != 0) {
                    adds[j] = 0;
                    j++;
                }
                adds[j] = 1;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x100, -0x18(%rbp)     # imm = 0x100
jae 0x104ac
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
callq 0x9030
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10478
movq $0x100, -0x20(%rbp)     # imm = 0x100
cmpq $0x102, -0x20(%rbp)     # imm = 0x102
jae 0x104d8
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x104b4
movq $0x0, -0x28(%rbp)
cmpq $0xfe, -0x28(%rbp)
jae 0x105d0
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x105bd
movq $0x1, -0x30(%rbp)
cmpq $0x5, -0x30(%rbp)
jae 0x10559
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
addq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movq -0x30(%rbp), %rax
movl %eax, %ecx
shll %cl, %esi
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
addq -0x30(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1050b
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x10, %eax
jle 0x105bb
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edx
subl $0x20, %edx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x5, %rax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x105af
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x10587
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x105bd
jmp 0x105bf
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x104e0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)