LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/flag_m.cpp
// Function: create_standard_include(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void create_standard_include (string file_name, string include_path) {
	int exit_code;
	vector<char*> cmd;

	LOAD_CMD ("bash");
	LOAD_CMD (ADD_HEADER_SCRIPT_PATH);
	LOAD_CMD ("0");
	LOAD_CMD (file_name.c_str());
	LOAD_CMD (include_path.c_str());

	cout << execute (exit_code, BASH_PATH, cmd);
	if (exit_code)
		return;

	cout << "\033[1;32minfo\033[0m: created standard header " 
		<< file_name << ".\n";
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x44e7(%rip), %rax      # 0x70f9
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
callq 0x3f94
leaq 0x4542(%rip), %rax      # 0x7168
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
leaq 0x4555(%rip), %rax      # 0x7194
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
movq (%rbx), %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
movq (%r14), %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3dea
leaq 0x445f(%rip), %rdx      # 0x70f0
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x50(%rsp), %rcx
callq 0x5e87
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x7312(%rip), %rdi      # 0x9fc8
callq 0x2210
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cd6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2ced
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
cmpl $0x0, 0xc(%rsp)
jne 0x2d33
movq 0x72cd(%rip), %rdi      # 0x9fc8
leaq 0x4494(%rip), %rsi      # 0x7196
movl $0x29, %edx
callq 0x2210
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x72ae(%rip), %rdi      # 0x9fc8
callq 0x2210
leaq 0x4507(%rip), %rsi      # 0x722d
movl $0x2, %edx
movq %rax, %rdi
callq 0x2210
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2d4a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d75
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x2d75
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2d9d
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x2d9d
jmp 0x2d9a
jmp 0x2d9a
jmp 0x2d9a
jmp 0x2d9a
jmp 0x2d9a
jmp 0x2d9a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2db4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/flag_m.cpp
// Function: create_dir(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void create_dir (string path) {
    if (mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) {
        cout << "\033[1;32minfo\033[0m: directory \""<< path
			<< "\" wasn't created. It must already exist.\n";
    } else {
		cout << "\033[1;32minfo\033[0m: created directory \"" << path
			<< "\".\n";
	}
	
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x20b0
movq 0x71f1(%rip), %r14      # 0x9fc8
testl %eax, %eax
je 0x2e0c
leaq 0x43de(%rip), %rsi      # 0x71c0
movl $0x1c, %edx
movq %r14, %rdi
callq 0x2210
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2210
leaq 0x43d8(%rip), %rsi      # 0x71dd
movl $0x29, %edx
jmp 0x2e3b
leaq 0x43f4(%rip), %rsi      # 0x7207
movl $0x24, %edx
movq %r14, %rdi
callq 0x2210
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2210
leaq 0x43f6(%rip), %rsi      # 0x722c
movl $0x3, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/other_flags.cpp
// Function: flag_t(char*)
void flag_t (char * optarg_) {
	int exit_code;
	vector<char*> cmd;

	LOAD_CMD ("bash");
	LOAD_CMD (LOAD_TEMPLATE_SCRIPT_PATH);
	LOAD_CMD (optarg_);
	LOAD_CMD (LOAD_TEMPLATES_DIR_PATH);

	cout << execute (exit_code, BASH_PATH, cmd);
	CHECK_CODE (exit_code);
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x2f47(%rip), %rax      # 0x70f9
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
callq 0x3f94
leaq 0x3332(%rip), %rax      # 0x74f8
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
leaq 0x28(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
leaq 0x3336(%rip), %rax      # 0x7527
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3dea
leaq 0x2ed7(%rip), %rdx      # 0x70f0
leaq 0x28(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x48(%rsp), %rcx
callq 0x5e87
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x5d8a(%rip), %rdi      # 0x9fc8
callq 0x2210
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x425e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4275
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
cmpl $0x1, 0xc(%rsp)
je 0x4299
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4293
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x60, %rsp
popq %rbx
retq
movl $0x1, %edi
callq 0x2240
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42c6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x42c6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x42ea
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x42ea
jmp 0x42e7
jmp 0x42e7
jmp 0x42e7
jmp 0x42e7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4301
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/parse_args.cpp
// Function: parse_args(int, char**)
void parse_args (int argc, char ** argv) {
	int c = 0;
	int exit_code;

	if (argc == 1) {
		fprintf(stderr,"\033[1;31merror\033[0m: Missing arguments.\n");
		case_h (EXIT_FAILURE);
	}

 	while ((c = getopt (argc, argv, "hcdmt:a:")) != -1) {

		switch (c) {
		case -1:
		case 0:
	  		break;

		case 'h':
	  		case_h (EXIT_SUCCESS);
			break;

		case 'a':
			cout << s_execute (exit_code, CODEGEN_DIR_PARSING_BIN_PATH,
				"codegen_setup");	
			CHECK_CODE (exit_code);
			flag_a (optarg);
			break;

		case 'm':
			cout << s_execute (exit_code, CODEGEN_DIR_PARSING_BIN_PATH,
				"codegen_setup");	
			CHECK_CODE (exit_code);
			flag_m ();
			break;

		case 't':
			flag_t (optarg);
			break;

		case 'c':
			flag_c ();
			break;

		case 'd':
			flag_d ();
			break;

		default:
	  		fprintf (stderr, "Unknown option character `%c'.\n", c);
	  		case_h (EXIT_FAILURE);
		}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x1, %edi
je 0x575e
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x227b(%rip), %r14      # 0x786c
leaq 0x2118(%rip), %r13      # 0x7710
movq 0x49c9(%rip), %r12      # 0x9fc8
movq 0x49b2(%rip), %r15      # 0x9fb8
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2040
cmpl $0x6c, %eax
jg 0x5691
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0x56ac
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
leaq 0x2236(%rip), %rdx      # 0x7875
leaq 0x2253(%rip), %rcx      # 0x7899
callq 0x5edf
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x2210
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5679
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpl $0x1, 0x4(%rsp)
je 0x573a
movq (%r15), %rdi
callq 0x48ca
jmp 0x5606
cmpl $0x6d, %eax
je 0x56ca
cmpl $0x74, %eax
jne 0x5744
movq (%r15), %rdi
callq 0x4190
jmp 0x5606
testl %eax, %eax
je 0x5606
jmp 0x5726
callq 0x528d
jmp 0x5606
callq 0x543c
jmp 0x5606
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
leaq 0x219a(%rip), %rdx      # 0x7875
leaq 0x21b7(%rip), %rcx      # 0x7899
callq 0x5edf
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x2210
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5715
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpl $0x1, 0x4(%rsp)
je 0x573a
callq 0x349a
jmp 0x5606
cmpl $-0x1, %eax
jne 0x5744
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x2240
movl %eax, %edi
callq 0x2632
leaq 0x1fde(%rip), %rdi      # 0x7730
callq 0x22f0
xorl %edi, %edi
callq 0x2240
callq 0x2661
jmp 0x5765
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5784
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: interupt(int, char const*, ...)
void interupt(int syserr, const char * msg, ...) {
	va_list ap;

	va_start(ap, msg);
	vfprintf(stderr, msg, ap);
	fprintf (stderr, "\n");
	va_end(ap);

	if (syserr == 1)
		perror("");

	exit(EXIT_FAILURE);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %edi, %ebx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5b68
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x4441(%rip), %r14      # 0x9fd0
movq (%r14), %rdi
callq 0x2290
movq (%r14), %rsi
movl $0xa, %edi
callq 0x2270
cmpl $0x1, %ebx
jne 0x5bb5
leaq 0x1ab3(%rip), %rdi      # 0x7663
callq 0x2140
movl $0x1, %edi
callq 0x2240
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: execute[abi:cxx11](int&, char const*, std::vector<char*, std::allocator<char*>>)
string execute (int & exit_code, const char * path, vector<char*> cmd) {

	cmd.push_back(NULL);

  	char **cmd_ptr = cmd.data();

	size_t len;

	string output = __execute__ (&exit_code, &len, path, cmd_ptr);

	output [len - 1] = '\0';

	return output;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %rsi
movq $0x0, (%rsi)
movq %rcx, %rdi
callq 0x3f94
movq (%rbx), %r8
movq %rsp, %rbx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x5bfb
movq (%rbx), %rax
movq (%r12), %rcx
movb $0x0, -0x1(%rcx,%rax)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: s_execute[abi:cxx11](int&, char const*, char const*)
string s_execute (int & exit_code, const char * path, const char * s) {
	
	vector<char*> cmd;

	cmd.push_back (const_cast<char*>(s));

	cmd.push_back(NULL);

  	char **cmd_ptr = cmd.data();

	size_t len;

	string output = __execute__ (&exit_code, &len, path, cmd_ptr);

	output [len - 1] = '\0';

	return output;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
callq 0x3f94
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f94
movq 0x10(%rsp), %r8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x5bfb
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
movb $0x0, -0x1(%rcx,%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f63
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5f74
jmp 0x5f74
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f8e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: parse_extension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
string parse_extension (string path, string & extension) {
	size_t path_len = path.length();
	string path_extension; 
	int break_point = 0;
	
	for (int i = path_len - 1; i >= 0; i--) {
		if (path[i] == '.') {
			break_point = i;
			break;
		}

		path_extension.push_back(path[i]);
	}

	reverse_str (path_extension);

	extension = path_extension;

	return path.substr(0, path_len - break_point - 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
movq 0x8(%rsi), %rbp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl %ebp, %r12d
movq %rbp, %r15
shlq $0x20, %r15
negq %r15
decq %r12
movabsq $0x100000000, %rbx      # imm = 0x100000000
leaq 0x8(%rsp), %r13
testl %r12d, %r12d
js 0x604e
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%r14), %rcx
movb (%rcx,%rax), %al
cmpb $0x2e, %al
je 0x6057
addq %rbx, %r15
decq %r12
movsbl %al, %esi
movq %r13, %rdi
callq 0x2150
jmp 0x6024
movq $-0x1, %r15
jmp 0x605b
sarq $0x20, %r15
movq 0x10(%rsp), %rax
cmpl $0x2, %eax
movq 0x30(%rsp), %rbx
jl 0x609e
movl %eax, %ecx
shrl %ecx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
decq %rax
xorl %edx, %edx
movq 0x8(%rsp), %rsi
movb (%rsi,%rdx), %dil
movb (%rsi,%rax), %r8b
movb %r8b, (%rsi,%rdx)
movb %dil, (%rsi,%rax)
incq %rdx
decq %rax
cmpq %rdx, %rcx
jne 0x607e
leaq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x20e0
addq %rbp, %r15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x21f0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x60dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60f0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x610f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_01/getint.c
// Function: main
int main(void)
{
  int number = 0;

  getint(&number);
  printf("%d\n", number);

  printbuf();

  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movq %rbx, %rdi
callq 0x11a1
movl (%rbx), %esi
leaq 0xe77(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1040
callq 0x1375
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_01/getint.c
// Function: getint
int getint(int *pn)
{
  int c, sign;

  while (isspace(c = getch()))
    ;

  if (!isdigit(c) && c != EOF && c != '+' && c != '-')
  {
    ungetch(c);
    return 0;
  }

  sign = (c == '-') ? -1 : 1;

  if (c == '+' || c == '-')
  {
    if (!isdigit(c = getch()))
    {
      ungetch(c);
      ungetch(sign == 1 ? '+' : '-');
      return 0;
    }
  }

  for (*pn = 0; isdigit(c); c = getch())
  {
    *pn = 10 * *pn + (c - '0');
  }

  *pn = *pn * sign;

  if (c != EOF)
  {
    ungetch(c);
  }

  return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1060
movq %rax, %r15
leaq 0x2eb2(%rip), %r13      # 0x4070
movq (%r15), %r12
movl 0x2e99(%rip), %eax      # 0x4060
testl %eax, %eax
jle 0x11da
decl %eax
movl %eax, 0x2e8d(%rip)      # 0x4060
movl (%r13,%rax,4), %ebx
jmp 0x11e1
callq 0x1050
movl %eax, %ebx
movslq %ebx, %rax
testb $0x20, 0x1(%r12,%rax,2)
jne 0x11be
movq (%r15), %rbp
movzwl (%rbp,%rax,2), %eax
btl $0xb, %eax
jb 0x121a
leal 0x1(%rbx), %eax
cmpl $0x2e, %eax
ja 0x1337
movabsq $0x500000000001, %rcx   # imm = 0x500000000001
btq %rax, %rcx
jae 0x1337
cmpl $0x2d, %ebx
je 0x1227
movl %ebx, %r12d
cmpl $0x2b, %ebx
jne 0x1274
movl 0x2e33(%rip), %eax      # 0x4060
testl %eax, %eax
jle 0x1240
decl %eax
movl %eax, 0x2e27(%rip)      # 0x4060
movl (%r13,%rax,4), %r12d
jmp 0x1248
callq 0x1050
movl %eax, %r12d
movslq %r12d, %rax
testb $0x8, 0x1(%rbp,%rax,2)
jne 0x1274
movslq 0x2e07(%rip), %rax      # 0x4060
cmpq $0x64, %rax
jl 0x1300
leaq 0xdb8(%rip), %rdi       # 0x2022
callq 0x1030
jmp 0x130e
movl $0x0, (%r14)
movq (%r15), %rax
movslq %r12d, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x12bb
movl (%r14), %eax
leal (%rax,%rax,4), %eax
leal (%r12,%rax,2), %eax
addl $-0x30, %eax
movl %eax, (%r14)
movl 0x2dc2(%rip), %eax      # 0x4060
testl %eax, %eax
jle 0x12b1
decl %eax
movl %eax, 0x2db6(%rip)      # 0x4060
movl (%r13,%rax,4), %r12d
jmp 0x127b
callq 0x1050
movl %eax, %r12d
jmp 0x127b
movl (%r14), %eax
movl %eax, %ecx
negl %ecx
cmpl $0x2d, %ebx
cmovnel %eax, %ecx
movl %ecx, (%r14)
cmpl $-0x1, %r12d
je 0x1363
movslq 0x2d84(%rip), %rax      # 0x4060
cmpq $0x64, %rax
jl 0x12f0
leaq 0xd39(%rip), %rdi       # 0x2022
callq 0x1030
jmp 0x1363
leal 0x1(%rax), %ecx
movl %ecx, 0x2d67(%rip)      # 0x4060
movl %r12d, (%r13,%rax,4)
jmp 0x1363
leal 0x1(%rax), %ecx
movl %ecx, 0x2d57(%rip)      # 0x4060
movl %r12d, (%r13,%rax,4)
movslq 0x2d4b(%rip), %rax      # 0x4060
cmpq $0x64, %rax
jge 0x1344
xorl %ecx, %ecx
cmpl $0x2d, %ebx
sete %cl
leal 0x2b(%rcx,%rcx), %ecx
leal 0x1(%rax), %edx
movl %edx, 0x2d30(%rip)      # 0x4060
movl %ecx, (%r13,%rax,4)
jmp 0x1360
movslq 0x2d22(%rip), %rax      # 0x4060
cmpq $0x64, %rax
jl 0x1352
leaq 0xcd7(%rip), %rdi       # 0x2022
callq 0x1030
jmp 0x1360
leal 0x1(%rax), %ecx
movl %ecx, 0x2d05(%rip)      # 0x4060
movl %ebx, (%r13,%rax,4)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_01/getint.c
// Function: printbuf
void printbuf(void)
{
  if (bufp)
  {
    printf("Buffer: [ ");

    int i;
    for (i = bufp - 1; i >= 0; --i)
    {
      if (i)
      {
        printf("'%c', ", buf[i] != '\n' ? buf[i] : '.');
      }
      else
      {
        printf("'%c' ", buf[i] != '\n' ? buf[i] : '.');
      }
    }

    printf("]\n");
  }
}

// Assembly:
cmpl $0x0, 0x2ce4(%rip)      # 0x4060
je 0x1414
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xc74(%rip), %rdi       # 0x2008
xorl %eax, %eax
callq 0x1040
movslq 0x2cbe(%rip), %rbx      # 0x4060
testq %rbx, %rbx
jle 0x13fa
leaq 0x2cc2(%rip), %r14      # 0x4070
leaq (%r14,%rbx,4), %r15
addq $-0x4, %r15
incq %rbx
leaq 0xc5a(%rip), %r12       # 0x201a
leaq 0xc4c(%rip), %r13       # 0x2013
movl $0x2e, %ebp
cmpq $0x2, %rbx
movq %r15, %rax
cmoveq %r14, %rax
movq %r13, %rdi
cmoveq %r12, %rdi
movl (%rax), %esi
cmpl $0xa, %esi
cmovel %ebp, %esi
xorl %eax, %eax
callq 0x1040
decq %rbx
addq $-0x4, %r15
cmpq $0x1, %rbx
jg 0x13cc
leaq 0xc1f(%rip), %rdi       # 0x2020
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O1/robertdavidgraham[P]wc2/wc2o.c
// Function: main
int main(void)
{
    static const unsigned char table[4][3] = {
        {2,0,1}, {2,0,1}, {3,0,1}, {3,0,1}
    };
    static const unsigned char column[256] = {
        0,0,0,0,0,0,0,0,0,1,2,1,1,1,0,0,0, /* \t\n\v\f\r */
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, /* SPACE ' ' */
    };
    unsigned long counts[4] = {0,0,0,0};
    int state = 0;
    int c;

    while ((c = getchar()) != EOF) {
        state = table[state][column[c]];
        counts[state]++;
    }

    printf("%lu %lu %lu\n", counts[1], counts[2], 
                counts[0] + counts[1] + counts[2] + counts[3]);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
callq 0x1040
cmpl $-0x1, %eax
je 0x119c
xorl %r15d, %r15d
leaq 0xeab(%rip), %rbx       # 0x2020
leaq 0xe94(%rip), %r14       # 0x2010
cltq
movzbl (%rax,%rbx), %eax
leaq (%r15,%r15,2), %rcx
addq %r14, %rcx
movzbl (%rax,%rcx), %r15d
incq (%rsp,%r15,8)
callq 0x1040
cmpl $-0x1, %eax
jne 0x117c
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq (%rdx,%rsi), %rcx
addq (%rsp), %rcx
addq 0x18(%rsp), %rcx
leaq 0xf66(%rip), %rdi       # 0x2120
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_08/_exit.c
// Function: main
int main(int argc, char *argv[])
{
	int ret;

	ret = atexit(func);
	if (ret) {
		fprintf(stderr, "cannot set atexit func\n");
		return -1;
	}

	if (argc >= 2)
		val = atoi(argv[1]);

	printf("this is a message");

	subfunc();

	printf("this point is unreachable!\n");

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq -0x27(%rip), %rdi       # 0x11ac
callq 0x1220
testl %eax, %eax
je 0x11ed
callq 0x10a0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x2, %ebp
jl 0x1201
movq 0x8(%rbx), %rdi
callq 0x1070
movl %eax, 0x2e5b(%rip)      # 0x405c
leaq 0xe14(%rip), %rdi       # 0x201c
xorl %eax, %eax
callq 0x1050
movl 0x2e47(%rip), %edi      # 0x405c
callq 0x1030
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/aligrudi[P]gpss/datpts.c
// Function: main
int main(int argc, char *argv[])
{
	int id = atoi(argv[1]);
	if (id == 0)
		grid(10, 10);
	if (id == 1)
		grid(13, 13);
	if (id == 2)
		grid(14, 14);
	if (id == 3)
		grid(15, 15);
	if (id == 4)
		grid(17, 17);
	if (id == 5)
		grid(5, 22);
	if (id == 6)
		grid(3, 37);
	if (id == 7)
		grid2(13, 13, 5, 0);
	if (id == 8)
		grid2(12, 12, 7, 7);
	return 0;
}

// Assembly:
pushq %rax
movq 0x8(%rsi), %rdi
callq 0x1040
cmpl $0x8, %eax
ja 0x11f6
movl %eax, %eax
leaq 0xe9c(%rip), %rcx       # 0x2004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, %edi
movl $0xa, %esi
jmp 0x11d6
movl $0x11, %edi
movl $0x11, %esi
jmp 0x11d6
movl $0xe, %edi
movl $0xe, %esi
jmp 0x11d6
movl $0xf, %edi
movl $0xf, %esi
jmp 0x11d6
movl $0xd, %edi
movl $0xd, %esi
movl $0x5, %edx
xorl %ecx, %ecx
jmp 0x11f1
movl $0xd, %edi
movl $0xd, %esi
jmp 0x11d6
movl $0x5, %edi
movl $0x16, %esi
jmp 0x11d6
movl $0x3, %edi
movl $0x25, %esi
callq 0x11fa
jmp 0x11f6
movl $0xc, %edi
movl $0xc, %esi
movl $0x7, %edx
movl $0x7, %ecx
callq 0x1255
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/aligrudi[P]gpss/datpts.c
// Function: grid
static void grid(int h, int w)
{
	int i, j;
	printf("%d\n", h * w);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			printf("%d %d\n", i, j);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
imull %edi, %esi
leaq 0xe1b(%rip), %rdi       # 0x202b
xorl %eax, %eax
callq 0x1030
testl %ebp, %ebp
jle 0x124c
leaq 0xe06(%rip), %r14       # 0x2028
xorl %r15d, %r15d
testl %ebx, %ebx
jle 0x1244
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x1030
incl %r12d
cmpl %r12d, %ebx
jne 0x122c
incl %r15d
cmpl %ebp, %r15d
jne 0x1225
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aligrudi[P]gpss/datpts.c
// Function: grid2
static void grid2(int h, int w, int dy, int dx)
{
	int i, j;
	printf("%d\n", h * w * 2);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			printf("%d %d\n", i, j);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			printf("%d %d\n", dy + i, dx + j);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl %esi, %r15d
movl %edi, %ebp
movl %edi, %esi
imull %r15d, %esi
addl %esi, %esi
leaq 0xdab(%rip), %rdi       # 0x202b
xorl %eax, %eax
callq 0x1030
testl %ebp, %ebp
jle 0x12ba
leaq 0xd96(%rip), %r12       # 0x2028
xorl %r13d, %r13d
testl %r15d, %r15d
jle 0x12b2
xorl %ebx, %ebx
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1030
incl %ebx
cmpl %ebx, %r15d
jne 0x129c
incl %r13d
cmpl %ebp, %r13d
jne 0x1295
testl %ebp, %ebp
jle 0x1302
leaq 0xd63(%rip), %r12       # 0x2028
xorl %r14d, %r14d
movl %ebp, 0xc(%rsp)
testl %r15d, %r15d
jle 0x12f6
movq 0x10(%rsp), %rax
leal (%r14,%rax), %r13d
movl 0x8(%rsp), %ebx
movl %r15d, %ebp
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1030
incl %ebx
decl %ebp
jne 0x12e1
incl %r14d
movl 0xc(%rsp), %ebp
cmpl %ebp, %r14d
jne 0x12cc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(struct state * S, struct deleteto * deleteto, int s)
{
	struct dispatch_state * D;

	/* Allocate space for dispatcher state. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->S = S;
	D->D = deleteto;

	/* Accept a connection. */
	D->accepting = 1;
	if (network_accept(s, callback_accept, D) == NULL)
		goto err1;

	/* Success! */
	return (D);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x40, %edi
callq 0x2270
testq %rax, %rax
je 0x338d
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl $0x1, 0x10(%rax)
leaq 0x27(%rip), %rsi        # 0x339d
movl %ebp, %edi
movq %rax, %rdx
callq 0x65fc
testq %rax, %rax
jne 0x338f
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{

	/* Sanity check. */
	assert(D->accepting == 0);
	assert(D->read_cookie == NULL);
	assert(D->npending == 0);

	/* Free the buffered reader for the connection. */
	netbuf_read_free(D->readq);

	/* Free the buffered writer for the connection. */
	netbuf_write_free(D->writeq);

	/* Close the connection. */
	while (close(D->sconn)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err0;
	}

	/* Free allocated memory. */
	free(D);

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
jne 0x3637
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x3656
cmpq $0x0, 0x30(%rbx)
jne 0x3675
movq 0x20(%rbx), %rdi
callq 0x6090
movq 0x18(%rbx), %rdi
callq 0x647b
movl 0x14(%rbx), %edi
callq 0x21c0
testl %eax, %eax
je 0x3610
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x35e1
leaq 0xab89(%rip), %rdi      # 0xe18c
testl %eax, %eax
jne 0x361c
xorl %eax, %eax
callq 0x95e7
jmp 0x362a
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x362f
xorl %eax, %eax
callq 0x94c8
movl $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9ca6(%rip), %rdi      # 0xd2e4
leaq 0x9cb1(%rip), %rsi      # 0xd2f6
leaq 0x9cb5(%rip), %rcx      # 0xd301
movl $0x162, %edx            # imm = 0x162
callq 0x21a0
leaq 0x9ccf(%rip), %rdi      # 0xd32c
leaq 0x9c92(%rip), %rsi      # 0xd2f6
leaq 0x9c96(%rip), %rcx      # 0xd301
movl $0x163, %edx            # imm = 0x163
callq 0x21a0
leaq 0x9cc7(%rip), %rdi      # 0xd343
leaq 0x9c73(%rip), %rsi      # 0xd2f6
leaq 0x9c77(%rip), %rcx      # 0xd301
movl $0x164, %edx            # imm = 0x164
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: callback_get
static int
callback_get(void * cookie, struct proto_lbs_request * R,
    const uint8_t * buf, size_t blklen)
{
	struct dispatch_state * D = cookie;
	int status;
	int rc;

	/* Does the block exist? */
	if (buf != NULL)
		status = 0;
	else
		status = 1;

	/* Sanity check. */
	assert(blklen <= UINT32_MAX);

	/* Send a response back. */
	rc = proto_lbs_response_get(D->writeq, R->ID, status, (uint32_t)blklen,
	    buf);

	/* Free the request. */
	free(R);

	/* This request is done. */
	D->npending -= 1;

	/* Return success/failure from response write. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
shrq $0x20, %rax
jne 0x39a2
movq %rdx, %r8
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
testq %r8, %r8
sete %dl
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
callq 0xa386
movl %eax, %ebp
movq %r14, %rdi
callq 0x2040
decq 0x30(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x9ab4(%rip), %rdi      # 0xd45d
leaq 0x9946(%rip), %rsi      # 0xd2f6
leaq 0x9abb(%rip), %rcx      # 0xd472
movl $0xc5, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: callback_append
static int
callback_append(void * cookie, struct proto_lbs_request * R, uint64_t nextblk)
{
	struct dispatch_state * D = cookie;
	int rc;

	/* Send a response back. */
	rc = proto_lbs_response_append(D->writeq, R->ID, 0, nextblk);

	/* Free the request. */
	free(R->r.append.buf);
	free(R);

	/* This request is now done. */
	D->npending -= 1;
	D->appendip = 0;

	/* Return success/failure from response write. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rcx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
xorl %edx, %edx
callq 0xa42e
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
decq 0x30(%r14)
movl $0x0, 0x38(%r14)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_init
struct state *
state_init(struct wire_requestqueue * Q_DDBKV, size_t itemsz, uint8_t * tableid,
    struct metadata * M)
{
	struct state * S;
	struct readtableid RT;

	/* Sanity check. */
	assert(itemsz - KVOVERHEAD <= UINT32_MAX);

	/* Allocate a structure and initialize. */
	if ((S = malloc(sizeof(struct state))) == NULL)
		goto err0;
	S->Q = Q_DDBKV;
	S->M = M;
	S->blklen = (uint32_t)(itemsz - KVOVERHEAD);
	S->npending = 0;

	/* Read "nextblk" and "lastblk" values. */
	S->nextblk = metadata_nextblk_read(S->M);
	S->lastblk = metadata_lastblk_read(S->M);

	/* Read tableid from the table. */
	RT.done = 0;
	if (proto_dynamodb_kv_request_getc(S->Q, "tableid", callback_init, &RT))
		goto err1;
	if (events_spin(&RT.done)) {
		warnp("Error reading tableid");
		goto err1;
	}

	/* Verify that the table IDs match. */
	if (memcmp(RT.tableid, tableid, 32)) {
		warn0("Data table ID does not match metadata table ID!");
		goto err1;
	}

	/* Success! */
	return (S);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r13
addq $-0x12, %r13
movq %r13, %rax
shrq $0x20, %rax
jne 0x3b3c
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %r15
movl $0x30, %edi
callq 0x2270
testq %rax, %rax
je 0x3a98
movq %rax, %rbx
movq %r15, 0x18(%rax)
movq %r12, 0x20(%rax)
movl %r13d, (%rax)
movq $0x0, 0x28(%rax)
movq %r12, %rdi
callq 0x4551
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x46fa
movq %rax, 0x8(%rbx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x9c19(%rip), %rsi      # 0xd696
leaq 0xd7(%rip), %rdx        # 0x3b5b
movq %r15, %rdi
callq 0x9e9c
testl %eax, %eax
je 0x3aab
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xc(%rsp), %rdi
callq 0x4bf9
testl %eax, %eax
je 0x3add
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3b29
movq %rax, %r14
leaq 0x9a78(%rip), %rdi      # 0xd545
xorl %eax, %eax
callq 0x94c8
movl $0x0, (%r14)
jmp 0x3a90
movdqu 0x10(%rsp), %xmm0
movdqu 0x20(%rsp), %xmm1
movdqu (%r14), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r14), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x3a9a
leaq 0x9a49(%rip), %rdi      # 0xd55b
xorl %eax, %eax
callq 0x95e7
callq 0x20a0
movl $0x0, (%rax)
jmp 0x3a90
leaq 0x9a15(%rip), %rdi      # 0xd545
xorl %eax, %eax
callq 0x95e7
jmp 0x3a90
leaq 0x997d(%rip), %rdi      # 0xd4c0
leaq 0x9998(%rip), %rsi      # 0xd4e2
leaq 0x9999(%rip), %rcx      # 0xd4ea
movl $0x72, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_get
int
state_get(struct state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *,
        const uint8_t *, size_t), void * cookie)
{
	struct get_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct get_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;
	C->consistent = 0;

	/* Send the request. */
	if (proto_dynamodb_kv_request_get(S->Q, objmap(R->r.get.blkno),
	    callback_get, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movl $0x28, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3c69
movq %rax, %r15
movq %r14, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
movl $0x0, 0x20(%rax)
movq 0x18(%r14), %r13
movq 0x10(%r12), %rdi
callq 0x4908
leaq 0x33(%rip), %rdx        # 0x3c7a
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x9c78
testl %eax, %eax
je 0x3c63
movq %r15, %rdi
callq 0x2040
jmp 0x3c69
incq 0x28(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_get
static int
callback_get(void * cookie, int status, const uint8_t * buf, size_t buflen)
{
	struct get_cookie * C = cookie;
	struct proto_lbs_request * R = C->R;
	struct state * S = C->S;
	int rc;

	/* Sanity-check. */
	assert((status == 0) || (status == 1) || (status == 2));

	/*
	 * If an eventually-consistent read didn't find the block, try again
	 * with a strong-consistency read.
	 */
	if ((status == 2) && (C->consistent == 0)) {
		C->consistent = 1;
		return (proto_dynamodb_kv_request_getc(S->Q,
		    objmap(R->r.get.blkno), callback_get, C));
	}

	/* If we got data, verify the block size. */
	if ((status == 0) && (buflen != S->blklen)) {
		warn0("DynamoDB-KV GET returned wrong amount of data:"
		    " %zu (should be %" PRIu32 ")", buflen, S->blklen);
		goto err0;
	}

	/* Failures are bad. */
	if (status == 1) {
		warnp("Failure in DynamoDB-KV GET");
		goto err0;
	}

	/* If the block does not exist, we have no data. */
	if (status == 2)
		buf = NULL;

	/* Tell the dispatcher to send its response back. */
	rc = (C->callback)(C->cookie, C->R, buf, S->blklen);

	/* We've done a callback. */
	S->npending -= 1;

	/* Free our cookie. */
	free(C);

	/* Return status from callback. */
	return (rc);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x3, %esi
jae 0x3d6d
movl %esi, %eax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
cmpl $0x2, %eax
jne 0x3c9e
cmpl $0x0, 0x20(%rbx)
je 0x3d07
cmpl $0x1, %eax
je 0x3cb8
testl %eax, %eax
jne 0x3ce2
movl (%r14), %r8d
cmpq %rcx, %r8
jne 0x3d34
cmpl $0x1, %eax
jne 0x3ce2
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3d55
movq %rax, %rbx
leaq 0x9a77(%rip), %rdi      # 0xd747
xorl %eax, %eax
callq 0x94c8
movl $0x0, (%rbx)
jmp 0x3d63
xorl %ecx, %ecx
cmpl $0x2, %eax
cmoveq %rcx, %rdx
movq 0x18(%rbx), %rdi
movl (%r14), %ecx
callq *0x10(%rbx)
movl %eax, %ebp
decq 0x28(%r14)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
jmp 0x3d68
movl $0x1, 0x20(%rbx)
movq 0x18(%r14), %r14
movq 0x10(%rsi), %rdi
callq 0x4908
leaq -0xa8(%rip), %rdx       # 0x3c7a
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x9e9c
leaq 0x99ca(%rip), %rdi      # 0xd705
movq %rcx, %rsi
movl %r8d, %edx
xorl %eax, %eax
callq 0x95e7
callq 0x20a0
movl $0x0, (%rax)
jmp 0x3d63
leaq 0x99eb(%rip), %rdi      # 0xd747
xorl %eax, %eax
callq 0x95e7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x98ab(%rip), %rdi      # 0xd61f
leaq 0x9767(%rip), %rsi      # 0xd4e2
leaq 0x994c(%rip), %rcx      # 0xd6ce
movl $0xdc, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_append
int
state_append(struct state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *, uint64_t),
    void * cookie)
{
	struct append_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct append_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;
	C->nblks_left = R->r.append.nblks;
	C->nextblk_old = S->nextblk;

	/* Update nextblk. */
	S->nextblk += R->r.append.nblks;
	if (metadata_nextblk_write(S->M, S->nextblk,
	    callback_append_put_nextblk, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r14
movl $0x30, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3e07
movq %rax, %r15
movq %r14, (%rax)
movq %r13, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r12, 0x18(%rax)
movl 0x10(%r13), %eax
movq %rax, 0x20(%r15)
movq 0x10(%r14), %rsi
movq %rsi, 0x28(%r15)
addq %rax, %rsi
movq %rsi, 0x10(%r14)
movq 0x20(%r14), %rdi
leaq 0x2d(%rip), %rdx        # 0x3e18
movq %r15, %rcx
callq 0x4556
testl %eax, %eax
je 0x3e01
movq %r15, %rdi
callq 0x2040
jmp 0x3e07
incq 0x28(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_append_put_nextblk
int
callback_append_put_nextblk(void * cookie)
{
	struct append_cookie * C = cookie;
	struct state * S = C->S;
	struct proto_lbs_request * R = C->R;
	size_t i;

	/* Store all the blocks. */
	for (i = 0; i < R->r.append.nblks; i++) {
		if (proto_dynamodb_kv_request_put(S->Q,
		    objmap(C->nextblk_old + i),
		    &R->r.append.buf[i * S->blklen], S->blklen,
		    callback_append_put_blks, C))
			goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r12
cmpl $0x0, 0x10(%r12)
je 0x3e80
movq %rdi, %rbx
movq (%rdi), %r13
xorl %ebp, %ebp
leaq 0x5a(%rip), %r14        # 0x3e98
movq 0x18(%r13), %r15
movq 0x28(%rbx), %rdi
addq %rbp, %rdi
callq 0x4908
movl (%r13), %ecx
movq %rbp, %rdx
imulq %rcx, %rdx
addq 0x20(%r12), %rdx
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %r8
movq %rbx, %r9
callq 0x970c
testl %eax, %eax
jne 0x3e84
incq %rbp
movl 0x10(%r12), %eax
cmpq %rax, %rbp
jb 0x3e3e
xorl %eax, %eax
jmp 0x3e89
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_append_put_blks
int
callback_append_put_blks(void * cookie, int status)
{
	struct append_cookie * C = cookie;
	struct state * S = C->S;

	/* Sanity-check: We should be storing blocks. */
	assert(C->nblks_left != 0);

	/* Failures are bad. */
	if (status) {
		warn0("DynamoDB-KV failed storing data block");
		goto err0;
	}

	/* We've stored a block. */
	C->nblks_left--;

	/* If we've stored all the blocks, record a new lastblk value. */
	if (C->nblks_left == 0) {
		S->lastblk = S->nextblk - 1;
		if (metadata_lastblk_write(S->M, S->lastblk,
		    callback_append_put_lastblk, C))
			goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x3efc
testl %esi, %esi
je 0x3ec6
leaq 0x971b(%rip), %rdi      # 0xd5c8
xorl %eax, %eax
callq 0x95e7
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3ed7
movq %rdi, %rcx
movq (%rdi), %rdx
xorl %ebx, %ebx
decq %rax
movq %rax, 0x20(%rdi)
je 0x3edb
movl %ebx, %eax
popq %rbx
retq
movq 0x10(%rdx), %rsi
movq 0x20(%rdx), %rdi
decq %rsi
movq %rsi, 0x8(%rdx)
leaq 0x2a(%rip), %rdx        # 0x3f1b
callq 0x46ff
testl %eax, %eax
jne 0x3ebf
jmp 0x3ed7
leaq 0x9688(%rip), %rdi      # 0xd58b
leaq 0x95d8(%rip), %rsi      # 0xd4e2
leaq 0x968d(%rip), %rcx      # 0xd59e
movl $0x155, %edx            # imm = 0x155
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_append_put_lastblk
int
callback_append_put_lastblk(void * cookie)
{
	struct append_cookie * C = cookie;
	struct state * S = C->S;
	int rc;

	/* Tell the dispatcher to send its response back. */
	rc = (C->callback)(C->cookie, C->R, S->nextblk);

	/* We've done a callback. */
	S->npending -= 1;

	/* Free our cookie. */
	free(C);

	/* Return status from callback. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rbx), %r14
movq 0x8(%rbx), %rsi
movq 0x10(%r14), %rdx
callq *0x10(%rbx)
movl %eax, %ebp
decq 0x28(%r14)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/deleteto.c
// Function: deleteto_init
struct deleteto *
deleteto_init(struct wire_requestqueue * Q_DDBKV, struct metadata * M)
{
	struct deleteto * D;

	/* Allocate and initialize a DeleteTo structure. */
	if ((D = malloc(sizeof(struct deleteto))) == NULL)
		goto err0;
	D->Q = Q_DDBKV;
	D->MD = M;
	D->N = 0;
	D->flushed = 0;
	D->npending = 0;
	D->shuttingdown = 0;
	D->shutdown = 0;
	D->ip_head = NULL;
	D->ip_tail = NULL;

	/* How far are we guaranteed was previously deleted? */
	D->M = metadata_deletedto_read(D->MD);

	/* We want to be poked every time a metadata write completes. */
	metadata_deletedto_register(D->MD, poke, D);

	/* Success! */
	return (D);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x2270
testq %rax, %rax
je 0x3fce
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %r14, %rdi
callq 0x474d
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rdi
leaq 0x15(%rip), %rsi        # 0x3fd9
movq %rbx, %rdx
callq 0x4757
jmp 0x3fd0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/deleteto.c
// Function: callback_done
static int
callback_done(void * cookie, int status)
{
	struct delete * D1 = cookie;
	struct deleteto * D = D1->D;

	/* Sanity-check. */
	assert(D->npending > 0);

	/* Failures are bad, m'kay? */
	if (status) {
		warn0("DynamoDB-KV DELETE operation failed!");
		goto err0;
	}

	/* Remove from linked list of in-progress deletes. */
	if (D1->prev != NULL)
		D1->prev->next = D1->next;
	else
		D->ip_head = D1->next;
	if (D1->next != NULL)
		D1->next->prev = D1->prev;
	else
		D->ip_tail = D1->prev;

	/* Free cookie. */
	free(D1);

	/* We've finished an operation. */
	D->npending -= 1;

	/* Check what we should do next. */
	if (poke(D))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpq $0x0, 0x28(%rbx)
je 0x4237
testl %esi, %esi
je 0x41e7
leaq 0x95c9(%rip), %rdi      # 0xd79c
xorl %eax, %eax
callq 0x95e7
callq 0x20a0
movl $0x0, (%rax)
jmp 0x422c
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
leaq 0x38(%rbx), %rdx
leaq 0x18(%rax), %rsi
testq %rax, %rax
cmoveq %rdx, %rsi
movq %rcx, (%rsi)
movq 0x18(%rdi), %rcx
leaq 0x40(%rbx), %rdx
leaq 0x10(%rcx), %rsi
testq %rcx, %rcx
cmoveq %rdx, %rsi
movq %rax, (%rsi)
callq 0x2040
decq 0x28(%rbx)
movq %rbx, %rdi
callq 0x3fd9
testl %eax, %eax
je 0x4233
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
xorl %eax, %eax
jmp 0x4231
leaq 0x9524(%rip), %rdi      # 0xd762
leaq 0x952d(%rip), %rsi      # 0xd772
leaq 0x9531(%rip), %rcx      # 0xd77d
movl $0xb1, %edx
callq 0x21a0
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-dynamodb/metadata.c
// Function: metadata_init
struct metadata *
metadata_init(struct wire_requestqueue * Q, uint64_t * itemsz,
    uint8_t * tableid)
{
	struct metadata * M;

	/* Bake a cookie. */
	if ((M = malloc(sizeof(struct metadata))) == NULL)
		goto err0;
	M->Q = Q;

	/* Read metadata and take ownership. */
tryagain:
	M->init_done = 0;
	if (proto_dynamodb_kv_request_getc(Q, "metadata",
	    callback_readmetadata, M)) {
		warnp("Error reading LBS metadata");
		goto err1;
	}
	if (events_spin(&M->init_done)) {
		warnp("Error claiming ownership of LBS metadata");
		goto err1;
	}

	/* Did we lose a race trying to claim the metadata? */
	if (M->init_lostrace) {
		warn0("Lost race claiming metadata; trying again...");
		goto tryagain;
	}

	/* The next metadata will be the same except one higher generation. */
	M->M_latest = M->M_stored;
	M->M_latest.generation++;

	/* Nothing in progress yet. */
	M->M_latest.callback_state = NULL;
	M->M_latest.cookie_state = NULL;
	M->callback_deletedto = NULL;
	M->cookie_deletedto = NULL;
	M->write_inprogress = 0;
	M->write_wanted = 0;

	/* Return the item size and table ID. */
	*itemsz = M->itemsz;
	memcpy(tableid, M->tableid, 32);

	/* Success! */
	return (M);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x100, %edi            # imm = 0x100
callq 0x2270
testq %rax, %rax
je 0x4357
movq %rax, %rbx
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %r12, (%rax)
movl $0x0, 0xd0(%rax)
leaq 0x9559(%rip), %rsi      # 0xd7fc
leaq 0x144(%rip), %rdx       # 0x43ee
movq %r12, %rdi
movq %rax, %rcx
callq 0x9e9c
testl %eax, %eax
je 0x42dd
callq 0x20a0
cmpl $0x0, (%rax)
je 0x4341
movq %rax, %r14
leaq 0x94f4(%rip), %rdi      # 0xd7c1
xorl %eax, %eax
callq 0x94c8
movl $0x0, (%r14)
jmp 0x434f
movq %rbx, %r13
addq $0xd0, %r13
xorl %ebp, %ebp
leaq 0x950c(%rip), %r15      # 0xd7fc
leaq 0xf7(%rip), %r14        # 0x43ee
movq %r13, %rdi
callq 0x4bf9
testl %eax, %eax
jne 0x436b
cmpl $0x0, 0xd4(%rbx)
je 0x4384
leaq 0x94f2(%rip), %rdi      # 0xd805
xorl %eax, %eax
callq 0x95e7
callq 0x20a0
movl %ebp, (%rax)
movl %ebp, 0xd0(%rbx)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x9e9c
testl %eax, %eax
je 0x42f7
jmp 0x42b9
leaq 0x9479(%rip), %rdi      # 0xd7c1
xorl %eax, %eax
callq 0x95e7
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20a0
cmpl $0x0, (%rax)
je 0x43e2
movq %rax, %r14
leaq 0x945d(%rip), %rdi      # 0xd7dc
jmp 0x42cd
movups 0x8(%rbx), %xmm0
movups 0x18(%rbx), %xmm1
movups %xmm1, 0x78(%rbx)
movups %xmm0, 0x68(%rbx)
incq 0x78(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0xb8(%rbx)
movq $0x0, 0xc8(%rbx)
movq 0xd8(%rbx), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movups 0xe0(%rbx), %xmm0
movups 0xf0(%rbx), %xmm1
movq 0x10(%rsp), %rax
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0x4359
leaq 0x93f3(%rip), %rdi      # 0xd7dc
jmp 0x4348