LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: chacha20_refill_pool
static void chacha20_refill_pool(crypto_chacha_ctx *ctx)
{
    chacha20_rounds(ctx->pool, ctx->input);
    FOR (j, 0, 16) {
        ctx->pool[j] += ctx->input[j];
    }
    ctx->pool_idx = 0;
    ctx->input[12]++;
    if (ctx->input[12] == 0) {
        ctx->input[13]++;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x40(%rdi), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18a8
xorl %eax, %eax
movdqu -0x40(%r14,%rax,4), %xmm0
movdqu (%r14,%rax,4), %xmm1
paddd %xmm0, %xmm1
movdqu %xmm1, (%r14,%rax,4)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x1cfb
movq $0x0, 0x80(%rbx)
incl 0x30(%rbx)
jne 0x1d2f
incl 0x34(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_poly1305_init
void crypto_poly1305_init(crypto_poly1305_ctx *ctx, const u8 key[32])
{
    // Initial hash is zero
    FOR (i, 0, 5) {
        ctx->h[i] = 0;
    }
    // add 2^130 to every input block
    ctx->c[4] = 1;
    poly_clear_c(ctx);
    // load r and pad (r has some of its bits cleared)
    FOR (i, 0, 1) { ctx->r  [0] = load32_le(key           ) & 0x0fffffff; }
    FOR (i, 1, 4) { ctx->r  [i] = load32_le(key + i*4     ) & 0x0ffffffc; }
    FOR (i, 0, 4) { ctx->pad[i] = load32_le(key + i*4 + 16);              }
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x0, 0x20(%rdi)
movl $0x1, 0x34(%rdi)
movq $0x0, 0x48(%rdi)
movups %xmm0, 0x24(%rdi)
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
andl (%rsi), %eax
movl %eax, (%rdi)
movl $0x1, %eax
movl $0xffffffc, %ecx        # imm = 0xFFFFFFC
movl (%rsi,%rax,4), %edx
andl %ecx, %edx
movl %edx, (%rdi,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1d75
xorl %eax, %eax
movl 0x10(%rsi,%rax,4), %ecx
movl %ecx, 0x38(%rdi,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1d88
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_poly1305_update
void crypto_poly1305_update(crypto_poly1305_ctx *ctx,
                            const u8 *message, size_t message_size)
{
    // Align ourselves with block boundaries
    size_t align = MIN(ALIGN(ctx->c_idx, 16), message_size);
    poly_update(ctx, message, align);
    message      += align;
    message_size -= align;

    // Process the message block by block
    size_t nb_blocks = message_size >> 4;
    FOR (i, 0, nb_blocks) {
        ctx->c[0] = load32_le(message +  0);
        ctx->c[1] = load32_le(message +  4);
        ctx->c[2] = load32_le(message +  8);
        ctx->c[3] = load32_le(message + 12);
        poly_block(ctx);
        message += 16;
    }
    if (nb_blocks > 0) {
        poly_clear_c(ctx);
    }
    message_size &= 15;

    // remaining bytes
    poly_update(ctx, message, message_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
subl 0x48(%rdi), %r12d
andl $0xf, %r12d
cmpq %rdx, %r12
cmovaeq %rdx, %r12
movq %r12, %rdx
callq 0x1e37
addq %r12, %r14
subq %r12, %rbx
cmpq $0x10, %rbx
jb 0x1e1e
movq %rbx, %r12
shrq $0x4, %r12
movl (%r14), %eax
movl %eax, 0x24(%r15)
movl 0x4(%r14), %eax
movl %eax, 0x28(%r15)
movl 0x8(%r14), %eax
movl %eax, 0x2c(%r15)
movl 0xc(%r14), %eax
movl %eax, 0x30(%r15)
movq %r15, %rdi
callq 0x1eac
addq $0x10, %r14
decq %r12
jne 0x1dd8
cmpq $0x10, %rbx
jb 0x1e1e
movq $0x0, 0x48(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x24(%r15)
andl $0xf, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1e37
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: poly_update
static void poly_update(crypto_poly1305_ctx *ctx,
                        const u8 *message, size_t message_size)
{
    FOR (i, 0, message_size) {
        poly_take_input(ctx, message[i]);
        if (ctx->c_idx == 16) {
            poly_block(ctx);
            poly_clear_c(ctx);
        }
    }
}

// Assembly:
testq %rdx, %rdx
je 0x1eab
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x24(%rdi), %r12
movq 0x48(%rdi), %rax
xorl %r13d, %r13d
movzbl (%r14,%r13), %edx
leal (,%rax,8), %ecx
shll %cl, %edx
movq %rax, %rcx
andq $-0x4, %rcx
orl %edx, 0x24(%r15,%rcx)
incq %rax
movq %rax, 0x48(%r15)
cmpq $0x10, %rax
jne 0x1e9a
movq %r15, %rdi
callq 0x1eac
movq $0x0, 0x48(%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
xorl %eax, %eax
incq %r13
cmpq %r13, %rbx
jne 0x1e59
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_blake2b_general_init
void crypto_blake2b_general_init(crypto_blake2b_ctx *ctx, size_t hash_size,
                                 const u8           *key, size_t key_size)
{
    // initial hash
    FOR (i, 0, 8) {
        ctx->hash[i] = iv[i];
    }
    ctx->hash[0] ^= 0x01010000 ^ (key_size << 8) ^ hash_size;

    ctx->input_offset[0] = 0;         // begining of the input, no offset
    ctx->input_offset[1] = 0;         // begining of the input, no offset
    ctx->hash_size       = hash_size; // remember the hash size we want
    ctx->input_idx       = 0;

    // if there is a key, the first block is that key (padded with zeroes)
    if (key_size > 0) {
        crypto_blake2b_update(ctx, key ,       key_size);
        crypto_blake2b_update(ctx, zero, 128 - key_size);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movaps 0x7405(%rip), %xmm0     # 0x95c0
movups %xmm0, (%rdi)
movaps 0x742b(%rip), %xmm0     # 0x95f0
movups %xmm0, 0x30(%rdi)
movaps 0x7410(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x20(%rdi)
movaps 0x73f5(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x10(%rdi)
movq %rcx, %rax
shlq $0x8, %rax
xorq %rsi, %rax
movabsq $0x6a09e667f2bdc908, %rcx # imm = 0x6A09E667F2BDC908
xorq %rax, %rcx
movq %rcx, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq %rsi, 0xd8(%rdi)
movq $0x0, 0xd0(%rdi)
testq %rbx, %rbx
je 0x2243
movq %rdi, %r14
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x224b
movl $0x80, %edx
subq %rbx, %rdx
leaq 0x73cc(%rip), %rsi      # 0x9600
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x224b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_blake2b_update
void crypto_blake2b_update(crypto_blake2b_ctx *ctx,
                           const u8 *message, size_t message_size)
{
    // Align ourselves with block boundaries
    size_t align = MIN(ALIGN(ctx->input_idx, 128), message_size);
    blake2b_update(ctx, message, align);
    message      += align;
    message_size -= align;

    // Process the message block by block
    FOR (i, 0, message_size >> 7) { // number of blocks
        blake2b_end_block(ctx);
        FOR (j, 0, 16) {
            ctx->input[j] = load64_le(message + j*8);
        }
        message += 128;
        ctx->input_idx = 128;
    }
    message_size &= 127;

    // remaining bytes
    blake2b_update(ctx, message, message_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
subl 0xd0(%rdi), %r12d
andl $0x7f, %r12d
cmpq %rdx, %r12
cmovaeq %rdx, %r12
movq %r12, %rdx
callq 0x233a
addq %r12, %r14
subq %r12, %rbx
cmpq $0x80, %rbx
jb 0x22c8
movq %rbx, %r12
shrq $0x7, %r12
xorl %r13d, %r13d
movl $0x80, %ebp
movq %r15, %rdi
callq 0x23d3
xorl %eax, %eax
movq (%r14,%rax,8), %rcx
movq %rcx, 0x50(%r15,%rax,8)
incq %rax
cmpq $0x10, %rax
jne 0x22a4
addq %rbp, %r14
movq %rbp, 0xd0(%r15)
incq %r13
cmpq %r12, %r13
jne 0x229a
andl $0x7f, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x233a
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: blake2b_update
static void blake2b_update(crypto_blake2b_ctx *ctx,
                           const u8 *message, size_t message_size)
{
    FOR (i, 0, message_size) {
        blake2b_end_block(ctx);
        blake2b_set_input(ctx, message[i], ctx->input_idx);
        ctx->input_idx++;
    }
}

// Assembly:
testq %rdx, %rdx
je 0x23d2
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x50(%rdi), %r12
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x23d3
movzbl (%r14,%r13), %eax
movq 0xd0(%r15), %rdx
testq %rdx, %rdx
jne 0x23a7
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r12)
movups %xmm0, 0x60(%r12)
movups %xmm0, 0x50(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
leal (,%rdx,8), %ecx
shlq %cl, %rax
andq $-0x8, %rdx
orq %rax, 0x50(%r15,%rdx)
incq 0xd0(%r15)
incq %r13
cmpq %r13, %rbx
jne 0x235c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: blake2b_end_block
static void blake2b_end_block(crypto_blake2b_ctx *ctx)
{
    if (ctx->input_idx == 128) {  // If buffer is full,
        blake2b_incr(ctx);        // update the input offset
        blake2b_compress(ctx, 0); // and compress the (not last) block
        ctx->input_idx = 0;
    }
}

// Assembly:
cmpq $0x80, 0xd0(%rdi)
jne 0x240c
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
subq $-0x80, %rax
movq %rax, 0x40(%rdi)
jb 0x23f6
incq 0x48(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24f9
movq $0x0, 0xd0(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0xd0(%rdi), %rax
cmpq $0x7f, %rax
ja 0x245e
leaq 0x50(%rbx), %rcx
xorps %xmm0, %xmm0
movq %rax, %rdx
testq %rdx, %rdx
jne 0x2452
movups %xmm0, 0x70(%rcx)
movups %xmm0, 0x60(%rcx)
movups %xmm0, 0x50(%rcx)
movups %xmm0, 0x40(%rcx)
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
incq %rdx
cmpq $0x80, %rdx
jne 0x242e
addq %rax, 0x40(%rbx)
jae 0x2468
incq 0x48(%rbx)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x24f9
movq 0xd8(%rbx), %rax
movq %rax, %rcx
cmpq $0x8, %rax
jb 0x24a5
movq %rax, %rcx
shrq $0x3, %rcx
xorl %edx, %edx
movq (%rbx,%rdx,8), %rsi
movq %rsi, (%r14,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x248e
movq 0xd8(%rbx), %rcx
movq %rax, %rdx
andq $-0x8, %rdx
cmpq %rcx, %rdx
jae 0x24e0
shlq $0x3, %rax
andq $-0x40, %rax
movq %rdx, %rcx
andq $-0x8, %rcx
movq (%rbx,%rcx), %rsi
movl %eax, %ecx
andb $0x38, %cl
shrq %cl, %rsi
movb %sil, (%r14,%rdx)
incq %rdx
addq $0x8, %rax
cmpq 0xd8(%rbx), %rdx
jb 0x24b9
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0xe0, %rax
jne 0x24e2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: blake_update_32
static void blake_update_32(crypto_blake2b_ctx *ctx, u32 input)
{
    u8 buf[4];
    store32_le(buf, input);
    crypto_blake2b_update(ctx, buf, 4);
    WIPE_BUFFER(buf);
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
movl $0x4, %edx
movq %rax, %rsi
callq 0x224b
xorl %eax, %eax
movb $0x0, 0x4(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x41f0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x40, %esi
movl $0x40, %eax
cmovbl %esi, %eax
movaps 0x5395(%rip), %xmm0     # 0x95c0
movq %rsp, %r12
movaps %xmm0, (%r12)
movaps 0x53b6(%rip), %xmm0     # 0x95f0
movaps %xmm0, 0x30(%r12)
movaps 0x5399(%rip), %xmm0     # 0x95e0
movaps %xmm0, 0x20(%r12)
movaps 0x537c(%rip), %xmm0     # 0x95d0
movaps %xmm0, 0x10(%r12)
movabsq $0x6a09e667f2bdc908, %rcx # imm = 0x6A09E667F2BDC908
xorq %rax, %rcx
movq %rcx, (%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%r12)
movq %rax, 0xd8(%r12)
movq $0x0, 0xd0(%r12)
movq %r12, %rdi
callq 0x41d9
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x224b
movq %r12, %rdi
movq %r14, %rsi
callq 0x240d
cmpl $0x41, %ebx
jb 0x4327
movl %ebx, %r12d
addq $0x1f, %r12
shrq $0x5, %r12
leal -0x2(%r12), %ebp
cmpl $0x2, %ebp
jb 0x42ff
addl $-0x3, %r12d
movl $0x20, %r15d
leal -0x20(%r15), %r8d
movl %r15d, %edi
addq %r14, %rdi
addq %r14, %r8
movl $0x40, %esi
movl $0x40, %r9d
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3b6d
addl $0x20, %r15d
decl %r12d
jne 0x42cc
movl %r15d, %edi
addl $-0x20, %r15d
jmp 0x4307
movl $0x20, %edi
xorl %r15d, %r15d
addq %r14, %rdi
shll $0x5, %ebp
subl %ebp, %ebx
addq %r14, %r15
movl $0x40, %r9d
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x3b6d
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r8
movq %rdi, %rbx
xorl %r12d, %r12d
movq %rsp, %r14
movl $0x40, %esi
movl $0x20, %r9d
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3b6d
andb $-0x8, (%r14)
movb 0x1f(%r14), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%r14)
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5baf
movq %rbx, %rdi
movq %r15, %rsi
callq 0x603c
movb $0x0, (%rsp,%r12)
incq %r12
cmpq $0x40, %r12
jne 0x5b80
xorl %eax, %eax
movb $0x0, 0x48(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x5b90
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x50, %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0x5662
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x494b
addq $0x28, %r14
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x494b
movq %rbx, %rdi
movq %r13, %rsi
callq 0x58dc
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x58dc
xorl %ecx, %ecx
movb (%r14), %al
movb $0x0, (%rsp,%rcx)
incq %rcx
cmpq $0x20, %rcx
jne 0x60ae
shlb $0x7, %al
xorb %al, 0x1f(%rbx)
xorl %eax, %eax
movb $0x0, 0x80(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x60c3
xorl %eax, %eax
movb $0x0, 0x50(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x60d6
xorl %eax, %eax
movb $0x0, 0x20(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x60e6
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0xe0, %rdi
movl $0x40, %esi
movl $0x20, %r9d
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x3b6d
andb $-0x8, 0xe0(%rbx)
movb 0xff(%rbx), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0xff(%rbx)
leaq 0x140(%rbx), %rdi
testq %r14, %r14
je 0x6168
xorl %eax, %eax
movb (%r14,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x6156
jmp 0x6170
movq %r15, %rsi
callq 0x5b24
leaq 0x100(%rbx), %rsi
movaps 0x3442(%rip), %xmm0     # 0x95c0
movups %xmm0, (%rbx)
movaps 0x3468(%rip), %xmm0     # 0x95f0
movups %xmm0, 0x30(%rbx)
movaps 0x344d(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x20(%rbx)
movaps 0x3432(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x10(%rbx)
movabsq $0x6a09e667f2bdc948, %rax # imm = 0x6A09E667F2BDC948
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq $0x40, 0xd8(%rbx)
movq $0x0, 0xd0(%rbx)
movl $0x20, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x224b
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x100(%rdi), %r15
leaq 0x120(%rdi), %r14
movq %r15, %rsi
callq 0x240d
movq %r15, %rdi
callq 0x62c6
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5baf
movq %r14, %rdi
movq %r12, %rsi
callq 0x603c
xorl %eax, %eax
movb $0x0, 0x8(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x622f
movaps 0x337a(%rip), %xmm0     # 0x95c0
movups %xmm0, (%rbx)
movaps 0x33a0(%rip), %xmm0     # 0x95f0
movups %xmm0, 0x30(%rbx)
movaps 0x3385(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x20(%rbx)
movaps 0x336a(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x10(%rbx)
movabsq $0x6a09e667f2bdc948, %rax # imm = 0x6A09E667F2BDC948
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq $0x40, 0xd8(%rbx)
movq $0x0, 0xd0(%rbx)
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x224b
leaq 0x140(%rbx), %rsi
movl $0x20, %edx
movq %rbx, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x224b
// File: /workspace/github_c_makefile_star2_O3/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:
subq $0x208, %rsp            # imm = 0x208
xorl %eax, %eax
movzbl (%rdi,%rax), %ecx
movq %rcx, (%rsp,%rax,8)
movb $0x0, (%rdi,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x62cf
movq %rsp, %rsi
callq 0x80be
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x62ee
addq $0x208, %rsp            # imm = 0x208
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rsi
callq 0x240d
movq %r15, %rdi
callq 0x62c6
xorl %eax, %eax
movb 0x120(%rbx,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x6329
leaq 0xe0(%rbx), %rdx
leaq 0x100(%rbx), %rcx
addq $0x20, %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6384
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0x160, %rax            # imm = 0x160
jne 0x635c
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x636d
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %eax, %eax
movzbl (%rcx,%rax), %edx
movq %rdx, (%rsp,%rax,8)
incq %rax
cmpq $0x20, %rax
jne 0x639d
leaq 0x100(%rsp), %rdi
xorl %r12d, %r12d
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1070
movq %rsp, %rax
pxor %xmm0, %xmm0
movzbl (%r15,%r12), %ecx
movd %ecx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
xorl %ecx, %ecx
movzwl (%r14,%rcx), %edx
movd %edx, %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
pshufd $0xd4, %xmm2, %xmm2     # xmm2 = xmm2[0,1,1,3]
pmuludq %xmm1, %xmm2
movdqu (%rax,%rcx,8), %xmm3
paddq %xmm2, %xmm3
movdqu %xmm3, (%rax,%rcx,8)
addq $0x2, %rcx
cmpq $0x20, %rcx
jne 0x63dc
incq %r12
addq $0x8, %rax
cmpq $0x20, %r12
jne 0x63cc
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x80be
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x6428
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x6105
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x224b
movq %r12, %rdi
callq 0x61e3
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x224b
movq %r12, %rdi
movq %r15, %rsi
callq 0x6305
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
xorl %eax, %eax
movb (%rsi,%rax), %cl
movb %cl, 0xe0(%r14,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x64b4
xorl %eax, %eax
movb (%rbx,%rax), %cl
movb %cl, 0x120(%r14,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x64ca
movaps 0x30db(%rip), %xmm0     # 0x95c0
movups %xmm0, (%r14)
movaps 0x3100(%rip), %xmm0     # 0x95f0
movups %xmm0, 0x30(%r14)
movaps 0x30e4(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x20(%r14)
movaps 0x30c8(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x10(%r14)
movabsq $0x6a09e667f2bdc948, %rax # imm = 0x6A09E667F2BDC948
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r14)
movq $0x40, 0xd8(%r14)
movq $0x0, 0xd0(%r14)
movl $0x20, %edx
movq %r14, %rdi
callq 0x224b
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x224b
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x4362
movl %eax, %ebx
leaq 0x27ea(%rip), %rdx      # 0x9600
movq %r14, %rdi
movq %r15, %rsi
callq 0x182a
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x6e23
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movl $0x1, 0xe8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
callq 0x1b22
xorl %r15d, %r15d
movq %rsp, %r14
movl $0x40, %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1b94
addq $0x88, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d41
movb $0x0, (%rsp,%r15)
incq %r15
cmpq $0x40, %r15
jne 0x6e8b
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0xe8(%rdi)
je 0x6f8a
xorl %edx, %edx
movl %edx, 0xe8(%rbx)
leaq 0x88(%rbx), %rdi
subl 0xd8(%rbx), %edx
andl $0xf, %edx
leaq 0x267b(%rip), %rsi      # 0x9600
callq 0x1d9a
movq 0xd8(%rbx), %rax
movq %rsp, %r15
movq %rax, (%r15)
movq 0xe0(%rbx), %rdx
movq %rdx, 0x8(%r15)
leaq 0x88(%rbx), %r12
negl %edx
andl $0xf, %edx
leaq 0x264b(%rip), %rsi      # 0x9600
movq %r12, %rdi
callq 0x1d9a
movl $0x10, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1d9a
movq %r12, %rdi
movq %r14, %rsi
callq 0x204a
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0xf0, %rax
jne 0x6fda
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x6f4c
movq (%r14), %rcx
movq 0x8(%r14), %rsi
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
xorl %edi, %edi
movb $0x0, (%rsp,%rdi)
incq %rdi
cmpq $0x10, %rdi
jne 0x7055
xorq %rsi, %rdx
xorq %rcx, %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x20, %rcx
movl %eax, %edx
orq %rcx, %rdx
decq %rdx
xorl %eax, %eax
btq $0x20, %rdx
adcl $-0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x6e3c
leaq 0x90(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1d9a
addq %r14, 0x50(%rbp)
movq %r13, %rdi
movq %r12, %rsi
movq 0x130(%rsp), %rdx
movq 0x138(%rsp), %r14
movq %r14, %rcx
callq 0x1b94
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x6ec8
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6f4c
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r9, %r13
movq %r8, %rbp
movq %rcx, %r12
movq %rdi, 0x8(%rsp)
movq 0x1c0(%rsp), %r14
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x6e3c
leaq 0x120(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x1d9a
addq %r13, 0x50(%r15)
movq 0x1c8(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6ec8
leaq 0x10(%rsp), %rdi
movl $0x88, %edx
movq %rbx, %rsi
callq 0x10b0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7030
testl %eax, %eax
je 0x71c0
xorl %eax, %eax
movb $0x0, 0x10(%rsp,%rax)
incq %rax
cmpq $0x88, %rax
jne 0x71a9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x71ea
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1b94
xorl %eax, %eax
xorl %ecx, %ecx
movb $0x0, 0x10(%rsp,%rcx)
incq %rcx
cmpq $0x88, %rcx
jne 0x71d9
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movl 0x400(%rdi), %eax
movl 0x40c(%rdi), %ecx
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movsd 0x404(%rdi), %xmm0
xorps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movups %xmm0, 0x10(%rdi)
movq %rcx, 0x20(%rdi)
movq $0x1, 0x28(%rdi)
movl 0x410(%rdi), %eax
movq %rax, 0x30(%rdi)
addq $0x38, %rdi
movl $0x3c8, %edx            # imm = 0x3C8
xorl %esi, %esi
callq 0x1070
movq %rbx, %rdi
callq 0x7293
movq %rbx, %rdi
popq %rbx
jmp 0x7293
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x72f1
xorl %eax, %eax
movups (%rsp,%rax,8), %xmm0
movups (%rbx,%rax,8), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%rbx,%rax,8)
addq $0x2, %rax
cmpq $0x80, %rax
jne 0x72b8
xorl %eax, %eax
movq $0x0, (%rsp,%rax,8)
incq %rax
cmpq $0x80, %rax
jne 0x72d5
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq %rdx, %rdi
callq 0x517b
leaq 0x28(%rbx), %r15
leaq 0x28(%r13), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x517b
leaq 0x50(%rbx), %r12
addq $0x50, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x517b
movq %r12, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x7e30
leaq 0x78(%rbx), %r13
movq $-0x28, %rax
movl 0x28(%rbp,%rax), %ecx
addl (%rbp,%rax), %ecx
movl %ecx, 0xa0(%rbx,%rax)
addq $0x4, %rax
jne 0x7ff6
leaq 0x78(%r14), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x517b
xorl %eax, %eax
movl (%rbx,%rax,4), %ecx
addl 0x28(%rbx,%rax,4), %ecx
movl %ecx, 0x78(%rbx,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x801c
movl $0xa, %eax
movl -0x28(%rbx,%rax,4), %ecx
subl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x14, %rax
jne 0x8035
movl $0x1e, %eax
movl (%r14,%rax,4), %ecx
subl (%rbx,%rax,4), %ecx
movl %ecx, -0x78(%rbx,%rax,4)
incq %rax
cmpq $0x28, %rax
jne 0x804a
movl $0x14, %eax
movl -0x28(%rbx,%rax,4), %ecx
subl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x1e, %rax
jne 0x8063
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x494b
leaq 0x28(%r14), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x494b
addq $0x50, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x494b
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x494b
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: modL
static void modL(u8 *r, i64 x[64])
{
    for (unsigned i = 63; i >= 32; i--) {
        i64 carry = 0;
        FOR (j, i-32, i-12) {
            x[j] += carry - 16 * x[i] * L[j - (i - 32)];
            carry = (x[j] + 128) >> 8;
            x[j] -= carry * (1 << 8);
        }
        x[i-12] += carry;
        x[i] = 0;
    }
    i64 carry = 0;
    FOR (i, 0, 32) {
        x[i] += carry - (x[31] >> 4) * L[i];
        carry = x[i] >> 8;
        x[i] &= 255;
    }
    FOR (i, 0, 32) {
        x[i] -= carry * L[i];
    }
    FOR (i, 0, 32) {
        x[i+1] += x[i] >> 8;
        r[i  ]  = x[i] & 255;
    }
}

// Assembly:
leaq 0xf8(%rsi), %rcx
movl $0x3f, %edx
leaq 0x1d8f(%rip), %rax      # 0x9e60
leaq -0x20(%rdx), %r8
leaq -0xc(%rdx), %r9
cmpq %r9, %r8
jae 0x812a
xorl %r9d, %r9d
xorl %r8d, %r8d
movq (%rsi,%rdx,8), %r10
imulq (%r9,%rax), %r10
shlq $0x4, %r10
subq %r10, %r8
movq (%rcx,%r9), %r10
leaq (%r8,%r10), %r11
addq %r8, %r10
addq $0x80, %r10
movq %r10, %r8
sarq $0x8, %r8
andq $-0x100, %r10
subq %r10, %r11
movq %r11, (%rcx,%r9)
addq $0x8, %r9
cmpq $0xa0, %r9
jne 0x80e4
jmp 0x812d
xorl %r8d, %r8d
addq %r8, -0x60(%rsi,%rdx,8)
movq $0x0, (%rsi,%rdx,8)
decq %rdx
addq $-0x8, %rcx
cmpq $0x1f, %rdx
ja 0x80d1
xorl %ecx, %ecx
xorl %edx, %edx
movq 0xf8(%rsi), %r8
sarq $0x4, %r8
imulq (%rcx,%rax), %r8
subq %r8, %rdx
addq (%rsi,%rcx), %rdx
movzbl %dl, %r8d
sarq $0x8, %rdx
movq %r8, (%rsi,%rcx)
addq $0x8, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x814b
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa %xmm0, %xmm1
psrlq $0x20, %xmm1
movdqa (%rcx,%rax), %xmm2
movdqa %xmm2, %xmm3
pmuludq %xmm1, %xmm3
movdqa %xmm2, %xmm4
psrlq $0x20, %xmm4
pmuludq %xmm0, %xmm4
paddq %xmm3, %xmm4
psllq $0x20, %xmm4
pmuludq %xmm0, %xmm2
paddq %xmm4, %xmm2
movdqu (%rsi,%rcx), %xmm3
psubq %xmm2, %xmm3
movdqu %xmm3, (%rsi,%rcx)
addq $0x10, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x8190
xorl %eax, %eax
movq (%rsi,%rax,8), %rcx
movq %rcx, %rdx
sarq $0x8, %rdx
addq %rdx, 0x8(%rsi,%rax,8)
movb %cl, (%rdi,%rax)
leaq 0x1(%rax), %rcx
movq %rcx, %rax
cmpq $0x20, %rcx
jne 0x81d8
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movq %rdi, %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x58dc
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
xorl %edi, %edi
movq 0x18(%rbx), %rsi
movb $0x0, (%rsp,%rdi)
incq %rdi
cmpq $0x20, %rdi
jne 0x821d
orq %rcx, %rax
orq %rdx, %rax
orq %rsi, %rax
movq %rax, %rcx
shrq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
decq %rax
xorl %ecx, %ecx
btq $0x20, %rax
adcl $-0x1, %ecx
movzbl %cl, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %r12
movq %rdi, %rbx
leaq 0xa8(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x7f99
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8542
movl $0x7, %r12d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x836d
addq $0xa0, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8542
decq %r12
jne 0x8292
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorl %eax, %eax
movq %rax, %rcx
shrq $0x3, %rcx
movzbl (%rsi,%rcx), %ecx
movl %eax, %edx
andl $0x7, %edx
btl %edx, %ecx
setb (%rdi,%rax)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x82c8
movw $0x0, 0x100(%rdi)
leaq 0x5(%rdi), %rax
xorl %edx, %edx
movq %rdi, %rsi
movb (%rdi,%rdx), %r8b
testb %r8b, %r8b
je 0x835a
movl $0x1, %ecx
movzbl (%rsi,%rcx), %r9d
shll %cl, %r9d
orb %r9b, %r8b
movb $0x0, (%rsi,%rcx)
incq %rcx
cmpq $0x5, %rcx
jne 0x830a
movb %r8b, (%rdi,%rdx)
cmpb $0x10, %r8b
jle 0x835a
addb $-0x20, %r8b
movb %r8b, (%rdi,%rdx)
leal 0x5(%rdx), %ecx
cmpb $0x0, (%rdi,%rcx)
je 0x8354
movq %rax, %r8
movb $0x0, (%r8)
leaq 0x1(%r8), %rcx
cmpb $0x0, 0x1(%r8)
movq %rcx, %r8
jne 0x8340
jmp 0x8357
addq %rdi, %rcx
movb $0x1, (%rcx)
incq %rdx
incq %rsi
incq %rax
cmpq $0xfe, %rdx
jne 0x82fc
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_add
static void ge_add(ge *s, const ge *p, const ge_cached *q)
{
    fe a, b; // not used to process secrets, no need to wipe
    fe_add(a   , p->Y, p->X );
    fe_sub(b   , p->Y, p->X );
    fe_mul(a   , a   , q->Yp);
    fe_mul(b   , b   , q->Ym);
    fe_add(s->Y, a   , b    );
    fe_sub(s->X, a   , b    );

    fe_add(s->Z, p->Z, p->Z );
    fe_mul(s->Z, s->Z, q->Z );
    fe_mul(s->T, p->T, q->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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
xorl %eax, %eax
movl (%r12,%rax,4), %ecx
addl 0x28(%r12,%rax,4), %ecx
movl %ecx, 0x30(%rsp,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x8386
xorl %eax, %eax
movl 0x28(%r12,%rax,4), %ecx
subl (%r12,%rax,4), %ecx
movl %ecx, (%rsp,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x839e
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movq %r14, %rdx
callq 0x494b
leaq 0x28(%r14), %rdx
movq %rsp, %rdi
movq %rdi, %rsi
callq 0x494b
leaq 0x28(%rbx), %r15
xorl %eax, %eax
movl (%rsp,%rax,4), %ecx
addl 0x30(%rsp,%rax,4), %ecx
movl %ecx, 0x28(%rbx,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x83d8
xorl %eax, %eax
movl 0x30(%rsp,%rax,4), %ecx
subl (%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x83ee
leaq 0x50(%rbx), %r13
movl $0x14, %eax
movl (%r12,%rax,4), %ecx
addl %ecx, %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x1e, %rax
jne 0x840a
leaq 0x50(%r14), %rdx
movq %r13, %rdi
movq %r13, %rsi
callq 0x494b
leaq 0x78(%rbx), %rbp
addq $0x78, %r12
addq $0x78, %r14
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x494b
movl $0x14, %eax
movl 0x28(%rbx,%rax,4), %ecx
addl (%rbx,%rax,4), %ecx
movl %ecx, -0x20(%rsp,%rax,4)
incq %rax
cmpq $0x1e, %rax
jne 0x844a
movl $0x14, %eax
movl (%rbx,%rax,4), %ecx
subl 0x28(%rbx,%rax,4), %ecx
movl %ecx, -0x50(%rsp,%rax,4)
incq %rax
cmpq $0x1e, %rax
jne 0x8463
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x494b
movq %rsp, %r14
movq %rbx, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x494b
leaq 0x30(%rsp), %rbx
movq %r15, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x494b
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x494b
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_cache
static void ge_cache(ge_cached *c, const ge *p)
{
    static const fe D2 = { // - 2 * 121665 / 121666
        -21827239, -5839606, -30745221, 13898782, 229458,
        15978800, -12551817, -6495438, 29715968, 9444199
    };
    fe_add (c->Yp, p->Y, p->X);
    fe_sub (c->Ym, p->Y, p->X);
    fe_copy(c->Z , p->Z      );
    fe_mul (c->T2, p->T, D2  );
}

// Assembly:
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
addl 0x28(%rsi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x8544
xorl %eax, %eax
movl 0x28(%rsi,%rax,4), %ecx
subl (%rsi,%rax,4), %ecx
movl %ecx, 0x28(%rdi,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x8559
xorl %eax, %eax
movl 0x50(%rsi,%rax,4), %ecx
movl %ecx, 0x50(%rdi,%rax,4)
incq %rax
cmpq $0xa, %rax
jne 0x856f
addq $0x78, %rdi
addq $0x78, %rsi
leaq 0x1a91(%rip), %rdx      # 0xa020
jmp 0x494b
// File: /workspace/github_c_makefile_star2_O3/LoupVaillant[P]Monocypher-Utils/src/sha512.c
// Function: crypto_sha512_update
void crypto_sha512_update(crypto_sha512_ctx *ctx,
                          const u8 *message, size_t message_size)
{
    // Align ourselves with block boundaries
    size_t align = MIN(ALIGN(ctx->input_idx, 128), message_size);
    sha512_update(ctx, message, align);
    message      += align;
    message_size -= align;

    // Process the message block by block
    FOR (i, 0, message_size / 128) { // number of blocks
        FOR (j, 0, 16) {
            ctx->input[j] = load64_be(message + j*8);
        }
        message        += 128;
        ctx->input_idx += 128;
        sha512_end_block(ctx);
    }
    message_size &= 127;

    // remaining bytes
    sha512_update(ctx, message, message_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
subl 0x350(%rdi), %r12d
andl $0x7f, %r12d
cmpq %rdx, %r12
cmovaeq %rdx, %r12
movq %r12, %rdx
callq 0x86c7
addq %r12, %r14
subq %r12, %rbx
cmpq $0x80, %rbx
jb 0x86b0
movq %rbx, %r12
shrq $0x7, %r12
xorl %r13d, %r13d
xorl %eax, %eax
movq (%r14,%rax,8), %rcx
bswapq %rcx
movq %rcx, 0x2c0(%r15,%rax,8)
incq %rax
cmpq $0x10, %rax
jne 0x867c
subq $-0x80, %r14
subq $-0x80, 0x350(%r15)
movq %r15, %rdi
callq 0x8766
incq %r13
cmpq %r12, %r13
jne 0x867a
andl $0x7f, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86c7