// File: DoubleString[P]eph_converter/src/B2bDecoder.cpp
// Function: B2b::m_loadorbclk()
void B2b::m_loadorbclk(){
	string line;
	ifstream in;
	int iyear,imon,iday,ih,imin,iv,nsat;
	double dsec;
	in.open(File, ios::in | ios::binary);
	if (!in.is_open()) {
		cout << "***ERROR(m_loadorbclk):can't open file " << File << endl;
		exit(1);
	}
	cout << "start reading file..." << endl;
	while (!in.eof()) {
		getline(in, line);
		if (!len_trim(line.c_str()))
			continue;
		if (strstr(line.c_str(), "> ORBIT") != nullptr) {
			orbit orb_epoch;
			sscanf(line.c_str(),"%*s%*s%d%d%d%d%d%lf%d%d",&iyear,&imon,&iday,&ih,&imin,&dsec,&iv,&nsat);
			orb_epoch.mjd = md_julday(iyear,imon,iday);
			orb_epoch.sod = ih * 3600.0 + imin * 60.0 + dsec;
			if(lbdtime){ timinc(orb_epoch.mjd,orb_epoch.sod,14,&orb_epoch.mjd,&orb_epoch.sod);}
			for(int it = 0;it < nsat;it++){
				getline(in,line);
				sat_orb orb;
				sscanf(line.c_str(),"%s%d%lf%lf%lf%lf%lf%lf",orb.cprn,&orb.iode,orb.orb,orb.orb+1,orb.orb+2,orb.orb+3,
						orb.orb+4,orb.orb+5);
				orb_epoch.ORB[orb.cprn] = orb;
			}
			ORB_ALL.push_back(orb_epoch);
		}
		if(strstr(line.c_str(),"> CLOCK") != nullptr){
			clk clk_epoch;
			sscanf(line.c_str(),"%*s%*s%d%d%d%d%d%lf%d%d",&iyear,&imon,&iday,&ih,&imin,&dsec,&iv,&nsat);
			clk_epoch.mjd = md_julday(iyear,imon,iday);
			clk_epoch.sod = ih * 3600.0 + imin * 60.0 + dsec;
			if(lbdtime){ timinc(clk_epoch.mjd,clk_epoch.sod,14,&clk_epoch.mjd,&clk_epoch.sod);}
			for(int it = 0;it < nsat;it++){
				getline(in,line);
				sat_clk clk;
				sscanf(line.c_str(),"%s%d%lf%lf%lf",clk.cprn,&clk.iode,clk.clk,clk.clk + 1,clk.clk + 2);
				clk_epoch.CLK[clk.cprn] = clk;
			}
			CLK_ALL.push_back(clk_epoch);
		}
	}
	in.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp            # imm = 0x450
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3a0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x33e0
leaq -0x230(%rbp), %rdi
callq 0x3320
jmp 0x3a11
movq -0x3a0(%rbp), %rax
addq $0x948, %rax            # imm = 0x948
movq %rax, -0x3b0(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x62e0
movl %eax, -0x3a4(%rbp)
jmp 0x3a3c
movl -0x3a4(%rbp), %edx
movq -0x3b0(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0x31d0
jmp 0x3a57
leaq -0x230(%rbp), %rdi
callq 0x3460
movb %al, -0x3b1(%rbp)
jmp 0x3a6b
movb -0x3b1(%rbp), %al
testb $0x1, %al
jne 0x3b07
jmp 0x3a7b
movq 0x1c556(%rip), %rdi     # 0x1ffd8
leaq 0x13603(%rip), %rsi     # 0x1708c
callq 0x32a0
movq %rax, -0x3c0(%rbp)
jmp 0x3a97
movq -0x3c0(%rbp), %rdi
movq -0x3a0(%rbp), %rsi
addq $0x948, %rsi            # imm = 0x948
callq 0x32a0
movq %rax, -0x3c8(%rbp)
jmp 0x3aba
movq -0x3c8(%rbp), %rdi
movq 0x1c500(%rip), %rsi     # 0x1ffc8
callq 0x3300
jmp 0x3acf
movl $0x1, %edi
callq 0x3360
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x41cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x41c0
movq 0x1c4ca(%rip), %rdi     # 0x1ffd8
leaq 0x1359f(%rip), %rsi     # 0x170b4
callq 0x32a0
movq %rax, -0x3d0(%rbp)
jmp 0x3b23
movq -0x3d0(%rbp), %rdi
movq 0x1c497(%rip), %rsi     # 0x1ffc8
callq 0x3300
jmp 0x3b38
jmp 0x3b3a
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x34f0
movb %al, -0x3d1(%rbp)
jmp 0x3b5a
movb -0x3d1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3b6b
jmp 0x4194
leaq -0x230(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3090
jmp 0x3b7d
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
callq 0x15160
movl %eax, -0x3d8(%rbp)
jmp 0x3b96
movl -0x3d8(%rbp), %eax
cmpl $0x0, %eax
jne 0x3ba3
jmp 0x3b3a
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
leaq 0x13514(%rip), %rsi     # 0x170ca
callq 0x30c0
cmpq $0x0, %rax
je 0x3e9e
leaq -0x2a0(%rbp), %rdi
callq 0x6300
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
movq %rsp, %rax
leaq -0x258(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x254(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x260(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x250(%rbp), %rcx
movq %rcx, (%rax)
leaq 0x134c0(%rip), %rsi     # 0x170d2
xorl %eax, %eax
leaq -0x240(%rbp), %rdx
leaq -0x244(%rbp), %rcx
leaq -0x248(%rbp), %r8
leaq -0x24c(%rbp), %r9
callq 0x3290
movl -0x240(%rbp), %edi
movl -0x244(%rbp), %esi
movl -0x248(%rbp), %edx
callq 0x14480
movl %eax, -0x3dc(%rbp)
jmp 0x3c54
movq -0x3a0(%rbp), %rax
movl -0x3dc(%rbp), %ecx
movl %ecx, -0x2a0(%rbp)
cvtsi2sdl -0x24c(%rbp), %xmm0
cvtsi2sdl -0x250(%rbp), %xmm1
movsd 0x13391(%rip), %xmm2    # 0x17010
mulsd %xmm2, %xmm1
movsd 0x1337d(%rip), %xmm2    # 0x17008
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x260(%rbp), %xmm0
movsd %xmm0, -0x298(%rbp)
cmpl $0x0, 0x8(%rax)
je 0x3ced
movl -0x2a0(%rbp), %edi
leaq -0x298(%rbp), %rdx
movsd -0x298(%rbp), %xmm0
movsd 0x13352(%rip), %xmm1    # 0x17018
leaq -0x2a0(%rbp), %rsi
callq 0x15590
jmp 0x3cd4
jmp 0x3ced
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x3e8d
movl $0x0, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
cmpl -0x258(%rbp), %eax
jge 0x3e63
leaq -0x230(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3090
jmp 0x3d1b
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
leaq -0x2dc(%rbp), %rcx
leaq -0x2d8(%rbp), %r8
leaq -0x2d0(%rbp), %r9
leaq -0x2c8(%rbp), %rdx
leaq -0x2c0(%rbp), %rsi
leaq -0x2b8(%rbp), %r10
leaq -0x2b0(%rbp), %r11
movq %rsp, %rax
movq %r11, 0x18(%rax)
movq %r10, 0x10(%rax)
movq %rsi, 0x8(%rax)
movq %rdx, (%rax)
leaq 0x13379(%rip), %rsi     # 0x170ea
xorl %eax, %eax
leaq -0x2e0(%rbp), %rdx
movq %rdx, -0x3f0(%rbp)
callq 0x3290
leaq -0x290(%rbp), %rax
movq %rax, -0x3f8(%rbp)
leaq -0x301(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0x34e0
movq -0x3f0(%rbp), %rsi
movq -0x3e8(%rbp), %rdx
leaq -0x300(%rbp), %rdi
callq 0x33d0
jmp 0x3dc3
movq -0x3f8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x6320
movq %rax, -0x400(%rbp)
jmp 0x3ddf
movq -0x400(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
movl $0x38, %edx
callq 0x3230
leaq -0x300(%rbp), %rdi
callq 0x31c0
leaq -0x301(%rbp), %rdi
callq 0x3310
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x3e55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x31c0
leaq -0x301(%rbp), %rdi
callq 0x3310
jmp 0x3e8d
movq -0x3a0(%rbp), %rdi
addq $0xd48, %rdi            # imm = 0xD48
leaq -0x2a0(%rbp), %rsi
callq 0x6400
jmp 0x3e7f
leaq -0x2a0(%rbp), %rdi
callq 0x6470
jmp 0x3e9e
leaq -0x2a0(%rbp), %rdi
callq 0x6470
jmp 0x41c0
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
leaq 0x13250(%rip), %rsi     # 0x17101
callq 0x30c0
cmpq $0x0, %rax
je 0x418f
leaq -0x348(%rbp), %rdi
callq 0x6490
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
movq %rsp, %rax
leaq -0x258(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x254(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x260(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x250(%rbp), %rcx
movq %rcx, (%rax)
leaq 0x131c5(%rip), %rsi     # 0x170d2
xorl %eax, %eax
leaq -0x240(%rbp), %rdx
leaq -0x244(%rbp), %rcx
leaq -0x248(%rbp), %r8
leaq -0x24c(%rbp), %r9
callq 0x3290
movl -0x240(%rbp), %edi
movl -0x244(%rbp), %esi
movl -0x248(%rbp), %edx
callq 0x14480
movl %eax, -0x404(%rbp)
jmp 0x3f4f
movq -0x3a0(%rbp), %rax
movl -0x404(%rbp), %ecx
movl %ecx, -0x348(%rbp)
cvtsi2sdl -0x24c(%rbp), %xmm0
cvtsi2sdl -0x250(%rbp), %xmm1
movsd 0x13096(%rip), %xmm2    # 0x17010
mulsd %xmm2, %xmm1
movsd 0x13082(%rip), %xmm2    # 0x17008
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x260(%rbp), %xmm0
movsd %xmm0, -0x340(%rbp)
cmpl $0x0, 0x8(%rax)
je 0x3fe8
movl -0x348(%rbp), %edi
leaq -0x340(%rbp), %rdx
movsd -0x340(%rbp), %xmm0
movsd 0x13057(%rip), %xmm1    # 0x17018
leaq -0x348(%rbp), %rsi
callq 0x15590
jmp 0x3fcf
jmp 0x3fe8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x4181
movl $0x0, -0x34c(%rbp)
movl -0x34c(%rbp), %eax
cmpl -0x258(%rbp), %eax
jge 0x4157
leaq -0x230(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3090
jmp 0x4016
leaq -0x28(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
leaq -0x36c(%rbp), %rcx
leaq -0x368(%rbp), %r8
leaq -0x360(%rbp), %r9
leaq -0x358(%rbp), %rdx
movq %rsp, %rax
movq %rdx, (%rax)
leaq 0x130be(%rip), %rsi     # 0x17109
xorl %eax, %eax
leaq -0x370(%rbp), %rdx
movq %rdx, -0x418(%rbp)
callq 0x3290
leaq -0x338(%rbp), %rax
movq %rax, -0x420(%rbp)
leaq -0x391(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x34e0
movq -0x418(%rbp), %rsi
movq -0x410(%rbp), %rdx
leaq -0x390(%rbp), %rdi
callq 0x33d0
jmp 0x409d
movq -0x420(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x64b0
movq %rax, -0x428(%rbp)
jmp 0x40b9
movq -0x428(%rbp), %rax
movq -0x370(%rbp), %rcx
movq %rcx, (%rax)
movq -0x368(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x360(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x358(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x390(%rbp), %rdi
callq 0x31c0
leaq -0x391(%rbp), %rdi
callq 0x3310
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0x3ff2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x4149
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x31c0
leaq -0x391(%rbp), %rdi
callq 0x3310
jmp 0x4181
movq -0x3a0(%rbp), %rdi
addq $0xd60, %rdi            # imm = 0xD60
leaq -0x348(%rbp), %rsi
callq 0x6590
jmp 0x4173
leaq -0x348(%rbp), %rdi
callq 0x6600
jmp 0x418f
leaq -0x348(%rbp), %rdi
callq 0x6600
jmp 0x41c0
jmp 0x3b3a
leaq -0x230(%rbp), %rdi
callq 0x30a0
jmp 0x41a2
leaq -0x230(%rbp), %rdi
callq 0x30f0
leaq -0x28(%rbp), %rdi
callq 0x31c0
addq $0x450, %rsp            # imm = 0x450
popq %rbp
retq
leaq -0x230(%rbp), %rdi
callq 0x30f0
leaq -0x28(%rbp), %rdi
callq 0x31c0
movq -0x238(%rbp), %rdi
callq 0x34d0
nopw %cs:(%rax,%rax)