LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/crypto_aesctr/main.c
// Function: parse_testcase
static int
parse_testcase(const struct testcase testcase,
    struct crypto_aes_key ** key_exp_p, size_t * keylen_p,
    uint8_t plaintext_arr[static MAX_PLAINTEXT_LENGTH],
    uint8_t ciphertext_arr[static MAX_PLAINTEXT_LENGTH])
{
	uint8_t key_unexpanded[32]; /* We will use 16 or 32 of these bytes. */
	const size_t len = strlen(testcase.plaintext_str);

	/* Determine key length. */
	*keylen_p = strlen(testcase.keytext_hex) / 2;

	/* Sanity check. */
	assert((*keylen_p == 16) || (*keylen_p == 32));
	assert(len <= MAX_PLAINTEXT_LENGTH);

	/* Prepare the key. */
	if (unhexify(testcase.keytext_hex, key_unexpanded, *keylen_p)) {
		warn0("unhexify(%s)", testcase.keytext_hex);
		goto err0;
	}
	if ((*key_exp_p = crypto_aes_key_expand(key_unexpanded, *keylen_p))
	    == NULL) {
		warn0("crypto_aes_key_expand");
		goto err0;
	}

	/* Prepare the arrays. */
	memcpy(plaintext_arr, testcase.plaintext_str, len);
	if (unhexify(testcase.ciphertext_hex, ciphertext_arr, len)) {
		warn0("unhexify(%s)", testcase.ciphertext_hex);
		goto err1;
	}

	/* Clean up.  Irrelevant for a test, but it's a good habit. */
	insecure_memzero(key_unexpanded, 32);

	/* Success! */
	return (0);

err1:
	crypto_aes_key_free(*key_exp_p);
err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x78(%rsp), %r13
movq %r13, %rdi
callq 0x2140
movq %rax, %r15
movq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x2140
shrq %rax
movq %rax, (%rbp)
cmpq $0x10, %rax
je 0x2d03
cmpq $0x20, %rax
jne 0x2dfd
cmpq $0x21, %r15
jae 0x2dde
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0x44d3
testl %eax, %eax
je 0x2d4c
leaq 0x242b(%rip), %rdi      # 0x5153
movq %r14, %rsi
xorl %eax, %eax
callq 0x4b64
callq 0x21c0
andl $0x0, (%rax)
pushq $0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2f5a
movq %rax, (%rbx)
testq %rax, %rax
je 0x2db0
leaq 0x70(%rsp), %r14
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2240
movq 0x10(%r14), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x44d3
testl %eax, %eax
je 0x2dc3
leaq 0x23bf(%rip), %rdi      # 0x5153
movq %r14, %rsi
xorl %eax, %eax
callq 0x4b64
callq 0x21c0
andl $0x0, (%rax)
movq (%rbx), %rdi
callq 0x2ffa
jmp 0x2d3a
leaq 0x23a9(%rip), %rdi      # 0x5160
xorl %eax, %eax
callq 0x4b64
jmp 0x2d32
leaq 0x646e(%rip), %rax      # 0x9238
movq (%rax), %rax
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
callq *%rax
xorl %eax, %eax
jmp 0x2d3d
leaq 0x2352(%rip), %rdi      # 0x5137
leaq 0x22e0(%rip), %rsi      # 0x50cc
leaq 0x22e0(%rip), %rcx      # 0x50d3
movl $0xd8, %edx
callq 0x20a0
leaq 0x22a1(%rip), %rdi      # 0x50a5
leaq 0x22c1(%rip), %rsi      # 0x50cc
leaq 0x22c1(%rip), %rcx      # 0x50d3
movl $0xd7, %edx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/crypto_aesctr/main.c
// Function: print_arr
static void
print_arr(const char * name, const uint8_t * arr, size_t len)
{
	size_t i;

	printf("%s", name);
	for (i = 0; i < len; i++)
		printf("%02x", arr[i]);
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x2e0b(%rip), %rdi      # 0x5c3f
xorl %eax, %eax
callq 0x2030
leaq 0x2334(%rip), %r15      # 0x5176
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x2e5e
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
incq %r12
jmp 0x2e45
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20b0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes.c
// Function: hwaccel_init
static void
hwaccel_init(void)
{

	/* If we've already set hwaccel, we're finished. */
	if (hwaccel != HW_UNSET)
		return;

	/* Default to software. */
	hwaccel = HW_SOFTWARE;

#if defined(CPUSUPPORT_X86_AESNI)
	CPUSUPPORT_VALIDATE(hwaccel, HW_X86_AESNI, cpusupport_x86_aesni(),
	    functest(x86_aesni_oneshot));
#endif
#if defined(CPUSUPPORT_ARM_AES)
	CPUSUPPORT_VALIDATE(hwaccel, HW_ARM_AES, cpusupport_arm_aes(),
	    functest(arm_aes_oneshot));
#endif

	/*
	 * If we're here, we're not using any intrinsics.  Test OpenSSL; if
	 * there's an error, print a warning and abort.
	 */
	if (functest(openssl_oneshot)) {
		warn0("OpenSSL gives incorrect AES values.");
		abort();
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, 0x6295(%rip)      # 0x9150
jne 0x2f3a
andl $0x0, 0x628c(%rip)      # 0x9150
leaq 0x6381(%rip), %rbx      # 0x924c
cmpl $0x0, (%rbx)
je 0x2ef8
leaq 0x1f0(%rip), %rdi       # 0x30c7
callq 0x3034
testl %eax, %eax
je 0x2f30
leaq 0x2889(%rip), %rdi      # 0x5770
xorl %eax, %eax
callq 0x4b64
callq 0x21c0
andl $0x0, (%rax)
jmp 0x2f05
leaq 0x6351(%rip), %r14      # 0x9250
cmpl $0x0, (%r14)
je 0x2f42
leaq 0x1f6(%rip), %rdi       # 0x3102
callq 0x3034
testl %eax, %eax
je 0x2f3a
leaq 0x2883(%rip), %rdi      # 0x579f
xorl %eax, %eax
callq 0x4b64
callq 0x21c0
andl $0x0, (%rax)
callq 0x2060
movl $0x1, 0x6216(%rip)      # 0x9150
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2e74
movl %eax, (%rbx)
movl $0x1, (%r14)
testl %eax, %eax
jne 0x2ed0
jmp 0x2f05
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes.c
// Function: crypto_aes_key_expand
struct crypto_aes_key *
crypto_aes_key_expand(const uint8_t * key_unexpanded, size_t len)
{
	AES_KEY * kexp;

	/* Sanity-check. */
	assert((len == 16) || (len == 32));

#ifdef HWACCEL
	/* Ensure that we've chosen the type of hardware acceleration. */
	hwaccel_init();

#ifdef CPUSUPPORT_X86_AESNI
	if (hwaccel == HW_X86_AESNI)
		return (crypto_aes_key_expand_aesni(key_unexpanded, len));
#endif
#ifdef CPUSUPPORT_ARM_AES
	if (hwaccel == HW_ARM_AES)
		return (crypto_aes_key_expand_arm(key_unexpanded, len));
#endif
#endif /* HWACCEL */

	/* Allocate structure. */
	if ((kexp = malloc(sizeof(AES_KEY))) == NULL)
		goto err0;

	/* Expand the key. */
	if (AES_set_encrypt_key(key_unexpanded, (int)(len * 8), kexp) != 0)
		goto err1;

	/* Success! */
	return ((void *)kexp);

err1:
	free(kexp);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x10, %rsi
je 0x2f71
cmpq $0x20, %rbx
jne 0x2fc9
callq 0x2eb0
cmpl $0x1, 0x61d3(%rip)      # 0x9150
jne 0x2f8f
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3160
movl $0xf4, %edi
callq 0x20d0
testq %rax, %rax
je 0x2fbd
movq %rax, %r14
shll $0x3, %ebx
movq %r15, %rdi
movl %ebx, %esi
movq %rax, %rdx
callq 0x2260
testl %eax, %eax
je 0x2fc0
movq %r14, %rdi
callq 0x2130
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2728(%rip), %rdi      # 0x56f8
leaq 0x273c(%rip), %rsi      # 0x5713
leaq 0x274c(%rip), %rcx      # 0x572a
movl $0xf1, %edx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes.c
// Function: functest
static int
functest(int (* func)(const uint8_t *, size_t, const uint8_t[16], uint8_t[16]))
{
	struct aes_test * knowngood;
	uint8_t ctext[16];
	size_t i;

	for (i = 0; i < sizeof(testcases) / sizeof(testcases[0]); i++) {
		knowngood = &testcases[i];

		/* Sanity-check. */
		assert((knowngood->len == 16) || (knowngood->len == 32));

		/* Expand the key and encrypt with the provided function. */
		if (func(knowngood->key, knowngood->len, knowngood->ptext,
		    ctext))
			goto err0;

		/* Does the output match the known good value? */
		if (memcmp(knowngood->ctext, ctext, 16))
			goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
pushq $0x3
popq %r12
leaq 0x6149(%rip), %r13      # 0x9198
movq %rsp, %r15
pushq $-0x1
popq %rbx
decq %r12
je 0x3098
movq -0x18(%r13), %rsi
cmpq $0x10, %rsi
je 0x306a
cmpq $0x20, %rsi
jne 0x30aa
leaq -0x38(%r13), %rdi
leaq -0x10(%r13), %rdx
movq %r15, %rcx
callq *%r14
testl %eax, %eax
jne 0x309a
movdqu (%r13), %xmm0
addq $0x48, %r13
pcmpeqb (%rsp), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x3055
jmp 0x309a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x2712(%rip), %rdi      # 0x57c3
leaq 0x265b(%rip), %rsi      # 0x5713
leaq 0x2735(%rip), %rcx      # 0x57f4
pushq $0x54
popq %rdx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes.c
// Function: x86_aesni_oneshot
static int
x86_aesni_oneshot(const uint8_t * key_unexpanded, size_t len,
    const uint8_t ptext[16], uint8_t ctext[16])
{
	void * kexp_hw;

	/* Expand the key and encrypt with hardware intrinsics. */
	if ((kexp_hw = crypto_aes_key_expand_aesni(key_unexpanded, len))
	    == NULL)
		goto err0;
	crypto_aes_encrypt_block_aesni(ptext, ctext, kexp_hw);
	crypto_aes_key_free_aesni(kexp_hw);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
callq 0x3160
testq %rax, %rax
je 0x30f9
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x36cd
movq %r15, %rdi
callq 0x36e1
xorl %eax, %eax
jmp 0x30fc
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes.c
// Function: openssl_oneshot
static int
openssl_oneshot(const uint8_t * key_unexpanded, size_t len,
    const uint8_t ptext[16], uint8_t * ctext)
{
	AES_KEY kexp_actual;
	AES_KEY * kexp = &kexp_actual;

	/* Expand the key, encrypt, and clean up. */
	if (AES_set_encrypt_key(key_unexpanded, (int)(len * 8), kexp) != 0)
		goto err0;
	AES_encrypt(ptext, ctext, kexp);
	insecure_memzero(kexp, sizeof(AES_KEY));

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rcx, %rbx
movq %rdx, %r14
shll $0x3, %esi
leaq 0xc(%rsp), %rdx
callq 0x2260
testl %eax, %eax
je 0x312a
pushq $-0x1
popq %rax
jmp 0x3153
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2160
leaq 0x60f4(%rip), %rax      # 0x9238
movq (%rax), %rax
movl $0xf4, %esi
movq %r15, %rdi
callq *%rax
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr.c
// Function: crypto_aesctr_init2
void
crypto_aesctr_init2(struct crypto_aesctr * stream,
    const struct crypto_aes_key * key, uint64_t nonce)
{

	/* If the key is NULL, retain the previous AES key. */
	if (key != NULL)
		stream->key = key;

	/* Set nonce as provided and reset bytectr. */
	be64enc(stream->pblk, nonce);
	stream->bytectr = 0;

	/*
	 * Set the counter such that the least significant byte will wrap once
	 * incremented.
	 */
	stream->pblk[15] = 0xff;

#ifdef HWACCEL
	hwaccel_init();
#endif

	/* Sanity check. */
	assert(stream->key != NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x371c
movq %rsi, (%rbx)
leaq 0x20(%rbx), %rdi
movq %rdx, %rsi
callq 0x379d
andq $0x0, 0x8(%rbx)
movb $-0x1, 0x2f(%rbx)
cmpl $0x2, 0x5ab8(%rip)      # 0x91f0
jne 0x3759
andl $0x0, 0x5aaf(%rip)      # 0x91f0
callq 0x2e9c
testl %eax, %eax
je 0x3759
cmpl $0x1, %eax
jne 0x3780
movl $0x1, 0x5a97(%rip)      # 0x91f0
cmpq $0x0, (%rbx)
je 0x3761
popq %rbx
retq
leaq 0x20fd(%rip), %rdi      # 0x5865
leaq 0x210a(%rip), %rsi      # 0x5879
leaq 0x211d(%rip), %rcx      # 0x5893
movl $0x80, %edx
callq 0x20a0
leaq 0x224c(%rip), %rdi      # 0x59d3
leaq 0x20eb(%rip), %rsi      # 0x5879
leaq 0x220e(%rip), %rcx      # 0x59a3
pushq $0x48
popq %rdx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr.c
// Function: crypto_aesctr_init
struct crypto_aesctr *
crypto_aesctr_init(const struct crypto_aes_key * key, uint64_t nonce)
{
	struct crypto_aesctr * stream;

	/* Sanity check. */
	assert(key != NULL);

	/* Allocate memory. */
	if ((stream = crypto_aesctr_alloc()) == NULL)
		goto err0;

	/* Initialize values. */
	crypto_aesctr_init2(stream, key, nonce);

	/* Success! */
	return (stream);

err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x37d8
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3708
movq %rax, %r15
testq %rax, %rax
je 0x37cf
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3710
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x208e(%rip), %rdi      # 0x586d
leaq 0x2093(%rip), %rsi      # 0x5879
leaq 0x2100(%rip), %rcx      # 0x58ed
movl $0x90, %edx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr.c
// Function: crypto_aesctr_stream
void
crypto_aesctr_stream(struct crypto_aesctr * stream, const uint8_t * inbuf,
    uint8_t * outbuf, size_t buflen)
{

#if defined(HWACCEL)
#if defined(CPUSUPPORT_X86_AESNI)
	if ((buflen >= 16) && (hwaccel == HW_X86_AESNI)) {
		crypto_aesctr_aesni_stream(stream, inbuf, outbuf, buflen);
		return;
	}
#endif
#if defined(CPUSUPPORT_ARM_AES)
	if ((buflen >= 16) && (hwaccel == HW_ARM_AES)) {
		crypto_aesctr_arm_stream(stream, inbuf, outbuf, buflen);
		return;
	}
#endif
#endif /* HWACCEL */

	/* Process any bytes before we can process a whole block. */
	if (crypto_aesctr_stream_pre_wholeblock(stream, &inbuf, &outbuf,
	    &buflen))
		return;

	/* Process whole blocks of 16 bytes. */
	while (buflen >= 16) {
		/* Generate a block of cipherstream. */
		crypto_aesctr_stream_cipherblock_generate(stream);

		/* Encrypt the bytes and update the positions. */
		crypto_aesctr_stream_cipherblock_use(stream, &inbuf, &outbuf,
		    &buflen, 16, 0);
	}

	/* Process any final bytes after finishing all whole blocks. */
	crypto_aesctr_stream_post_wholeblock(stream, &inbuf, &outbuf, &buflen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
cmpq $0x10, %rcx
jb 0x383b
cmpl $0x1, 0x59cd(%rip)      # 0x91f0
jne 0x383b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3a08
movq 0x8(%rbx), %r9
andq $0xf, %r9
je 0x3873
leaq (%r9,%rcx), %r14
pushq $0x10
popq %r8
subq %r9, %r8
cmpq $0x11, %r14
cmovbq %rcx, %r8
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
callq 0x3936
cmpq $0x11, %r14
jb 0x38d6
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r12
movq %rsp, %r13
pushq $0x10
popq %rbp
movq (%rsp), %r15
cmpq $0x10, %r15
jb 0x38ae
movq %rbx, %rdi
callq 0x38e5
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0x3936
jmp 0x3883
testq %r15, %r15
je 0x38d6
movq %rbx, %rdi
callq 0x38e5
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
movq %r15, %r8
xorl %r9d, %r9d
callq 0x3936
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr_shared.c
// Function: crypto_aesctr_stream_cipherblock_generate
static inline void
crypto_aesctr_stream_cipherblock_generate(struct crypto_aesctr * stream)
{

	/* Sanity check. */
	assert(stream->bytectr % 16 == 0);

	/* Prepare counter. */
	stream->pblk[15]++;
	if (stream->pblk[15] == 0) {
		/*
		 * If incrementing the least significant byte resulted in it
		 * wrapping, re-encode the complete 64-bit value.
		 */
		be64enc(stream->pblk + 8, stream->bytectr / 16);
	}

	/* Encrypt the cipherblock. */
	crypto_aes_encrypt_block(stream->pblk, stream->buf, stream->key);
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rsi
testb $0xf, %sil
jne 0x3919
movq %rdi, %rbx
incb 0x2f(%rdi)
jne 0x3905
leaq 0x28(%rbx), %rdi
shrq $0x4, %rsi
callq 0x379d
leaq 0x20(%rbx), %rdi
movq (%rbx), %rdx
addq $0x10, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x2fe8
leaq 0x209b(%rip), %rdi      # 0x59bb
leaq 0x20ae(%rip), %rsi      # 0x59d5
leaq 0x20c8(%rip), %rcx      # 0x59f6
pushq $0x15
popq %rdx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr.c
// Function: crypto_aesctr_buf
void
crypto_aesctr_buf(const struct crypto_aes_key * key, uint64_t nonce,
    const uint8_t * inbuf, uint8_t * outbuf, size_t buflen)
{
	struct crypto_aesctr stream_rec;
	struct crypto_aesctr * stream = &stream_rec;

	/* Sanity check. */
	assert(key != NULL);

	/* Initialize values. */
	crypto_aesctr_init2(stream, key, nonce);

	/* Perform the encryption. */
	crypto_aesctr_stream(stream, inbuf, outbuf, buflen);

	/* Zero potentially sensitive information. */
	insecure_memzero(stream, sizeof(struct crypto_aesctr));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0x39e8
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3710
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x37f7
leaq 0x5867(%rip), %rax      # 0x9238
movq (%rax), %rax
pushq $0x30
popq %rsi
movq %r12, %rdi
callq *%rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1e7e(%rip), %rdi      # 0x586d
leaq 0x1e83(%rip), %rsi      # 0x5879
leaq 0x1f42(%rip), %rcx      # 0x593f
movl $0xed, %edx
callq 0x20a0
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr_aesni.c
// Function: crypto_aesctr_aesni_stream
void
crypto_aesctr_aesni_stream(struct crypto_aesctr * stream, const uint8_t * inbuf,
    uint8_t * outbuf, size_t buflen)
{

	/* Process any bytes before we can process a whole block. */
	if (crypto_aesctr_stream_pre_wholeblock(stream, &inbuf, &outbuf,
	    &buflen))
		return;

	/* Process whole blocks of 16 bytes. */
	if (buflen >= 16)
		crypto_aesctr_aesni_stream_wholeblocks(stream, &inbuf,
		    &outbuf, &buflen);

	/* Process any final bytes after finishing all whole blocks. */
	crypto_aesctr_stream_post_wholeblock(stream, &inbuf, &outbuf, &buflen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdi, %rbx
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq 0x8(%rdi), %r9
andq $0xf, %r9
je 0x3a6a
leaq (%r9,%r12), %r14
pushq $0x10
popq %r8
subq %r9, %r8
cmpq $0x11, %r14
cmovbq %r12, %r8
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
callq 0x3bb4
cmpq $0x11, %r14
jb 0x3b88
movq (%rsp), %r12
cmpq $0x10, %r12
jb 0x3afc
movq 0x20(%rbx), %xmm0
movdqa %xmm0, 0x20(%rsp)
movq 0x8(%rbx), %r14
shrq $0x4, %r14
movq %r12, 0x18(%rsp)
shrq $0x4, %r12
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r13
movq %r14, %r15
bswapq %r15
movq %r15, %xmm1
movdqa 0x20(%rsp), %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq (%rbx), %rdi
callq 0x364a
movdqu (%rbp), %xmm1
pxor %xmm0, %xmm1
movdqu %xmm1, (%r13)
incq %r14
addq $0x10, %rbp
addq $0x10, %r13
decq %r12
jne 0x3a9a
movq %rbp, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %r12
movq %r12, %rax
andq $-0x10, %rax
andl $0xf, %r12d
movq %r12, (%rsp)
movq %r15, 0x28(%rbx)
addq %rax, 0x8(%rbx)
testq %r12, %r12
je 0x3b88
movq 0x8(%rbx), %rax
testb $0xf, %al
jne 0x3b97
incb 0x2f(%rbx)
jne 0x3b5d
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, 0x2f(%rbx)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, 0x2e(%rbx)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, 0x2d(%rbx)
movq %rax, %rcx
shrq $0x1c, %rcx
movb %cl, 0x2c(%rbx)
movq %rax, %rcx
shrq $0x24, %rcx
movb %cl, 0x2b(%rbx)
movq %rax, %rcx
shrq $0x2c, %rcx
movb %cl, 0x2a(%rbx)
movq %rax, %rcx
shrq $0x34, %rcx
movb %cl, 0x29(%rbx)
shrq $0x3c, %rax
movb %al, 0x28(%rbx)
leaq 0x20(%rbx), %rdi
leaq 0x10(%rbx), %rsi
movq (%rbx), %rdx
callq 0x2fe8
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
movq %r12, %r8
xorl %r9d, %r9d
callq 0x3bb4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e1d(%rip), %rdi      # 0x59bb
leaq 0x1e30(%rip), %rsi      # 0x59d5
leaq 0x1e4a(%rip), %rcx      # 0x59f6
pushq $0x15
popq %rdx
callq 0x20a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/liball/../crypto/crypto_aesctr_shared.c
// Function: crypto_aesctr_stream_cipherblock_use
static inline void
crypto_aesctr_stream_cipherblock_use(struct crypto_aesctr * stream,
    const uint8_t ** inbuf, uint8_t ** outbuf, size_t * buflen, size_t nbytes,
    size_t bytemod)
{
	size_t i;

	/* Encrypt the byte(s). */
	for (i = 0; i < nbytes; i++)
		(*outbuf)[i] = (*inbuf)[i] ^ stream->buf[bytemod + i];

	/* Move to the next byte(s) of cipherstream. */
	stream->bytectr += nbytes;

	/* Update the positions. */
	*inbuf += nbytes;
	*outbuf += nbytes;
	*buflen -= nbytes;
}

// Assembly:
leaq (%r9,%rdi), %rax
addq $0x10, %rax
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x3bdb
movq (%rsi), %r10
movb (%rax,%r9), %r11b
xorb (%r10,%r9), %r11b
movq (%rdx), %r10
movb %r11b, (%r10,%r9)
incq %r9
jmp 0x3bbf
addq %r8, 0x8(%rdi)
addq %r8, (%rsi)
addq %r8, (%rdx)
subq %r8, (%rcx)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/gf.c
// Function: setup_tables
int setup_tables()
{
  u_int b, log, x_to_w, prim_poly;

  switch(W) {
  case 4:  prim_poly = prim_poly_4;  break;
  case 8:  prim_poly = prim_poly_8;  break;
  case 16: prim_poly = prim_poly_16; break;
  default: return -1;
  }
  x_to_w = 1 << W;
  gflog  = (unsigned short *) xmalloc (sizeof(unsigned short) * x_to_w);
  gfilog = (unsigned short *) xmalloc (sizeof(unsigned short) * x_to_w);
  b = 1;
  for (log = 0; log < x_to_w-1; log++) {
    gflog[b] = (unsigned short) log;
    gfilog[log] = (unsigned short) b;
    b = b << 1;
    if (b & x_to_w) b = b ^ prim_poly;
  }
  return 0; 
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x3e35(%rip), %ebp      # 0x50d0
pushq $0x20
popq %rbx
movq %rbx, %rdi
callq 0x2a78
movq %rax, 0x3e3b(%rip)      # 0x50e8
movq %rbx, %rdi
callq 0x2a78
movq %rax, 0x3e34(%rip)      # 0x50f0
pushq $0x1
popq %rcx
xorl %edx, %edx
movq 0x3e20(%rip), %rsi      # 0x50e8
cmpq $0xf, %rdx
je 0x12ea
movl %ecx, %edi
movw %dx, (%rsi,%rdi,2)
movw %cx, (%rax,%rdx,2)
leal (%rcx,%rcx), %edi
shll $0x1c, %ecx
sarl $0x1f, %ecx
andl %ebp, %ecx
xorl %edi, %ecx
incq %rdx
jmp 0x12c8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/gf.c
// Function: dump_tables
void dump_tables()
{
  u_int log, x_to_w;

  x_to_w = 1 << W;
  for (log = 0; log < x_to_w-1; log++) {
    printf("%d ", gflog[log]);
  }
  printf("\n");
  for (log = 0; log < x_to_w-1; log++) {
    printf("%d ", gfilog[log]);
  }
  printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1d06(%rip), %rbx      # 0x3004
xorl %r14d, %r14d
cmpq $0xf, %r14
je 0x1322
movq 0x3dda(%rip), %rax      # 0x50e8
movzwl (%rax,%r14,2), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
incq %r14
jmp 0x1301
pushq $0xa
popq %rdi
callq 0x1040
leaq 0x1cd3(%rip), %rbx      # 0x3004
xorl %r14d, %r14d
cmpq $0xf, %r14
je 0x1355
movq 0x3daf(%rip), %rax      # 0x50f0
movzwl (%rax,%r14,2), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
incq %r14
jmp 0x1334
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/gf.c
// Function: gmul
int gmul(int a, int b)
{
  int sum_log;
  if (a == 0 || b == 0) return 0;
  sum_log = gflog[a] + gflog[b];
  if (sum_log >= NW-1) sum_log -= NW-1;
  return gfilog[sum_log];
}

// Assembly:
testl %edi, %edi
sete %cl
testl %esi, %esi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x13a1
movq 0x3d6d(%rip), %rax      # 0x50e8
movslq %edi, %rcx
movzwl (%rax,%rcx,2), %ecx
movslq %esi, %rdx
movzwl (%rax,%rdx,2), %eax
leal (%rax,%rcx), %edx
cmpl $0xf, %edx
leal -0xf(%rax,%rcx), %eax
cmovbl %edx, %eax
movq 0x3d53(%rip), %rcx      # 0x50f0
movzwl (%rcx,%rax,2), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/gf.c
// Function: gdiv
int gdiv(int a, int b)
{
  int diff_log;
  if (a == 0) return 0;
  if (b == 0) return -1;
  diff_log = gflog[a] - gflog[b];
  if (diff_log < 0) diff_log += NW-1;
  return gfilog[diff_log];
}

// Assembly:
testl %edi, %edi
je 0x13d7
testl %esi, %esi
je 0x13da
movq 0x3d37(%rip), %rax      # 0x50e8
movslq %edi, %rcx
movzwl (%rax,%rcx,2), %ecx
movslq %esi, %rdx
movzwl (%rax,%rdx,2), %eax
subl %eax, %ecx
leal 0xf(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
movq 0x3d20(%rip), %rcx      # 0x50f0
cltq
movzwl (%rcx,%rax,2), %eax
retq
xorl %eax, %eax
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/gf.c
// Function: gpow
int gpow(int a, int b)
{
  int r, i;

  if (0 == b)
    return 1;

  if (1 == b)
    return a;

  r = a;
  for (i = 1; i < b;i++) {
    r = gmul(r, a);
  }

  return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testl %esi, %esi
je 0x1408
movl %esi, %ebp
movl %edi, %ebx
cmpl $0x1, %esi
je 0x140f
pushq $0x1
popq %r14
movl %ebx, %eax
cmpl %ebp, %r14d
jge 0x140d
movl %eax, %edi
movl %ebx, %esi
callq 0x1364
incl %r14d
jmp 0x13f5
pushq $0x1
popq %rbx
jmp 0x140f
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_xcalloc
t_mat *mat_xcalloc(u_int n_rows, u_int n_cols)
{
  t_mat *mat;

  mat = xmalloc(sizeof (*mat));
  mat->n_rows = n_rows;
  mat->n_cols = n_cols;
  mat->mem = xmalloc(sizeof (int) * n_rows * n_cols);
  mat_zero(mat);
  return mat;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x10
popq %rdi
callq 0x2a78
movq %rax, %rbx
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
movl %r14d, %eax
movl %ebp, %edi
imulq %rax, %rdi
shlq $0x2, %rdi
callq 0x2a78
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
movl 0x4(%rbx), %edx
imulq %rcx, %rdx
shlq $0x2, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x10a0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_dump
void mat_dump(t_mat *mat)
{
  int i, j;
  
  for (i = 0;i < mat->n_rows;i++) {
    for (j = 0;j < mat->n_cols;j++) {
      printf("%d ", MAT_ITEM(mat, i, j));
    }
    printf("\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xd58(%rip), %r14       # 0x3004
pushq $0xa
popq %rbp
xorl %r15d, %r15d
cmpl (%rbx), %r15d
jae 0x22eb
xorl %r12d, %r12d
movl 0x4(%rbx), %eax
cmpl %eax, %r12d
jae 0x22df
movq 0x8(%rbx), %rcx
imull %r15d, %eax
addl %r12d, %eax
movl (%rcx,%rax,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
incl %r12d
jmp 0x22ba
movl %ebp, %edi
callq 0x1040
incl %r15d
jmp 0x22b2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_vandermonde
t_mat *mat_vandermonde(u_int n_rows, u_int n_cols)
{
  t_mat *mat;
  int i, j;
  
  mat = mat_xcalloc(n_rows, n_cols);
  for (i = 0;i < n_rows;i++) {
    for (j = 0;j < n_cols;j++) {
      MAT_ITEM(mat, i, j) = gpow(j + 1, i); 
    }
  }
  return mat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
callq 0x222f
movq %rax, %r14
xorl %r15d, %r15d
cmpl %ebp, %r15d
je 0x2346
xorl %r13d, %r13d
cmpl %r13d, %ebx
je 0x2341
leal 0x1(%r13), %r12d
movl %r12d, %edi
movl %r15d, %esi
callq 0x13de
movq 0x8(%r14), %rcx
movl 0x4(%r14), %edx
imull %r15d, %edx
addl %r13d, %edx
movl %eax, (%rcx,%rdx,4)
movl %r12d, %r13d
jmp 0x2316
incl %r15d
jmp 0x230e
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_cauchy
t_mat *mat_cauchy(u_int n_rows, u_int n_cols)
{
  t_mat *mat;
  int i, j;

  mat = mat_xcalloc(n_rows, n_cols);
  for (i = 0;i < n_rows;i++) {
    for (j = 0;j < n_cols;j++) {
      MAT_ITEM(mat, i, j) = gdiv(1, (i ^ (j + n_rows)));
    }
  }

  /* do optimise */
  // convert 1st row to all 1s
  for (j = 0;j < n_cols;j++) {
    for (i = 0;i < n_rows;i++) {
      MAT_ITEM(mat, i, j) = gdiv(MAT_ITEM(mat, i, j), MAT_ITEM(mat, 0, j));
    }
  }
  // convert 1st element of each row to 1
  for (i = 1;i < n_rows;i++) {
    for (j = 0;j < n_cols;j++) {
      MAT_ITEM(mat, i, j) = gdiv(MAT_ITEM(mat, i, j), MAT_ITEM(mat, i, 0));
    }
  }

  return mat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
callq 0x222f
movq %rax, %r15
xorl %r12d, %r12d
pushq $0x1
popq %rbp
cmpl %r14d, %r12d
je 0x23ad
xorl %r13d, %r13d
cmpl %r13d, %ebx
je 0x23a8
leal (%r14,%r13), %esi
xorl %r12d, %esi
movl %ebp, %edi
callq 0x13a2
movq 0x8(%r15), %rcx
movl 0x4(%r15), %edx
imull %r12d, %edx
addl %r13d, %edx
movl %eax, (%rcx,%rdx,4)
incl %r13d
jmp 0x237e
incl %r12d
jmp 0x2376
movl %ebx, %eax
movq %rax, (%rsp)
xorl %r13d, %r13d
cmpq (%rsp), %r13
je 0x2435
xorl %r12d, %r12d
cmpl %r12d, %r14d
je 0x23f6
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
imull %r12d, %ecx
addl %r13d, %ecx
movl (%rax,%rcx,4), %edi
movl (%rax,%r13,4), %esi
callq 0x13a2
movq 0x8(%r15), %rcx
movl 0x4(%r15), %edx
imull %r12d, %edx
addl %r13d, %edx
movl %eax, (%rcx,%rdx,4)
incl %r12d
jmp 0x23bf
incq %r13
jmp 0x23b6
xorl %r12d, %r12d
cmpl %r12d, %ebx
je 0x2433
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
imull %ebp, %ecx
leal (%r12,%rcx), %edx
movl (%rax,%rdx,4), %edi
movl (%rax,%rcx,4), %esi
callq 0x13a2
movq 0x8(%r15), %rcx
movl 0x4(%r15), %edx
imull %ebp, %edx
addl %r12d, %edx
movl %eax, (%rcx,%rdx,4)
incl %r12d
jmp 0x23fe
incl %ebp
cmpl %r14d, %ebp
jb 0x23fb
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_check_row_is_identity
int mat_check_row_is_identity(t_mat *mat, int row)
{
  int j;

  for (j = 0;j < mat->n_cols;j++) {
    if (MAT_ITEM(mat, row, j) != ((j == row) ? 1 : 0))
      return 0;
  }
  return 1;
}

// Assembly:
movl 0x4(%rdi), %ecx
movl %ecx, %edx
imull %esi, %edx
xorl %r8d, %r8d
pushq $0x1
popq %rax
cmpl %r8d, %ecx
je 0x247c
movq 0x8(%rdi), %r9
leal (%rdx,%r8), %r10d
xorl %r11d, %r11d
cmpl %r8d, %esi
sete %r11b
incl %r8d
cmpl %r11d, (%r9,%r10,4)
je 0x245a
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_swap_cols
void mat_swap_cols(t_mat *mat, int c1, int c2)
{
  int i;

  assert(c1 < mat->n_cols && c2 < mat->n_cols);
  for (i = 0;i < mat->n_rows;i++) {
    int val = MAT_ITEM(mat, i, c1);
    MAT_ITEM(mat, i, c1) = MAT_ITEM(mat, i, c2);
    MAT_ITEM(mat, i, c2) = val;
  }
}

// Assembly:
pushq %rax
movl 0x4(%rdi), %eax
cmpl %esi, %eax
jbe 0x24c3
cmpl %edx, %eax
jbe 0x24c3
xorl %eax, %eax
cmpl (%rdi), %eax
jae 0x24c1
movq 0x8(%rdi), %rcx
movl 0x4(%rdi), %r8d
imull %eax, %r8d
leal (%r8,%rsi), %r9d
movl (%rcx,%r9,4), %r10d
addl %edx, %r8d
movl (%rcx,%r8,4), %r8d
movl %r8d, (%rcx,%r9,4)
movl 0x4(%rdi), %r8d
imull %eax, %r8d
addl %edx, %r8d
movl %r10d, (%rcx,%r8,4)
incl %eax
jmp 0x248b
popq %rax
retq
leaq 0xe41(%rip), %rdi       # 0x330b
leaq 0xe5f(%rip), %rsi       # 0x3330
leaq 0xe5e(%rip), %rcx       # 0x3336
pushq $0x63
popq %rdx
callq 0x1090
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_transform1
void mat_transform1(t_mat *tmp, int i)
{
  int k;
  int f_minus_1 = gdiv(1, MAT_ITEM(tmp, i, i));

  for (k = 0;k < tmp->n_rows;k++) {
    MAT_ITEM(tmp, k, i) = gmul(f_minus_1, MAT_ITEM(tmp, k, i));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl 0x4(%rdi), %ecx
incl %ecx
imull %esi, %ecx
movl (%rax,%rcx,4), %esi
pushq $0x1
popq %rdi
callq 0x13a2
movl %eax, %ebp
xorl %r15d, %r15d
cmpl (%r14), %r15d
jae 0x253b
movq 0x8(%r14), %rax
movl 0x4(%r14), %ecx
imull %r15d, %ecx
addl %ebx, %ecx
movl (%rax,%rcx,4), %esi
movl %ebp, %edi
callq 0x1364
movq 0x8(%r14), %rcx
movl 0x4(%r14), %edx
imull %r15d, %edx
addl %ebx, %edx
movl %eax, (%rcx,%rdx,4)
incl %r15d
jmp 0x2508
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_transform2
void mat_transform2(t_mat *tmp, int i, int j)
{
  int k;
  int f_i_j = MAT_ITEM(tmp, i, j);

  for (k = 0;k < tmp->n_rows;k++) {
    MAT_ITEM(tmp, k, j) = MAT_ITEM(tmp, k, j) ^ gmul(f_i_j, MAT_ITEM(tmp, k, i));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rcx
movl 0x4(%rdi), %eax
imull %esi, %eax
addl %edx, %eax
movl (%rcx,%rax,4), %r15d
xorl %r12d, %r12d
cmpl (%r14), %r12d
jae 0x25a5
movl 0x4(%r14), %eax
imull %r12d, %eax
leal (%rax,%rbx), %edx
movl (%rcx,%rdx,4), %r13d
addl %ebp, %eax
movl (%rcx,%rax,4), %esi
movl %r15d, %edi
callq 0x1364
xorl %r13d, %eax
movq 0x8(%r14), %rcx
movl 0x4(%r14), %edx
imull %r12d, %edx
addl %ebx, %edx
movl %eax, (%rcx,%rdx,4)
incl %r12d
jmp 0x256b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_vandermonde_correct
t_mat *mat_vandermonde_correct(u_int n_rows, u_int n_cols)
{
  t_mat *mat, *tmp;
  int i, j, dim;
  
  dim = n_rows + n_cols;
  tmp = mat_xcalloc(dim, n_cols);
  for (i = 0;i < dim;i++) {
    for (j = 0;j < n_cols;j++) {
      MAT_ITEM(tmp, i, j) = gpow(i, j); 
    }
  }

  /* perform transformations to get the identity matrix on the top rows */
  i = 0;
  while (i < n_cols) {
    
    if (mat_check_row_is_identity(tmp, i)) {
      i++;
      continue ;
    }
    
    //this case is mentionned in the paper but cannot happen
    /* if (0 == MAT_ITEM(tmp, i, i)) {
       for (j = i + 1;j < tmp->n_cols;j++) {
       if (0 != MAT_ITEM(tmp, i, j)) {
       mat_swap_cols(tmp, i, j);
       continue ;
       }
       } */
    
    //check if f_i_i == 1
    if (1 != MAT_ITEM(tmp, i, i)) {
      //check for inverse since f_i_i != 0
      mat_transform1(tmp, i);
    }
    
    //now f_i_i == 1
    for (j = 0;j < tmp->n_cols;j++) {
      if (i != j) {
        if (0 != MAT_ITEM(tmp, i, j)) {
          mat_transform2(tmp, i, j);
        }
      }
    }
    
    i++;
  }

  mat = mat_xcalloc(n_rows, n_cols);

  //copy last n_rows rows of tmp into mat
  for (i = 0;i < n_rows;i++) {
    for (j = 0;j < n_cols;j++) {
      MAT_ITEM(mat, i, j) = MAT_ITEM(tmp, n_cols + i, j);
    }
  }

  free(tmp);
  return mat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
leal (%rbx,%r14), %ebp
movl %ebp, %edi
callq 0x222f
movq %rax, %r15
xorl %r12d, %r12d
testl %ebp, %ebp
cmovlel %r12d, %ebp
cmpl %ebp, %r12d
je 0x260f
xorl %r13d, %r13d
cmpl %r13d, %ebx
je 0x260a
movl %r12d, %edi
movl %r13d, %esi
callq 0x13de
movq 0x8(%r15), %rcx
movl 0x4(%r15), %edx
imull %r12d, %edx
addl %r13d, %edx
movl %eax, (%rcx,%rdx,4)
incl %r13d
jmp 0x25e3
incl %r12d
jmp 0x25db
xorl %ebp, %ebp
cmpl %ebx, %ebp
je 0x2677
movq %r15, %rdi
movl %ebp, %esi
callq 0x244c
testl %eax, %eax
je 0x2627
incl %ebp
jmp 0x2611
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
incl %ecx
imull %ebp, %ecx
cmpl $0x1, (%rax,%rcx,4)
je 0x2644
movq %r15, %rdi
movl %ebp, %esi
callq 0x24e0
xorl %r12d, %r12d
movl 0x4(%r15), %eax
cmpl %eax, %r12d
jae 0x2623
cmpl %r12d, %ebp
je 0x2672
movq 0x8(%r15), %rcx
imull %ebp, %eax
addl %r12d, %eax
cmpl $0x0, (%rcx,%rax,4)
je 0x2672
movq %r15, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x2546
incl %r12d
jmp 0x2647
movl %r14d, %edi
movl %ebx, %esi
callq 0x222f
movq %rax, %r12
xorl %eax, %eax
movl %ebx, %ecx
cmpl %r14d, %eax
je 0x26c2
xorl %edx, %edx
cmpl %edx, %ebx
je 0x26bc
movq 0x8(%r15), %rsi
movl 0x4(%r15), %edi
imull %ecx, %edi
addl %edx, %edi
movl (%rsi,%rdi,4), %esi
movq 0x8(%r12), %rdi
movl 0x4(%r12), %r8d
imull %eax, %r8d
addl %edx, %r8d
movl %esi, (%rdi,%r8,4)
incl %edx
jmp 0x268f
incl %eax
incl %ecx
jmp 0x2688
movq %r15, %rdi
callq 0x1030
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/mat.c
// Function: mat_mult
void mat_mult(t_vec *output, t_mat *a, t_vec *b)
{
  int i, j;

  assert(output->n == b->n);
  assert(output->n == a->n_cols);
  for (i = 0;i < a->n_rows;i++) {
    for (j = 0;j < a->n_cols;j++) {
      int x = gmul(MAT_ITEM(a, i, j), VEC_ITEM(b, j));
      if (0 == j)
        VEC_ITEM(output, i) = x;
      else
        VEC_ITEM(output, i) ^= x;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl (%rdi), %eax
cmpl (%rdx), %eax
jne 0x29c0
movq %rsi, %r14
cmpl 0x4(%rsi), %eax
jne 0x29df
movq %rdx, %rbx
movq %rdi, %r15
xorl %r12d, %r12d
movl (%r14), %ecx
cmpq %rcx, %r12
jae 0x29b6
xorl %r13d, %r13d
movl %eax, %ecx
cmpq %rcx, %r13
jae 0x29b1
movq 0x8(%r14), %rcx
imull %r12d, %eax
addl %r13d, %eax
movl (%rcx,%rax,4), %edi
movq 0x8(%rbx), %rax
movl (%rax,%r13,4), %esi
callq 0x1364
movq 0x8(%r15), %rcx
testq %r13, %r13
je 0x29a4
xorl (%rcx,%r12,4), %eax
movl %eax, (%rcx,%r12,4)
incq %r13
movl 0x4(%r14), %eax
jmp 0x2975
incq %r12
jmp 0x296a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x9c6(%rip), %rdi       # 0x338d
leaq 0x962(%rip), %rsi       # 0x3330
leaq 0x9ca(%rip), %rcx       # 0x339f
movl $0x10b, %edx            # imm = 0x10B
callq 0x1090
leaq 0x9e2(%rip), %rdi       # 0x33c8
leaq 0x943(%rip), %rsi       # 0x3330
leaq 0x9ab(%rip), %rcx       # 0x339f
movl $0x10c, %edx            # imm = 0x10C
callq 0x1090
nop
// File: /workspace/github_c_makefile_star2_O2/vrancurel[P]ec/vec.c
// Function: vec_xcalloc
t_vec *vec_xcalloc(u_int n)
{
  t_vec *vec;

  vec = xmalloc(sizeof (*vec));
  vec->n = n;
  vec->mem = xmalloc(sizeof (int) * n);
  vec_zero(vec);
  return vec;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x10
popq %rdi
callq 0x2a78
movq %rax, %r14
movl %ebx, (%rax)
movl %ebx, %edi
shlq $0x2, %rdi
callq 0x2a78
movq %rax, 0x8(%r14)
movl (%r14), %edx
shlq $0x2, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x10a0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: ringbuffer_create
struct ringbuffer *ringbuffer_create(unsigned int size)
{
	struct ringbuffer *rb;

	/* Size needs to be of power of 2 */
	if ((size & (size - 1)) != 0)
		return NULL;

	rb = calloc(1, sizeof(*rb));
	if (!rb)
		return NULL;

	rb->size = size;
	rb->data = calloc(rb->size, sizeof(struct ringbuffer_sample));

	return rb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r14d
leal -0x1(%r14), %eax
testl %eax, %edi
jne 0x23b2
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2130
testq %rax, %rax
je 0x23b2
movq %rax, %rbx
movl %r14d, (%rax)
movl %r14d, %edi
pushq $0x18
popq %rsi
callq 0x2130
movq %rax, 0x10(%rbx)
jmp 0x23b4
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: ringbuffer_write
int ringbuffer_write(struct ringbuffer *rb, struct timespec ts, uint64_t val)
{
	uint32_t read, idx;

	read = READ_ONCE(rb->read);
	if (ringbuffer_full(rb->size, read, rb->write)) {
		rb->overflow++;
		return 1;
	}

	idx = ringbuffer_mask(rb->size, rb->write + 1);
	rb->data[idx].ts = ts;
	rb->data[idx].val = val;

	WRITE_ONCE(rb->write, rb->write + 1);
	return 0;
}

// Assembly:
movl (%rdi), %r8d
movl 0xc(%rdi), %eax
movl %eax, %r9d
subl 0x8(%rdi), %r9d
cmpl %r8d, %r9d
jne 0x23ee
incl 0x4(%rdi)
pushq $0x1
popq %rax
retq
incl %eax
decl %r8d
andl %eax, %r8d
movq 0x10(%rdi), %r9
imulq $0x18, %r8, %r8
movq %rsi, (%r9,%r8)
movq %rdx, 0x8(%r9,%r8)
movq %rcx, 0x10(%r9,%r8)
movl %eax, 0xc(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: ringbuffer_read
int ringbuffer_read(struct ringbuffer *rb, struct timespec *ts, uint64_t *val)
{
	uint32_t write, idx;

	write = READ_ONCE(rb->write);
	if (ringbuffer_empty(rb->read, write))
		return 1;

	idx = ringbuffer_mask(rb->size, rb->read + 1);
	*ts = rb->data[idx].ts;
	*val = rb->data[idx].val;

	WRITE_ONCE(rb->read, rb->read + 1);
	return 0;
}

// Assembly:
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %ecx
cmpl %eax, %ecx
jne 0x2420
pushq $0x1
popq %rax
retq
movl (%rdi), %ecx
incl %eax
decl %ecx
andl %eax, %ecx
movq 0x10(%rdi), %rax
imulq $0x18, %rcx, %rcx
movups (%rax,%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x10(%rdi), %rax
movq 0x10(%rax,%rcx), %rax
movq %rax, (%rdx)
incl 0x8(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: err_handler
void _err_handler(int error, char *fmt, ...)
{
	va_list ap;
	char *msg;

	va_start(ap, fmt);
	vasprintf(&msg, fmt, ap);
	va_end(ap);

	fprintf(stderr, "%s: %s\n", msg, strerror(error));

	free(msg);
	exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edi, %ebx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x24ac
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %rdi, 0x10(%rdx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x20a0
movq 0x3b16(%rip), %rax      # 0x5ff8
movq (%rax), %r15
movq (%r14), %r12
movl %ebx, %edi
callq 0x2250
leaq 0x1b0e(%rip), %rsi      # 0x4004
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2150
movq (%r14), %rdi
callq 0x2030
pushq $0x1
popq %rdi
callq 0x2210
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: parse_num
long int parse_num(const char *str, int base, size_t *len)
{
	long int ret;
	char *endptr;

	errno = 0;
	ret = strtol(str, &endptr, base);
	if (errno)
		return -errno;
	if (ret < 0)
		return -ERANGE;

	if (len)
		*len = endptr - str;

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x2050
movq %rax, %r15
andl $0x0, (%rax)
movq %rsp, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x2170
movslq (%r15), %rcx
testq %rcx, %rcx
je 0x25ee
negq %rcx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testq %rax, %rax
js 0x2604
testq %rbx, %rbx
je 0x25e3
movq (%rsp), %rcx
subq %r14, %rcx
movq %rcx, (%rbx)
jmp 0x25e3
pushq $-0x22
popq %rax
jmp 0x25e3
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: parse_time
long int parse_time(const char *str)
{
	long int t;
	char *end;

	t = strtol(str, &end, 10);

	if (!(strlen(end) == 0 || strlen(end) == 1))
		return -EINVAL;

	if (end) {
		switch (*end) {
		case 's':
		case 'S':
			break;
		case 'm':
		case 'M':
			t *= 60;
			break;

		case 'h':
		case 'H':
			t *= 60 * 60;
			break;

		case 'd':
		case 'D':
			t *= 24 * 60 * 60;
			break;
		default:
			return -EINVAL;
		}
	}

	return t;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsp, %r14
pushq $0xa
popq %rdx
movq %r14, %rsi
callq 0x2170
movq %rax, %rbx
movq (%r14), %r14
movq %r14, %rdi
callq 0x20d0
movq %rax, %rcx
pushq $-0x16
popq %rax
cmpq $0x1, %rcx
ja 0x2681
testq %r14, %r14
je 0x266c
movzbl (%r14), %ecx
cmpl $0x44, %ecx
je 0x2671
cmpl $0x48, %ecx
je 0x267a
cmpl $0x4d, %ecx
je 0x2666
cmpl $0x53, %ecx
je 0x266c
cmpl $0x64, %ecx
je 0x2671
cmpl $0x68, %ecx
je 0x267a
cmpl $0x73, %ecx
je 0x266c
cmpl $0x6d, %ecx
jne 0x2681
imulq $0x3c, %rbx, %rax
jmp 0x2681
movq %rbx, %rax
jmp 0x2681
imulq $0x15180, %rbx, %rax    # imm = 0x15180
jmp 0x2681
imulq $0xe10, %rbx, %rax      # imm = 0xE10
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jd_utils.c
// Function: cpuset_fprint
void cpuset_fprint(FILE *f, cpu_set_t *set)
{
	unsigned long bit = 0, range = 0;
	unsigned long i, t, comma = 0;

	for (i = 0, t = 0; t < (unsigned) CPU_COUNT(set); t += bit, i++) {
		bit = CPU_ISSET(i, set);
		if (!range && bit) {
			if (comma)
				fputc(',', f);

			comma = 1;
			fprintf(f, "%lu", i);
		} else if (!bit) {
			_cpuset_fprint_end(f, i, range);
			range = 0;
		}
		range += bit;
	}

	_cpuset_fprint_end(f, i, range);
	fprintf(f, " = %u [0x%lX]", CPU_COUNT(set), cpuset_to_bits(set));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r13d, %r13d
movl $0x80, %edi
movq %r14, %rsi
callq 0x20c0
movl %eax, %eax
cmpq %rax, %r12
jae 0x2737
cmpq $0x3ff, %r15            # imm = 0x3FF
ja 0x2716
movq %r15, %rdx
pushq $0x1
popq %rax
movl %r15d, %ecx
shlq %cl, %rax
shrq $0x6, %rdx
andq (%r14,%rdx,8), %rax
testq %r13, %r13
jne 0x270c
testq %rax, %rax
je 0x270c
testq %rbp, %rbp
je 0x26f0
pushq $0x2c
popq %rdi
movq %rbx, %rsi
callq 0x2110
movq %rbx, %rdi
leaq 0x1a04(%rip), %rsi      # 0x40fe
movq %r15, %rdx
xorl %eax, %eax
callq 0x2150
pushq $0x1
popq %rbp
movq %rbp, %rax
jmp 0x2726
testq %rax, %rax
je 0x2716
pushq $0x1
popq %rax
jmp 0x2729
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x27c3
xorl %eax, %eax
xorl %r13d, %r13d
addq %rax, %r13
addq %rax, %r12
incq %r15
jmp 0x26a5
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x27c3
movl $0x80, %edi
movq %r14, %rsi
callq 0x20c0
movl %eax, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
movl $0x80, %edi
movq %r14, %rsi
callq 0x20c0
cmpl %eax, %r13d
jae 0x279f
xorl %eax, %eax
cmpl $0x3ff, %r12d           # imm = 0x3FF
ja 0x278d
movl %r12d, %eax
shrl $0x6, %eax
movq (%r14,%rax,8), %rcx
xorl %eax, %eax
btq %r12, %rcx
setb %al
movl %eax, %edx
movl %r12d, %ecx
shll %cl, %edx
orq %rdx, %r15
addl %eax, %r13d
incl %r12d
jmp 0x275d
leaq 0x1866(%rip), %rsi      # 0x400c
movq %rbx, %rdi
movl %ebp, %edx
movq %r15, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150