// File: WShabti-Team[P]WShabtiPict/wshabtilib/oracle-generator/oracle-generator.cpp
// Function: append_oracle_to_csv(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>>>>, 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 append_oracle_to_csv(vector<string> oracle, string input_file_path, string output_file_path)
{
    ofstream output_file;
    ifstream input_file;
  	output_file.open(output_file_path, ios_base::out);
	input_file.open(input_file_path, ios_base::in);

    int index = 0;
    string combination = "";

    bool interval_found = check_interval(oracle);

	bool keep_reading = !input_file.eof();

	//---------------------------------------------------THESE LINES ARE FOR APPENDING ORACLES TO CSV FILE---------------------------------------------------
    while(keep_reading)
	{
		getline(input_file, combination);

		if(interval_found)
		{
			if(oracle[index].find(':') != string::npos) //':' FOUND - JUST APPEND
			{
				vector<string> expected_delta = split(oracle[index++], ":");
				output_file<<combination <<","<<expected_delta[0]<<","<<expected_delta[1];
			}
			else
			{
				output_file<<combination <<","<<oracle[index++]<<",0"; //':' NOT FOUND - CREATE NULL DELTA
			}
		}
        
		else
		{
			output_file<<combination <<","<<oracle[index++];
		}

		keep_reading = !input_file.eof();
        if(keep_reading)
        {
          	output_file<<endl;
        }           
    }
	//---------------------------------------------------THESE LINES ARE FOR APPENDING ORACLES TO CSV FILE---------------------------------------------------

    input_file.close();
    output_file.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x560, %rsp            # imm = 0x560
movq %rdi, -0x4f0(%rbp)
movq %rsi, -0x4e8(%rbp)
movq %rdx, -0x4e0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x7970
leaq -0x420(%rbp), %rdi
callq 0x76d0
jmp 0x5efc6
movq -0x4e0(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x10, %edx
callq 0x72d0
jmp 0x5efe0
movq -0x4e8(%rbp), %rsi
leaq -0x420(%rbp), %rdi
movl $0x8, %edx
callq 0x7520
jmp 0x5effa
movl $0x0, -0x430(%rbp)
leaq -0x451(%rbp), %rdi
movq %rdi, -0x4f8(%rbp)
callq 0x79e0
movq -0x4f8(%rbp), %rdx
leaq 0x6c0d(%rip), %rsi      # 0x65c32
leaq -0x450(%rbp), %rdi
callq 0xd700
jmp 0x5f033
leaq -0x451(%rbp), %rdi
callq 0x7660
movq -0x4f0(%rbp), %rsi
leaq -0x470(%rbp), %rdi
callq 0x47fc0
jmp 0x5f054
leaq -0x470(%rbp), %rdi
callq 0x5eed0
movb %al, -0x4f9(%rbp)
jmp 0x5f068
leaq -0x470(%rbp), %rdi
callq 0x32bc0
movb -0x4f9(%rbp), %al
andb $0x1, %al
movb %al, -0x452(%rbp)
movq -0x420(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x420(%rbp,%rax), %rdi
callq 0x7a30
movb %al, -0x4fa(%rbp)
jmp 0x5f0a2
movb -0x4fa(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x471(%rbp)
testb $0x1, -0x471(%rbp)
je 0x5f49b
leaq -0x420(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x70e0
jmp 0x5f0d4
testb $0x1, -0x452(%rbp)
je 0x5f3de
movq -0x4f0(%rbp), %rdi
movslq -0x430(%rbp), %rsi
callq 0x32c40
movq %rax, %rdi
movl $0x3a, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7790
cmpq $-0x1, %rax
je 0x5f358
movq -0x4f0(%rbp), %rdi
movslq -0x430(%rbp), %rsi
movl %esi, %eax
incl %eax
movl %eax, -0x430(%rbp)
callq 0x32c40
movq %rax, %rsi
leaq -0x4b0(%rbp), %rdi
callq 0x7270
jmp 0x5f13d
leaq -0x4d1(%rbp), %rdi
movq %rdi, -0x508(%rbp)
callq 0x79e0
movq -0x508(%rbp), %rdx
leaq 0x59c2(%rip), %rsi      # 0x64b20
leaq -0x4d0(%rbp), %rdi
callq 0xd700
jmp 0x5f16c
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x32880
jmp 0x5f188
leaq -0x4d0(%rbp), %rdi
callq 0x73e0
leaq -0x4d1(%rbp), %rdi
callq 0x7660
leaq -0x4b0(%rbp), %rdi
callq 0x73e0
leaq -0x218(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x7560
movq %rax, -0x510(%rbp)
jmp 0x5f1c8
movq -0x510(%rbp), %rdi
leaq 0x6a9c(%rip), %rsi      # 0x65c72
callq 0x75d0
movq %rax, -0x518(%rbp)
jmp 0x5f1e4
xorl %eax, %eax
movl %eax, %esi
leaq -0x490(%rbp), %rdi
callq 0x32c40
movq -0x518(%rbp), %rdi
movq %rax, %rsi
callq 0x7560
movq %rax, -0x520(%rbp)
jmp 0x5f20c
movq -0x520(%rbp), %rdi
leaq 0x6a58(%rip), %rsi      # 0x65c72
callq 0x75d0
movq %rax, -0x528(%rbp)
jmp 0x5f228
leaq -0x490(%rbp), %rdi
movl $0x1, %esi
callq 0x32c40
movq -0x528(%rbp), %rdi
movq %rax, %rsi
callq 0x7560
jmp 0x5f24a
leaq -0x490(%rbp), %rdi
callq 0x32bc0
jmp 0x5f3dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
jmp 0x5f4fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
jmp 0x5f4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x451(%rbp), %rdi
callq 0x7660
jmp 0x5f4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
jmp 0x5f4e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x32bc0
jmp 0x5f4e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
jmp 0x5f318
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x73e0
leaq -0x4d1(%rbp), %rdi
callq 0x7660
leaq -0x4b0(%rbp), %rdi
callq 0x73e0
jmp 0x5f4e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x32bc0
jmp 0x5f4e4
leaq -0x218(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x7560
movq %rax, -0x530(%rbp)
jmp 0x5f374
movq -0x530(%rbp), %rdi
leaq 0x68f0(%rip), %rsi      # 0x65c72
callq 0x75d0
movq %rax, -0x538(%rbp)
jmp 0x5f390
movq -0x4f0(%rbp), %rdi
movslq -0x430(%rbp), %rsi
movl %esi, %eax
incl %eax
movl %eax, -0x430(%rbp)
callq 0x32c40
movq -0x538(%rbp), %rdi
movq %rax, %rsi
callq 0x7560
movq %rax, -0x540(%rbp)
jmp 0x5f3c5
movq -0x540(%rbp), %rdi
leaq 0x69c6(%rip), %rsi      # 0x65d99
callq 0x75d0
jmp 0x5f3da
jmp 0x5f3dc
jmp 0x5f446
leaq -0x218(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x7560
movq %rax, -0x548(%rbp)
jmp 0x5f3fa
movq -0x548(%rbp), %rdi
leaq 0x686a(%rip), %rsi      # 0x65c72
callq 0x75d0
movq %rax, -0x550(%rbp)
jmp 0x5f416
movq -0x4f0(%rbp), %rdi
movslq -0x430(%rbp), %rsi
movl %esi, %eax
incl %eax
movl %eax, -0x430(%rbp)
callq 0x32c40
movq -0x550(%rbp), %rdi
movq %rax, %rsi
callq 0x7560
jmp 0x5f444
jmp 0x5f446
movq -0x420(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x420(%rbp,%rax), %rdi
callq 0x7a30
movb %al, -0x551(%rbp)
jmp 0x5f466
movb -0x551(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x471(%rbp)
testb $0x1, -0x471(%rbp)
je 0x5f496
movq 0x32ada(%rip), %rsi     # 0x91f60
leaq -0x218(%rbp), %rdi
callq 0x7640
jmp 0x5f494
jmp 0x5f496
jmp 0x5f0b2
leaq -0x420(%rbp), %rdi
callq 0x7110
jmp 0x5f4a9
leaq -0x218(%rbp), %rdi
callq 0x7810
jmp 0x5f4b7
leaq -0x450(%rbp), %rdi
callq 0x73e0
leaq -0x420(%rbp), %rdi
callq 0x7140
leaq -0x218(%rbp), %rdi
callq 0x7850
addq $0x560, %rsp            # imm = 0x560
popq %rbp
retq
leaq -0x450(%rbp), %rdi
callq 0x73e0
leaq -0x420(%rbp), %rdi
callq 0x7140
leaq -0x218(%rbp), %rdi
callq 0x7850
movq -0x428(%rbp), %rdi
callq 0x79d0
nopw %cs:(%rax,%rax)
nop