LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x38e3(%rip), %rax      # 0x60f9
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
callq 0x35bc
leaq 0x393e(%rip), %rax      # 0x6168
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
leaq 0x3951(%rip), %rax      # 0x6194
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
movq (%rbx), %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
movq (%r14), %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x349c
leaq 0x385b(%rip), %rdx      # 0x60f0
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x50(%rsp), %rcx
callq 0x4d8c
movq 0x6718(%rip), %rdi      # 0x8fc8
leaq 0x30(%rsp), %rsi
callq 0x2180
leaq 0x30(%rsp), %rdi
callq 0x20c0
leaq 0x50(%rsp), %rdi
callq 0x3588
cmpl $0x0, 0xc(%rsp)
jne 0x2902
movq 0x66ec(%rip), %rdi      # 0x8fc8
leaq 0x38b3(%rip), %rsi      # 0x6196
callq 0x21b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2180
leaq 0x3933(%rip), %rsi      # 0x622d
movq %rax, %rdi
callq 0x21b0
leaq 0x10(%rsp), %rdi
callq 0x3588
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x20c0
jmp 0x2926
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3588
jmp 0x2941
jmp 0x293e
jmp 0x293e
jmp 0x293e
jmp 0x293e
jmp 0x293e
jmp 0x293e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3588
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x288a(%rip), %rax      # 0x60f9
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
callq 0x35bc
leaq 0x2c75(%rip), %rax      # 0x64f8
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
leaq 0x28(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
leaq 0x2c79(%rip), %rax      # 0x6527
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x349c
leaq 0x281a(%rip), %rdx      # 0x60f0
leaq 0x28(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x48(%rsp), %rcx
callq 0x4d8c
movq 0x56d7(%rip), %rdi      # 0x8fc8
leaq 0x28(%rsp), %rsi
callq 0x2180
leaq 0x28(%rsp), %rdi
callq 0x20c0
leaq 0x48(%rsp), %rdi
callq 0x3588
cmpl $0x1, 0xc(%rsp)
je 0x3926
leaq 0x10(%rsp), %rdi
callq 0x3588
addq $0x60, %rsp
popq %rbx
retq
pushq $0x1
popq %rdi
callq 0x2240
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20c0
jmp 0x3940
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3588
jmp 0x3957
jmp 0x3954
jmp 0x3954
jmp 0x3954
jmp 0x3954
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3588
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/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 0x47a2
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2203(%rip), %r14      # 0x686c
leaq 0x8(%rsp), %r13
movq 0x4953(%rip), %r12      # 0x8fc8
leaq 0x2094(%rip), %r15      # 0x6710
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2040
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
jbe 0x46b8
testl %eax, %eax
je 0x467c
cmpl $0x6d, %eax
je 0x471e
cmpl $0x74, %eax
jne 0x475d
movq 0x490a(%rip), %rax      # 0x8fb8
movq (%rax), %rdi
callq 0x3850
jmp 0x467c
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
leaq 0x21a5(%rip), %rdx      # 0x6875
leaq 0x21c2(%rip), %rcx      # 0x6899
callq 0x4de1
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %r13, %rdi
callq 0x20c0
cmpl $0x1, 0x4(%rsp)
je 0x4771
movq 0x48bb(%rip), %rax      # 0x8fb8
movq (%rax), %rdi
callq 0x3c71
jmp 0x467c
callq 0x4496
jmp 0x467c
callq 0x4355
jmp 0x467c
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
leaq 0x2148(%rip), %rdx      # 0x6875
leaq 0x2165(%rip), %rcx      # 0x6899
callq 0x4de1
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %r13, %rdi
callq 0x20c0
cmpl $0x1, 0x4(%rsp)
je 0x4771
callq 0x2d4e
jmp 0x467c
cmpl $-0x1, %eax
jne 0x4779
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x2240
movq 0x4850(%rip), %rcx      # 0x8fd0
movq (%rcx), %rdi
leaq 0x211d(%rip), %rsi      # 0x68a7
movl %eax, %edx
xorl %eax, %eax
callq 0x22e0
pushq $0x1
popq %rdi
callq 0x4630
xorl %edi, %edi
callq 0x4630
movq 0x4827(%rip), %rax      # 0x8fd0
movq (%rax), %rcx
leaq 0x2093(%rip), %rdi      # 0x6846
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
callq 0x23a0
jmp 0x4793
jmp 0x47c2
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x4a6c
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 0x453d(%rip), %r14      # 0x8fd0
movq (%r14), %rdi
callq 0x22a0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x2270
cmpl $0x1, %ebx
jne 0x4ab7
leaq 0x1bb1(%rip), %rdi      # 0x6663
callq 0x2150
pushq $0x1
popq %rdi
callq 0x2240
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%rsi)
movq %rcx, %rdi
callq 0x35bc
movq (%rbx), %r8
movq %rsp, %rbx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x4af1
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_O2/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
leaq 0x10(%rsp), %rdi
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
callq 0x35bc
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x35bc
movq 0x10(%rsp), %r8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x4af1
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
movb $0x0, -0x1(%rcx,%rax)
leaq 0x10(%rsp), %rdi
callq 0x3588
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4e63
jmp 0x4e63
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3588
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
movq 0x8(%rsi), %rbp
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl %ebp, %ebx
movq %rbp, (%rsp)
shlq $0x20, %rbp
negq %rbp
decq %rbx
pushq $-0x1
popq %r12
movabsq $0x100000000, %r15      # imm = 0x100000000
leaq 0x18(%rsp), %r13
testl %ebx, %ebx
js 0x4f45
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%r14), %rcx
movb (%rcx,%rax), %al
cmpb $0x2e, %al
je 0x4f3e
addq %r15, %rbp
decq %rbx
movsbl %al, %esi
movq %r13, %rdi
callq 0x2160
jmp 0x4f16
sarq $0x20, %rbp
movq %rbp, %r12
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x4e78
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x2100
movq 0x10(%rsp), %rbx
addq (%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x21f0
leaq 0x18(%rsp), %rdi
callq 0x20c0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4f96
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: cut_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string cut_file (string path) {
	bool to_exit = true;
	stringstream ss(path);
	string token;

    while ( getline(ss, token, '/') ) {
		if ( token == "." || token == ".." )
			continue;
        else if ( has_dot (token) ) {
			to_exit = false;
			break;
		}
	}

	if (to_exit)
		return path;

	int exit_code;
	vector<char*> cmd;

	LOAD_CMD ("dirname");
	LOAD_CMD (path.c_str());

	string out = execute(exit_code, DIRNAME_PATH, cmd);
	CHECK_CODE (exit_code);

	out.erase(remove(out.begin(), out.end(), '\n'), out.end());

	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, (%rsp)
leaq 0x90(%rsp), %r13
pushq $0x18
popq %rdx
movq %r13, %rdi
movq %rsi, 0x10(%rsp)
callq 0x2320
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x50(%rsp), %r12
pushq $0x2f
popq %rbp
leaq 0x196d(%rip), %r15      # 0x6965
leaq 0x1234(%rip), %rbx      # 0x6233
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x2370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x512b
movq %r12, %rdi
movq %r15, %rsi
callq 0x348e
testb %al, %al
jne 0x4fff
movq %r12, %rdi
movq %rbx, %rsi
callq 0x348e
testb %al, %al
jne 0x4fff
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x22c0
movl %ebp, %r12d
movq %r15, %rbp
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x4acf
movq %rbx, %r14
movl %eax, %ebx
movq %r15, %rdi
movq %rbp, %r15
movl %r12d, %ebp
leaq 0x50(%rsp), %r12
callq 0x20c0
testb %bl, %bl
movq %r14, %rbx
je 0x4fff
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x1a29(%rip), %rax      # 0x6abb
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
callq 0x35bc
movq 0x10(%rsp), %rax
movq (%rax), %rax
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x20(%rsp), %rdi
callq 0x35bc
movq (%rsp), %rbx
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x349c
leaq 0x19df(%rip), %rdx      # 0x6ab2
leaq 0xc(%rsp), %rsi
leaq 0x38(%rsp), %rcx
movq %rbx, %rdi
callq 0x4d8c
leaq 0x38(%rsp), %rdi
callq 0x3588
cmpl $0x1, 0xc(%rsp)
je 0x5168
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq 0x18(%rsp), %rdx
movb $0xa, (%rdx)
callq 0x51c4
movq (%rbx), %rdx
addq 0x8(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2030
leaq 0x20(%rsp), %rdi
callq 0x3588
jmp 0x513c
movq (%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x2280
leaq 0x50(%rsp), %rdi
callq 0x20c0
leaq 0x90(%rsp), %rdi
callq 0x2120
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x2240
jmp 0x5172
movq %rax, %rbx
movq (%rsp), %rdi
callq 0x20c0
jmp 0x5196
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3588
jmp 0x5196
jmp 0x5193
jmp 0x5193
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3588
jmp 0x51a5
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x20c0
leaq 0x90(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/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
andl $0x0, (%rbx)
movq %rbx, %rdi
callq 0x119e
movl (%rbx), %esi
leaq 0xe7a(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1040
callq 0x1274
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdi, %rbx
callq 0x1060
movq %rax, %r14
movq (%r14), %r12
callq 0x12ef
movl %eax, %r15d
cltq
testb $0x20, 0x1(%r12,%rax,2)
jne 0x11b1
movq (%r14), %r12
movzwl (%r12,%rax,2), %ecx
btl $0xb, %ecx
jb 0x11ef
xorl %ebp, %ebp
leal 0x1(%r15), %ecx
cmpl $0x2e, %ecx
ja 0x125d
movabsq $0x500000000001, %rdx   # imm = 0x500000000001
btq %rcx, %rdx
jae 0x125d
cmpl $0x2d, %r15d
je 0x11fb
cmpl $0x2b, %r15d
jne 0x1226
callq 0x12ef
movslq %eax, %rcx
testb $0x8, 0x1(%r12,%rcx,2)
jne 0x1226
xorl %ebx, %ebx
cmpl $0x2d, %r15d
sete %bl
movl %eax, %edi
callq 0x1310
leal 0x2b(,%rbx,2), %eax
xorl %ebp, %ebp
jmp 0x125d
andl $0x0, (%rbx)
movq (%r14), %rcx
movslq %eax, %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
movl (%rbx), %ecx
je 0x1249
imull $0xa, %ecx, %ecx
addl %ecx, %eax
addl $-0x30, %eax
movl %eax, (%rbx)
callq 0x12ef
jmp 0x1229
movl %ecx, %edx
negl %edx
cmpl $0x2d, %r15d
cmovnel %ecx, %edx
movl %edx, (%rbx)
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x1266
movl %eax, %edi
callq 0x1310
jmp 0x1269
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x2de5(%rip)      # 0x4060
je 0x12ee
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xd7c(%rip), %rdi       # 0x2008
xorl %eax, %eax
callq 0x1040
movl 0x2dc7(%rip), %eax      # 0x4060
leaq 0x2dd0(%rip), %rbx      # 0x4070
leaq 0xd73(%rip), %r14       # 0x201a
leaq 0xd65(%rip), %r15       # 0x2013
pushq $0x2e
popq %rbp
testl %eax, %eax
jle 0x12da
leaq -0x1(%rax), %r12
cmpq $0x1, %rax
movq %r15, %rdi
cmoveq %r14, %rdi
movl -0x4(%rbx,%rax,4), %esi
cmpl $0xa, %esi
cmovel %ebp, %esi
xorl %eax, %eax
callq 0x1040
movq %r12, %rax
jmp 0x12b1
leaq 0xd3f(%rip), %rdi       # 0x2020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/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)
xorl %r15d, %r15d
leaq 0xeb5(%rip), %rbx       # 0x2020
leaq 0xe9e(%rip), %r14       # 0x2010
callq 0x1040
cmpl $-0x1, %eax
je 0x1194
cltq
movzbl (%rax,%rbx), %eax
leaq (%r15,%r15,2), %rcx
addq %r14, %rcx
movzbl (%rax,%rcx), %r15d
incq (%rsp,%r15,8)
jmp 0x1172
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq (%rdx,%rsi), %rcx
addq (%rsp), %rcx
addq 0x18(%rsp), %rcx
leaq 0xf6e(%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_O2/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       # 0x118c
callq 0x1210
testl %eax, %eax
je 0x11e2
movq 0x2e35(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xe37(%rip), %rdi       # 0x2004
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x1080
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x2, %ebp
jl 0x11f6
movq 0x8(%rbx), %rdi
callq 0x1070
movl %eax, 0x2e66(%rip)      # 0x405c
leaq 0xe1f(%rip), %rdi       # 0x201c
xorl %eax, %eax
callq 0x1050
callq 0x1198
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x11b3
movl %eax, %eax
leaq 0xea0(%rip), %rcx       # 0x2004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0xa
jmp 0x118b
pushq $0x11
jmp 0x118b
pushq $0xe
jmp 0x118b
pushq $0xf
jmp 0x118b
pushq $0xd
popq %rdi
pushq $0x5
popq %rdx
movl %edi, %esi
xorl %ecx, %ecx
jmp 0x11ae
pushq $0xd
popq %rdi
movl %edi, %esi
jmp 0x119d
pushq $0x5
popq %rdi
pushq $0x16
jmp 0x119c
pushq $0x3
popq %rdi
pushq $0x25
popq %rsi
callq 0x11b7
jmp 0x11b3
pushq $0xc
popq %rdi
pushq $0x7
popq %rcx
movl %edi, %esi
movl %ecx, %edx
callq 0x121d
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe5e(%rip), %rdi       # 0x202b
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x1030
testl %ebx, %ebx
cmovlel %r14d, %ebx
testl %ebp, %ebp
cmovlel %r14d, %ebp
leaq 0xe3e(%rip), %r14       # 0x2028
xorl %r15d, %r15d
cmpl %ebp, %r15d
je 0x1214
xorl %r12d, %r12d
cmpl %r12d, %ebx
je 0x120f
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x1030
incl %r12d
jmp 0x11f5
incl %r15d
jmp 0x11ed
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xc(%rsp)
movq %rdx, 0x10(%rsp)
movl %esi, %r15d
movl %edi, %ebp
movl %edi, %esi
imull %r15d, %esi
addl %esi, %esi
leaq 0xde3(%rip), %rdi       # 0x202b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1030
testl %r15d, %r15d
cmovlel %ebx, %r15d
testl %ebp, %ebp
cmovlel %ebx, %ebp
leaq 0xdc4(%rip), %r12       # 0x2028
xorl %r13d, %r13d
cmpl %ebp, %r13d
je 0x128b
xorl %ebx, %ebx
cmpl %ebx, %r15d
je 0x1286
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1030
incl %ebx
jmp 0x126e
incl %r13d
jmp 0x1267
leaq 0xd96(%rip), %r12       # 0x2028
xorl %r14d, %r14d
movl %ebp, 0x8(%rsp)
cmpl %ebp, %r14d
je 0x12cf
movq 0x10(%rsp), %rax
leal (%r14,%rax), %r13d
movl 0xc(%rsp), %ebx
movl %r15d, %ebp
subl $0x1, %ebp
jb 0x12c6
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1030
incl %ebx
jmp 0x12ae
incl %r14d
movl 0x8(%rsp), %ebp
jmp 0x1299
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]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
pushq $0x40
popq %rdi
callq 0x2270
testq %rax, %rax
je 0x2e73
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl $0x1, 0x10(%rax)
leaq 0x27(%rip), %rsi        # 0x2e83
movl %ebp, %edi
movq %rax, %rdx
callq 0x5ca0
testq %rax, %rax
jne 0x2e75
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_O2/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 0x30fa
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x3119
cmpq $0x0, 0x30(%rbx)
jne 0x3138
movq 0x20(%rbx), %rdi
callq 0x5787
movq 0x18(%rbx), %rdi
callq 0x5b3c
movl 0x14(%rbx), %edi
callq 0x21c0
testl %eax, %eax
je 0x30d8
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x30a9
leaq 0xa0d1(%rip), %rdi      # 0xd19c
testl %eax, %eax
jne 0x30e4
xorl %eax, %eax
callq 0x88e8
jmp 0x30ef
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x30f2
xorl %eax, %eax
callq 0x8759
andl $0x0, (%r14)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x91e3(%rip), %rdi      # 0xc2e4
leaq 0x91ee(%rip), %rsi      # 0xc2f6
leaq 0x91f2(%rip), %rcx      # 0xc301
movl $0x162, %edx            # imm = 0x162
callq 0x21a0
leaq 0x920c(%rip), %rdi      # 0xc32c
leaq 0x91cf(%rip), %rsi      # 0xc2f6
leaq 0x91d3(%rip), %rcx      # 0xc301
movl $0x163, %edx            # imm = 0x163
callq 0x21a0
leaq 0x9204(%rip), %rdi      # 0xc343
leaq 0x91b0(%rip), %rsi      # 0xc2f6
leaq 0x91b4(%rip), %rcx      # 0xc301
movl $0x164, %edx            # imm = 0x164
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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 0x342f
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 0x9625
movl %eax, %ebp
movq %r14, %rdi
callq 0x2040
decq 0x30(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x9027(%rip), %rdi      # 0xc45d
leaq 0x8eb9(%rip), %rsi      # 0xc2f6
leaq 0x902e(%rip), %rcx      # 0xc472
movl $0xc5, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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 0x96c8
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
decq 0x30(%r14)
andl $0x0, 0x38(%r14)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3599
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %r15
pushq $0x30
popq %rdi
callq 0x2270
testq %rax, %rax
je 0x3518
movq %rax, %rbx
movq %r15, 0x18(%rax)
movq %r12, 0x20(%rax)
movl %r13d, (%rax)
andq $0x0, 0x28(%rax)
movq %r12, %rdi
callq 0x3f1f
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x40be
movq %rax, 0x8(%rbx)
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x9199(%rip), %rsi      # 0xc696
leaq 0xb2(%rip), %rdx        # 0x35b6
movq %r15, %rdi
callq 0x91ed
testl %eax, %eax
je 0x352b
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 0x4597
testl %eax, %eax
je 0x355a
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3586
movq %rax, %r14
leaq 0x8ff8(%rip), %rdi      # 0xc545
xorl %eax, %eax
callq 0x8759
andl $0x0, (%r14)
jmp 0x3510
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rdx
movq %r14, %rsi
callq 0x22b0
testl %eax, %eax
je 0x351a
leaq 0x8fe6(%rip), %rdi      # 0xc55b
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x3510
leaq 0x8fb8(%rip), %rdi      # 0xc545
xorl %eax, %eax
callq 0x88e8
jmp 0x3510
leaq 0x8f20(%rip), %rdi      # 0xc4c0
leaq 0x8f3b(%rip), %rsi      # 0xc4e2
leaq 0x8f3c(%rip), %rcx      # 0xc4ea
pushq $0x72
popq %rdx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_init
static int
callback_init(void * cookie, int status, const uint8_t * buf, size_t buflen)
{
	struct readtableid * RT = cookie;

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

	/* Check status. */
	if (status == 1) {
		warn0("Failed to read tableid");
		goto err0;
	} else if (status == 2) {
		warn0("Tableid not initialized");
		goto err0;
	}

	/* Check buffer length. */
	if (buflen != 32) {
		warn0("Tableid is not 32 bytes");
		goto err0;
	}

	/* Copy the table ID out. */
	memcpy(RT->tableid, buf, 32);

	/* We've finished reading this value. */
	RT->done = 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rax
cmpl $0x3, %esi
jae 0x3612
cmpl $0x2, %esi
je 0x35cf
cmpl $0x1, %esi
jne 0x35d8
leaq 0x90ba(%rip), %rdi      # 0xc687
jmp 0x35fe
leaq 0x90c8(%rip), %rdi      # 0xc69e
jmp 0x35fe
cmpq $0x20, %rcx
jne 0x35f7
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x14(%rdi)
movups %xmm0, 0x4(%rdi)
movl $0x1, (%rdi)
xorl %eax, %eax
jmp 0x3610
leaq 0x90b8(%rip), %rdi      # 0xc6b6
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
pushq $-0x1
popq %rax
popq %rcx
retq
leaq 0x9006(%rip), %rdi      # 0xc61f
leaq 0x8ec2(%rip), %rsi      # 0xc4e2
leaq 0x9028(%rip), %rcx      # 0xc64f
pushq $0x43
popq %rdx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rdi
callq 0x2270
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x36b6
movq %rax, %r15
movq %r14, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
andl $0x0, 0x20(%rax)
movq 0x18(%r14), %r13
movq 0x10(%r12), %rdi
callq 0x42c4
leaq 0x33(%rip), %rdx        # 0x36c7
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x8fd0
testl %eax, %eax
je 0x36b0
movq %r15, %rdi
callq 0x2040
jmp 0x36b6
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_O2/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 0x379a
movq %rcx, %rax
movl %esi, %ecx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
testl %ecx, %ecx
je 0x36f9
cmpl $0x2, %ecx
jne 0x371a
cmpl $0x0, 0x20(%rbx)
je 0x3757
movl (%r14), %ecx
xorl %edx, %edx
jmp 0x3701
movl (%r14), %ecx
cmpq %rax, %rcx
jne 0x373a
movq 0x18(%rbx), %rdi
callq *0x10(%rbx)
movl %eax, %ebp
decq 0x28(%r14)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
jmp 0x3795
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3784
movq %rax, %rbx
leaq 0x9019(%rip), %rdi      # 0xc747
xorl %eax, %eax
callq 0x8759
andl $0x0, (%rbx)
jmp 0x3792
leaq 0x8fc4(%rip), %rdi      # 0xc705
movq %rax, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x3792
movl $0x1, 0x20(%rbx)
movq 0x18(%r14), %r14
movq 0x10(%rsi), %rdi
callq 0x42c4
leaq -0xab(%rip), %rdx       # 0x36c7
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x91ed
leaq 0x8fbc(%rip), %rdi      # 0xc747
xorl %eax, %eax
callq 0x88e8
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8e7e(%rip), %rdi      # 0xc61f
leaq 0x8d3a(%rip), %rsi      # 0xc4e2
leaq 0x8f1f(%rip), %rcx      # 0xc6ce
movl $0xdc, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x30
popq %rdi
callq 0x2270
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x3830
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        # 0x3841
movq %r15, %rcx
callq 0x3f24
testl %eax, %eax
je 0x382a
movq %r15, %rdi
callq 0x2040
jmp 0x3830
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_O2/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 %rdi, %r14
movq (%rdi), %r13
movq 0x8(%rdi), %rbp
leaq 0x57(%rip), %r15        # 0x38b4
xorl %ebx, %ebx
movl 0x10(%rbp), %eax
cmpq %rax, %rbx
jae 0x38a3
movq 0x18(%r13), %r12
movq 0x28(%r14), %rdi
addq %rbx, %rdi
callq 0x42c4
movl (%r13), %ecx
movq %rbx, %rdx
imulq %rcx, %rdx
addq 0x20(%rbp), %rdx
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %r8
movq %r14, %r9
callq 0x8a6c
incq %rbx
testl %eax, %eax
je 0x385f
pushq $-0x1
popq %rax
jmp 0x38a5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3913
testl %esi, %esi
je 0x38dd
leaq 0x8cff(%rip), %rdi      # 0xc5c8
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
pushq $-0x1
popq %rbx
jmp 0x38ee
movq %rdi, %rcx
movq (%rdi), %rdx
xorl %ebx, %ebx
decq %rax
movq %rax, 0x20(%rdi)
je 0x38f2
movl %ebx, %eax
popq %rbx
retq
movq 0x10(%rdx), %rsi
movq 0x20(%rdx), %rdi
decq %rsi
movq %rsi, 0x8(%rdx)
leaq 0x2a(%rip), %rdx        # 0x3932
callq 0x40c3
testl %eax, %eax
jne 0x38d8
jmp 0x38ee
leaq 0x8c71(%rip), %rdi      # 0xc58b
leaq 0x8bc1(%rip), %rsi      # 0xc4e2
leaq 0x8c76(%rip), %rcx      # 0xc59e
movl $0x155, %edx            # imm = 0x155
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rdi, %r15
pushq $0x48
popq %rdi
callq 0x2270
movq %rax, %r14
testq %rax, %rax
je 0x39e3
movq %r15, (%r14)
movq %rbx, 0x8(%r14)
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
andq $0x0, 0x40(%r14)
movq %rbx, %rdi
callq 0x4111
movq %rax, 0x18(%r14)
leaq 0x14(%rip), %rsi        # 0x39ec
movq %rbx, %rdi
movq %r14, %rdx
callq 0x411b
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3c32
testl %esi, %esi
je 0x3be8
leaq 0x8bc5(%rip), %rdi      # 0xc79c
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x3c29
movq 0x10(%rdi), %rax
leaq 0x38(%rbx), %rcx
leaq 0x18(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq 0x18(%rdi), %rcx
movq %rcx, (%rdx)
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 0x39ec
testl %eax, %eax
je 0x3c2e
pushq $-0x1
popq %rax
popq %rbx
retq
xorl %eax, %eax
jmp 0x3c2c
leaq 0x8b29(%rip), %rdi      # 0xc762
leaq 0x8b32(%rip), %rsi      # 0xc772
leaq 0x8b36(%rip), %rcx      # 0xc77d
movl $0xb1, %edx
callq 0x21a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x3da4
movq %rax, %rbx
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %r12, (%rax)
movq %rax, %r13
addq $0xd0, %r13
leaq 0x8b5d(%rip), %rbp      # 0xc7fc
leaq 0x112(%rip), %r15       # 0x3db8
leaq 0x8b58(%rip), %r14      # 0xc805
andl $0x0, 0xd0(%rbx)
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x91ed
testl %eax, %eax
jne 0x3cf2
movq %r13, %rdi
callq 0x4597
testl %eax, %eax
jne 0x3d0c
cmpl $0x0, 0xd4(%rbx)
je 0x3d2d
movq %r14, %rdi
xorl %eax, %eax
callq 0x88e8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x3cad
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3d85
movq %rax, %r14
leaq 0x8ab7(%rip), %rdi      # 0xc7c1
jmp 0x3d20
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3d8e
movq %rax, %r14
leaq 0x8abc(%rip), %rdi      # 0xc7dc
xorl %eax, %eax
callq 0x8759
andl $0x0, (%r14)
jmp 0x3d9c
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)
andq $0x0, 0xc8(%rbx)
movups %xmm0, 0xb8(%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 0x3da6
leaq 0x8a35(%rip), %rdi      # 0xc7c1
jmp 0x3d95
leaq 0x8a47(%rip), %rdi      # 0xc7dc
xorl %eax, %eax
callq 0x88e8
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