// File: /workspace/github_cpp_makefile_star2_O3/BUSEC[P]RPKI_Downgrade_Detector/cli.cpp
// Function: readScanROAFile(std::vector<ROA*, std::allocator<ROA*>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
int readScanROAFile(vector<ROA*>* ROAs, string* filepath){

	ifstream f;
	f.open(*filepath);
	if ( f.is_open() ) {
		string line;

		while( getline(f, line) ){
			string path;
			string datetime;
			int as = 0;

			istringstream iss(line);
			int i = 0;
			do {
	
				if ( i == 0 ) iss>>path;
				if ( i == 1 ) iss>>datetime;
				if ( i == 2 ) iss>>as;

				if ( i > 2 ) {
					string prefix;
					iss>>prefix;

					// Ignore ipv6 prefixes (ipv6 prefixes contain ':' )
					// and
					// Ignore empty strings
					if ( prefix.find(":") == std::string::npos && prefix != "") {
						string formatStr = "%d.%d.%d.%d/%d-%d";
						int ip1, ip2, ip3, ip4, prefixlen, maxlen;

						sscanf(prefix.c_str(), formatStr.c_str(), &ip1, &ip2, &ip3, &ip4, &prefixlen, &maxlen);

						ROA* roa = new ROA(as, IPPrefix(IPAddr(ip1,ip2,ip3,ip4), prefixlen), maxlen, path );
						ROAs->push_back(roa);
					}
				}

				i++;
			} while(iss);
			assert(i > 3); // Something is wrong if we didn't read in atleast for tokens from this line (bad format)

		}
		f.close();
	} else return 0;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rsi, %rbx
movq %rdi, 0xf0(%rsp)
leaq 0x280(%rsp), %r14
movq %r14, %rdi
callq 0x2270
movq %r14, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x21f0
leaq 0x2f8(%rsp), %rdi
callq 0x2070
xorl %ebx, %ebx
testb %al, %al
je 0x44d4
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x38(%rsp), %r15
leaq 0x70(%rsp), %r14
leaq 0x280(%rsp), %rbx
movq 0x280(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x2380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x449d
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x50(%rsp)
movb %cl, 0x58(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %rcx, 0x78(%rsp)
movb %cl, 0x80(%rsp)
movl $0x0, 0xc(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl $0x8, %edx
callq 0x2330
xorl %ebx, %ebx
cmpl $0x2, %ebx
je 0x41ea
movq %r14, %rsi
cmpl $0x1, %ebx
je 0x41db
testl %ebx, %ebx
jne 0x4217
leaq 0x48(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x22a0
jmp 0x41fc
leaq 0x100(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2140
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x120(%rsp,%rax)
je 0x428c
jmp 0x44f5
movq %r15, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x22a0
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x3e90(%rip), %rsi      # 0x80de
xorl %edx, %edx
callq 0x2350
cmpq $-0x1, %rax
je 0x4293
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4272
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x120(%rsp,%rax)
jne 0x442d
incl %ebx
jmp 0x41c5
leaq 0x28(%rsp), %rdi
leaq 0x4094(%rip), %rsi      # 0x8333
callq 0x20a0
testl %eax, %eax
je 0x425b
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x3e35(%rip), %rsi      # 0x80fc
leaq 0x3e3f(%rip), %rdx      # 0x810d
callq 0x7db4
movq 0x28(%rsp), %rdi
movq 0x90(%rsp), %rsi
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x18(%rsp), %r9
xorl %eax, %eax
leaq 0x10(%rsp), %r10
pushq %r10
leaq 0x1c(%rsp), %r10
pushq %r10
callq 0x2220
addq $0x10, %rsp
movl $0x30, %edi
callq 0x2230
movq %rax, %r15
movl 0x24(%rsp), %eax
movl 0x20(%rsp), %ecx
movl 0x1c(%rsp), %edx
movzbl 0x18(%rsp), %esi
shll $0x18, %eax
movzbl %cl, %ecx
shll $0x10, %ecx
orl %eax, %ecx
shll $0x8, %edx
movzwl %dx, %eax
orl %ecx, %eax
orl %esi, %eax
movl 0x14(%rsp), %edx
movl %edx, %ecx
negb %cl
shrl %cl, %eax
shll %cl, %eax
testl %edx, %edx
cmovel %edx, %eax
movl 0xc(%rsp), %ebp
movl %eax, 0x68(%rsp)
movl %edx, 0x6c(%rsp)
movl 0x10(%rsp), %r12d
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
callq 0x7078
movq %r15, %rdi
movl %ebp, %esi
leaq 0x68(%rsp), %rdx
movl %r12d, %ecx
movq %r13, %r8
callq 0x5a3a
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x43c9
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2240
movq %r15, 0xf8(%rsp)
movq 0xf0(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x43ed
movq %r15, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x43fa
leaq 0xf8(%rsp), %rdx
callq 0x783a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x425b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x425b
leaq 0x100(%rsp), %rdi
movq 0x7b94(%rip), %rsi      # 0xbfd0
callq 0x22c0
leaq 0x178(%rsp), %rdi
callq 0x20b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4470
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x280(%rsp), %rbx
je 0x4135
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x4135
leaq 0x280(%rsp), %rdi
callq 0x2060
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x44cf
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2240
movl $0x1, %ebx
leaq 0x280(%rsp), %rdi
callq 0x2080
movl %ebx, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3c12(%rip), %rdi      # 0x810e
leaq 0x3c11(%rip), %rsi      # 0x8114
leaq 0x3c12(%rip), %rcx      # 0x811c
movl $0x39, %edx
callq 0x2150
jmp 0x4526
movq %rax, %rbx
jmp 0x463e
movq %rax, %rbx
jmp 0x45db
movq %rax, %rbx
jmp 0x4619
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x455b
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x455b
movq %rax, %rbx
movl $0x30, %esi
movq %r15, %rdi
callq 0x2240
jmp 0x456f
jmp 0x459b
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x459e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x459e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x45ba
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x45ba
movq %rax, %rbx
movq 0x7a0f(%rip), %rsi      # 0xbfd0
leaq 0x100(%rsp), %rdi
callq 0x22c0
leaq 0x178(%rsp), %rdi
callq 0x20b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x45fd
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4619
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x463e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2240
leaq 0x280(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2360