// File: DoubleString[P]RtConverter/src/Rnxobs/Com.cpp
// Function: bamboo::getfreq(char, char*, int, double*)
void getfreq(char csys, char* freq, int ifreq, double* val) {
	switch (csys) {
	case 'G':
		if (strstr(freq, "L1") != NULL)
			*val = GPS_L1;
		else if (strstr(freq, "L2") != NULL)
			*val = GPS_L2;
		else if (strstr(freq, "L5") != NULL)
			*val = GPS_L5;
		else {
			printf("freq = %s,unknow frequency for GPS",freq);
			exit(1);
		}
		break;
	case 'R':
		if (strstr(freq, "L1") != NULL)
			*val = GLS_L1 + ifreq * GLS_dL1;
		else if (strstr(freq, "L2") != NULL)
			*val = GLS_L2 + ifreq * GLS_dL2;
		else {
			printf("freq = %s,unknow frequency for GLONASS",freq);
			exit(1);
		}
		break;
	case 'E':
		if (strstr(freq, "L1") != NULL)
			*val = GAL_E1;
		else if (strstr(freq, "L8") != NULL)
			*val = GAL_E5;
		else if (strstr(freq, "L6") != NULL)
			*val = GAL_E6;
		else if (strstr(freq, "L5") != NULL)
			*val = GAL_E5a;
		else if (strstr(freq, "L7") != NULL)
			*val = GAL_E5b;
		else {
			printf("freq = %s,unknow frequency for GALILEO",freq);
			exit(1);
		}
		break;
	case 'C':
		if (strstr(freq, "L1") != NULL || strstr(freq, "L2") != NULL)
			*val = BDS_B1;
		else if (strstr(freq, "L7") != NULL)
			*val = BDS_B2;
		else if (strstr(freq, "L6") != NULL)
			*val = BDS_B3;
		else {
			printf("freq = %s,unknow frequency for BDS",freq);
			exit(1);
		}
		break;
	case 'J':
		if (strstr(freq, "L1") != NULL)
			*val = QZS_L1;
		else if (strstr(freq, "L2") != NULL)
			*val = QZS_L2;
		else if (strstr(freq, "L5") != NULL)
			*val = QZS_L5;
		else if (strstr(freq, "L6") != NULL)
			*val = QZS_LEX;
		else {
			printf("freq = %s,unknow frequency for QZSS",freq);
			exit(1);
		}
		break;
	default:
		printf("freq = %s,unknow frequency",freq);
		exit(1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movsbl -0x1(%rbp), %eax
addl $-0x43, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xf, %eax
ja 0x366de
movq -0x28(%rbp), %rax
leaq 0x86ce6(%rip), %rcx     # 0xbd010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
leaq 0x86f8a(%rip), %rsi     # 0xbd2c8
callq 0x91b0
cmpq $0x0, %rax
je 0x3635b
movq -0x20(%rbp), %rax
movsd 0x86b4b(%rip), %xmm0    # 0xbcea0
movsd %xmm0, (%rax)
jmp 0x363cb
movq -0x10(%rbp), %rdi
leaq 0x86f65(%rip), %rsi     # 0xbd2cb
callq 0x91b0
cmpq $0x0, %rax
je 0x36383
movq -0x20(%rbp), %rax
movsd 0x86b1b(%rip), %xmm0    # 0xbce98
movsd %xmm0, (%rax)
jmp 0x363c9
movq -0x10(%rbp), %rdi
leaq 0x86f40(%rip), %rsi     # 0xbd2ce
callq 0x91b0
cmpq $0x0, %rax
je 0x363ab
movq -0x20(%rbp), %rax
movsd 0x86aeb(%rip), %xmm0    # 0xbce90
movsd %xmm0, (%rax)
jmp 0x363c7
movq -0x10(%rbp), %rsi
leaq 0x86f1b(%rip), %rdi     # 0xbd2d1
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
jmp 0x363c9
jmp 0x363cb
jmp 0x366fa
movq -0x10(%rbp), %rdi
leaq 0x86eed(%rip), %rsi     # 0xbd2c8
callq 0x91b0
cmpq $0x0, %rax
je 0x3640d
cvtsi2sdl -0x14(%rbp), %xmm0
movsd 0x86ae5(%rip), %xmm1    # 0xbced8
mulsd %xmm1, %xmm0
movsd 0x86ae1(%rip), %xmm1    # 0xbcee0
addsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x36468
movq -0x10(%rbp), %rdi
leaq 0x86eb3(%rip), %rsi     # 0xbd2cb
callq 0x91b0
cmpq $0x0, %rax
je 0x3644a
cvtsi2sdl -0x14(%rbp), %xmm0
movsd 0x86a98(%rip), %xmm1    # 0xbcec8
mulsd %xmm1, %xmm0
movsd 0x86a94(%rip), %xmm1    # 0xbced0
addsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x36466
movq -0x10(%rbp), %rsi
leaq 0x86e9f(%rip), %rdi     # 0xbd2f4
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
jmp 0x36468
jmp 0x366fa
movq -0x10(%rbp), %rdi
leaq 0x86e50(%rip), %rsi     # 0xbd2c8
callq 0x91b0
cmpq $0x0, %rax
je 0x36498
movq -0x20(%rbp), %rax
movsd 0x86a11(%rip), %xmm0    # 0xbcea0
movsd %xmm0, (%rax)
jmp 0x3655f
movq -0x10(%rbp), %rdi
leaq 0x86e78(%rip), %rsi     # 0xbd31b
callq 0x91b0
cmpq $0x0, %rax
je 0x364c3
movq -0x20(%rbp), %rax
movsd 0x86a06(%rip), %xmm0    # 0xbcec0
movsd %xmm0, (%rax)
jmp 0x3655d
movq -0x10(%rbp), %rdi
leaq 0x86e50(%rip), %rsi     # 0xbd31e
callq 0x91b0
cmpq $0x0, %rax
je 0x364eb
movq -0x20(%rbp), %rax
movsd 0x869a3(%rip), %xmm0    # 0xbce88
movsd %xmm0, (%rax)
jmp 0x3655b
movq -0x10(%rbp), %rdi
leaq 0x86dd8(%rip), %rsi     # 0xbd2ce
callq 0x91b0
cmpq $0x0, %rax
je 0x36513
movq -0x20(%rbp), %rax
movsd 0x86983(%rip), %xmm0    # 0xbce90
movsd %xmm0, (%rax)
jmp 0x36559
movq -0x10(%rbp), %rdi
leaq 0x86e03(%rip), %rsi     # 0xbd321
callq 0x91b0
cmpq $0x0, %rax
je 0x3653b
movq -0x20(%rbp), %rax
movsd 0x8697b(%rip), %xmm0    # 0xbceb0
movsd %xmm0, (%rax)
jmp 0x36557
movq -0x10(%rbp), %rsi
leaq 0x86dde(%rip), %rdi     # 0xbd324
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
jmp 0x36559
jmp 0x3655b
jmp 0x3655d
jmp 0x3655f
jmp 0x366fa
movq -0x10(%rbp), %rdi
leaq 0x86d59(%rip), %rsi     # 0xbd2c8
callq 0x91b0
cmpq $0x0, %rax
jne 0x36590
movq -0x10(%rbp), %rdi
leaq 0x86d46(%rip), %rsi     # 0xbd2cb
callq 0x91b0
cmpq $0x0, %rax
je 0x365a2
movq -0x20(%rbp), %rax
movsd 0x8691c(%rip), %xmm0    # 0xbceb8
movsd %xmm0, (%rax)
jmp 0x36612
movq -0x10(%rbp), %rdi
leaq 0x86d74(%rip), %rsi     # 0xbd321
callq 0x91b0
cmpq $0x0, %rax
je 0x365ca
movq -0x20(%rbp), %rax
movsd 0x868ec(%rip), %xmm0    # 0xbceb0
movsd %xmm0, (%rax)
jmp 0x36610
movq -0x10(%rbp), %rdi
leaq 0x86d49(%rip), %rsi     # 0xbd31e
callq 0x91b0
cmpq $0x0, %rax
je 0x365f2
movq -0x20(%rbp), %rax
movsd 0x868bc(%rip), %xmm0    # 0xbcea8
movsd %xmm0, (%rax)
jmp 0x3660e
movq -0x10(%rbp), %rsi
leaq 0x86d4e(%rip), %rdi     # 0xbd34b
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
jmp 0x36610
jmp 0x36612
jmp 0x366fa
movq -0x10(%rbp), %rdi
leaq 0x86ca6(%rip), %rsi     # 0xbd2c8
callq 0x91b0
cmpq $0x0, %rax
je 0x36642
movq -0x20(%rbp), %rax
movsd 0x86867(%rip), %xmm0    # 0xbcea0
movsd %xmm0, (%rax)
jmp 0x366dc
movq -0x10(%rbp), %rdi
leaq 0x86c7e(%rip), %rsi     # 0xbd2cb
callq 0x91b0
cmpq $0x0, %rax
je 0x3666a
movq -0x20(%rbp), %rax
movsd 0x86834(%rip), %xmm0    # 0xbce98
movsd %xmm0, (%rax)
jmp 0x366da
movq -0x10(%rbp), %rdi
leaq 0x86c59(%rip), %rsi     # 0xbd2ce
callq 0x91b0
cmpq $0x0, %rax
je 0x36692
movq -0x20(%rbp), %rax
movsd 0x86804(%rip), %xmm0    # 0xbce90
movsd %xmm0, (%rax)
jmp 0x366d8
movq -0x10(%rbp), %rdi
leaq 0x86c81(%rip), %rsi     # 0xbd31e
callq 0x91b0
cmpq $0x0, %rax
je 0x366ba
movq -0x20(%rbp), %rax
movsd 0x867d4(%rip), %xmm0    # 0xbce88
movsd %xmm0, (%rax)
jmp 0x366d6
movq -0x10(%rbp), %rsi
leaq 0x86ca9(%rip), %rdi     # 0xbd36e
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
jmp 0x366d8
jmp 0x366da
jmp 0x366dc
jmp 0x366fa
movq -0x10(%rbp), %rsi
leaq 0x86ca9(%rip), %rdi     # 0xbd392
movb $0x0, %al
callq 0x9090
movl $0x1, %edi
callq 0x9910
addq $0x30, %rsp
popq %rbp
retq