// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0x66b0
leaq 0xa0(%rsp), %rdi
callq 0x64e0
leaq 0x2a8(%rsp), %rdi
pushq $0x10
popq %rdx
movq %r15, %rsi
callq 0x6200
leaq 0xa0(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x63a0
leaq 0x4ca1(%rip), %rsi      # 0x23b9a
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x7f56
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x178b6
leaq 0x28(%rsp), %rdi
callq 0x1ee38
movl %eax, %ebp
leaq 0x28(%rsp), %rdi
callq 0x11254
leaq 0xa0(%rsp), %rax
movq (%rax), %rax
movq -0x18(%rax), %rax
movb 0xc0(%rsp,%rax), %r12b
andb $0x2, %r12b
shrb %r12b
xorl %r14d, %r14d
leaq 0x40(%rsp), %r15
testb $0x1, %r12b
jne 0x1f0d5
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x60b0
testb %bpl, %bpl
je 0x1f037
movq (%rbx), %rdi
addq %r14, %rdi
pushq $0x3a
popq %rsi
xorl %edx, %edx
callq 0x6590
cmpq $-0x1, %rax
je 0x1f066
movq (%rbx), %rsi
addq %r14, %rsi
leaq 0x60(%rsp), %rdi
callq 0x65b0
leaq 0x80(%rsp), %r13
movq %r13, %rdi
leaq 0x3b64(%rip), %rsi      # 0x22b14
leaq 0xf(%rsp), %rdx
callq 0x7f56
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %r12
movq %r12, %rsi
movq %r13, %rdx
callq 0x110b0
movq %r13, %rdi
callq 0x61e0
movq %r12, %rdi
callq 0x61e0
leaq 0x2a8(%rsp), %rdi
movq %r15, %rsi
callq 0x63d0
movq %rax, %rdi
leaq 0x4be1(%rip), %rsi      # 0x23bda
callq 0x6430
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x63d0
movq %rax, %rdi
leaq 0x4bc5(%rip), %rsi      # 0x23bda
callq 0x6430
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
movq %rax, %rdi
callq 0x63d0
leaq 0x10(%rsp), %rdi
callq 0x11254
jmp 0x1f0a2
leaq 0x2a8(%rsp), %rdi
movq %r15, %rsi
callq 0x63d0
movq %rax, %rdi
leaq 0x4b89(%rip), %rsi      # 0x23bda
callq 0x6430
movq (%rbx), %rsi
addq %r14, %rsi
movq %rax, %rdi
callq 0x63d0
jmp 0x1f0a2
leaq 0x2a8(%rsp), %rdi
movq %r15, %rsi
callq 0x63d0
movq %rax, %rdi
leaq 0x4b5a(%rip), %rsi      # 0x23bda
callq 0x6430
movq (%rbx), %rsi
addq %r14, %rsi
movq %rax, %rdi
callq 0x63d0
movq %rax, %rdi
leaq 0x4c64(%rip), %rsi      # 0x23d01
callq 0x6430
movq 0xa0(%rsp), %rax
movq -0x18(%rax), %rax
movb 0xc0(%rsp,%rax), %r12b
andb $0x2, %r12b
shrb %r12b
jne 0x1f0cc
leaq 0x2a8(%rsp), %rdi
callq 0x6210
addq $0x20, %r14
jmp 0x1ef51
leaq 0xa0(%rsp), %rdi
callq 0x60d0
leaq 0x2a8(%rsp), %rdi
callq 0x65e0
leaq 0x40(%rsp), %rdi
callq 0x61e0
leaq 0xa0(%rsp), %rdi
callq 0x60f0
leaq 0x2a8(%rsp), %rdi
callq 0x6610
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x1f16a
jmp 0x1f171
jmp 0x1f13a
movq %rax, %rbx
jmp 0x1f18b
jmp 0x1f171
movq %rax, %rbx
jmp 0x1f17e
jmp 0x1f171
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x61e0
jmp 0x1f156
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x61e0
jmp 0x1f174
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x11254
jmp 0x1f174
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x61e0
leaq 0xa0(%rsp), %rdi
callq 0x60f0
leaq 0x2a8(%rsp), %rdi
callq 0x6610
movq %rbx, %rdi
callq 0x66e0