LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tcache.c
// Function: je_tcache_arena_associate
void
tcache_arena_associate(tcache_t *tcache, arena_t *arena)
{

	if (config_stats) {
		/* Link into list of extant tcaches. */
		malloc_mutex_lock(&arena->lock);
		ql_elm_new(tcache, link);
		ql_tail_insert(&arena->tcache_ql, tcache, link);
		malloc_mutex_unlock(&arena->lock);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x8(%rsi), %r14
movq %r14, %rdi
callq 0x12960
movq %r15, (%r15)
movq %r15, 0x8(%r15)
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0x4ec3f
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq %rax, (%r15)
movq %r15, (%rcx)
movq %r15, 0x8(%rax)
movq (%r15), %rax
movq %rax, 0xa8(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x125c0
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tcache.c
// Function: je_tcache_arena_dissociate
void
tcache_arena_dissociate(tcache_t *tcache, arena_t *arena)
{

	if (config_stats) {
		/* Unlink from list of extant tcaches. */
		malloc_mutex_lock(&arena->lock);
		if (config_debug) {
			bool in_ql = false;
			tcache_t *iter;
			ql_foreach(iter, &arena->tcache_ql, link) {
				if (iter == tcache) {
					in_ql = true;
					break;
				}
			}
			assert(in_ql);
		}
		ql_remove(&arena->tcache_ql, tcache, link);
		tcache_stats_merge(tcache, arena);
		malloc_mutex_unlock(&arena->lock);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsi), %rbx
movq %rbx, %rdi
callq 0x12960
movq 0xa8(%r14), %rax
cmpq %r15, %rax
jne 0x4eca4
movq (%rax), %rax
movq %rax, 0xa8(%r14)
cmpq %r15, 0xa8(%r14)
je 0x4ecc7
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %rax, (%rcx)
movq (%r15), %rax
movq %rcx, 0x8(%rax)
movq %r15, (%r15)
movq %r15, 0x8(%r15)
jmp 0x4ecd2
movq $0x0, 0xa8(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4ecea
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x125c0
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tcache.c
// Function: je_tcache_stats_merge
void
tcache_stats_merge(tcache_t *tcache, arena_t *arena)
{
	unsigned i;

	cassert(config_stats);

	/* Merge and reset tcache stats. */
	for (i = 0; i < NBINS; i++) {
		arena_bin_t *bin = &arena->bins[i];
		tcache_bin_t *tbin = &tcache->tbins[i];
		malloc_mutex_lock(&bin->lock);
		bin->stats.nrequests += tbin->tstats.nrequests;
		malloc_mutex_unlock(&bin->lock);
		tbin->tstats.nrequests = 0;
	}

	for (; i < nhbins; i++) {
		malloc_large_stats_t *lstats = &arena->stats.lstats[i - NBINS];
		tcache_bin_t *tbin = &tcache->tbins[i];
		arena->stats.nrequests_large += tbin->tstats.nrequests;
		lstats->nrequests += tbin->tstats.nrequests;
		tbin->tstats.nrequests = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x450(%rsi), %r15
movl $0x20, %r12d
movq %r15, %rdi
callq 0x12960
movq (%r14,%r12), %rax
addq %rax, 0xa8(%r15)
movq %r15, %rdi
callq 0x125c0
movq $0x0, (%r14,%r12)
addq $0xe0, %r15
addq $0x20, %r12
cmpq $0x4a0, %r12            # imm = 0x4A0
jne 0x4ed05
cmpq $0x25, 0x36064(%rip)    # 0x84da8
jb 0x4ed8f
movq 0x78(%rbx), %rax
movq 0x98(%rbx), %rcx
addq $0x20, %r14
movl $0x24, %edx
movl $0x25, %esi
leal -0x25(%rsi), %edi
shlq $0x5, %rdx
movq (%r14,%rdx), %r8
addq %r8, %rax
shlq $0x5, %rdi
addq %r8, 0x10(%rcx,%rdi)
movq $0x0, (%r14,%rdx)
movl %esi, %edx
incl %esi
cmpq %rdx, 0x3601f(%rip)     # 0x84da8
ja 0x4ed5f
movq %rax, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tcache.c
// Function: je_tcaches_create
bool
tcaches_create(tsd_t *tsd, unsigned *r_ind)
{
	tcache_t *tcache;
	tcaches_t *elm;

	if (tcaches == NULL) {
		tcaches = base_alloc(sizeof(tcache_t *) *
		    (MALLOCX_TCACHE_MAX+1));
		if (tcaches == NULL)
			return (true);
	}

	if (tcaches_avail == NULL && tcaches_past > MALLOCX_TCACHE_MAX)
		return (true);
	tcache = tcache_create(tsd, a0get());
	if (tcache == NULL)
		return (true);

	if (tcaches_avail != NULL) {
		elm = tcaches_avail;
		tcaches_avail = tcaches_avail->next;
		elm->tcache = tcache;
		*r_ind = elm - tcaches;
	} else {
		elm = &tcaches[tcaches_past];
		elm->tcache = tcache;
		*r_ind = tcaches_past;
		tcaches_past++;
	}

	return (false);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x35c61(%rip)     # 0x84db8
jne 0x4f16f
movl $0x7ff0, %edi           # imm = 0x7FF0
callq 0x3fe04
movq %rax, 0x35c4e(%rip)     # 0x84db8
testq %rax, %rax
je 0x4f193
cmpq $0x0, 0x35c49(%rip)     # 0x84dc0
jne 0x4f197
movb $0x1, %al
cmpl $0xffd, 0x35c43(%rip)   # imm = 0xFFD
jbe 0x4f197
andb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movb $0x1, %al
jmp 0x4f187
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x15cc0
movb (%r15), %al
jmp 0x4f187
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tcache.c
// Function: je_tcache_boot
bool
tcache_boot(void)
{
	unsigned i;

	/*
	 * If necessary, clamp opt_lg_tcache_max, now that large_maxclass is
	 * known.
	 */
	if (opt_lg_tcache_max < 0 || (1U << opt_lg_tcache_max) < SMALL_MAXCLASS)
		tcache_maxclass = SMALL_MAXCLASS;
	else if ((1U << opt_lg_tcache_max) > large_maxclass)
		tcache_maxclass = large_maxclass;
	else
		tcache_maxclass = (1U << opt_lg_tcache_max);

	nhbins = size2index(tcache_maxclass) + 1;

	/* Initialize tcache_bin_info. */
	tcache_bin_info = (tcache_bin_info_t *)base_alloc(nhbins *
	    sizeof(tcache_bin_info_t));
	if (tcache_bin_info == NULL)
		return (true);
	stack_nelms = 0;
	for (i = 0; i < NBINS; i++) {
		if ((arena_bin_info[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MIN) {
			tcache_bin_info[i].ncached_max =
			    TCACHE_NSLOTS_SMALL_MIN;
		} else if ((arena_bin_info[i].nregs << 1) <=
		    TCACHE_NSLOTS_SMALL_MAX) {
			tcache_bin_info[i].ncached_max =
			    (arena_bin_info[i].nregs << 1);
		} else {
			tcache_bin_info[i].ncached_max =
			    TCACHE_NSLOTS_SMALL_MAX;
		}
		stack_nelms += tcache_bin_info[i].ncached_max;
	}
	for (; i < nhbins; i++) {
		tcache_bin_info[i].ncached_max = TCACHE_NSLOTS_LARGE;
		stack_nelms += tcache_bin_info[i].ncached_max;
	}

	return (false);
}

// Assembly:
movq 0x1fe61(%rip), %rcx     # 0x6f078
movl $0x3800, %edi           # imm = 0x3800
testq %rcx, %rcx
js 0x4f23e
cmpl $0xe, %ecx
jb 0x4f23e
movl $0x1, %edi
shll %cl, %edi
leaq 0x352fc(%rip), %rax     # 0x84530
movq (%rax), %rax
cmpq %rdi, %rax
cmovbq %rax, %rdi
pushq %rax
movq %rdi, 0x35b8a(%rip)     # 0x84dd0
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x4f314
decq %rdi
shrq $0x3, %rdi
leaq 0xa59f(%rip), %rax      # 0x59800
movzbl (%rax,%rdi), %edi
incl %edi
movq %rdi, 0x35b3a(%rip)     # 0x84da8
shlq $0x2, %rdi
callq 0x3fe04
movq %rax, 0x35b22(%rip)     # 0x84da0
testq %rax, %rax
je 0x4f30c
movl $0x0, 0x35b1f(%rip)     # 0x84db0
leaq 0x34518(%rip), %rdx     # 0x837b0
addq $0x20, %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movl (%rdx), %edi
addl %edi, %edi
cmpl $0x14, %edi
ja 0x4f2b2
movl $0x14, (%rax,%rsi,4)
jmp 0x4f2c6
cmpl $0xc8, %edi
ja 0x4f2bf
movl %edi, (%rax,%rsi,4)
jmp 0x4f2c6
movl $0xc8, (%rax,%rsi,4)
addl (%rax,%rsi,4), %ecx
incq %rsi
addq $0x60, %rdx
cmpq $0x24, %rsi
jne 0x4f2a0
movl %ecx, 0x35ad4(%rip)     # 0x84db0
movq 0x35ac5(%rip), %rdx     # 0x84da8
cmpq $0x25, %rdx
jb 0x4f30c
movl $0x24, %edi
movl $0x25, %esi
movl $0x14, (%rax,%rdi,4)
addl $0x14, %ecx
movl %esi, %edi
incl %esi
cmpq %rdi, %rdx
ja 0x4f2f3
movl %ecx, 0x35aa4(%rip)     # 0x84db0
testq %rax, %rax
sete %al
popq %rcx
retq
callq 0x4f320
movl %eax, %edi
jmp 0x4f265
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/util.c
// Function: je_buferror
int
buferror(int err, char *buf, size_t buflen)
{

#ifdef _WIN32
	FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
	    (LPSTR)buf, buflen, NULL);
	return (0);
#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
	char *b = strerror_r(err, buf, buflen);
	if (b != buf) {
		strncpy(buf, b, buflen);
		buf[buflen-1] = '\0';
	}
	return (0);
#else
	return (strerror_r(err, buf, buflen));
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
callq 0x12590
cmpq %r14, %rax
je 0x4f400
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x12100
movb $0x0, -0x1(%r14,%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/tsd.c
// Function: je_malloc_tsd_boot0
bool
malloc_tsd_boot0(void)
{

	ncleanups = 0;
	if (tsd_boot0())
		return (true);
	*tsd_arenas_cache_bypassp_get(tsd_fetch()) = true;
	return (false);
}

// Assembly:
pushq %rbx
movl $0x0, 0x3476a(%rip)     # 0x84e00
leaq 0x34767(%rip), %rdi     # 0x84e04
leaq -0xd4(%rip), %rsi       # 0x505d0
callq 0x12370
movl %eax, %ebx
testl %eax, %eax
jne 0x506e0
movb $0x1, 0x3472a(%rip)     # 0x84de0
movq %fs:0x0, %rax
leaq -0x50(%rax), %rsi
movl %fs:-0x50, %eax
testl %eax, %eax
je 0x506e7
cmpl $0x2, %eax
je 0x506f5
movb $0x1, %fs:-0x14
testl %ebx, %ebx
setne %al
popq %rbx
retq
movl $0x1, %fs:-0x50
jmp 0x50701
movl $0x3, %fs:-0x50
movl 0x346fd(%rip), %edi     # 0x84e04
callq 0x12990
testl %eax, %eax
je 0x506d7
leaq 0x949d(%rip), %rdi      # 0x59bb4
callq 0x4f37c
leaq 0x3300d(%rip), %rax     # 0x83730
cmpb $0x1, (%rax)
jne 0x506d7
callq 0x120c0
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/signal1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	struct sigaction act;

	memset(&act, 0, sizeof(act));
	act.sa_handler = handler;
	sigaction(SIGUSR1, &act, NULL);

	while (1) {
		raise(SIGUSR1);

		(*iterations)++;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1140
leaq -0x27(%rip), %rax       # 0x1c50
movq %rax, (%r14)
movl $0xa, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10c0
movl $0xa, %edi
callq 0x1050
incq (%rbx)
jmp 0x1c89
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/posix_semaphore1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	sem_t sem;

	sem_init(&sem, 0, 1);

	while (1) {
		sem_wait(&sem);
		sem_post(&sem);
		(*iterations)++;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x21e0
movq %r14, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x2150
incq (%rbx)
jmp 0x2c0a
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_chacha20_H
void crypto_chacha20_H(u8 out[32], const u8 key[32], const u8 in[16])
{
    crypto_chacha_ctx ctx;
    chacha20_init_key(&ctx, key);
    FOR (i, 0, 4) {
        ctx.input[i+12] = load32_le(in + i*4);
    }
    u32 buffer[16];
    chacha20_rounds(buffer, ctx.input);
    // prevents reversal of the rounds by revealing only half of the buffer.
    FOR (i, 0, 4) {
        store32_le(out      + i*4, buffer[i     ]); // constant
        store32_le(out + 16 + i*4, buffer[i + 12]); // counter and nonce
    }
    WIPE_CTX(&ctx);
    WIPE_BUFFER(buffer);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
callq 0x18ca
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
movl %ecx, 0x70(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1867
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x18e7
xorl %eax, %eax
movl (%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,4)
movl 0x30(%rsp,%rax,4), %ecx
movl %ecx, 0x10(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1887
xorl %eax, %eax
movb $0x0, 0x40(%rsp,%rax)
incq %rax
cmpq $0x88, %rax
jne 0x18a0
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x18b2
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_chacha20_init
void crypto_chacha20_init(crypto_chacha_ctx *ctx,
                          const u8           key[32],
                          const u8           nonce[8])
{
    chacha20_init_key      (ctx, key);     // key
    crypto_chacha20_set_ctr(ctx, 0  );     // counter
    ctx->input[14] = load32_le(nonce + 0); // nonce
    ctx->input[15] = load32_le(nonce + 4); // nonce
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
callq 0x18ca
movq $0x0, 0x30(%r14)
movq $0x40, 0x80(%r14)
movl (%rbx), %eax
movl %eax, 0x38(%r14)
movl 0x4(%rbx), %eax
movl %eax, 0x3c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_chacha20_x_init
void crypto_chacha20_x_init(crypto_chacha_ctx *ctx,
                            const u8           key[32],
                            const u8           nonce[24])
{
    u8 derived_key[32];
    crypto_chacha20_H(derived_key, key, nonce);
    crypto_chacha20_init(ctx, derived_key, nonce + 16);
    WIPE_BUFFER(derived_key);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x184b
addq $0x10, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1b10
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x1b8b
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_chacha20_encrypt
void crypto_chacha20_encrypt(crypto_chacha_ctx *ctx,
                             u8                *cipher_text,
                             const u8          *plain_text,
                             size_t             text_size)
{
    // Align ourselves with block boundaries
    size_t align = MIN(ALIGN(ctx->pool_idx, 64), text_size);
    chacha20_encrypt(ctx, cipher_text, plain_text, align);
    if (plain_text != 0) {
        plain_text += align;
    }
    cipher_text += align;
    text_size   -= align;

    // Process the message block by block
    FOR (i, 0, text_size >> 6) {  // number of blocks
        chacha20_refill_pool(ctx);
        if (plain_text != 0) {
            FOR (j, 0, 16) {
                u32 plain = load32_le(plain_text);
                store32_le(cipher_text, ctx->pool[j] ^ plain);
                plain_text  += 4;
                cipher_text += 4;
            }
        } else {
            FOR (j, 0, 16) {
                store32_le(cipher_text, ctx->pool[j]);
                cipher_text += 4;
            }
        }
        ctx->pool_idx = 64;
    }
    text_size &= 63;

    // remaining bytes
    chacha20_encrypt(ctx, cipher_text, plain_text, text_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
subl 0x80(%rdi), %ebp
andl $0x3f, %ebp
cmpq %rcx, %rbp
cmovaeq %rcx, %rbp
movq %rbp, %rcx
callq 0x1c76
movq %r13, %r12
addq %rbp, %r12
testq %r13, %r13
cmoveq %r13, %r12
addq %rbp, %r14
subq %rbp, %rbx
cmpq $0x40, %rbx
jb 0x1c57
movq %rbx, %r13
shrq $0x6, %r13
cmpq $0x1, %r13
adcq $0x0, %r13
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x1cf9
xorl %eax, %eax
testq %r12, %r12
je 0x1c2b
movl (%r12,%rax), %ecx
xorl 0x40(%r15,%rax), %ecx
movl %ecx, (%r14,%rax)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x1c0c
addq %rax, %r14
addq %rax, %r12
jmp 0x1c44
movl 0x40(%r15,%rax), %ecx
movl %ecx, (%r14,%rax)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x1c2b
addq %rax, %r14
xorl %r12d, %r12d
movq $0x40, 0x80(%r15)
incq %rbp
cmpq %r13, %rbp
jne 0x1bfd
andl $0x3f, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c76
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: chacha20_encrypt
static void chacha20_encrypt(crypto_chacha_ctx *ctx,
                             u8                *cipher_text,
                             const u8          *plain_text,
                             size_t             text_size)
{
    FOR (i, 0, text_size) {
        if (ctx->pool_idx == 64) {
            chacha20_refill_pool(ctx);
        }
        u8 plain = 0;
        if (plain_text != 0) {
            plain = *plain_text;
            plain_text++;
        }
        *cipher_text = chacha20_pool_byte(ctx) ^ plain;
        cipher_text++;
    }
}

// Assembly:
testq %rcx, %rcx
je 0x1cf8
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
xorl %r13d, %r13d
cmpq $0x40, 0x80(%r12)
jne 0x1ca6
movq %r12, %rdi
callq 0x1cf9
testq %r15, %r15
je 0x1cb3
movb (%r15), %al
incq %r15
jmp 0x1cb8
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x80(%r12), %rdx
movq %rdx, %rcx
andq $-0x4, %rcx
movl 0x40(%r12,%rcx), %esi
leal (,%rdx,8), %ecx
shrl %cl, %esi
incq %rdx
movq %rdx, 0x80(%r12)
xorb %al, %sil
movb %sil, (%r14,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x1c93
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x18e7
xorl %eax, %eax
movl -0x40(%r14,%rax,4), %ecx
addl %ecx, (%r14,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x1d11
movq $0x0, 0x80(%rbx)
incl 0x30(%rbx)
jne 0x1d36
incl 0x34(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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)
movzwl (%rsi), %eax
movzbl 0x2(%rsi), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0x3(%rsi), %eax
andl $0xf, %eax
shll $0x18, %eax
orl %ecx, %eax
movl %eax, (%rdi)
xorl %eax, %eax
movl $0xffffffc, %ecx        # imm = 0xFFFFFFC
movl 0x4(%rsi,%rax,4), %edx
andl %ecx, %edx
movl %edx, 0x4(%rdi,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x1d8a
xorl %eax, %eax
movl 0x10(%rsi,%rax,4), %ecx
movl %ecx, 0x38(%rdi,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1d9f
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1e56
addq %r12, %r14
subq %r12, %rbx
cmpq $0x10, %rbx
jb 0x1e27
movq %rbx, %r12
shrq $0x4, %r12
cmpq $0x1, %r12
adcq $0x0, %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 0x1ec9
addq $0x10, %r14
decq %r12
jne 0x1df7
cmpq $0x10, %rbx
jb 0x1e3d
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 0x1e56
// File: /workspace/github_c_makefile_star2_O1/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 0x1ec8
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x24(%rdi), %r12
xorl %r13d, %r13d
movzbl (%r14,%r13), %eax
movq 0x48(%r15), %rdx
leal (,%rdx,8), %ecx
shll %cl, %eax
movq %rdx, %rcx
andq $-0x4, %rcx
orl %eax, 0x24(%r15,%rcx)
incq %rdx
movq %rdx, 0x48(%r15)
cmpq $0x10, %rdx
jne 0x1eb7
movq %r15, %rdi
callq 0x1ec9
movq $0x0, 0x48(%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
incq %r13
cmpq %r13, %rbx
jne 0x1e74
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: crypto_poly1305_final
void crypto_poly1305_final(crypto_poly1305_ctx *ctx, u8 mac[16])
{
    // Process the last block (if any)
    if (ctx->c_idx != 0) {
        // move the final 1 according to remaining input length
        // (We may add less than 2^130 to the last input block)
        ctx->c[4] = 0;
        poly_take_input(ctx, 1);
        // one last hash update
        poly_block(ctx);
    }

    // check if we should subtract 2^130-5 by performing the
    // corresponding carry propagation.
    const u64 u0 = (u64)5     + ctx->h[0]; // <= 1_00000004
    const u64 u1 = (u0 >> 32) + ctx->h[1]; // <= 1_00000000
    const u64 u2 = (u1 >> 32) + ctx->h[2]; // <= 1_00000000
    const u64 u3 = (u2 >> 32) + ctx->h[3]; // <= 1_00000000
    const u64 u4 = (u3 >> 32) + ctx->h[4]; // <=          5
    // u4 indicates how many times we should subtract 2^130-5 (0 or 1)

    // h + pad, minus 2^130-5 if u4 exceeds 3
    const u64 uu0 = (u4 >> 2) * 5 + ctx->h[0] + ctx->pad[0]; // <= 2_00000003
    const u64 uu1 = (uu0 >> 32)   + ctx->h[1] + ctx->pad[1]; // <= 2_00000000
    const u64 uu2 = (uu1 >> 32)   + ctx->h[2] + ctx->pad[2]; // <= 2_00000000
    const u64 uu3 = (uu2 >> 32)   + ctx->h[3] + ctx->pad[3]; // <= 2_00000000

    store32_le(mac     , (u32)uu0);
    store32_le(mac +  4, (u32)uu1);
    store32_le(mac +  8, (u32)uu2);
    store32_le(mac + 12, (u32)uu3);

    WIPE_CTX(ctx);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x20a8
movl $0x0, 0x34(%rbx)
leal (,%rax,8), %ecx
movl $0x1, %edx
shll %cl, %edx
movq %rax, %rcx
andq $-0x4, %rcx
orl %edx, 0x24(%rbx,%rcx)
incq %rax
movq %rax, 0x48(%rbx)
movq %rbx, %rdi
callq 0x1ec9
movl 0x10(%rbx), %eax
movl 0x14(%rbx), %r8d
leaq 0x5(%rax), %rcx
shrq $0x20, %rcx
addq %r8, %rcx
shrq $0x20, %rcx
movl 0x18(%rbx), %r9d
addq %r9, %rcx
shrq $0x20, %rcx
movl 0x1c(%rbx), %esi
addq %rsi, %rcx
shrq $0x20, %rcx
movl 0x20(%rbx), %edx
addq %rcx, %rdx
shrq $0x2, %rdx
leaq (%rdx,%rdx,4), %rcx
movl 0x38(%rbx), %edx
addq %rax, %rdx
addq %rcx, %rdx
movl 0x3c(%rbx), %ecx
movl 0x40(%rbx), %eax
movl 0x44(%rbx), %edi
movb %dl, (%rbp)
movb %dh, 0x1(%rbp)
movl %edx, %r10d
shrl $0x10, %r10d
movb %r10b, 0x2(%rbp)
movq %rdx, %r10
shrl $0x18, %edx
movb %dl, 0x3(%rbp)
addq %r8, %rcx
shrq $0x20, %r10
addq %r10, %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
addq %r9, %rax
addq %rdx, %rax
movb %cl, 0x4(%rbp)
movb %ch, 0x5(%rbp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x6(%rbp)
shrl $0x18, %ecx
movb %cl, 0x7(%rbp)
movq %rax, %rcx
movb %al, 0x8(%rbp)
movb %ah, 0x9(%rbp)
movl %eax, %edx
shrl $0x10, %edx
movb %dl, 0xa(%rbp)
shrl $0x18, %eax
movb %al, 0xb(%rbp)
shrq $0x20, %rcx
addl %esi, %edi
addl %edi, %ecx
movb %cl, 0xc(%rbp)
movb %ch, 0xd(%rbp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0xe(%rbp)
shrl $0x18, %ecx
movb %cl, 0xf(%rbp)
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0x50, %rax
jne 0x216d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movaps 0x73df(%rip), %xmm0     # 0x95b0
movups %xmm0, (%rdi)
movaps 0x7405(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x30(%rdi)
movaps 0x73ea(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x20(%rdi)
movaps 0x73cf(%rip), %xmm0     # 0x95c0
movups %xmm0, 0x10(%rdi)
movq %rcx, %rax
shlq $0x8, %rax
xorq (%rdi), %rax
xorq %rsi, %rax
xorq $0x1010000, %rax        # imm = 0x1010000
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq %rsi, 0xd8(%rdi)
movq $0x0, 0xd0(%rdi)
testq %rcx, %rcx
je 0x225c
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x225d
movl $0x80, %edx
subq %rbx, %rdx
leaq 0x73a3(%rip), %rsi      # 0x95f0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x225d
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x235b
addq %r12, %r14
subq %r12, %rbx
cmpq $0x80, %rbx
movq %rbx, (%rsp)
jb 0x22ef
movq %rbx, %r12
shrq $0x7, %r12
cmpq $0x1, %r12
adcq $0x0, %r12
xorl %r13d, %r13d
movl $0x80, %ebp
movq %r15, %rdi
callq 0x23f4
xorl %ebx, %ebx
leaq (%r14,%rbx), %rdi
callq 0x2428
movq %rax, 0x50(%r15,%rbx)
addq $0x8, %rbx
cmpq $0x80, %rbx
jne 0x22c2
addq %rbp, %r14
movq %rbp, 0xd0(%r15)
incq %r13
cmpq %r12, %r13
jne 0x22b8
movq (%rsp), %rdx
andl $0x7f, %edx
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x235b
// File: /workspace/github_c_makefile_star2_O1/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 0x23f3
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 0x23f4
movzbl (%r14,%r13), %eax
movq 0xd0(%r15), %rdx
testq %rdx, %rdx
jne 0x23c8
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 0x237d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0xd0(%rdi), %rax
cmpq $0x80, %rax
jne 0x2427
pushq %rbx
movq %rdi, %rbx
addq %rax, 0x40(%rdi)
jae 0x2411
incq 0x48(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2512
movq $0x0, 0xd0(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x247d
leaq 0x50(%rbx), %rcx
xorps %xmm0, %xmm0
movq %rax, %rdx
testq %rdx, %rdx
jne 0x2471
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 0x244d
addq %rax, 0x40(%rbx)
jae 0x2487
incq 0x48(%rbx)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2512
movq 0xd8(%rbx), %rax
cmpq $0x8, %rax
jb 0x24ba
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 0x24aa
movq %rax, %rdx
andq $-0x8, %rdx
cmpq 0xd8(%rbx), %rdx
jae 0x24f9
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 0x24d2
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0xe0, %rax
jne 0x24fb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x225d
xorl %eax, %eax
movb $0x0, 0x4(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x4208
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x536d(%rip), %xmm0     # 0x95b0
movq %rsp, %r12
movaps %xmm0, (%r12)
movaps 0x538e(%rip), %xmm0     # 0x95e0
movaps %xmm0, 0x30(%r12)
movaps 0x5371(%rip), %xmm0     # 0x95d0
movaps %xmm0, 0x20(%r12)
movaps 0x5354(%rip), %xmm0     # 0x95c0
movaps %xmm0, 0x10(%r12)
movq %rax, %rcx
orq $0x1010000, %rcx        # imm = 0x1010000
xorq %rcx, (%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%r12)
movq %rax, 0xd8(%r12)
movq $0x0, 0xd0(%r12)
movq %r12, %rdi
callq 0x41f1
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x225d
movq %r12, %rdi
movq %r14, %rsi
callq 0x242c
cmpl $0x41, %ebx
jb 0x433c
movl %ebx, %r12d
addq $0x1f, %r12
shrq $0x5, %r12
leal -0x2(%r12), %ebp
cmpl $0x2, %ebp
jb 0x4314
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 0x3b86
addl $0x20, %r15d
decl %r12d
jne 0x42e1
movl %r15d, %edi
addl $-0x20, %r15d
jmp 0x431c
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 0x3b86
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3b86
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 0x5c54
movq %rbx, %rdi
movq %r15, %rsi
callq 0x60e1
movb $0x0, (%rsp,%r12)
incq %r12
cmpq $0x40, %r12
jne 0x5c25
xorl %eax, %eax
movb $0x0, 0x48(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x5c35
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x56a9
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4992
addq $0x28, %r14
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4992
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5923
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x5923
xorl %ecx, %ecx
movb (%r14), %al
movb $0x0, (%rsp,%rcx)
incq %rcx
cmpq $0x20, %rcx
jne 0x6153
shlb $0x7, %al
xorb %al, 0x1f(%rbx)
xorl %eax, %eax
movb $0x0, 0x80(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x6168
xorl %eax, %eax
movb $0x0, 0x50(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x617b
xorl %eax, %eax
movb $0x0, 0x20(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x618b
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3b86
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 0x620d
xorl %eax, %eax
movb (%r14,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x61fb
jmp 0x6215
movq %r15, %rsi
callq 0x5bc9
leaq 0x100(%rbx), %rsi
movaps 0x338d(%rip), %xmm0     # 0x95b0
movups %xmm0, (%rbx)
movaps 0x33b3(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x30(%rbx)
movaps 0x3398(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x20(%rbx)
movaps 0x337d(%rip), %xmm0     # 0x95c0
xorl $0x1010040, (%rbx)      # imm = 0x1010040
movups %xmm0, 0x10(%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 0x225d
// File: /workspace/github_c_makefile_star2_O1/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 0x242c
movq %r15, %rdi
callq 0x635d
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5c54
movq %r14, %rdi
movq %r12, %rsi
callq 0x60e1
xorl %eax, %eax
movb $0x0, 0x8(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x62cd
movaps 0x32cc(%rip), %xmm0     # 0x95b0
movups %xmm0, (%rbx)
movaps 0x32f2(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x30(%rbx)
movaps 0x32d7(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x20(%rbx)
movaps 0x32bc(%rip), %xmm0     # 0x95c0
movups %xmm0, 0x10(%rbx)
xorl $0x1010040, (%rbx)      # imm = 0x1010040
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 0x225d
leaq 0x140(%rbx), %rsi
movl $0x20, %edx
movq %rbx, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x225d
// File: /workspace/github_c_makefile_star2_O1/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 0x6366
movq %rsp, %rsi
callq 0x80d8
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x6385
addq $0x208, %rsp            # imm = 0x208
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x242c
movq %r15, %rdi
callq 0x635d
xorl %eax, %eax
movb 0x120(%rbx,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x63c0
leaq 0xe0(%rbx), %rdx
leaq 0x100(%rbx), %rcx
addq $0x20, %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x641b
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0x160, %rax            # imm = 0x160
jne 0x63f3
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x6404
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6434
leaq 0x100(%rsp), %rdi
xorl %r12d, %r12d
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1070
movq %rsp, %rax
movzbl (%r15,%r12), %ecx
xorl %edx, %edx
movzbl (%r14,%rdx), %esi
imulq %rcx, %rsi
addq %rsi, (%rax,%rdx,8)
incq %rdx
cmpq $0x20, %rdx
jne 0x6466
incq %r12
addq $0x8, %rax
cmpq $0x20, %r12
jne 0x645f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x80d8
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x200, %rax            # imm = 0x200
jne 0x6496
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x61aa
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x225d
movq %r12, %rdi
callq 0x6281
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x225d
movq %r12, %rdi
movq %r15, %rsi
callq 0x639c
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6522
xorl %eax, %eax
movb (%rbx,%rax), %cl
movb %cl, 0x120(%r14,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x6538
movaps 0x305d(%rip), %xmm0     # 0x95b0
movups %xmm0, (%r14)
movaps 0x3082(%rip), %xmm0     # 0x95e0
movups %xmm0, 0x30(%r14)
movaps 0x3066(%rip), %xmm0     # 0x95d0
movups %xmm0, 0x20(%r14)
movaps 0x304a(%rip), %xmm0     # 0x95c0
movups %xmm0, 0x10(%r14)
xorl $0x1010040, (%r14)      # imm = 0x1010040
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r14)
movq $0x40, 0xd8(%r14)
movq $0x0, 0xd0(%r14)
movl $0x20, %edx
movq %r14, %rdi
callq 0x225d
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x225d
// File: /workspace/github_c_makefile_star2_O1/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 0x4377
movl %eax, %ebx
leaq 0x2799(%rip), %rdx      # 0x95f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x184b
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x6e64
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1b5d
xorl %r15d, %r15d
movq %rsp, %r14
movl $0x40, %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1ba2
addq $0x88, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d48
movb $0x0, (%rsp,%r15)
incq %r15
cmpq $0x40, %r15
jne 0x6ecc
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq