LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::parse_perms(file_pos_ref, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*)
inline int parse_perms(file_pos_ref input_pos, string &paramval, const std::string &servicename,
        const char * paramname)
{
    std::size_t ind = 0;
    try {
        int perms = std::stoi(paramval, &ind, 8);
        if (ind != paramval.length()) {
            throw std::logic_error("");
        }
        return perms;
    }
    catch (std::logic_error &exc) {
        throw service_description_exc(servicename, paramname,
                "badly-formed or out-of-range numeric value", input_pos);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movl %edi, 0x18(%rsp)
movq %rsi, 0x20(%rsp)
movq (%rdx), %r13
callq 0x4060
movq %rax, %r12
movl (%rax), %ebx
movl $0x0, (%rax)
leaq 0x28(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0x8, %edx
callq 0x4520
movq (%rbp), %rcx
subq %r13, %rcx
je 0x17662
movslq %eax, %rdx
cmpq %rax, %rdx
jne 0x1766e
movl (%r12), %edx
cmpl $0x22, %edx
je 0x1766e
testl %edx, %edx
jne 0x1764d
movl %ebx, (%r12)
cmpq 0x8(%r15), %rcx
jne 0x1767a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e59(%rip), %rdi      # 0x1d4c2
callq 0x4270
leaq 0x5e4d(%rip), %rdi      # 0x1d4c2
callq 0x4550
movl $0x10, %edi
callq 0x41c0
movq %rax, %r12
leaq 0x4edc(%rip), %rsi      # 0x1c56a
movq %rax, %rdi
callq 0x4540
movq 0xe92b(%rip), %rsi      # 0x25fc8
movq 0xe8dc(%rip), %rdx      # 0x25f80
movq %r12, %rdi
callq 0x4620
jmp 0x17743
movq %rdx, %r13
movq %rax, %r15
jmp 0x176da
movq %rdx, %r13
movq %rax, %r15
movq %r12, %rdi
callq 0x42d0
jmp 0x176da
movq %rdx, %r13
movq %rax, %r15
cmpl $0x0, (%r12)
jne 0x176da
movl %ebx, (%r12)
cmpl $0x1, %r13d
jne 0x17777
movq %r15, %rdi
callq 0x4170
movl $0x70, %edi
callq 0x41c0
movq %rax, %r12
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0xfff2
movb $0x1, %bl
leaq 0x5d83(%rip), %rcx      # 0x1d497
leaq 0x28(%rsp), %rdx
leaq 0x18(%rsp), %r8
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0x18652
xorl %ebx, %ebx
leaq 0xe4ec(%rip), %rsi      # 0x25c20
leaq -0xb95(%rip), %rdx      # 0x16ba6
movq %r12, %rdi
callq 0x4620
movq %rax, %r15
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17761
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bl, %bl
jne 0x1776a
jmp 0x17772
movq %rax, %r15
movq %r12, %rdi
callq 0x42d0
callq 0x4600
movq %r15, %rdi
callq 0x4630
movq %rax, %rdi
callq 0x1002f
// File: /workspace/github_cpp_makefile_star2_O3/josh0xA[P]bf/src/bf.cc
// Function: bf::Parser::get_loop_closer(bf::Environment&)
void Parser::get_loop_closer(Environment& env) {
    temp_value = 1;
    do {
      env.bf_instruction_pointer++;
      if (*env.bf_instruction_pointer == '[') temp_value++;
      else if (*env.bf_instruction_pointer == ']') temp_value--;
    } while (temp_value != BF_SUCCESS_CODE_STANDARD);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, 0x1c0(%rdi)
movl $0x1, %ecx
movq 0x30(%rsi), %rax
incq %rax
movq %rax, 0x30(%rsi)
movl $0x1, %edx
movzbl (%rax), %r8d
cmpl $0x5b, %r8d
je 0x24ac
cmpl $0x5d, %r8d
jne 0x24b4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %ecx
movl %ecx, 0x1c0(%rdi)
incq %rax
testl %ecx, %ecx
jne 0x248e
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/josh0xA[P]bf/src/bf.cc
// Function: bf::Parser::get_loop_opener(bf::Environment&)
void Parser::get_loop_opener(Environment& env) {
    temp_value = BF_SUCCESS_CODE_STANDARD;
    do {
      if (*env.bf_instruction_pointer == '[') temp_value++;
      else if (*env.bf_instruction_pointer == ']') temp_value--;
      env.bf_instruction_pointer--;
    } while (temp_value != BF_SUCCESS_CODE_STANDARD);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x1c0(%rdi)
xorl %ecx, %ecx
movq 0x30(%rsi), %rax
decq %rax
movzbl 0x1(%rax), %edx
cmpl $0x5b, %edx
je 0x24ea
cmpl $0x5d, %edx
jne 0x24f7
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0x24ef
movl $0x1, %edx
addl %edx, %ecx
movl %ecx, 0x1c0(%rdi)
movq %rax, 0x30(%rsi)
decq %rax
testl %ecx, %ecx
jne 0x24d5
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/josh0xA[P]bf/src/bf.cc
// Function: bf::User::load_interactive_interpreter(bf::Environment&)
bool User::load_interactive_interpreter(Environment& env) {
    while (bf::bfuck_should_succeed<bool>(true, true)) {
      std::cout << ": ";
      std::getline(std::cin, interpreter_prompt);
      if (!std::cin) {
        std::cerr << "(error): broken input stream\n";
        break;
      }
      if (temp_bracks == BF_SUCCESS_CODE_STANDARD) { env.wipe_instruction_buffer(true);  }
      BF_SET_VALUE(temp_bracks, entry_point_line(env, interpreter_prompt, temp_bracks));
      if (temp_bracks == BF_SUCCESS_CODE_STANDARD) {
        interpret_bf_instructions(env);
        output_bf_stream(*env.bf_memory_pointer);
        BF_FLUSH(std::endl);
      } else {
          std::cout << "... ";
      }
    }
    return true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x390b(%rip), %r12      # 0x5fc0
movq 0x3914(%rip), %r13      # 0x5fd0
leaq 0x1c8(%rdi), %r15
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2, %edx
leaq 0x1980(%rip), %rsi      # 0x4055
movq %r12, %rdi
callq 0x2160
movq (%r13), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r13, %rdi
callq 0x2110
movsbl %al, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2220
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x27aa
movl 0x1c4(%r14), %ecx
testl %ecx, %ecx
jne 0x2731
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x272d
movq %rax, 0x20(%rbx)
movq %rax, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2d4c
movl %eax, 0x1c4(%r14)
testl %eax, %eax
je 0x2763
movl $0x4, %edx
leaq 0x1920(%rip), %rsi      # 0x4076
movq %r12, %rdi
callq 0x2160
jmp 0x26c9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2504
movq 0x38(%rbx), %rax
movq %r14, %rdi
movsbl (%rax), %esi
callq 0x2cf2
movq (%r12), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r12, %rdi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
jmp 0x26c9
movq 0x383f(%rip), %rdi      # 0x5ff0
leaq 0x18a0(%rip), %rsi      # 0x4058
movl $0x1d, %edx
callq 0x2160
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/disk.cpp
// Function: Disk::Disk()
Disk::Disk() : disk_file("diskdata") {
	ifstream ifile(disk_file);
	BLKsize = 0;
	if(!ifile) { cout << "Disk initialization error! ！(◎_◎;)" << endl; return; }
	char tmp = 0;
	for(int i = 0; i < 2; ++i) {		// read the basic size of a block in the disk
		ifile.read((char*)&tmp, sizeof(tmp));
		BLKsize += (int)tmp << (8 * i);	// Little endian
	}
	ifile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
leaq 0x6a56(%rip), %rsi      # 0x9004
leaq 0x6a57(%rip), %rdx      # 0x900c
callq 0x2920
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x2310
movl $0x0, 0x20(%rbx)
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
je 0x262b
movq 0xa9e6(%rip), %r14      # 0xcfd0
leaq 0x6a1c(%rip), %rsi      # 0x900d
movl $0x28, %edx
movq %r14, %rdi
callq 0x2240
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0xa9b4(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
jmp 0x2675
leaq 0xf(%rsp), %r14
movb $0x0, (%r14)
xorl %ebp, %ebp
movb $0x1, %r13b
leaq 0x10(%rsp), %r15
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2270
movsbl 0xf(%rsp), %eax
movl %ebp, %ecx
shll %cl, %eax
addl %eax, 0x20(%rbx)
movl $0x8, %ebp
testb $0x1, %r13b
movl $0x0, %r13d
jne 0x263e
leaq 0x10(%rsp), %rdi
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x2070
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x269a
movq %rax, %r14
jmp 0x26a7
jmp 0x269a
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2070
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x26bb
movq (%r12), %rsi
incq %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/disk.cpp
// Function: Disk::Getblk(char*, int)
bool Disk::Getblk(char buf[], int blk_num) {
	ifstream ifile(disk_file);
	if(!ifile) {	// cannot open file
		cout << "Diskfile not found... (´Д` )" << endl;
		return false;
	}
	ifile.seekg(ifile.beg + BLKsize * blk_num);
	for(int i = 0; i < BLKsize; ++i) {
		ifile.read((char*)&buf[i], sizeof(char));
	}
	ifile.close();
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2310
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x20(%rsp,%rax), %r12d
testb $0x5, %r12b
je 0x2766
movq 0xa8ab(%rip), %rbx      # 0xcfd0
leaq 0x690a(%rip), %rsi      # 0x9036
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0xa879(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
jmp 0x27ad
movslq 0x20(%r14), %rax
movslq %ebp, %rsi
imulq %rax, %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x2280
cmpl $0x0, 0x20(%r14)
jle 0x27a5
xorl %r13d, %r13d
movq %rsp, %r15
leaq (%rbx,%r13), %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2270
incq %r13
movslq 0x20(%r14), %rax
cmpq %rax, %r13
jl 0x2788
movq %rsp, %rdi
callq 0x2060
testb $0x5, %r12b
sete %bl
movq %rsp, %rdi
callq 0x2070
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27d2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/disk.cpp
// Function: Disk::Putblk(char*, int)
bool Disk::Putblk(char buf[], int blk_num) {
	ofstream ofile(disk_file, ios::out | ios::in);
	if(!ofile) {	// cannot open file
		cout << "Diskfile not found... (´Д` )" << endl;
		return false;
	}
	ofile.seekp(ofile.beg + BLKsize * blk_num);
	for(int i = 0; i < BLKsize; ++i) {
		ofile.write((char*)&buf[i], sizeof(char));
	}
	ofile.close();
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x2390
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x28(%rsp,%rax), %r12d
testb $0x5, %r12b
je 0x286e
movq 0xa7a3(%rip), %rbx      # 0xcfd0
leaq 0x6802(%rip), %rsi      # 0x9036
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0xa771(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
jmp 0x28bb
movslq 0x20(%r14), %rax
movslq %ebp, %rsi
imulq %rax, %rsi
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x2250
cmpl $0x0, 0x20(%r14)
jle 0x28b1
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
leaq (%rbx,%r13), %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x22b0
incq %r13
movslq 0x20(%r14), %rax
cmpq %rax, %r13
jl 0x2894
leaq 0x8(%rsp), %rdi
callq 0x22c0
testb $0x5, %r12b
sete %bl
movq 0xa6ff(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x21a0
leaq 0x100(%rsp), %rdi
callq 0x20b0
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x290a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22e0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: byte2int(char*, int, int)
int byte2int(char buf[], int begin, int end) {
    if (end - begin > 4) {
        cout << "[Error] Too many bytes to convert them to int!" << endl;
        return -1;
    }

    int ret = 0;
    for (int i = 0; i < end - begin; i++) {
        ret += (int)buf[begin + i] << (i * 8);   // little endian
    }
    return ret;
}

// Assembly:
pushq %rbx
subl %esi, %edx
cmpl $0x4, %edx
jle 0x2a87
movq 0xa58b(%rip), %rbx      # 0xcfd0
leaq 0x66c4(%rip), %rsi      # 0x9110
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2ab2
testl %edx, %edx
jle 0x2ab0
movslq %esi, %rax
movl %edx, %edx
addq %rax, %rdi
shlq $0x3, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
movsbl (%rdi), %esi
shll %cl, %esi
addl %esi, %eax
incq %rdi
addq $0x8, %rcx
cmpq %rcx, %rdx
jne 0x2a9b
jmp 0x2ab2
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: byte2string[abi:cxx11](char*, int, int)
string byte2string(char buf[], int begin, int end) {
    string ret = "";
    for (int i = begin; i < end; i++) {
        int tmp = byte2int(buf, i, i + 1);
        if (tmp == 0)
            break;
        ret += buf[i];
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
leaq 0x6b4a(%rip), %rdx      # 0x9622
movq %rdx, %rsi
callq 0x2920
movslq %r15d, %r15
cmpl %r15d, %ebp
cmovlel %r15d, %ebp
movslq %ebp, %r13
cmpq %r15, %r13
je 0x2b17
leal 0x1(%r15), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x2a36
testl %eax, %eax
je 0x2b17
movsbl (%r14,%r15), %esi
incq %r15
movq %rbx, %rdi
callq 0x21b0
jmp 0x2aed
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x2b40
movq (%r12), %rsi
incq %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: getTime[abi:cxx11]()
string getTime() {
    time_t timep;
    time (&timep);
    char tmp[64];
    strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M",localtime(&timep) );
    return tmp;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
movq %r14, %rdi
callq 0x2160
leaq 0x63bd(%rip), %rdx      # 0x9141
leaq 0x10(%rsp), %r14
movl $0x40, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x2180
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x20e0
leaq (%rsp,%rax), %rdx
addq $0x10, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2920
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Get_dir_inodeNum_from_path(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
int FileSystem::Get_dir_inodeNum_from_path(vector<string>& path) {
    int p = 0, inode_num;

    if(path.empty()) {
    	cout << "[Error] empty path!" << endl;
        return -1;
    }

    // initialization
    if(path[0] == "/") {
        ++p;
        inode_num = root_dir_inodeNum;
    } else {
        inode_num = cur_dir_inodeNum;
    }

    while(p < (int)path.size()) {
    	inode_num = Get_file_inodeNum_from_dir(inode_num, path[p]);

    	// if not found
    	if(inode_num == -1) {
    		cout << "[Error] Cannot find file: " << path[p] << endl;
    		return -1;
    	}
    	++p;
    }

    return inode_num;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rsi), %rdi
cmpq 0x8(%rsi), %rdi
je 0x3554
movq %rsi, %rbx
leaq 0x5c5d(%rip), %rsi      # 0x913f
callq 0x2090
movl %eax, %ecx
xorl %eax, %eax
xorl %esi, %esi
testl %ecx, %ecx
setne %al
sete %sil
movl 0x30(%r14,%rax,4), %eax
movq (%rbx), %rdx
movq 0x8(%rbx), %rdi
subq %rdx, %rdi
shrq $0x5, %rdi
cmpl %edi, %esi
jge 0x35cf
xorl %r12d, %r12d
testl %ecx, %ecx
sete %r12b
movl %r12d, %r15d
shll $0x5, %r15d
addq %r15, %rdx
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35dc
cmpl $-0x1, %eax
je 0x3571
incq %r12
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
subq %rdx, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
addq $0x20, %r15
cmpq %rcx, %r12
jl 0x3521
jmp 0x35cf
movq 0x9a75(%rip), %rbx      # 0xcfd0
leaq 0x5f44(%rip), %rsi      # 0x94a6
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2240
jmp 0x35a3
movq 0x9a58(%rip), %r14      # 0xcfd0
leaq 0x5f3b(%rip), %rsi      # 0x94ba
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2240
movq (%rbx), %rax
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r14, %rdi
callq 0x2240
movq %rax, %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Find_empty_inodeNum()
int FileSystem::Find_empty_inodeNum() {
	for(int i = 0; i < 10; ++i) {
		// find a byte
		if((int)inode_bitmap[i] != -1) {
			// m -> mask
			for(int j = 0, m = 1; j < 8; ++j, m <<= 1) {
				// find a bit
				if((inode_bitmap[i] & m) == 0) {
					return i * 8 + j;
				}
			}
		}
	}
	return -1;
}

// Assembly:
xorl %ecx, %ecx
xorl %edx, %edx
movsbl 0x50(%rdi,%rdx), %esi
cmpl $-0x1, %esi
je 0x3df3
xorl %eax, %eax
movl $0x1, %r8d
testl %esi, %r8d
je 0x3e05
incl %eax
addl %r8d, %r8d
cmpl $0x8, %eax
jne 0x3de4
incq %rdx
addl $-0x8, %ecx
cmpq $0xa, %rdx
jne 0x3dd2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
subl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Find_empty_dataBLKNum()
int FileSystem::Find_empty_dataBLKNum() {
	for(int i = 0; i < 80; ++i) {
		// find a byte
		if((int)data_block_bitmap[i] != -1) {
			// m -> mask
			for(int j = 0, m = 1; j < 8; ++j, m <<= 1) {
				// find a bit
				if((data_block_bitmap[i] & m) == 0) {
					return i * 8 + j;
				}
			}
		}
	}
	return -1;
}

// Assembly:
xorl %ecx, %ecx
xorl %edx, %edx
movsbl 0x5a(%rdi,%rdx), %esi
cmpl $-0x1, %esi
je 0x3e2d
xorl %eax, %eax
movl $0x1, %r8d
testl %esi, %r8d
je 0x3e3f
incl %eax
addl %r8d, %r8d
cmpl $0x8, %eax
jne 0x3e1e
incq %rdx
addl $-0x8, %ecx
cmpq $0x50, %rdx
jne 0x3e0c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
subl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Save_superBLK()
void FileSystem::Save_superBLK() {
	char buf[BLKsize];
	D.Getblk(buf, 0);

	// save inode bitmap
    for(int i = 3; i <= 12; ++i) {
        buf[i] = inode_bitmap[i - 3];
    }

    // save data block bitmap
    for(int i = 13; i <= 92; ++i) {
        buf[i] = data_block_bitmap[i - 13];
    }

    D.Putblk(buf, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %r12d
movq %rsp, %r13
addq $0xf, %r12
andq $-0x10, %r12
movq %r13, %r14
subq %r12, %r14
movq %r14, %rsp
leaq 0x8(%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x26e0
negq %r12
movzwl 0x58(%rbx), %eax
movw %ax, 0xb(%r13,%r12)
movq 0x50(%rbx), %rax
movq %rax, 0x3(%r14)
addq $0x5a, %rbx
leaq 0xd(%r14), %rdi
movl $0x50, %edx
movq %rbx, %rsi
callq 0x2190
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x27e6
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::FindEOF(char*)
int FileSystem::FindEOF(char buf[]) {
    for (int i = 0; i < BLKsize - 1; i++) {
        int num = byte2int(buf, i, i + 2);
        if (num == -1)
            return i;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, (%rdi)
jl 0x3f98
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
leal 0x2(%r12), %edx
movq %r14, %rdi
movl %r12d, %esi
callq 0x2a36
cmpl $-0x1, %eax
je 0x3f95
incl %r12d
movl (%r15), %eax
decl %eax
cmpl %eax, %r12d
jl 0x3f71
jmp 0x3f98
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Analysis_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int FileSystem::Analysis_path(const string& filepath, string& filename) {
	vector<string> path;
    int dir_inodeNum;
    if(!Decomposition_path(filepath, path)) {
        cout << "[Error] Illegal path!" << endl;
        return -1;
    }

    if(path.empty()) {
        cout << "[Error] Empty path!" << endl;
        return -1;
    }

    if((int)path.size() >= 2) {
        filename = path[path.size() - 1];
    } else {
        filename = path[0]; // omit path
    }
    path.pop_back();
    
    if((int)filename.size() > 8) {
    	cout << "[Error] filename is too long" << endl;
    	return -1;
    }

    if((int)path.size() >= 1) {
        dir_inodeNum = Get_dir_inodeNum_from_path(path);
    } else {
        dir_inodeNum = cur_dir_inodeNum;    // omit path -> cur dir
    }

    return dir_inodeNum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x7268
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x2b48
movl %eax, %ebp
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ec4
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testb %bpl, %bpl
je 0x4f2f
movq (%rsp), %rax
movq 0x8(%rsp), %rsi
cmpq %rsi, %rax
je 0x4f3d
movq %rsi, %rcx
subq %rax, %rcx
shrq $0x5, %rcx
addq $-0x20, %rsi
cmpl $0x2, %ecx
cmovlq %rax, %rsi
movq %r14, %rdi
callq 0x2110
movq 0x8(%rsp), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0x4f1a
movq (%rax), %rsi
incq %rsi
callq 0x2200
cmpl $0x9, 0x8(%r14)
jl 0x4f9d
movl $0x1c, %edx
leaq 0x45c5(%rip), %rsi      # 0x94f2
jmp 0x4f49
movl $0x15, %edx
leaq 0x4622(%rip), %rsi      # 0x955d
jmp 0x4f49
movl $0x13, %edx
leaq 0x462a(%rip), %rsi      # 0x9573
movq 0x8080(%rip), %rbx      # 0xcfd0
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x805a(%rip), %rdi      # 0xcfd0
callq 0x2030
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x2120
movq %rsp, %rdi
callq 0x7068
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x4fbd
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x34c4
movl %eax, %ebx
jmp 0x4f88
movl 0x34(%rbx), %ebx
jmp 0x4f88
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x4fe1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x4fe1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7068
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::Outside_file2str(std::basic_ifstream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool FileSystem::Outside_file2str(ifstream& ifile, string& str) {
	string tmp;
	str.clear();	// start from empty
	while(getline(ifile, tmp)) {
		str += tmp + '\n';
		if((int)str.length() > 8 * BLKsize) {
			cout << "[Error] File is too large" << endl;
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq %rax, 0x8(%rdx)
movq (%rdx), %rcx
movb %al, (%rcx)
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ebp
testb $0x5, %bpl
jne 0x5698
movq %r12, 0x8(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x7268
movq 0x10(%rsp), %rsi
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
movl $0xa, %r8d
callq 0x2380
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x20a0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5643
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movl (%r15), %eax
shll $0x3, %eax
cmpl 0x8(%rbx), %eax
jge 0x55ad
movq 0x7977(%rip), %rbx      # 0xcfd0
leaq 0x3ff2(%rip), %rsi      # 0x9652
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x7945(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x56b4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
testb $0x5, %bpl
setne %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x56ec
jmp 0x56ce
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x56ef
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x56ef
jmp 0x56ec
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x570b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::MoveFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool FileSystem::MoveFile(string& S_filepath, string& D_filepath) {
    string filename;
    int dir_inodeNum = Analysis_path(S_filepath, filename);
    if(dir_inodeNum == -1) {
        return false;
    }
    int file_inodeNum = Get_file_inodeNum_from_dir(dir_inodeNum, filename);
    if(file_inodeNum == -1) {
        return false;
    }
    if(isDir(file_inodeNum)) {
        cout << "[Error] Source cannot be a directory" << endl;
        return false;
    }

	// convert inside file to string
	string file_data;
	if(!Inside_file2str(S_filepath, file_data)) {
		return false;
	}

	DeleteFile(S_filepath);
    str2Inside_file(file_data, D_filepath);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x20(%rsp), %rdx
callq 0x4e5e
cmpl $-0x1, %eax
je 0x6b78
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35dc
cmpl $-0x1, %eax
je 0x6b78
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
movl %eax, %edx
callq 0x3d48
movsbl 0x40(%rsp), %eax
movsbl 0x41(%rsp), %ecx
shll $0x8, %ecx
addl %eax, %ecx
cmpl $0x1, %ecx
jne 0x6ba5
movq 0x6497(%rip), %rbx      # 0xcfd0
leaq 0x2c19(%rip), %rsi      # 0x9759
movl $0x24, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x6465(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6b91
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x6910
movl %eax, %ebp
testb %al, %al
je 0x6c29
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2ae1(%rip), %rsi      # 0x96c2
leaq 0x2ade(%rip), %rdx      # 0x96c6
movq %rsp, %rdi
callq 0x2920
movq %rsp, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x487e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6c19
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6000
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x6b7a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6b7a
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6c6e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6c6e
jmp 0x6c6b
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x6c8c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6c8c
jmp 0x6c89
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6ca3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::PrintFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool FileSystem::PrintFile(const string& filepath) {
    string filename;
    int dir_inodeNum = Analysis_path(filepath, filename);
    if(dir_inodeNum == -1) {
        return false;
    }
    int file_inodeNum = Get_file_inodeNum_from_dir(dir_inodeNum, filename);
    if(file_inodeNum == -1) {
        cout << "[Error] Cannot find file: " << filename << endl;
        return false;
    }
    if(isDir(file_inodeNum)) {
        cout << "[Error] Target cannot be a directory" << endl;
        return false;
    }
	string file_data;
	Inside_file2str(filepath, file_data);
	cout << file_data;
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq %rsp, %rdx
callq 0x4e5e
cmpl $-0x1, %eax
je 0x6da6
movq %rsp, %rdx
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35dc
cmpl $-0x1, %eax
je 0x6d4f
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
movl %eax, %edx
callq 0x3d48
movsbl 0x20(%rsp), %eax
movsbl 0x21(%rsp), %ecx
shll $0x8, %ecx
addl %eax, %ecx
cmpl $0x1, %ecx
jne 0x6dcc
movq 0x62ab(%rip), %rbx      # 0xcfd0
leaq 0x2a52(%rip), %rsi      # 0x977e
movl $0x24, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
jmp 0x6d93
movq 0x627a(%rip), %rdi      # 0xcfd0
leaq 0x275d(%rip), %rsi      # 0x94ba
movl $0x1a, %edx
callq 0x2240
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x6259(%rip), %rdi      # 0xcfd0
callq 0x2240
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
xorl %ebx, %ebx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x6dbe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6910
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x61cb(%rip), %rdi      # 0xcfd0
callq 0x2240
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e21
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movb $0x1, %bl
jmp 0x6da8
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e46
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6e46
jmp 0x6e43
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x6e5c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/filesystem.cpp
// Function: FileSystem::WriteFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool FileSystem::WriteFile(string& str, const string& filepath) {
    string filename;
    int dir_inodeNum = Analysis_path(filepath, filename);
    if(dir_inodeNum == -1) {
        return false;
    }
    int file_inodeNum = Get_file_inodeNum_from_dir(dir_inodeNum, filename);
    if(file_inodeNum == -1) {
        CreateFile(filepath);
    }
    if(isDir(file_inodeNum)) {
        cout << "[Error] Target cannot be a directory" << endl;
        return false;
    }

    str2Inside_file(str, filepath);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x4e5e
cmpl $-0x1, %eax
je 0x6f2f
movq %rsp, %rdx
movq %r15, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35dc
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x6ec6
movq %r15, %rdi
movq %rbx, %rsi
callq 0x45fc
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
movl %ebp, %edx
callq 0x3d48
movsbl 0x20(%rsp), %eax
movsbl 0x21(%rsp), %ecx
shll $0x8, %ecx
addl %eax, %ecx
cmpl $0x1, %ecx
jne 0x6f33
movq 0x60e0(%rip), %rbx      # 0xcfd0
leaq 0x2887(%rip), %rsi      # 0x977e
movl $0x24, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x60ae(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
xorl %ebp, %ebp
jmp 0x6f44
movb $0x1, %bpl
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6000
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6f5a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6f6b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6f84
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/main.cpp
// Function: Replace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string Replace(string str) {
	string ans;
	int p;
	while((p = str.find("\\n")) != -1) {
		ans += str.substr(0, p);
		ans += '\n';
		str = str.substr(p + 2);
	}
	if(!str.empty()) {
		ans += str;
	}
	return ans;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x1e5e(%rip), %rsi      # 0x97f0
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x2340
movq %rax, %r13
cmpl $-0x1, %r13d
je 0x7a70
leaq 0x18(%rsp), %rbp
leaq 0x8(%rsp), %r15
leaq 0x1e31(%rip), %r12      # 0x97f0
movslq %r13d, %rcx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2220
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x20a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x79f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
shlq $0x20, %r13
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %r13
sarq $0x20, %r13
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq $-0x1, %rcx
callq 0x2220
movq %r14, %rdi
movq %r15, %rsi
callq 0x2260
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7a51
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movl $0x2, %ecx
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2340
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x79bf
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0x7a84
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7ab8
jmp 0x7ab8
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7abb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x7abb
jmp 0x7ab8
movq %rax, %r14
movq (%rbx), %rdi
cmpq (%rsp), %rdi
je 0x7ad3
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/hyp1231[P]FMSS/main.cpp
// Function: Menu()
void Menu() {				// get opts and execute them
	FileSystem S;
	vector<string> opt;
	do {
		cout << "[";
		S.Print_cur_path();
		cout << "]>>> ";
		opt.clear();
		get_opt(opt);
	} while(exec_opt(S, opt));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2e22
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq 0x4c17(%rip), %r15      # 0xcfd0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x14bb(%rip), %rsi      # 0x9883
callq 0x2240
movq %rbx, %rdi
callq 0x6f8c
movl $0x5, %edx
movq %r15, %rdi
leaq 0x14a1(%rip), %rsi      # 0x9885
callq 0x2240
movq (%rsp), %rbp
movq 0x8(%rsp), %r12
cmpq %rbp, %r12
je 0x8425
leaq 0x10(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x8410
movq (%r13), %rsi
incq %rsi
callq 0x2200
leaq 0x20(%r13), %rax
addq $0x10, %r13
cmpq %r12, %r13
movq %rax, %r13
jne 0x83fb
movq %rbp, 0x8(%rsp)
movq %r14, %rdi
callq 0x7adb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7f4d
testb %al, %al
jne 0x83b9
movq %rsp, %rdi
callq 0x7068
leaq 0x18(%rsp), %rdi
callq 0x3056
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7068
leaq 0x18(%rsp), %rdi
callq 0x3056
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/MyHush[P]hush-seeder/bitcoin.cpp
// Function: CNode::CNode(CService const&, std::vector<CAddress, std::allocator<CAddress>>*)
CNode(const CService& ip, vector<CAddress>* vAddrIn) : you(ip), nHeaderStart(-1), nMessageStart(-1), vAddr(vAddrIn), ban(0), doneAfter(0), nVersion(0) {
    vSend.SetType(SER_NETWORK);
    vSend.SetVersion(0);
    vRecv.SetType(SER_NETWORK);
    vRecv.SetVersion(0);
    if (time(NULL) > 1329696000) {
      vSend.SetVersion(INIT_PROTO_VERSION);
      vRecv.SetVersion(INIT_PROTO_VERSION);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x14(%rdi)
movups %xmm0, 0x8(%rdi)
movl $0x29817, %eax          # imm = 0x29817
movl %eax, 0x2c(%rdi)
movabsq $0x100050000, %rcx      # imm = 0x100050000
movq %rcx, 0x24(%rdi)
leaq 0x30(%rdi), %r15
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x3c(%rdi)
movl %eax, 0x54(%rdi)
movq %rcx, 0x4c(%rdi)
movq $-0x1, 0x58(%rdi)
xorl %eax, %eax
movl %eax, 0x60(%rdi)
leaq 0x78(%rdi), %r13
movq %r13, 0x68(%rdi)
movq %rax, 0x70(%rdi)
movb $0x0, 0x78(%rdi)
movq %rdx, 0x90(%rdi)
movl %eax, 0x98(%rdi)
movq %rax, 0xa0(%rdi)
addq $0xa8, %rdi
movzwl 0x10(%rsi), %eax
movw %ax, 0x30(%rsp)
movups (%rsi), %xmm0
movaps %xmm0, 0x20(%rsp)
movzwl 0x30(%rsp), %eax
movw %ax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movl $0x1, %r12d
movl $0x1, %esi
callq 0xbdce
movq %r12, 0x28(%rbx)
movq %r12, 0x50(%rbx)
xorl %edi, %edi
callq 0x33c0
cmpq $0x4f418d01, %rax       # imm = 0x4F418D01
jl 0x6056
movl $0xd1, %eax
movl %eax, 0x2c(%rbx)
movl %eax, 0x54(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r12
movq 0x68(%rbx), %rdi
cmpq %r13, %rdi
je 0x6075
callq 0x33d0
movq %r15, %rdi
callq 0x62e2
movq %r14, %rdi
callq 0x62e2
movq %r12, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O3/MyHush[P]hush-seeder/bitcoin.cpp
// Function: CNode::PushVersion()
void PushVersion() {
    int64 nTime = time(NULL);
    uint64 nLocalNonce = BITCOIN_SEED_NONCE;
    int64 nLocalServices = 0;
    CAddress me(CService("0.0.0.0"));
    BeginMessage("version");
    int nBestHeight = GetRequireHeight();
    string ver = "/hush-seeder:0.03/";
    vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
    EndMessage();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x33c0
movq %rax, %r15
leaq 0xdcf6(%rip), %rsi      # 0x1409e
leaq 0x48(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0xaeb6
movzwl 0x10(%r14), %eax
movw %ax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
movl $0x1, %esi
callq 0xbdce
leaq 0xdcc7(%rip), %rsi      # 0x140a6
movq %rbx, %rdi
callq 0x690e
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xdcb6(%rip), %rsi      # 0x140ae
leaq 0xdcc1(%rip), %rdx      # 0x140c0
leaq 0x28(%rsp), %rdi
callq 0x82f6
leaq 0x8(%rbx), %r14
leaq 0x24(%rsp), %rcx
movl $0x29817, -0x4(%rcx)    # imm = 0x29817
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x6b46
leaq 0x28(%rsp), %rcx
movq $0x0, -0x8(%rcx)
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x6b46
leaq 0x28(%rsp), %rcx
movq %r15, -0x8(%rcx)
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x6b46
leaq 0xa8(%rbx), %rdi
movl 0x28(%rbx), %edx
movl 0x2c(%rbx), %ecx
movq %r14, %rsi
callq 0x6d9c
movl 0x28(%rbx), %edx
movl 0x2c(%rbx), %ecx
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x6d9c
movabsq $0x539a019ca550825, %rax # imm = 0x539A019CA550825
leaq 0x28(%rsp), %rcx
movq %rax, -0x8(%rcx)
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x6b46
movq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x6e77
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
je 0x64d2
movq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x6b06
leaq 0x24(%rsp), %rcx
movl $0x0, -0x4(%rcx)
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x6b46
movq %rbx, %rdi
callq 0x697a
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x6506
callq 0x33d0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x6527
callq 0x33d0
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O3/MyHush[P]hush-seeder/./db.h
// Function: CAddrInfo::GetBanTime() const
int GetBanTime() const {
    if (IsGood()) return 0;
    if (clientVersion && clientVersion < minimunClientVersion) { return 604800; }
    if (stat1M.reliability - stat1M.weight + 1.0 < 0.15 && stat1M.count > 32) { return 30*86400; }
    if (stat1W.reliability - stat1W.weight + 1.0 < 0.10 && stat1W.count > 16) { return 7*86400; }
    if (stat1D.reliability - stat1D.weight + 1.0 < 0.05 && stat1D.count > 8) { return 1*86400; }
    return 0;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xcdfc
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
jne 0xd00b
movl 0x7c(%rbx), %eax
testl %eax, %eax
setne %cl
cmpl $0x29812, %eax          # imm = 0x29812
setl %dl
movl $0x93a80, %eax          # imm = 0x93A80
testb %dl, %cl
jne 0xd00b
movss 0x78(%rbx), %xmm0
subss 0x70(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x7ac0(%rip), %xmm0     # 0x14a38
movsd 0x7b08(%rip), %xmm1     # 0x14a88
ucomisd %xmm0, %xmm1
jbe 0xcf99
movss 0x74(%rbx), %xmm0
movl $0x278d00, %eax         # imm = 0x278D00
ucomiss 0x7b29(%rip), %xmm0     # 0x14ac0
ja 0xd00b
movss 0x6c(%rbx), %xmm0
subss 0x64(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x7a89(%rip), %xmm0     # 0x14a38
movsd 0x7ad9(%rip), %xmm1     # 0x14a90
ucomisd %xmm0, %xmm1
jbe 0xcfd0
movss 0x68(%rbx), %xmm0
ucomiss 0x7af3(%rip), %xmm0     # 0x14abc
movl $0x93a80, %eax          # imm = 0x93A80
ja 0xd00b
movss 0x60(%rbx), %xmm0
subss 0x58(%rbx), %xmm0
movss 0x5c(%rbx), %xmm1
cvtss2sd %xmm0, %xmm0
addsd 0x7a4d(%rip), %xmm0     # 0x14a38
xorl %ecx, %ecx
ucomiss 0x7ac4(%rip), %xmm1     # 0x14ab8
movl $0x15180, %eax          # imm = 0x15180
cmovbel %ecx, %eax
movsd 0x7a94(%rip), %xmm1     # 0x14a98
ucomisd %xmm0, %xmm1
cmovbel %ecx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/MyHush[P]hush-seeder/main.cpp
// Function: ThreadSeeder
void* ThreadSeeder(void*) {
  //if (!fTestNet){
  //  db.Add(CService("kjy2eqzk4zwi5zd3.onion", 8888), true);
  //}
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
  return nullptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x58e9(%rip), %rbx      # 0x147d5
leaq 0x50(%rsp), %r14
leaq 0x38(%rsp), %r12
leaq 0xeb3b(%rip), %r13      # 0x1da38
movq 0xe4bc(%rip), %rdi      # 0x1d3c0
movq %rbx, %rsi
callq 0x30e0
testl %eax, %eax
je 0xefe3
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0xe491(%rip), %rax      # 0x1d3c0
movq %r15, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x859a
movq 0x20(%rsp), %rbp
cmpq 0x28(%rsp), %rbp
je 0xefb5
cmpb $0x0, 0xead2(%rip)      # 0x1da30
movl $0x6d7e, %edx           # imm = 0x6D7E
jne 0xef6a
movl $0x466e, %edx           # imm = 0x466E
movq %r12, %rdi
movq %rbp, %rsi
callq 0xadc0
movzwl 0x48(%rsp), %eax
movw %ax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movl $0x1, %esi
movq %r14, %rdi
callq 0xbdce
movq %r13, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xfee4
addq $0x10, %rbp
cmpq 0x28(%rsp), %rbp
jne 0xef57
movq 0x20(%rsp), %rbp
testq %rbp, %rbp
je 0xefc2
movq %rbp, %rdi
callq 0x33d0
incq %r15
movq %r15, %rdi
shlq $0x5, %rdi
addq 0xe3ed(%rip), %rdi      # 0x1d3c0
movq %rbx, %rsi
callq 0x30e0
testl %eax, %eax
jne 0xef17
movq $0x708, 0x50(%rsp)      # imm = 0x708
movq $0x0, 0x58(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x3100
jmp 0xeefd
jmp 0xf006
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xf018
callq 0x33d0
movq %rbx, %rdi
callq 0x3650