// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rdi, 0xf0(%rsp)
leaq 0x280(%rsp), %rbx
movq %rbx, %rdi
callq 0x2270
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x21f0
leaq 0x2f8(%rsp), %rdi
callq 0x2070
xorl %ebp, %ebp
testb %al, %al
je 0x4706
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %rbx
leaq 0x60(%rsp), %r14
leaq 0xb0(%rsp), %r13
movq 0x280(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x280(%rsp), %r15
addq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %edx
movq %r15, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x2380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x46cf
movq %rbx, 0x10(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x18(%rsp)
movb %cl, 0x20(%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 %eax, %eax
leaq 0xc(%rsp), %r15
movl %eax, %ebx
cmpl $0x2, %eax
je 0x4436
cmpl $0x1, %ebx
je 0x441f
testl %ebx, %ebx
jne 0x4446
leaq 0x100(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x22a0
cmpl $0x2, %ebx
je 0x4436
cmpl $0x1, %ebx
jne 0x4446
leaq 0x100(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x22a0
cmpl $0x2, %ebx
jne 0x4446
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
callq 0x2140
cmpl $0x3, %ebx
jb 0x4641
movq %r14, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movb $0x0, 0x60(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x50(%rsp), %r12
movq %r12, %rsi
callq 0x22a0
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x4c58(%rip), %rsi      # 0x90de
xorl %edx, %edx
callq 0x2350
cmpq $-0x1, %rax
jne 0x462a
leaq 0x50(%rsp), %rdi
leaq 0x4e90(%rip), %rsi      # 0x9333
callq 0x20a0
testl %eax, %eax
je 0x462a
movq %r14, %r15
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x4c2a(%rip), %rsi      # 0x90fc
leaq 0x4c34(%rip), %rdx      # 0x910d
callq 0x809c
movq 0x50(%rsp), %rdi
movq 0x90(%rsp), %rsi
leaq 0x44(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x3c(%rsp), %r8
leaq 0x38(%rsp), %r9
xorl %eax, %eax
leaq 0x30(%rsp), %r10
pushq %r10
leaq 0x3c(%rsp), %r10
pushq %r10
callq 0x2220
addq $0x10, %rsp
movl $0x30, %edi
callq 0x2230
movq %rax, %r14
movl 0x44(%rsp), %eax
movl 0x40(%rsp), %ecx
movl 0x3c(%rsp), %edx
movzbl 0x38(%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 0x34(%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, 0x48(%rsp)
movl %edx, 0x4c(%rsp)
movl 0x30(%rsp), %r12d
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x7372
movq %r14, %rdi
movl %ebp, %esi
leaq 0x48(%rsp), %rdx
movl %r12d, %ecx
movq %r13, %r8
callq 0x5cba
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x45cc
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2240
movq %r14, 0xf8(%rsp)
movq 0xf0(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x45f0
movq %r14, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x45fd
leaq 0xf8(%rsp), %rdx
callq 0x7b2e
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0x4625
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2240
leaq 0xc(%rsp), %r15
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x4641
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rcx
leal 0x1(%rbx), %eax
testb $0x5, 0x120(%rsp,%rcx)
je 0x43f3
cmpl $0x2, %ebx
jbe 0x4727
leaq 0x100(%rsp), %rdi
movq 0x895a(%rip), %rsi      # 0xcfd0
callq 0x22c0
leaq 0x178(%rsp), %rdi
callq 0x20b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0x46af
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x435b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x435b
leaq 0x280(%rsp), %rdi
callq 0x2060
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x4701
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2240
movl $0x1, %ebp
leaq 0x280(%rsp), %rdi
callq 0x2080
movl %ebp, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x49e0(%rip), %rdi      # 0x910e
leaq 0x49df(%rip), %rsi      # 0x9114
leaq 0x49e0(%rip), %rcx      # 0x911c
movl $0x39, %edx
callq 0x2150
jmp 0x475d
movq %rax, %r12
jmp 0x4888
movq %rax, %r12
leaq 0x20(%rsp), %rbx
jmp 0x482a
movq %rax, %r12
jmp 0x4863
movq %rax, %r12
jmp 0x4792
movq %rax, %r12
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x4792
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2240
movl $0x30, %esi
movq %r14, %rdi
callq 0x2240
jmp 0x47b1
movq %rax, %r12
leaq 0x20(%rsp), %rbx
movq %r15, %r14
jmp 0x47e8
movq %rax, %r12
leaq 0x20(%rsp), %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0x47e8
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x47e8
movq %rax, %r12
leaq 0x20(%rsp), %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x4809
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2240
jmp 0x4809
movq %rax, %r12
leaq 0x20(%rsp), %rbx
movq 0x87c0(%rip), %rsi      # 0xcfd0
leaq 0x100(%rsp), %rdi
callq 0x22c0
leaq 0x178(%rsp), %rdi
callq 0x20b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x484c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4863
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2240
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x4888
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2240
leaq 0x280(%rsp), %rdi
callq 0x2080
movq %r12, %rdi
callq 0x2360