LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/mitchblank[P]qiksolve/qiksolve.cpp
// Function: Dictionary::printInteractiveSuggestions(std::vector<unsigned int, std::allocator<unsigned int>> const&, unsigned int) const
void Dictionary::printInteractiveSuggestions(Words const& active_words, unsigned const show) const
{
	assert(!active_words.empty());
	assert(show > 0);
	vector<pair<double, Word>> suggestions;
	suggestions.reserve(active_words.size());
	puts("Suggestions:");
	{
		DividedWordList dl(wordLength());
		auto it = keys_.cbegin();
		do {
			dl.build(*this, active_words, *it);
			suggestions.push_back(make_pair(-dl.entropy(), *it));
		} while (++it != keys_.cend());
	}
	sort(suggestions.begin(), suggestions.end());
	{
		auto it = suggestions.cbegin();
		unsigned i = 0;
		do {
			printf("\t%2u: ", ++i);
			describeWord(stdout, it->second);
			putchar('\n');
		} while (++it != suggestions.cend() && i < show);
	}
	putchar('\n');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
cmpq %rsi, %rax
je 0x336c
movl %edx, -0x2c(%rbp)
testl %edx, %edx
je 0x338b
movq %rdi, %r14
leaq -0x50(%rbp), %rdi
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
subq %rax, %rsi
sarq $0x2, %rsi
callq 0x3898
leaq 0x3168(%rip), %rdi      # 0x63ea
callq 0x21d0
movl 0x48(%r14), %esi
leaq -0x78(%rbp), %rdi
callq 0x3716
movq 0x30(%r14), %r13
leaq -0x78(%rbp), %r12
leaq -0x60(%rbp), %rbx
movl (%r13), %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2670
movq %r12, %rdi
callq 0x27a2
xorps 0x2d7f(%rip), %xmm0     # 0x6040
movl (%r13), %eax
movlps %xmm0, -0x60(%rbp)
movl %eax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4996
addq $0x4, %r13
cmpq 0x38(%r14), %r13
jne 0x32a0
leaq -0x78(%rbp), %rdi
callq 0x374a
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4abe
movq -0x50(%rbp), %r13
addq $0x10, %r13
pushq $0x1
popq %r15
movq 0x6cb5(%rip), %r12      # 0x9fc0
pushq $0xa
popq %rbx
leaq 0x30e2(%rip), %rdi      # 0x63f7
movl %r15d, %esi
xorl %eax, %eax
callq 0x2040
movq (%r12), %rsi
movl -0x8(%r13), %edx
movq %r14, %rdi
callq 0x3776
movl %ebx, %edi
callq 0x21a0
cmpl -0x2c(%rbp), %r15d
jae 0x334c
leaq 0x10(%r13), %rax
incl %r15d
cmpq -0x48(%rbp), %r13
movq %rax, %r13
jne 0x330e
pushq $0xa
popq %rdi
callq 0x21a0
leaq -0x50(%rbp), %rdi
callq 0x4938
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2dc0(%rip), %rdi      # 0x6133
leaq 0x2cdf(%rip), %rsi      # 0x6059
leaq 0x300a(%rip), %rcx      # 0x638b
movl $0x276, %edx            # imm = 0x276
callq 0x20c0
leaq 0x304f(%rip), %rdi      # 0x63e1
leaq 0x2cc0(%rip), %rsi      # 0x6059
leaq 0x2feb(%rip), %rcx      # 0x638b
movl $0x277, %edx            # imm = 0x277
callq 0x20c0
jmp 0x33ae
jmp 0x33ae
movq %rax, %rbx
jmp 0x33c1
jmp 0x33b5
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x374a
leaq -0x50(%rbp), %rdi
callq 0x4938
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x343b
movl %edi, %r14d
movq 0x8(%rbx), %rax
pushq $0x1
popq %r13
xorl %ecx, %ecx
cmpb $0x2d, (%rax)
jne 0x342f
cmpb $0x74, 0x1(%rax)
jne 0x341b
cmpb $0x0, 0x2(%rax)
je 0x350c
xorl %ecx, %ecx
cmpb $0x62, 0x1(%rax)
jne 0x342f
xorl %ecx, %ecx
cmpb $0x0, 0x2(%rax)
je 0x351e
xorl %r12d, %r12d
leal -0x4(%r14), %eax
cmpl $-0x3, %eax
ja 0x344c
movq (%rbx), %rdi
callq 0x3597
pushq $0x8
popq %r14
jmp 0x34fa
movl %ecx, -0x2c(%rbp)
movq (%rbx,%r13,8), %rdi
leaq 0x2fa4(%rip), %rsi      # 0x63fe
callq 0x2180
testq %rax, %rax
je 0x3530
movq %rax, %r15
cmpl $0x2, %r14d
jne 0x3476
pushq $0x4
popq %rdx
jmp 0x3482
movq 0x8(%rbx,%r13,8), %rdi
callq 0x21e0
movl %eax, %edx
leaq -0x80(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x2476
cmpq $0x0, 0x28(%r14)
je 0x3543
cmpl $0x2, %r12d
je 0x34b2
testl %r12d, %r12d
jne 0x34d1
leaq -0x80(%rbp), %rdi
callq 0x33d2
jmp 0x34ee
movq 0x6b1f(%rip), %rax      # 0x9fd8
movq (%rax), %rsi
movq 0x6afd(%rip), %rax      # 0x9fc0
movq (%rax), %rdx
leaq -0x80(%rbp), %rdi
callq 0x2d4a
jmp 0x34ee
cmpb $0x0, -0x2c(%rbp)
je 0x3564
movq 0x6ade(%rip), %rax      # 0x9fc0
movq (%rax), %rsi
leaq -0x80(%rbp), %rdi
callq 0x2be2
xorl %r14d, %r14d
leaq -0x80(%rbp), %rdi
callq 0x3940
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %r14d
pushq $0x2
popq %r13
pushq $0x1
popq %r12
movb $0x1, %cl
jmp 0x3432
decl %r14d
pushq $0x2
popq %r13
pushq $0x2
popq %r12
xorl %ecx, %ecx
jmp 0x3432
leaq 0x2ec9(%rip), %rdi      # 0x6400
callq 0x2100
pushq $0x4
jmp 0x3445
pushq $0x1
popq %r14
movq 0x6a92(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0x2eaa(%rip), %rsi      # 0x6405
xorl %eax, %eax
callq 0x21b0
jmp 0x34f1
leaq 0x2eaf(%rip), %rdi      # 0x641a
leaq 0x2ae7(%rip), %rsi      # 0x6059
leaq 0x2eb7(%rip), %rcx      # 0x6430
movl $0x2bc, %edx            # imm = 0x2BC
callq 0x20c0
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3940
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/kdungs[P]codecon/src/palindronum.cc
// Function: stepsToPalindrome(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
auto stepsToPalindrome(const std::string& str) -> std::size_t {
  for (auto r = std::end(str); r > std::begin(str); --r) {
    auto pal = std::string{};
    pal.reserve(str.size() * 2);
    std::copy(r, std::end(str), std::back_inserter(pal));
    std::reverse(std::begin(pal), std::end(pal));
    std::copy(std::begin(str), std::end(str), std::back_inserter(pal));
    if (isPalindrome(pal)) {
      return pal.size();
    }
  }
  return 0u;  // should never happen!
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %r14
addq 0x8(%rdi), %r14
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %r15
cmpq (%rbx), %r14
jbe 0x12bc
movq %r13, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
addq %rsi, %rsi
movq %r15, %rdi
callq 0x10a0
movq (%rbx), %rsi
addq 0x8(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x1350
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq %rdi, %rsi
callq 0x13a6
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
movq %r15, %rdx
callq 0x1350
movq %r15, %rdi
callq 0x11ec
movl %eax, %ebp
movq 0x10(%rsp), %r12
movq %r15, %rdi
callq 0x1030
decq %r14
testb %bpl, %bpl
je 0x1241
jmp 0x12bf
xorl %r12d, %r12d
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x10b0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x88, %rsp
leaq 0x4947(%rip), %rdi      # 0x9004
callq 0x4300
testq %rax, %rax
leaq 0x4947(%rip), %rbx      # 0x9013
cmovneq %rax, %rbx
leaq 0x4949(%rip), %rdi      # 0x9020
callq 0x4300
xorl %edx, %edx
testq %rax, %rax
setne %dl
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x47ce
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x4804
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x72a8
leaq 0x8(%rsp), %rdi
callq 0x73e4
xorb $0x1, %al
movzbl %al, %ebx
leaq 0x8(%rsp), %rdi
callq 0x7398
leaq 0x28(%rsp), %rdi
callq 0x48c4
leaq 0x50(%rsp), %rdi
callq 0x60d4
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7398
jmp 0x4761
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x48c4
jmp 0x4770
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x60d4
movq %rbx, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4dc2
xorl %eax, %eax
popq %rbx
retq
movq %rax, %rdi
callq 0x40b0
movq 0xa84d(%rip), %rdi      # 0xefe8
leaq 0x48b0(%rip), %rsi      # 0x9052
callq 0x4290
movq %rax, %rdi
callq 0x40e0
callq 0x43e0
jmp 0x4788
movq %rax, %rbx
callq 0x43e0
movq %rbx, %rdi
callq 0x4430
movq %rax, %rdi
callq 0x4d25
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9f0c(%rip), %rax      # 0xe720
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movl $0xb0, %edi
callq 0x42a0
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
callq 0x491a
movq %r14, 0x10(%rbx)
pushq $0x10
popq %rdi
callq 0x42a0
movq 0x8(%rbx), %rcx
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rax, 0x18(%rbx)
addq $0x20, %rbx
leaq -0xd6(%rip), %rdx       # 0x4782
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x4450
testl %eax, %eax
jne 0x486e
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x40f0
movq %rax, %r14
leaq 0x47b2(%rip), %rsi      # 0x9032
movq %rax, %rdi
callq 0x40a0
movq 0xa761(%rip), %rsi      # 0xeff0
movq 0xa722(%rip), %rdx      # 0xefb8
movq %r14, %rdi
callq 0x4400
movq %rax, %rbx
movq %r14, %rdi
callq 0x41b0
jmp 0x48bb
movq %rax, %rbx
movl $0xb0, %esi
movq %r14, %rdi
callq 0x42b0
movq %rbx, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O2/dustin[P]kvtest/./async.hh
// Function: kvtest::QueuedKVStore::~QueuedKVStore()
~QueuedKVStore() {
            executor->stop();
            pthread_join(thread, NULL);
            delete executor;
            delete iq;
        }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x9e51(%rip), %rax      # 0xe720
movq %rax, (%rdi)
movq 0x18(%rdi), %rdi
callq 0x589a
movq 0x20(%rbx), %rdi
xorl %esi, %esi
callq 0x4240
movq 0x18(%rbx), %rdi
pushq $0x10
popq %rsi
callq 0x42b0
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x4903
movq %rbx, %rdi
callq 0x58be
movl $0xb0, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x42b0
movq %rax, %rdi
callq 0x4d25
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rdi, %r14
leaq 0x68(%rsp), %rdi
callq 0x4b94
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x5304
movq 0x10(%r14), %r14
pushq $0x10
popq %rdi
callq 0x42a0
movq %rbx, 0x8(%rax)
leaq 0x9eab(%rip), %rcx      # 0xe848
movq %rcx, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x53a0
movq %rsp, %rdi
callq 0x543a
movq %rsp, %rdi
callq 0x54f4
leaq 0x68(%rsp), %rdi
callq 0x52d6
addq $0xb8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x49e0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x54f4
leaq 0x68(%rsp), %rdi
callq 0x52d6
movq %rbx, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %r14, %rdi
callq 0x4b94
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4efa
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x10(%rsp), %rax
cmpq %rax, 0x30(%rsp)
je 0x4e1c
movq (%rax), %r15
movq %r14, %rdi
callq 0x5280
movq (%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x4dee
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %r14, %rdi
callq 0x52d6
jmp 0x4dd1
jmp 0x4e3b
movq %rdx, %r14
movq %rax, %rbx
jmp 0x4e49
jmp 0x4e3b
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x52d6
cmpl $0x2, %r14d
jne 0x4e8f
movq %rbx, %rdi
callq 0x40b0
testq %rax, %rax
je 0x4e65
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0xa17c(%rip), %rdi      # 0xefe8
leaq 0x4223(%rip), %rsi      # 0x9096
callq 0x4290
movq %rax, %rdi
callq 0x40e0
callq 0x43e0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x1, %r14d
jne 0x4ef1
movq %rbx, %rdi
callq 0x40b0
movq %rax, %rbx
movq 0xa141(%rip), %rdi      # 0xefe8
leaq 0x41cb(%rip), %rsi      # 0x9079
callq 0x4290
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x4290
movq %rax, %rdi
callq 0x40e0
callq 0x4140
movq %rax, %rbx
callq 0x43e0
jmp 0x4ef1
movq %rax, %rdi
callq 0x4d25
movq %rax, %rbx
callq 0x43e0
movq %rbx, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4fce
movq 0x90(%r14), %rax
cmpq 0x70(%r14), %rax
jne 0x4f38
leaq 0x30(%r14), %rdi
movq %r15, %rsi
callq 0x4390
testl %eax, %eax
jne 0x4f79
leaq 0x60(%r14), %r15
xorl %ebp, %ebp
cmpl (%r14), %ebp
jge 0x4f64
movq 0x70(%r14), %rsi
cmpq %rsi, 0x90(%r14)
je 0x4f64
movq %rbx, %rdi
callq 0x5034
movq %r15, %rdi
callq 0x5280
incl %ebp
jmp 0x4f3e
leaq 0x8(%rsp), %rdi
callq 0x5268
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x40f0
movq %rax, %r14
leaq 0x411c(%rip), %rsi      # 0x90a7
movq %rax, %rdi
callq 0x40a0
movq 0xa056(%rip), %rsi      # 0xeff0
movq 0xa017(%rip), %rdx      # 0xefb8
movq %r14, %rdi
callq 0x4400
movq %rax, %rbx
movq %r14, %rdi
callq 0x41b0
jmp 0x4fbb
jmp 0x4fb8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5268
movq %rbx, %rdi
callq 0x4430
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %rsi, (%r14)
leaq 0x8(%rdi), %rsi
movq %rsp, %rdi
callq 0x4fce
leaq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x5034
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x4030
testl %eax, %eax
jne 0x53ea
movq %rsp, %rdi
callq 0x5268
addq $0x18, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x40f0
movq %rax, %rbx
leaq 0x3d65(%rip), %rsi      # 0x9161
movq %rax, %rdi
callq 0x40a0
movq 0x9be5(%rip), %rsi      # 0xeff0
movq 0x9ba6(%rip), %rdx      # 0xefb8
movq %rbx, %rdi
callq 0x4400
movq %rax, %r14
movq %rbx, %rdi
callq 0x41b0
jmp 0x542a
movq %rax, %r14
movq %rsp, %rdi
callq 0x5268
movq %r14, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x32
popq %r15
leaq 0xd17(%rip), %r12       # 0x200e
movq %rsp, %r13
subl $0x1, %r15d
jb 0x1358
movq %rbx, %rdi
callq 0x1598
movq 0x2cc9(%rip), %rdi      # 0x3fd8
leaq 0xcee(%rip), %rsi       # 0x2004
movl %eax, %r14d
callq 0x1110
movq %rax, %rdi
movl %ebp, %esi
callq 0x1180
movq %rax, %rdi
movq %r12, %rsi
callq 0x1110
movq %rax, %rdi
movl %r14d, %esi
callq 0x1180
movq %rax, %rdi
callq 0x10a0
movq %r13, %rdi
movq $0xfa, (%rsp)
callq 0x1614
jmp 0x12fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
leaq 0xc9f(%rip), %r12       # 0x2018
leaq 0xca2(%rip), %r13       # 0x2022
movq %rsi, %rbx
movl %edi, %ebp
xorl %r14d, %r14d
movq %rsp, %r15
cmpl $0x4b, %r14d
je 0x13e8
movq %rbx, %rdi
movl %r14d, %esi
callq 0x166a
movq 0x2c35(%rip), %rdi      # 0x3fd8
movq %r12, %rsi
callq 0x1110
movq %rax, %rdi
movl %ebp, %esi
callq 0x1180
movq %rax, %rdi
movq %r13, %rsi
callq 0x1110
movq %rax, %rdi
movl %r14d, %esi
callq 0x1180
movq %rax, %rdi
callq 0x10a0
movq %r15, %rdi
movq $0x64, (%rsp)
callq 0x1614
incl %r14d
jmp 0x138b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x16e6
leaq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rcx
andl $0x0, (%rdx)
movq %rbx, (%rcx)
leaq -0x14c(%rip), %rsi      # 0x12dc
leaq 0x28(%rsp), %rdi
callq 0x175c
leaq 0x10(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movl $0x1, (%rdx)
movq %rbx, (%rcx)
leaq -0x170(%rip), %rsi      # 0x12dc
leaq 0x20(%rsp), %rdi
callq 0x175c
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movl $0x2, (%rdx)
movq %rbx, (%rcx)
leaq -0x194(%rip), %rsi      # 0x12dc
leaq 0x18(%rsp), %rdi
callq 0x175c
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
andl $0x0, (%rdx)
movq %rbx, (%rcx)
leaq -0x12a(%rip), %rsi      # 0x1367
leaq 0x10(%rsp), %rdi
callq 0x175c
leaq 0x3c(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl $0x1, (%rdx)
movq %rbx, (%rcx)
leaq -0x14e(%rip), %rsi      # 0x1367
leaq 0x8(%rsp), %rdi
callq 0x175c
leaq 0x28(%rsp), %rdi
callq 0x1170
leaq 0x20(%rsp), %rdi
callq 0x1170
leaq 0x18(%rsp), %rdi
callq 0x1170
leaq 0x10(%rsp), %rdi
callq 0x1170
leaq 0x8(%rsp), %rdi
callq 0x1170
leaq 0x8(%rsp), %rdi
callq 0x17dc
leaq 0x10(%rsp), %rdi
callq 0x17dc
leaq 0x18(%rsp), %rdi
callq 0x17dc
leaq 0x20(%rsp), %rdi
callq 0x17dc
leaq 0x28(%rsp), %rdi
callq 0x17dc
leaq 0x40(%rsp), %rdi
callq 0x17ea
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
retq
movq %rax, %rbx
jmp 0x155e
movq %rax, %rbx
jmp 0x1568
movq %rax, %rbx
jmp 0x1572
movq %rax, %rbx
jmp 0x157c
movq %rax, %rbx
jmp 0x1586
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x17dc
leaq 0x10(%rsp), %rdi
callq 0x17dc
leaq 0x18(%rsp), %rdi
callq 0x17dc
leaq 0x20(%rsp), %rdi
callq 0x17dc
leaq 0x28(%rsp), %rdi
callq 0x17dc
leaq 0x40(%rsp), %rdi
callq 0x17ea
movq %rbx, %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x18(%rdi), %rsi
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x1812
leaq 0x70(%rbx), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1828
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
movl (%rax,%rcx,4), %ebp
leal 0x1(%rcx), %eax
cltd
idivl 0x8(%rbx)
movl %edx, 0xc(%rbx)
decl 0x14(%rbx)
movq %rsp, %rdi
callq 0x1850
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x10b0
movq %rsp, %rdi
callq 0x1876
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1601
movq %rsp, %rdi
movq %rax, %rbx
callq 0x1876
movq %rbx, %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
leaq 0x18(%rdi), %rsi
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x1812
leaq 0x40(%rbx), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x18d4
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)
movq %rsp, %rdi
callq 0x1850
addq $0x70, %rbx
movq %rbx, %rdi
callq 0x10b0
movq %rsp, %rdi
callq 0x1876
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x1876
movq %rbx, %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
cmpl $0x2, %edi
jne 0x2f43
movq %rsp, %r12
movq %r12, %rdi
callq 0x2748
movq 0x8(%r14), %rdi
leaq 0x11de(%rip), %rsi      # 0x40c3
callq 0x2f76
movq %rax, %rbx
movq 0x8(%r14), %rdi
leaq 0x11d0(%rip), %rsi      # 0x40c8
callq 0x2f76
movq %rax, %r15
movq 0x8(%r14), %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x2fe9
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x30ca
movq %rbx, %rdi
callq 0x22d0
movq %r15, %rdi
callq 0x22d0
movq %rsp, %rdi
callq 0x290e
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x308e(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0x1131(%rip), %rsi      # 0x4088
xorl %eax, %eax
callq 0x2320
pushq $0x1
popq %rax
jmp 0x2f37
movq %rax, %rbx
movq %rsp, %rdi
callq 0x290e
movq %rbx, %rdi
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2fc5
movq %rax, %r15
leaq 0x1210(%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
movq 0x300c(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0x1082(%rip), %rdi      # 0x4058
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x23f0
pushq $0x1
popq %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x319b
movslq %eax, %r12
leaq 0x10b8(%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 0x2b9c
cmpl $-0x1, %eax
je 0x30a6
movl %eax, %ebp
leaq 0x10b9(%rip), %rdi      # 0x40fa
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq (%rsp), %rdi
movslq %ebp, %rsi
callq 0x253c
movq %rax, %r15
movq %rax, %rdi
callq 0x2130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3277
leaq 0x1098(%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
movq 0x2f2b(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0x1030(%rip), %rdi      # 0x40e7
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x23f0
pushq $0x1
popq %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x319b
movslq %eax, %rsi
movq (%r14), %r14
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x2668
movslq %eax, %rdx
movq (%r12), %rsi
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
callq 0x2c34
cmpl $-0x1, %eax
je 0x3177
movl %eax, %ebp
leaq 0x101d(%rip), %rdi      # 0x4141
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq 0x8(%rsp), %rsi
movslq %ebp, %rdx
movq %rbx, %rdi
callq 0x3277
leaq 0x1011(%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
movq 0x2e5a(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0xfa6(%rip), %rdi       # 0x412e
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x23f0
pushq $0x1
popq %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xffc(%rip), %rsi       # 0x41a6
callq 0x22c0
testq %rax, %rax
je 0x3212
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
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 0x323e
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2340
cmpq %r15, %rax
jne 0x3253
movq %rbx, %rdi
callq 0x2230
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2dbf(%rip), %rax      # 0x5fd8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x20f0
leaq 0xf48(%rip), %rsi       # 0x4177
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2320
jmp 0x326f
movq 0x2d93(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0xe09(%rip), %rdi       # 0x4058
pushq $0x1a
jmp 0x3266
movq 0x2d7e(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0xf44(%rip), %rdi       # 0x41a8
pushq $0x13
popq %rsi
pushq $0x1
popq %rdx
callq 0x23f0
pushq $0x1
popq %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xeec(%rip), %rsi       # 0x4175
callq 0x22c0
testq %rax, %rax
je 0x32b9
movq %rax, %r14
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x23f0
cmpq %rbx, %rax
jne 0x32e5
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2230
movq 0x2d18(%rip), %rax      # 0x5fd8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x20f0
leaq 0xea1(%rip), %rsi       # 0x4177
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2320
jmp 0x3301
movq 0x2cec(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0xe9a(%rip), %rdi       # 0x4190
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x23f0
pushq $0x1
popq %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4d7e(%rip), %al       # 0x71a8
testb %al, %al
je 0x24f1
movq 0x4d57(%rip), %rax      # 0x7190
cmpq %rax, 0x4d58(%rip)      # 0x7198
je 0x2449
movq %rax, 0x4d4f(%rip)      # 0x7198
leaq 0x4d40(%rip), %r15      # 0x7190
movq %r15, %rdi
movq %r14, %rsi
callq 0x35be
movl -0x24(%rbp), %eax
xorl $0x1, %eax
leaq -0x28(%rbp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x3ac8
addq $0x8, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36b0
movq 0x4d0b(%rip), %rax      # 0x7190
cmpq %rax, 0x4d0c(%rip)      # 0x7198
je 0x2495
movq %rax, 0x4d03(%rip)      # 0x7198
leaq 0x4cf4(%rip), %r15      # 0x7190
leaq -0x24(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x368a
movq %r15, %rdi
movq %r12, %rsi
callq 0x368a
movq (%r14), %r12
movq 0x8(%r14), %r14
cmpq %r14, %r12
je 0x24e4
movl (%r12), %eax
xorl $0x1, %eax
movq 0x4cc0(%rip), %rcx      # 0x7190
movl %eax, 0x4(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36b0
addq $0x4, %r12
jmp 0x24bd
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4cb0(%rip), %rdi      # 0x71a8
callq 0x22a0
testl %eax, %eax
je 0x2432
xorps %xmm0, %xmm0
movups %xmm0, 0x4c81(%rip)     # 0x7190
andq $0x0, 0x4c89(%rip)      # 0x71a0
leaq 0x4c72(%rip), %rsi      # 0x7190
leaq 0x108f(%rip), %rdi      # 0x35b4
leaq 0x4c44(%rip), %rdx      # 0x7170
callq 0x2160
leaq 0x4c70(%rip), %rdi      # 0x71a8
callq 0x20f0
jmp 0x2432
// File: /workspace/github_cpp_makefile_star2_O2/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, -0x58(%rbp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%r15)
movq 0x8(%rsi), %r12
movq 0x10(%rsi), %r14
leaq -0x2c(%rbp), %r13
cmpq %r14, %r12
je 0x25a6
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
addl %eax, %eax
movl %eax, -0x2c(%rbp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x368a
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x240c
addq $0x18, %r12
jmp 0x2576
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
addl %eax, %eax
movq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
jbe 0x25d4
xorb $0x1, (%rax,%rdx,4)
incq %rdx
jmp 0x25c6
movl (%rsi), %edx
xorl $0x1, %edx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x240c
leaq -0x50(%rbp), %rdi
callq 0x38dc
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x25ff
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x38dc
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/conp-solutions[P]cnfmiter/Main.cc
// Function: generate_formula_miter(CNFMITER::Formula&, CNFMITER::Formula const&, CNFMITER::Formula const&)
void generate_formula_miter(Formula &formula, const Formula &input1, const Formula &input2)
{
    Lit e1, e2;
    generate_clause_sat(formula, input1, e1);
    std::cerr << "c after 1st equivalence formula, miter has " << formula.nVars() << " variables" << std::endl;
    generate_clause_sat(formula, input2, e2);
    std::cerr << "c after 2nd equivalence formula, miter has " << formula.nVars() << " variables" << std::endl;

    std::vector<Lit> clause;

    // !e1 -> e2
    clause.push_back(e1);
    clause.push_back(e2);
    formula.addClause_(clause);

    // e1 -> !e2
    clause[0] = ~e1;
    clause[1] = ~e2;
    formula.addClause_(clause);
    std::cerr << "c miter has " << formula.nVars() << " variables and " << formula.clauses.size() << " clauses" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rdi, %rbx
leaq -0x30(%rbp), %r14
movq %r14, %rdx
callq 0x2542
movq 0x49b3(%rip), %r12      # 0x6ff0
leaq 0x19c0(%rip), %rsi      # 0x4004
movq %r12, %rdi
callq 0x21a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x2280
leaq 0x19d3(%rip), %r13      # 0x4030
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2542
leaq 0x19b5(%rip), %rsi      # 0x403b
movq %r12, %rdi
callq 0x21a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %r14, %rsi
callq 0x368a
leaq -0x50(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x368a
leaq 0x8(%rbx), %r14
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x36b0
movl -0x30(%rbp), %eax
xorl $0x1, %eax
leaq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movl %eax, (%rcx)
movl -0x2c(%rbp), %eax
xorl $0x1, %eax
movl %eax, 0x4(%rcx)
movq %r14, %rdi
callq 0x36b0
movq 0x48ea(%rip), %rdi      # 0x6ff0
leaq 0x195a(%rip), %rsi      # 0x4067
callq 0x21a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x2280
leaq 0x1951(%rip), %rsi      # 0x4074
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %rsi
callq 0x2110
leaq 0x1937(%rip), %rsi      # 0x4084
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq -0x50(%rbp), %rdi
callq 0x38dc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x38dc
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/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
je 0x27ef
cmpl %esi, (%rdi)
jge 0x27ef
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cmpq %rcx, %rax
je 0x27df
movq (%rax), %r8
movq 0x8(%rax), %r9
subq %r8, %r9
sarq $0x2, %r9
xorl %r10d, %r10d
cmpq %r10, %r9
je 0x27d9
movl (%r8,%r10,4), %r11d
movl %r11d, %ebx
sarl %ebx
cmpl %esi, %ebx
jle 0x27d4
addl %edx, %ebx
andl $0x1, %r11d
leal (%r11,%rbx,2), %r11d
movl %r11d, (%r8,%r10,4)
incq %r10
jmp 0x27b4
addq $0x18, %rax
jmp 0x279e
movl (%rdi), %eax
addl %eax, %edx
popq %rbx
popq %rbp
cmpl %edx, %eax
jge 0x27ef
incl %eax
movl %eax, (%rdi)
jmp 0x27e5
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movl %edx, %r14d
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r12
cmpq %r12, %r15
je 0x284c
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2846
movl (%rax,%rdx,4), %esi
sarl %esi
incq %rdx
cmpl %r14d, %esi
jl 0x2829
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36b0
addq $0x18, %r15
jmp 0x2814
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x36ec
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/conp-solutions[P]cnfmiter/Main.cc
// Function: exchange_definition_clauses(CNFMITER::Formula&, CNFMITER::Formula&, int)
void exchange_definition_clauses(Formula &f1, Formula &f2, int largest_input_variable)
{
    std::vector<std::vector<Lit>> l2r, r2l;

    // get all clauses in f1 and f2 that have variable beyond largest variable
    l2r = get_definition_clauses(f1, largest_input_variable);
    std::cerr << "c extracted " << l2r.size() << " clauses from f1" << std::endl;
    r2l = get_definition_clauses(f2, largest_input_variable);
    std::cerr << "c extracted " << r2l.size() << " clauses from f2" << std::endl;

    // add the clauses mutually to each formula
    for (const auto &c : l2r) f2.addClause_(c);
    for (const auto &c : r2l) f1.addClause_(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
andq $0x0, -0x50(%rbp)
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x27f0
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %r12
movq %r12, %rsi
callq 0x3ccc
movq %r12, %rdi
callq 0x36ec
movq 0x472d(%rip), %rdi      # 0x6ff0
leaq 0x17c3(%rip), %rsi      # 0x408d
callq 0x21a0
movq %rax, %rdi
movq -0x58(%rbp), %rax
subq -0x60(%rbp), %rax
pushq $0x18
popq %r12
cqto
idivq %r12
movq %rax, %rsi
callq 0x2110
leaq 0x17a8(%rip), %rsi      # 0x409a
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x27f0
leaq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %r15
movq %r15, %rsi
callq 0x3ccc
movq %r15, %rdi
callq 0x36ec
movq 0x46c0(%rip), %rdi      # 0x6ff0
leaq 0x1756(%rip), %rsi      # 0x408d
callq 0x21a0
movq %rax, %rdi
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cqto
idivq %r12
movq %rax, %rsi
callq 0x2110
leaq 0x1750(%rip), %rsi      # 0x40ab
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq -0x60(%rbp), %r15
movq -0x58(%rbp), %r12
addq $0x8, %r14
cmpq %r12, %r15
je 0x298d
movq %r14, %rdi
movq %r15, %rsi
callq 0x36b0
addq $0x18, %r15
jmp 0x2977
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
addq $0x8, %rbx
cmpq %r15, %r14
je 0x29af
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36b0
addq $0x18, %r14
jmp 0x2999
leaq -0x40(%rbp), %rdi
callq 0x36ec
leaq -0x60(%rbp), %rdi
callq 0x36ec
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x36ec
leaq -0x60(%rbp), %rdi
callq 0x36ec
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/conp-solutions[P]cnfmiter/Main.cc
// Function: print_formula(CNFMITER::Formula&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void print_formula(Formula &f, std::string s)
{
    std::cout << "c CNFmiter, Norbert Manthey, 2020" << std::endl;
    if (!s.empty()) std::cout << "c " << s << std::endl;
    std::cout << "c " << std::endl;
    std::cout << "p cnf " << f.nVars() << " " << f.clauses.size() << std::endl;
    for (const auto &c : f.clauses) {
        std::stringstream s;
        s << c;
        printf("%s 0\n", s.str().c_str());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r14
movq %rdi, %rbx
movq 0x45ac(%rip), %rdi      # 0x6fc0
leaq 0x16a1(%rip), %rsi      # 0x40bc
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpq $0x0, 0x8(%r14)
je 0x2a55
movq 0x458a(%rip), %rdi      # 0x6fc0
leaq 0x16a1(%rip), %rsi      # 0x40de
callq 0x21a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq 0x4564(%rip), %r14      # 0x6fc0
leaq 0x167b(%rip), %rsi      # 0x40de
movq %r14, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x1667(%rip), %rsi      # 0x40e1
movq %r14, %rdi
callq 0x21a0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x2280
leaq 0x1823(%rip), %rsi      # 0x42b6
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x20c0
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r15
leaq -0x1d0(%rbp), %r12
leaq -0x48(%rbp), %r13
leaq 0x1610(%rip), %rbx      # 0x40e8
cmpq %r15, %r14
je 0x2b27
movq %r12, %rdi
callq 0x2130
leaq -0x1c0(%rbp), %rdi
movq %r14, %rsi
callq 0x3717
movq %r13, %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x2230
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
movq %r13, %rdi
callq 0x20b0
movq %r12, %rdi
callq 0x2140
addq $0x18, %r14
jmp 0x2ad8
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b3b
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
callq 0x2140
movq %rbx, %rdi
callq 0x2290