LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/mitchblank[P]qiksolve/qiksolve.cpp
// Function: SolutionPrinter::acceptSolution(AnswerSequence const&, unsigned int)
void SolutionPrinter::acceptSolution(AnswerSequence const& sequence, Word const word)
{
	sequence.describe(fout_);
	fputs(",Y,", fout_);
	dict_.describeWord(fout_, word);
	fputs(",,\n", fout_);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %rax
movq %rdi, %r14
movq 0x10(%rdi), %rsi
movq %rax, %rdi
callq 0x24c6
movq 0x10(%r14), %rsi
leaq 0x34b9(%rip), %rdi      # 0x620b
callq 0x2170
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
movl %ebx, %edx
callq 0x3aae
movq 0x10(%r14), %rsi
leaq 0x349e(%rip), %rdi      # 0x620f
popq %rbx
popq %r14
popq %rbp
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/mitchblank[P]qiksolve/qiksolve.cpp
// Function: SolutionTree::acceptSolution(AnswerSequence const&, unsigned int)
void SolutionTree::acceptSolution(AnswerSequence const& sequence, Word const word)
{
	string key;
	for (auto it = sequence.cbegin(); it != sequence.cend(); ++it)
		append_unsigned_period(&key, *it);
	assert(map_.find(key) == map_.end());
	map_[key] = word;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, -0x2c(%rbp)
movq %rdi, -0x38(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rsi), %r14
cmpq 0x8(%rsi), %r14
je 0x2e6c
movq %rsi, %r15
leaq 0x36b8(%rip), %r12      # 0x64ef
leaq -0xc0(%rbp), %r13
leaq -0x58(%rbp), %rbx
movl (%r14), %ecx
movl $0x64, %esi
movq %r13, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2200
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2270
addq $0x4, %r14
cmpq 0x8(%r15), %r14
jne 0x2e42
movq -0x38(%rbp), %r14
leaq 0x8(%r14), %rbx
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x46b4
addq $0x10, %r14
cmpq %r14, %rax
jne 0x2ebe
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x3b10
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2eac
callq 0x2140
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x334e(%rip), %rdi      # 0x6213
leaq 0x318d(%rip), %rsi      # 0x6059
leaq 0x335d(%rip), %rcx      # 0x6230
movl $0x207, %edx            # imm = 0x207
callq 0x20c0
jmp 0x2ee1
jmp 0x2ee1
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2ef6
callq 0x2140
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/mitchblank[P]qiksolve/qiksolve.cpp
// Function: main
int main(int argn, char const * const *argv)
{
	if (argn < 2)
		return usage(argv[0]);
	unsigned a = 1;
	enum {
		INTERACTIVE,
		SOLUTION_TREE,
		BATCH
	} mode = INTERACTIVE;
	if (0 == strcmp(argv[1], "-t")) {
		mode = SOLUTION_TREE;
		a = 2;
		argn--;
	} else if (0 == strcmp(argv[1], "-b")) {
		mode = BATCH;
		a = 2;
		argn--;
	}
	if (argn < 2 || argn > 3)
		return usage(argv[0]);
	FILE *fp = fopen(argv[a], "r");
	if (fp == NULL) {
		perror("open");
		return 4;
	}
	Dictionary dict(fp, (argn == 2) ? 4 : static_cast<unsigned>(atoi(argv[a + 1])));
	if (dict.empty()) {
		fprintf(stderr, "%s: No words found!\n", argv[0]);
		return 1;
	}
	switch (mode) {
	case INTERACTIVE:
		dict.interactive();
		break;
	case BATCH:
		dict.batch(stdin, stdout);
		break;
	default:
		assert(mode == SOLUTION_TREE);
		dict.printSolutions(stdout);
		break;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x3853
movl %edi, %r14d
movq 0x8(%rbx), %rax
movl $0x1, %r13d
xorl %ecx, %ecx
cmpb $0x2d, (%rax)
jne 0x3747
cmpb $0x74, 0x1(%rax)
jne 0x3733
cmpb $0x0, 0x2(%rax)
je 0x3827
xorl %ecx, %ecx
cmpb $0x62, 0x1(%rax)
jne 0x3747
xorl %ecx, %ecx
cmpb $0x0, 0x2(%rax)
je 0x383d
xorl %r12d, %r12d
leal -0x4(%r14), %eax
cmpl $-0x3, %eax
jbe 0x385d
movl %ecx, -0x2c(%rbp)
movq (%rbx,%r13,8), %rdi
leaq 0x2c99(%rip), %rsi      # 0x63fe
callq 0x21a0
testq %rax, %rax
je 0x386c
movq %rax, %r15
movl $0x4, %edx
cmpl $0x2, %r14d
je 0x378d
movq 0x8(%rbx,%r13,8), %rdi
callq 0x21f0
movl %eax, %edx
leaq -0x80(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x2570
cmpq $0x0, 0x28(%r14)
je 0x387f
cmpl $0x2, %r12d
je 0x37c1
testl %r12d, %r12d
jne 0x37e0
leaq -0x50(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3266
jmp 0x37fd
movq 0x5810(%rip), %rax      # 0x8fd8
movq (%rax), %rsi
movq 0x57ee(%rip), %rax      # 0x8fc0
movq (%rax), %rdx
leaq -0x80(%rbp), %rdi
callq 0x2efe
jmp 0x37fd
cmpb $0x0, -0x2c(%rbp)
je 0x3891
movq 0x57cf(%rip), %rax      # 0x8fc0
movq (%rax), %rsi
leaq -0x80(%rbp), %rdi
callq 0x2d7a
xorl %ebx, %ebx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x380d
callq 0x2140
leaq -0x80(%rbp), %rdi
callq 0x3cfe
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %r14d
movl $0x2, %r13d
movl $0x1, %r12d
movb $0x1, %cl
jmp 0x374a
decl %r14d
movl $0x2, %r13d
movl $0x2, %r12d
xorl %ecx, %ecx
jmp 0x374a
movq %rbx, %rdi
callq 0x22e7
jmp 0x3865
movq %rbx, %rdi
callq 0x22c4
movl $0x8, %ebx
jmp 0x3816
leaq 0x2b8d(%rip), %rdi      # 0x6400
callq 0x2120
movl $0x4, %ebx
jmp 0x3816
movq %rbx, %rdi
callq 0x22a0
movl $0x1, %ebx
jmp 0x37ff
leaq 0x2b82(%rip), %rdi      # 0x641a
leaq 0x27ba(%rip), %rsi      # 0x6059
leaq 0x2b8a(%rip), %rcx      # 0x6430
movl $0x2bc, %edx            # imm = 0x2BC
callq 0x20c0
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3c96
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/sqlite3-async-test.cc
// Function: main
int main(int argc, char **args) {
    const char *env_path = getenv("SQLITE_TEST_DB");
    Sqlite3 sq(env_path ? env_path : "/tmp/test.db",
               getenv("KVSTORE_AUDITABLE"));
    QueuedKVStore thing(&sq);

    TestSuite suite(&thing);
    return suite.run() ? 0 : 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
leaq 0x68d5(%rip), %rdi      # 0xb004
callq 0x4330
testq %rax, %rax
leaq 0x68d5(%rip), %rbx      # 0xb013
cmovneq %rax, %rbx
leaq 0x68d7(%rip), %rdi      # 0xb020
callq 0x4330
movq %rax, %r14
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5e7a
leaq 0xc310(%rip), %rax      # 0x10a78
addq $0x10, %rax
testq %r14, %r14
movq %rax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r15)
movq $0x0, 0x30(%r15)
setne 0x19(%r15)
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x4864
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x811c
movq %rsp, %rdi
callq 0x8322
xorb $0x1, %al
movzbl %al, %ebx
movq %rsp, %rdi
callq 0x829e
leaq 0x20(%rsp), %rdi
callq 0x4928
leaq 0x48(%rsp), %rdi
callq 0x6566
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x829e
jmp 0x47ee
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4928
jmp 0x47fd
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x6566
movq %rbx, %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::launch_executor_thread(void*)
static void* launch_executor_thread(void* arg) {
        AsyncExecutor *executor = (AsyncExecutor*) arg;
        try {
            executor->run();
        } catch(...) {
            std::cerr << "Caught a fatal exception in the thread" << std::endl;
        }
        return NULL;
    }

// Assembly:
pushq %rbx
callq 0x4e3a
xorl %eax, %eax
popq %rbx
retq
movq %rax, %rdi
callq 0x40d0
movq 0xc7c0(%rip), %rdi      # 0x10fe8
leaq 0x6823(%rip), %rsi      # 0xb052
movl $0x26, %edx
callq 0x42f0
movq 0xc7a8(%rip), %rdi      # 0x10fe8
callq 0x40f0
callq 0x4400
jmp 0x4815
movq %rax, %rbx
callq 0x4400
movq %rbx, %rdi
callq 0x4450
movq %rax, %rdi
callq 0x4e13
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::QueuedKVStore::QueuedKVStore(kvtest::KVStore*, int)
QueuedKVStore(KVStore *t, int max_drain=DEFAULT_MAX_DRAIN) {
            tut = t;
            iq = new AsyncQueue(max_drain);
            executor = new AsyncExecutor(tut, iq);

            if(pthread_create(&thread, NULL, launch_executor_thread, executor)
               != 0) {
                throw std::runtime_error("Error initializing queue thread");
            }
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
leaq 0xbea4(%rip), %rax      # 0x10718
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movl $0xb0, %edi
callq 0x42c0
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
callq 0x49ba
movq %r14, 0x10(%rbx)
movl $0x10, %edi
callq 0x42c0
movq 0x8(%rbx), %rcx
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rax, 0x18(%rbx)
addq $0x20, %rbx
leaq -0xab(%rip), %rdx       # 0x480f
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x4470
testl %eax, %eax
jne 0x48d0
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x4100
movq %rax, %r14
leaq 0x674e(%rip), %rsi      # 0xb032
movq %rax, %rdi
callq 0x40c0
movq 0xc6fd(%rip), %rsi      # 0x10ff0
movq 0xc6be(%rip), %rdx      # 0x10fb8
movq %r14, %rdi
callq 0x4420
movq %rax, %rbx
movq %r14, %rdi
callq 0x41d0
jmp 0x491f
movq %rax, %rbx
movl $0xb0, %esi
movq %r14, %rdi
callq 0x42d0
movq %rbx, %rdi
callq 0x4450
nop
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::QueuedKVStore::~QueuedKVStore()
~QueuedKVStore() {
            executor->stop();
            pthread_join(thread, NULL);
            delete executor;
            delete iq;
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xbde2(%rip), %rax      # 0x10718
movq %rax, (%rdi)
movq 0x18(%rdi), %rax
movq 0x8(%rax), %r14
movl $0x8, %edi
callq 0x42c0
leaq 0xc086(%rip), %rcx      # 0x109d8
movq %rcx, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x54ce
movq 0x20(%rbx), %rdi
xorl %esi, %esi
callq 0x4250
movq 0x18(%rbx), %rdi
movl $0x10, %esi
callq 0x42d0
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x499d
leaq 0x30(%rbx), %rdi
callq 0x44a0
leaq 0x8(%rbx), %rdi
callq 0x4300
leaq 0x60(%rbx), %rdi
callq 0x53d6
movl $0xb0, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42d0
movq %rax, %rdi
callq 0x4e13
nop
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::QueuedKVStore::reset()
void reset() {
            std::queue<AsyncOperation*> opq;
            RememberingCallback<bool> cb;
            iq->addOperation(new ResetOperation(&cb));
            cb.waitForValue();
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x4cba
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x542e
movq 0x10(%rbx), %rbx
movl $0x10, %edi
callq 0x42c0
movq %r14, 0x8(%rax)
leaq 0xbdbf(%rip), %rcx      # 0x10840
movq %rcx, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x54ce
leaq 0x8(%rsp), %rdi
callq 0x55a0
leaq 0xbd50(%rip), %rax      # 0x107f0
leaq 0x18(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x4300
leaq 0x40(%rsp), %rdi
callq 0x44a0
leaq 0x70(%rsp), %rdi
callq 0x53d6
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x4af4
movq %rax, %rbx
leaq 0xbd14(%rip), %rax      # 0x107f0
leaq 0x18(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x4300
leaq 0x40(%rsp), %rdi
callq 0x44a0
leaq 0x70(%rsp), %rdi
callq 0x53d6
movq %rbx, %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::AsyncExecutor::run()
void run() {
            try {
                while(true) {
                    std::queue<AsyncOperation*> ops;
                    iq->drainTo(ops);
                    tut->begin();
                    int count = 0;

                    while(!ops.empty()) {
                        AsyncOperation *op = ops.front();
                        ops.pop();

                        op->execute(tut);
                        count++;
                        delete op;
                    }

                    tut->commit();
                }
            } catch(AsyncShutdownOperation *op) {
                delete op;
                std::cerr << "Shutting down..." << std::endl;
            } catch(std::runtime_error &e) {
                std::cerr << "Exception in executor loop: "
                          << e.what() << std::endl;
                abort();
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq %rsp, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4cba
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5006
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x10(%rsp), %rax
cmpq %rax, 0x30(%rsp)
je 0x4ef4
movq (%rax), %r15
movq 0x20(%rsp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x4ea6
addq $0x8, %rax
jmp 0x4ed8
movq 0x18(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x42d0
movq 0x28(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movq (%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x4e83
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %r14, %rdi
callq 0x53d6
jmp 0x4e49
jmp 0x4f16
movq %rdx, %r14
movq %rax, %rbx
jmp 0x4f24
jmp 0x4f16
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x53d6
cmpl $0x2, %r14d
jne 0x4f95
movq %rbx, %rdi
callq 0x40d0
testq %rax, %rax
je 0x4f40
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0xc0a1(%rip), %rbx      # 0x10fe8
leaq 0x6148(%rip), %rsi      # 0xb096
movl $0x10, %edx
movq %rbx, %rdi
callq 0x42f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq 0xc06f(%rip), %rdi      # 0x10fe8
callq 0x4040
movq %rax, %rdi
callq 0x41a0
callq 0x4400
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x1, %r14d
jne 0x4ffd
movq %rbx, %rdi
callq 0x40d0
movq %rax, %rbx
movq 0xc03b(%rip), %rdi      # 0x10fe8
leaq 0x60c5(%rip), %rsi      # 0xb079
movl $0x1c, %edx
callq 0x42f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xc01a(%rip), %rdi      # 0x10fe8
movq %rax, %rsi
callq 0x42b0
movq %rax, %rdi
callq 0x40f0
callq 0x4160
movq %rax, %rbx
callq 0x4400
jmp 0x4ffd
movq %rax, %rdi
callq 0x4e13
movq %rax, %rbx
callq 0x4400
movq %rbx, %rdi
callq 0x4450
nop
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::AsyncQueue::drainTo(std::queue<kvtest::AsyncOperation*, std::deque<kvtest::AsyncOperation*, std::allocator<kvtest::AsyncOperation*>>>&)
void drainTo(std::queue<AsyncOperation*> &out) {
            LockHolder lh(&mutex);
            if(ops.empty()) {
                if(pthread_cond_wait(&cond, &mutex) != 0) {
                    throw std::runtime_error("Error waiting for signal.");
                }
            }
            for(int i = 0; i < max_drain_ && !ops.empty(); i++) {
                out.push(ops.front());
                ops.pop();
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x510c
movq 0x90(%r14), %rax
cmpq 0x70(%r14), %rax
jne 0x5044
leaq 0x30(%r14), %rdi
movq %r15, %rsi
callq 0x43b0
testl %eax, %eax
jne 0x50ae
cmpl $0x0, (%r14)
jle 0x5092
leaq 0x60(%r14), %r15
xorl %ebp, %ebp
movq 0x70(%r14), %rsi
cmpq %rsi, 0x90(%r14)
je 0x5092
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x507b
movq (%rsi), %rcx
movq %rcx, (%rax)
addq $0x8, 0x30(%rbx)
jmp 0x5083
movq %rbx, %rdi
callq 0x5174
movq %r15, %rdi
callq 0x5388
incl %ebp
cmpl (%r14), %ebp
jl 0x5050
cmpb $0x0, 0x10(%rsp)
jne 0x50a3
movq 0x8(%rsp), %rdi
callq 0x41f0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4100
movq %rax, %r14
leaq 0x5fe5(%rip), %rsi      # 0xb0a7
movq %rax, %rdi
callq 0x40c0
movq 0xbf1f(%rip), %rsi      # 0x10ff0
movq 0xbee0(%rip), %rdx      # 0x10fb8
movq %r14, %rdi
callq 0x4420
movq %rax, %rbx
movq %r14, %rdi
callq 0x41d0
jmp 0x50f2
jmp 0x50ef
movq %rax, %rbx
cmpb $0x0, 0x10(%rsp)
jne 0x5103
movq 0x8(%rsp), %rdi
callq 0x41f0
movq %rbx, %rdi
callq 0x4450
nop
// File: /workspace/github_cpp_makefile_star2_O3/dustin[P]kvtest/./async.hh
// Function: kvtest::AsyncQueue::addOperation(kvtest::AsyncOperation*)
void addOperation(AsyncOperation *op) {
            LockHolder lh(&mutex);
            ops.push(op);
            if(pthread_cond_signal(&cond) != 0) {
                throw std::runtime_error("Error signaling change.");
            }
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, 0x10(%rsp)
leaq 0x8(%rdi), %rsi
movq %rsp, %rdi
callq 0x510c
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x5510
movq %r14, (%rax)
addq $0x8, 0x90(%rbx)
jmp 0x551e
leaq 0x60(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5174
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x4030
testl %eax, %eax
jne 0x5546
cmpb $0x0, 0x8(%rsp)
jne 0x553e
movq (%rsp), %rdi
callq 0x41f0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x4100
movq %rax, %r14
leaq 0x5c07(%rip), %rsi      # 0xb161
movq %rax, %rdi
callq 0x40c0
movq 0xba87(%rip), %rsi      # 0x10ff0
movq 0xba48(%rip), %rdx      # 0x10fb8
movq %r14, %rdi
callq 0x4420
movq %rax, %rbx
movq %r14, %rdi
callq 0x41d0
jmp 0x5588
movq %rax, %rbx
cmpb $0x0, 0x8(%rsp)
jne 0x5598
movq (%rsp), %rdi
callq 0x41f0
movq %rbx, %rdi
callq 0x4450
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part3/condition_variables.cpp
// Function: consumer(int, BoundedBuffer&)
void consumer(int id, BoundedBuffer& buffer){
    for(int i = 0; i < 50; ++i){
        int value = buffer.fetch();
        std::cout << "Consumer " << id << " fetched " << value << std::endl;
        std::this_thread::sleep_for(std::chrono::milliseconds(250));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x2cc7(%rip), %r14      # 0x4fd8
leaq 0x8(%rsp), %r13
movq %rsi, (%rsp)
movl %edi, %ebp
xorl %ebx, %ebx
movq (%rsp), %rdi
callq 0x2656
movl $0x9, %edx
leaq 0xcd1(%rip), %rsi       # 0x3004
movq %r14, %rdi
movl %eax, %r15d
callq 0x2140
movq %r14, %rdi
movl %ebp, %esi
callq 0x21a0
movl $0x9, %edx
leaq 0xcba(%rip), %rsi       # 0x300e
movq %rax, %rdi
movq %rax, %r12
callq 0x2140
movq %r12, %rdi
movl %r15d, %esi
callq 0x21a0
movq %rax, %r15
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r15, %rdi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movq $0x0, 0x8(%rsp)
movq $0xee6b280, 0x10(%rsp)  # imm = 0xEE6B280
movq %r13, %rdi
movq %r13, %rsi
callq 0x2080
cmpl $-0x1, %eax
jne 0x23c0
callq 0x2050
cmpl $0x4, (%rax)
je 0x23a6
incl %ebx
cmpl $0x32, %ebx
jne 0x231e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part3/condition_variables.cpp
// Function: producer(int, BoundedBuffer&)
void producer(int id, BoundedBuffer& buffer){
    for(int i = 0; i < 75; ++i){
        buffer.deposit(i);
        std::cout << "Produced " << id << " produced " << i << std::endl;
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x2be9(%rip), %r15      # 0x4fd8
leaq 0x8(%rsp), %r12
movq %rsi, %rbx
movl %edi, %ebp
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x26fe
movl $0x9, %edx
leaq 0xc05(%rip), %rsi       # 0x3018
movq %r15, %rdi
callq 0x2140
movq %r15, %rdi
movl %ebp, %esi
callq 0x21a0
movl $0xa, %edx
leaq 0xbf1(%rip), %rsi       # 0x3022
movq %rax, %rdi
movq %rax, %r13
callq 0x2140
movq %r13, %rdi
movl %r14d, %esi
callq 0x21a0
movq %rax, %r13
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r13, %rdi
callq 0x2120
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movq $0x0, 0x8(%rsp)
movq $0x5f5e100, 0x10(%rsp)  # imm = 0x5F5E100
movq %r12, %rdi
movq %r12, %rsi
callq 0x2080
cmpl $-0x1, %eax
jne 0x249d
callq 0x2050
cmpl $0x4, (%rax)
je 0x2483
incl %r14d
cmpl $0x4b, %r14d
jne 0x23fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part3/condition_variables.cpp
// Function: main
int main(){
    BoundedBuffer buffer(200);

    std::thread c1(consumer, 0, std::ref(buffer));
    std::thread c2(consumer, 1, std::ref(buffer));
    std::thread c3(consumer, 2, std::ref(buffer));
    std::thread p1(producer, 0, std::ref(buffer));
    std::thread p2(producer, 1, std::ref(buffer));

    c1.join();
    c2.join();
    c3.join();
    p1.join();
    p2.join();

    return 0;
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
leaq 0x40(%rsp), %rbx
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x27a8
leaq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movl $0x0, (%rdx)
movq %rbx, (%rcx)
leaq -0x1f1(%rip), %rsi      # 0x22fc
leaq 0x28(%rsp), %rdi
callq 0x2822
leaq 0x10(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movl $0x1, (%rdx)
movq %rbx, (%rcx)
leaq -0x215(%rip), %rsi      # 0x22fc
leaq 0x20(%rsp), %rdi
callq 0x2822
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movl $0x2, (%rdx)
movq %rbx, (%rcx)
leaq -0x239(%rip), %rsi      # 0x22fc
leaq 0x18(%rsp), %rdi
callq 0x2822
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movl $0x0, (%rdx)
movq %rbx, (%rcx)
leaq -0x17f(%rip), %rsi      # 0x23da
leaq 0x10(%rsp), %rdi
callq 0x2822
leaq 0x3c(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl $0x1, (%rdx)
movq %rbx, (%rcx)
leaq -0x1a3(%rip), %rsi      # 0x23da
leaq 0x8(%rsp), %rdi
callq 0x2822
leaq 0x28(%rsp), %rdi
callq 0x2190
leaq 0x20(%rsp), %rdi
callq 0x2190
leaq 0x18(%rsp), %rdi
callq 0x2190
leaq 0x10(%rsp), %rdi
callq 0x2190
leaq 0x8(%rsp), %rdi
callq 0x2190
cmpq $0x0, 0x8(%rsp)
jne 0x2651
cmpq $0x0, 0x10(%rsp)
jne 0x2651
cmpq $0x0, 0x18(%rsp)
jne 0x2651
cmpq $0x0, 0x20(%rsp)
jne 0x2651
cmpq $0x0, 0x28(%rsp)
jne 0x2651
leaq 0x40(%rsp), %rdi
callq 0x28a8
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
retq
jmp 0x261c
movq %rax, %rbx
jmp 0x2627
movq %rax, %rbx
jmp 0x262f
movq %rax, %rbx
jmp 0x2637
movq %rax, %rbx
jmp 0x263f
cmpq $0x0, 0x8(%rsp)
jne 0x2651
cmpq $0x0, 0x10(%rsp)
movq %rax, %rbx
jne 0x2651
cmpq $0x0, 0x18(%rsp)
jne 0x2651
cmpq $0x0, 0x20(%rsp)
jne 0x2651
cmpq $0x0, 0x28(%rsp)
jne 0x2651
leaq 0x40(%rsp), %rdi
callq 0x28a8
movq %rbx, %rdi
callq 0x21b0
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part3/condition_variables.cpp
// Function: BoundedBuffer::fetch()
int fetch(){
        std::unique_lock<std::mutex> l(lock);

        not_empty.wait(l, [this](){return count != 0; });

        int result = buffer[front];
        front = (front + 1) % capacity;
        --count;

        l.unlock();
        not_full.notify_one();

        return result;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x18(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rdi, %rbx
movq %rax, (%r14)
movq %r14, %rdi
movb $0x0, 0x8(%r14)
callq 0x290e
movb $0x1, 0x8(%r14)
movl 0x14(%rbx), %ecx
testl %ecx, %ecx
jne 0x26a3
leaq 0x70(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2070
movl 0x14(%rbx), %ecx
testl %ecx, %ecx
je 0x2691
movq (%rbx), %rax
movslq 0xc(%rbx), %rdx
decl %ecx
movl (%rax,%rdx,4), %ebp
leal 0x1(%rdx), %eax
cltd
idivl 0x8(%rbx)
movl %edx, 0xc(%rbx)
movl %ecx, 0x14(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x28d0
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x28f8
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x28f8
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part3/condition_variables.cpp
// Function: BoundedBuffer::deposit(int)
void deposit(int data){
        std::unique_lock<std::mutex> l(lock);

        not_full.wait(l, [this](){return count != capacity; });

        buffer[rear] = data;
        rear = (rear + 1) % capacity;
        ++count;

        l.unlock();
        not_empty.notify_one();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x18(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rdi, %rbx
movl %esi, %ebp
movq %rax, (%r14)
movq %r14, %rdi
movb $0x0, 0x8(%r14)
callq 0x290e
movb $0x1, 0x8(%r14)
movl 0x14(%rbx), %eax
cmpl 0x8(%rbx), %eax
jne 0x274f
leaq 0x40(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2070
movl 0x14(%rbx), %eax
cmpl 0x8(%rbx), %eax
je 0x273c
movq (%rbx), %rax
movslq 0x10(%rbx), %rcx
movl %ebp, (%rax,%rcx,4)
movl 0x10(%rbx), %eax
incl %eax
cltd
idivl 0x8(%rbx)
movl %edx, 0x10(%rbx)
incl 0x14(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x28d0
addq $0x70, %rbx
movq %rbx, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x28f8
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x28f8
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: main
int main(int argc, char **argv) {
  if(argc != 2) {
    fprintf(stderr, "Invalid number of arguments given.\nUsage: %s [input file]\n", argv[0]);
    return 1;
  }

  Crypto crypto;

  char *encryptedOutput = appendToString(argv[1], (char*)".enc");
  char *decryptedOutput = appendToString(argv[1], (char*)".dec");

  encryptFile(&crypto, argv[1], encryptedOutput);
  decryptFile(&crypto, encryptedOutput, decryptedOutput);

  free(encryptedOutput);
  free(decryptedOutput);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
cmpl $0x2, %edi
jne 0x3143
movq %rsp, %r12
movq %r12, %rdi
callq 0x28f8
movq 0x8(%r15), %rdi
leaq 0xfde(%rip), %rsi       # 0x40c3
callq 0x3165
movq %rax, %rbx
movq 0x8(%r15), %rdi
leaq 0xfd0(%rip), %rsi       # 0x40c8
callq 0x3165
movq %rax, %r14
movq 0x8(%r15), %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x31b9
movq %rsp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x327b
movq %rbx, %rdi
callq 0x22d0
movq %r14, %rdi
callq 0x22d0
movq %rsp, %rdi
callq 0x2ac6
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x246a
movl $0x1, %eax
jmp 0x3137
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2ac6
movq %rbx, %rdi
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: appendToString(char*, char*)
char* appendToString(char *string, char *suffix) {
  char *appenedString = (char*)malloc(strlen(string) + strlen(suffix) + 1);

  if(appenedString == NULL) {
    fprintf(stderr, "Failed to allocate memory\n");
    exit(1);
  }

  sprintf(appenedString, "%s%s", string, suffix);
  return appenedString;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2130
movq %rax, %r15
movq %rbx, %rdi
callq 0x2130
leaq (%r15,%rax), %rdi
incq %rdi
callq 0x2300
testq %rax, %rax
je 0x31b4
movq %rax, %r15
leaq 0x1021(%rip), %rsi      # 0x41bc
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x20a0
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x2488
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: encryptFile(Crypto*, char*, char*)
void encryptFile(Crypto *crypto, char *input, char *output) {
  // Read the file to encrypt
  unsigned char *plaintext;
  size_t plainTextLength = readFile(input, &plaintext);
  printf("%d bytes to be encrypted\n", (int)plainTextLength);

  // Encrypt the file
  unsigned char *ciphertext;
  int ciphertextLength = crypto->aesEncrypt((const unsigned char*)plaintext, plainTextLength, &ciphertext);

  if(ciphertextLength == -1) {
    fprintf(stderr, "Encryption failed\n");
    exit(1);
  }
  printf("%d bytes encrypted\n", ciphertextLength);

  // Encode the encrypted file to base64
  char *base64Ciphertext = base64Encode(ciphertext, ciphertextLength);

  // Write the encrypted file to its own file
  writeFile(output, (unsigned char*)base64Ciphertext, strlen((char*)base64Ciphertext));
  printf("Encrypted file written to \"%s\"\n", output);

  free(plaintext);
  free(ciphertext);
  free(base64Ciphertext);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x332d
movslq %eax, %r12
leaq 0xee8(%rip), %rdi       # 0x40cd
movl %r12d, %esi
xorl %eax, %eax
callq 0x2050
movq (%r14), %r14
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2d7c
cmpl $-0x1, %eax
je 0x3276
movl %eax, %ebp
leaq 0xee9(%rip), %rdi       # 0x40fa
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq (%rsp), %rdi
movslq %ebp, %rsi
callq 0x26ec
movq %rax, %r15
movq %rax, %rdi
callq 0x2130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x33b7
leaq 0xec8(%rip), %rdi       # 0x410e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x22d0
movq (%rsp), %rdi
callq 0x22d0
movq %r15, %rdi
callq 0x22d0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x24ad
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: decryptFile(Crypto*, char*, char*)
void decryptFile(Crypto *crypto, char *input, char *output) {
  // Read the encrypted file back
  unsigned char *base64Ciphertext;
  size_t base64CiphertextLength = readFile(input, &base64Ciphertext);

  // Decode the encrypted file from base64
  unsigned char *ciphertext;
  size_t ciphertextLength = base64Decode((char*)base64Ciphertext, base64CiphertextLength, &ciphertext);

  // Decrypt the encrypted file
  unsigned char *plaintext;
  int plaintextLength = crypto->aesDecrypt(ciphertext, ciphertextLength, &plaintext);

  if(plaintextLength == -1) {
    fprintf(stderr, "Decryption failed\n");
    exit(1);
  }
  printf("%d bytes decrypted\n", (int)plaintextLength);

  // Write the decrypted file to its own file
  writeFile(output, plaintext, plaintextLength);
  printf("Decrypted file written to \"%s\"\n", output);

  free(base64Ciphertext);
  free(ciphertext);
  free(plaintext);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x18(%rsp), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x332d
movslq %eax, %rsi
movq (%r14), %r14
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x2801
movslq %eax, %rdx
movq (%r12), %rsi
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
callq 0x2e18
cmpl $-0x1, %eax
je 0x3328
movl %eax, %ebp
leaq 0xe6c(%rip), %rdi       # 0x4141
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq 0x8(%rsp), %rsi
movslq %ebp, %rdx
movq %rbx, %rdi
callq 0x33b7
leaq 0xe60(%rip), %rdi       # 0x4155
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x22d0
movq 0x10(%rsp), %rdi
callq 0x22d0
movq 0x8(%rsp), %rdi
callq 0x22d0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x24d2
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: readFile(char*, unsigned char**)
int readFile(char *filename, unsigned char **file) {
  FILE *fd = fopen(filename, "r");
  if(fd == NULL) {
    fprintf(stderr, "Failed to open file: %s\n", strerror(errno));
    exit(1);
  }

  // Determine size of the file
  fseek(fd, 0, SEEK_END);
  size_t fileLength = ftell(fd);
  fseek(fd, 0, SEEK_SET);

  // Allocate space for the file
  *file = (unsigned char*)malloc(fileLength);
  if(*file == NULL) {
    fprintf(stderr, "Failed to allocate memory\n");
    exit(1);
  }

  // Read the file into the buffer
  size_t bytesRead = fread(*file, 1, fileLength, fd);

  if(bytesRead != fileLength) {
    fprintf(stderr, "Error reading file\n");
    exit(1);
  }

  fclose(fd);

  return fileLength;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
leaq 0xe6a(%rip), %rsi       # 0x41a6
callq 0x22c0
testq %rax, %rax
je 0x33a8
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2280
movq %rbx, %rdi
callq 0x2030
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2280
movq %r15, %rdi
callq 0x2300
movq %rax, (%r14)
testq %rax, %rax
je 0x33ad
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2340
cmpq %r15, %rax
jne 0x33b2
movq %rbx, %rdi
callq 0x2230
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x2541
callq 0x251c
callq 0x24f7
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_file_example.cpp
// Function: writeFile(char*, unsigned char*, unsigned long)
void writeFile(char *filename, unsigned char *file, size_t fileLength) {
  FILE *fd = fopen(filename, "w");
  if(fd == NULL) {
    fprintf(stderr, "Failed to open file: %s\n", strerror(errno));
    exit(1);
  }

  size_t bytesWritten = fwrite(file, 1, fileLength, fd);

  if(bytesWritten != fileLength) {
    fprintf(stderr, "Failed to write file\n");
    exit(1);
  }

  fclose(fd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
leaq 0xdac(%rip), %rsi       # 0x4175
callq 0x22c0
testq %rax, %rax
je 0x33fb
movq %rax, %r14
movl $0x1, %esi
movq %r15, %rdi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x23f0
cmpq %rbx, %rax
jne 0x3400
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2230
callq 0x2599
callq 0x2574
// File: /workspace/github_cpp_makefile_star2_O3/conp-solutions[P]cnfmiter/Main.cc
// Function: generate_or_equivalence(CNFMITER::Formula&, std::vector<CNFMITER::Lit, std::allocator<CNFMITER::Lit>> const&, CNFMITER::Lit)
void generate_or_equivalence(Formula &f, const std::vector<Lit> &clause, Lit enabler_lit)
{
    static std::vector<Lit> tmpClause;
    tmpClause.clear();

    // !enabler_lit -> clause
    tmpClause = clause;
    tmpClause.push_back(~enabler_lit);
    f.addClause_(tmpClause);

    // clause -> enabler_lit
    tmpClause.clear();
    tmpClause.push_back(enabler_lit);
    tmpClause.push_back(enabler_lit);
    for (Lit l : clause) {
        tmpClause[1] = ~l;
        f.addClause_(tmpClause);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, -0x24(%rbp)
movb 0x4c8e(%rip), %al       # 0x71b8
testb %al, %al
je 0x2669
movq 0x4c67(%rip), %rax      # 0x71a0
cmpq %rax, 0x4c68(%rip)      # 0x71a8
je 0x2549
movq %rax, 0x4c5f(%rip)      # 0x71a8
leaq 0x4c50(%rip), %rdi      # 0x71a0
movq %r14, %rsi
callq 0x3bfe
movl -0x24(%rbp), %r15d
movl %r15d, %eax
xorl $0x1, %eax
movl %eax, -0x28(%rbp)
movq 0x4c3c(%rip), %rsi      # 0x71a8
cmpq 0x4c3d(%rip), %rsi      # 0x71b0
je 0x2584
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x4c26(%rip)      # 0x71a8
jmp 0x2594
leaq 0x4c15(%rip), %rdi      # 0x71a0
leaq -0x28(%rbp), %rdx
callq 0x400a
addq $0x8, %rbx
leaq 0x4c01(%rip), %rsi      # 0x71a0
movq %rbx, %rdi
callq 0x3ce4
movq 0x4bf2(%rip), %rax      # 0x71a0
movq 0x4bf3(%rip), %rsi      # 0x71a8
cmpq %rax, %rsi
je 0x25c4
movq %rax, 0x4be7(%rip)      # 0x71a8
movq %rax, %rsi
movq 0x4be5(%rip), %rax      # 0x71b0
cmpq %rax, %rsi
je 0x25e0
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x4bca(%rip)      # 0x71a8
jmp 0x25fe
leaq 0x4bb9(%rip), %rdi      # 0x71a0
leaq -0x24(%rbp), %rdx
callq 0x4124
movq 0x4bb1(%rip), %rsi      # 0x71a8
movq 0x4bb2(%rip), %rax      # 0x71b0
cmpq %rax, %rsi
je 0x2615
movl -0x24(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x4b95(%rip)      # 0x71a8
jmp 0x2625
leaq 0x4b84(%rip), %rdi      # 0x71a0
leaq -0x24(%rbp), %rdx
callq 0x4124
movq (%r14), %r15
movq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x265c
leaq 0x4b68(%rip), %r14      # 0x71a0
movl (%r15), %eax
xorl $0x1, %eax
movq 0x4b5b(%rip), %rcx      # 0x71a0
movl %eax, 0x4(%rcx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3ce4
addq $0x4, %r15
cmpq %r12, %r15
jne 0x2638
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2300
jmp 0x2532
// File: /workspace/github_cpp_makefile_star2_O3/conp-solutions[P]cnfmiter/Main.cc
// Function: generate_clause_sat(CNFMITER::Formula&, CNFMITER::Formula const&, CNFMITER::Lit&)
void generate_clause_sat(Formula &formula, const Formula &input, Lit &equivalence_lit)
{
    std::vector<Lit> enabler_lits; // literals that are equal to satisfiability of each clause

    for (const auto &c : input.clauses) {
        Lit enabler_lit = mkLit(formula.newVar());
        enabler_lits.push_back(enabler_lit);

        generate_or_equivalence(formula, c, enabler_lit);
    }

    equivalence_lit = mkLit(formula.newVar());

    // (x <-> (a or b)) is the same as (!x <->(!b and !c))
    for (int i = 0; i < enabler_lits.size(); ++i) enabler_lits[i] = ~enabler_lits[i];
    generate_or_equivalence(formula, enabler_lits, ~equivalence_lit);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rcx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r14
cmpq %r14, %r15
je 0x2734
movq %rcx, -0x58(%rbp)
leaq -0x50(%rbp), %r12
leaq -0x2c(%rbp), %r13
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
addl %eax, %eax
movl %eax, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x26d8
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x26e3
movq %r12, %rdi
movq %r13, %rdx
callq 0x4124
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x250c
addq $0x18, %r15
cmpq %r14, %r15
jne 0x26b6
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rbx)
addl %edx, %edx
movq -0x58(%rbp), %rsi
movl %edx, (%rsi)
subq %rax, %rcx
je 0x273f
sarq $0x2, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
xorb $0x1, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x2724
movl (%rsi), %edx
jmp 0x273f
movl (%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, (%rbx)
addl %edx, %edx
movl %edx, (%rcx)
xorl $0x1, %edx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x250c
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x275c
callq 0x2180
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x276d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x277e
callq 0x2180
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O3/conp-solutions[P]cnfmiter/Main.cc
// Function: rewrite_variable_range(CNFMITER::Formula&, int, int)
void rewrite_variable_range(Formula &formula, Var largest_input_variable, int offset)
{
    if (offset == 0) return;
    if (largest_input_variable <= formula.nVars()) return;

    for (auto &c : formula.clauses) {
        for (size_t i = 0; i < c.size(); ++i) {
            if (var(c[i]) > largest_input_variable) {
                c[i] = mkLit(var(c[i]) + offset, sign(c[i]));
            }
        }
    }

    int oldVars = formula.nVars();
    while (formula.nVars() < oldVars + offset) formula.newVar();
}

// Assembly:
testl %edx, %edx
setne %al
movl (%rdi), %r8d
cmpl %esi, %r8d
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2a40
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cmpq %rcx, %rax
je 0x2a2c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movq (%rax), %r8
movq 0x8(%rax), %r9
subq %r8, %r9
je 0x2a1e
sarq $0x2, %r9
cmpq $0x1, %r9
adcq $0x0, %r9
xorl %r10d, %r10d
movl (%r8,%r10,4), %r11d
movl %r11d, %ebx
sarl %ebx
cmpl %esi, %ebx
jle 0x2a16
addl %edx, %ebx
andl $0x1, %r11d
leal (%r11,%rbx,2), %r11d
movl %r11d, (%r8,%r10,4)
incq %r10
cmpq %r10, %r9
jne 0x29fb
addq $0x18, %rax
cmpq %rcx, %rax
jne 0x29e0
movl (%rdi), %r8d
popq %rbx
popq %rbp
testl %edx, %edx
jle 0x2a40
addl %r8d, %edx
incl %r8d
cmpl %r8d, %edx
cmovgl %edx, %r8d
movl %r8d, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/conp-solutions[P]cnfmiter/Main.cc
// Function: get_definition_clauses(CNFMITER::Formula&, int)
std::vector<std::vector<Lit>> get_definition_clauses(Formula &f1, int largest_input_variable)
{
    std::vector<std::vector<Lit>> l2r;

    for (const auto &c : f1.clauses) {
        bool move = false;
        for (size_t i = 0; i < c.size(); ++i) {
            if (var(c[i]) >= largest_input_variable) {
                move = true;
                break;
            }
        }
        if (move) l2r.push_back(c);
    }

    return l2r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r12
cmpq %r12, %r15
je 0x2aaf
movl %edx, %r14d
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x2aa6
sarq $0x2, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
movl (%rax,%rdx,4), %esi
sarl %esi
cmpl %r14d, %esi
jge 0x2a9b
incq %rdx
cmpq %rdx, %rcx
jne 0x2a87
jmp 0x2aa6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ce4
addq $0x18, %r15
cmpq %r12, %r15
jne 0x2a6d
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3d20
movq %r14, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O3/agorenst[P]trie/./radixtree.h
// Function: node<int>::tikz_print(std::ostream&)
void tikz_print(std::ostream& o) {
                o << "node[circle,draw]{}\n";
                for(auto& e : edge_list) {
                    o << "child {\n";
                    e.second->tikz_print(o);
                    o << "    edge from parent node[left]{\n";
                    for (auto& s : e.first) {
                        o << s << " ";
                    }
                    o << "    }\n";
                    o << "}\n";
                }
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xe88(%rip), %rsi       # 0x41a5
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2120
movq (%r14), %r13
movq %r14, -0x30(%rbp)
cmpq %r14, %r13
je 0x33d9
leaq 0xea4(%rip), %r12       # 0x41e5
leaq 0x10(%r13), %r15
movl $0x8, %edx
movq %rbx, %rdi
leaq 0xe66(%rip), %rsi       # 0x41ba
callq 0x2120
movq 0x28(%r13), %rdi
movq %rbx, %rsi
callq 0x3302
movl $0x21, %edx
movq %rbx, %rdi
leaq 0xe4f(%rip), %rsi       # 0x41c3
callq 0x2120
movq 0x10(%r13), %r14
cmpq %r15, %r14
je 0x33a3
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x21a0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq (%r14), %r14
jmp 0x337d
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xe35(%rip), %rsi       # 0x41e7
callq 0x2120
movl $0x2, %edx
movq %rbx, %rdi
leaq 0xe25(%rip), %rsi       # 0x41eb
callq 0x2120
movq (%r13), %r13
cmpq -0x30(%rbp), %r13
jne 0x3341
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/whitefusion[P]Jaipur_cardgame-/Token.cpp
// Function: Token::setType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Token::setType(string t){
    if (tokenType[t] >= tokenType["Diamond"] && tokenType[t] <= tokenType["5Bonus"]){
        type = t;
        return true;
    }
    else{
        cout << "Invalid token type!" << endl; 
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x12091(%rip), %r15     # 0x16180
movq %r15, %rdi
callq 0x44e2
movl (%rax), %ebp
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xc090(%rip), %rsi      # 0x10199
leaq 0xc090(%rip), %rdx      # 0x101a0
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x3fc4
movq %r15, %rdi
movq %r12, %rsi
callq 0x455e
cmpl (%rax), %ebp
jge 0x4130
xorl %ebp, %ebp
jmp 0x4190
leaq 0x12049(%rip), %rdi     # 0x16180
movq %rbx, %rsi
callq 0x44e2
movl (%rax), %ebp
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc041(%rip), %rsi      # 0x10192
leaq 0xc040(%rip), %rdx      # 0x10198
leaq 0x8(%rsp), %rdi
callq 0x3fc4
leaq 0x12017(%rip), %rdi     # 0x16180
leaq 0x8(%rsp), %rsi
callq 0x455e
cmpl (%rax), %ebp
setle %bpl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4190
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x41a7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21a0
testb %bpl, %bpl
je 0x41b9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20e0
jmp 0x41fb
movq 0x11e10(%rip), %rbx     # 0x15fd0
leaq 0xbfda(%rip), %rsi      # 0x101a1
movl $0x13, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x422d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x422d
jmp 0x422a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4244
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/whitefusion[P]Jaipur_cardgame-/Token.cpp
// Function: Token::setVal(int)
bool Token::setVal(int v){
    string thisToken = getType();
    pair<multimap<string,int>::iterator, multimap<string,int>::iterator> ii;
    multimap<string,int>::iterator it;
    ii = tokenValue.equal_range(thisToken);
    for (it = ii.first; it != ii.second; ++it){
        if (v == it->second){ 
            val = v;
            return true;
        }
    }

    cout << "Invalid token value of " << thisToken << "!" << endl;
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3f2e
leaq 0x11f2c(%rip), %rdi     # 0x161b0
movq %r15, %rsi
callq 0x4e0c
movq %rdx, %r15
cmpq %r15, %rax
je 0x42a3
cmpl %ebx, 0x40(%rax)
je 0x4313
movq %rax, %rdi
callq 0x2100
jmp 0x428f
movq 0x11d26(%rip), %rdi     # 0x15fd0
leaq 0xbf04(%rip), %rsi      # 0x101b5
movl $0x17, %edx
callq 0x21d0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x11d04(%rip), %rdi     # 0x15fd0
callq 0x21d0
movq %rax, %rbx
leaq 0xc483(%rip), %rsi      # 0x1075e
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
xorl %ebx, %ebx
jmp 0x4319
movl %ebx, 0x20(%r14)
movb $0x1, %bl
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4330
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x4340
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x435a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/whitefusion[P]Jaipur_cardgame-/AllTokens.cpp
// Function: All_Tokens::getSize(int)
int All_Tokens::getSize(int id){
    if (id >= 1 && id <= 7){
        return number[id-1];
    }
    
    cout << "getSize:Invalid type of token!" << endl;
    return -1;
}

// Assembly:
decl %esi
cmpl $0x6, %esi
ja 0x5470
movl %esi, %eax
movl 0x18(%rdi,%rax,4), %eax
retq
pushq %rbx
movq 0x10b58(%rip), %rbx     # 0x15fd0
leaq 0xad71(%rip), %rsi      # 0x101f0
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq