// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_rtcm3(bamboo::rtcm_t*)
extern int decode_rtcm3(rtcm_t *rtcm)
{
    double tow;
    int ret=0,type=getbitu(rtcm->buff,24,12),week;
    
    trace(3,"decode_rtcm3: len=%3d type=%d\n",rtcm->len,type);
    
    if (rtcm->outtype) {
        sprintf(rtcm->msgtype,"RTCM %4d (%4d):",type,rtcm->len);
    }
    /* real-time input option */
    if (strstr(rtcm->opt,"-RT_INP")) {
        tow=time2gpst(utc2gpst(timeget()),&week);
        rtcm->time=gpst2time(week,floor(tow));
    }
    switch (type) {
        case 1001: ret=decode_type1001(rtcm); break; /* not supported */
        case 1002: ret=decode_type1002(rtcm); break;
        case 1003: ret=decode_type1003(rtcm); break; /* not supported */
        case 1004: ret=decode_type1004(rtcm); break;
        case 1005: ret=decode_type1005(rtcm); break;
        case 1006: ret=decode_type1006(rtcm); break;
        case 1007: ret=decode_type1007(rtcm); break;
        case 1008: ret=decode_type1008(rtcm); break;
        case 1009: ret=decode_type1009(rtcm); break; /* not supported */
        case 1010: ret=decode_type1010(rtcm); break;
        case 1011: ret=decode_type1011(rtcm); break; /* not supported */
        case 1012: ret=decode_type1012(rtcm); break;
        case 1013: ret=decode_type1013(rtcm); break; /* not supported */
        case 1019: ret=decode_type1019(rtcm); break;
        case 1020: ret=decode_type1020(rtcm); break;
        case 1021: ret=decode_type1021(rtcm); break; /* not supported */
        case 1022: ret=decode_type1022(rtcm); break; /* not supported */
        case 1023: ret=decode_type1023(rtcm); break; /* not supported */
        case 1024: ret=decode_type1024(rtcm); break; /* not supported */
        case 1025: ret=decode_type1025(rtcm); break; /* not supported */
        case 1026: ret=decode_type1026(rtcm); break; /* not supported */
        case 1027: ret=decode_type1027(rtcm); break; /* not supported */
        case 1029: ret=decode_type1029(rtcm); break;
        case 1030: ret=decode_type1030(rtcm); break; /* not supported */
        case 1031: ret=decode_type1031(rtcm); break; /* not supported */
        case 1032: ret=decode_type1032(rtcm); break; /* not supported */
        case 1033: ret=decode_type1033(rtcm); break;
        case 1034: ret=decode_type1034(rtcm); break; /* not supported */
        case 1035: ret=decode_type1035(rtcm); break; /* not supported */
        case 1037: ret=decode_type1037(rtcm); break; /* not supported */
        case 1038: ret=decode_type1038(rtcm); break; /* not supported */
        case 1039: ret=decode_type1039(rtcm); break; /* not supported */
        case 1044: ret=decode_type1044(rtcm); break;
        case 1045: ret=decode_type1045(rtcm); break;
        case 1046: ret=decode_type1046(rtcm); break;
        case   63: ret=decode_type1042(rtcm); break; /* RTCM draft */
        case 1042: ret=decode_type1042(rtcm); break;
        case 1057: ret=decode_ssr1(rtcm,SYS_GPS); break;
        case 1058: ret=decode_ssr2(rtcm,SYS_GPS); break;
        case 1059: ret=decode_ssr3(rtcm,SYS_GPS); break;
        case 1060: ret=decode_ssr4(rtcm,SYS_GPS); break;
        case 1061: ret=decode_ssr5(rtcm,SYS_GPS); break;
        case 1062: ret=decode_ssr6(rtcm,SYS_GPS); break;
        case 1063: ret=decode_ssr1(rtcm,SYS_GLO); break;
        case 1064: ret=decode_ssr2(rtcm,SYS_GLO); break;
        case 1065: ret=decode_ssr3(rtcm,SYS_GLO); break;
        case 1066: ret=decode_ssr4(rtcm,SYS_GLO); break;
        case 1067: ret=decode_ssr5(rtcm,SYS_GLO); break;
        case 1068: ret=decode_ssr6(rtcm,SYS_GLO); break;
        case 1071: ret=decode_msm0(rtcm,SYS_GPS); break; /* not supported */
        case 1072: ret=decode_msm0(rtcm,SYS_GPS); break; /* not supported */
        case 1073: ret=decode_msm0(rtcm,SYS_GPS); break; /* not supported */
        case 1074: ret=decode_msm4(rtcm,SYS_GPS); break;
        case 1075: ret=decode_msm5(rtcm,SYS_GPS); break;
        case 1076: ret=decode_msm6(rtcm,SYS_GPS); break;
        case 1077: ret=decode_msm7(rtcm,SYS_GPS); break;
        case 1081: ret=decode_msm0(rtcm,SYS_GLO); break; /* not supported */
        case 1082: ret=decode_msm0(rtcm,SYS_GLO); break; /* not supported */
        case 1083: ret=decode_msm0(rtcm,SYS_GLO); break; /* not supported */
        case 1084: ret=decode_msm4(rtcm,SYS_GLO); break;
        case 1085: ret=decode_msm5(rtcm,SYS_GLO); break;
        case 1086: ret=decode_msm6(rtcm,SYS_GLO); break;
        case 1087: ret=decode_msm7(rtcm,SYS_GLO); break;
        case 1091: ret=decode_msm0(rtcm,SYS_GAL); break; /* not supported */
        case 1092: ret=decode_msm0(rtcm,SYS_GAL); break; /* not supported */
        case 1093: ret=decode_msm0(rtcm,SYS_GAL); break; /* not supported */
        case 1094: ret=decode_msm4(rtcm,SYS_GAL); break;
        case 1095: ret=decode_msm5(rtcm,SYS_GAL); break;
        case 1096: ret=decode_msm6(rtcm,SYS_GAL); break;
        case 1097: ret=decode_msm7(rtcm,SYS_GAL); break;
        case 1101: ret=decode_msm0(rtcm,SYS_SBS); break; /* not supported */
        case 1102: ret=decode_msm0(rtcm,SYS_SBS); break; /* not supported */
        case 1103: ret=decode_msm0(rtcm,SYS_SBS); break; /* not supported */
        case 1104: ret=decode_msm4(rtcm,SYS_SBS); break;
        case 1105: ret=decode_msm5(rtcm,SYS_SBS); break;
        case 1106: ret=decode_msm6(rtcm,SYS_SBS); break;
        case 1107: ret=decode_msm7(rtcm,SYS_SBS); break;
        case 1111: ret=decode_msm0(rtcm,SYS_QZS); break; /* not supported */
        case 1112: ret=decode_msm0(rtcm,SYS_QZS); break; /* not supported */
        case 1113: ret=decode_msm0(rtcm,SYS_QZS); break; /* not supported */
        case 1114: ret=decode_msm4(rtcm,SYS_QZS); break;
        case 1115: ret=decode_msm5(rtcm,SYS_QZS); break;
        case 1116: ret=decode_msm6(rtcm,SYS_QZS); break;
        case 1117: ret=decode_msm7(rtcm,SYS_QZS); break;
        case 1121: ret=decode_msm0(rtcm,SYS_CMP); break; /* not supported */
        case 1122: ret=decode_msm0(rtcm,SYS_CMP); break; /* not supported */
        case 1123: ret=decode_msm0(rtcm,SYS_CMP); break; /* not supported */
        case 1124: ret=decode_msm4(rtcm,SYS_CMP); break;
        case 1125: ret=decode_msm5(rtcm,SYS_CMP); break;
        case 1126: ret=decode_msm6(rtcm,SYS_CMP); break;
        case 1127: ret=decode_msm7(rtcm,SYS_CMP); break;
        case 1230: ret=decode_type1230(rtcm);     break; /* not supported */
        case 1240: ret=decode_ssr1(rtcm,SYS_GAL); break;
        case 1241: ret=decode_ssr2(rtcm,SYS_GAL); break;
        case 1242: ret=decode_ssr3(rtcm,SYS_GAL); break;
        case 1243: ret=decode_ssr4(rtcm,SYS_GAL); break;
        case 1244: ret=decode_ssr5(rtcm,SYS_GAL); break;
        case 1245: ret=decode_ssr6(rtcm,SYS_GAL); break;
        case 1246: ret=decode_ssr1(rtcm,SYS_QZS); break;
        case 1247: ret=decode_ssr2(rtcm,SYS_QZS); break;
        case 1248: ret=decode_ssr3(rtcm,SYS_QZS); break;
        case 1249: ret=decode_ssr4(rtcm,SYS_QZS); break;
        case 1250: ret=decode_ssr5(rtcm,SYS_QZS); break;
        case 1251: ret=decode_ssr6(rtcm,SYS_QZS); break;
        case 1252: ret=decode_ssr1(rtcm,SYS_SBS); break;
        case 1253: ret=decode_ssr2(rtcm,SYS_SBS); break;
        case 1254: ret=decode_ssr3(rtcm,SYS_SBS); break;
        case 1255: ret=decode_ssr4(rtcm,SYS_SBS); break;
        case 1256: ret=decode_ssr5(rtcm,SYS_SBS); break;
        case 1257: ret=decode_ssr6(rtcm,SYS_SBS); break;
        case 1258: ret=decode_ssr1(rtcm,SYS_CMP); break;
        case 1259: ret=decode_ssr2(rtcm,SYS_CMP); break;
        case 1260: ret=decode_ssr3(rtcm,SYS_CMP); break;
        case 1261: ret=decode_ssr4(rtcm,SYS_CMP); break;
        case 1262: ret=decode_ssr5(rtcm,SYS_CMP); break;
        case 1263: ret=decode_ssr6(rtcm,SYS_CMP); break;
        case   11: ret=decode_ssr7(rtcm,SYS_GLO); break; /* tentative */
        case   12: ret=decode_ssr7(rtcm,SYS_GAL); break; /* tentative */
        case   13: ret=decode_ssr7(rtcm,SYS_QZS); break; /* tentative */
        case   14: ret=decode_ssr7(rtcm,SYS_CMP); break; /* tentative */
    }
    if (ret>=0) {
        type-=1000;
        if      (   1<=type&&type<= 299) rtcm->nmsg3[type    ]++; /* 1001-1299 */
        else if (1000<=type&&type<=1099) rtcm->nmsg3[type-700]++; /* 2000-2099 */
        else rtcm->nmsg3[0]++;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl $0x18, %esi
movl $0xc, %edx
callq 0x4d9d6
movl %eax, %r14d
movl 0x9f0c0(%rbx), %edx
leaq 0x346dc(%rip), %rsi     # 0x6ef10
movl $0x3, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x4d55d
cmpl $0x0, 0xc(%rbx)
je 0x3a866
leaq 0x9b9d0(%rbx), %rdi
movl 0x9f0c0(%rbx), %ecx
leaq 0x346d3(%rip), %rsi     # 0x6ef2f
movl %r14d, %edx
xorl %eax, %eax
callq 0x8120
leaq 0x9fd48(%rbx), %rdi
leaq 0x346cb(%rip), %rsi     # 0x6ef3f
callq 0x8160
testq %rax, %rax
je 0x3a8b3
callq 0x4f542
movq %rax, %rdi
callq 0x4fa70
leaq -0x28(%rbp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x4f2b1
movl (%r15), %r15d
callq 0x8ac0
movl %r15d, %edi
callq 0x4f24a
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
xorl %r15d, %r15d
leal -0x3e9(%r14), %r12d
cmpl $0x106, %r12d           # imm = 0x106
ja 0x3a8e0
leaq 0x33e13(%rip), %rax     # 0x6e6e0
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3a93a
leal -0xb(%r14), %eax
cmpl $0x3, %eax
ja 0x3a979
leaq 0x33ddc(%rip), %rcx     # 0x6e6d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ae4e
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3a93a
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3a93a
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3a93a
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3a93a
movq %rbx, %rdi
movl $0x10, %esi
callq 0x40efa
jmp 0x3ae53
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x4257c
jmp 0x3a95e
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x428c3
testl %eax, %eax
js 0x3a990
xorl %r15d, %r15d
cmpl $0x0, -0x24(%rbp)
sete %r15b
movl %r15d, 0x9bdd0(%rbx)
jmp 0x3ae56
cmpl $0x3f, %r14d
jne 0x3ae5b
movq %rbx, %rdi
callq 0x3f3b2
jmp 0x3ae53
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x3ae56
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ad2e
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ade5
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3adf4
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ad2e
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ad2e
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ae2b
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ad73
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ad61
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3adb5
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ae03
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3ad2e
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ae1c
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3ad99
leaq 0x350bd(%rip), %rsi     # 0x6fb08
jmp 0x3acf4
leaq 0x34a1e(%rip), %rsi     # 0x6f475
jmp 0x3acf4
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3adb5
leaq 0x34af9(%rip), %rsi     # 0x6f569
jmp 0x3acf4
movq %rbx, %rdi
callq 0x3e503
jmp 0x3ae53
leaq 0x34abd(%rip), %rsi     # 0x6f546
jmp 0x3acf4
movq %rbx, %rdi
callq 0x3d830
jmp 0x3ae53
leaq 0x3492f(%rip), %rsi     # 0x6f3d1
jmp 0x3acf4
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3adf4
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ae1c
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ad73
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3adb5
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ae1c
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ad99
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3ae2b
leaq 0x34949(%rip), %rsi     # 0x6f452
jmp 0x3acf4
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ae03
movq %rbx, %rdi
callq 0x3d9b5
jmp 0x3ae53
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3adf4
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ade5
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ad61
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ad73
leaq 0x34a29(%rip), %rsi     # 0x6f58c
jmp 0x3acf4
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ae1c
leaq 0x34783(%rip), %rsi     # 0x6f2ff
jmp 0x3acf4
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ade5
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ad99
movq %rbx, %rdi
callq 0x3cfb0
jmp 0x3ae53
leaq 0x34796(%rip), %rsi     # 0x6f345
jmp 0x3acf4
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ad61
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3adb5
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ae2b
leaq 0x34941(%rip), %rsi     # 0x6f523
jmp 0x3acf4
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ae2b
movq %rbx, %rdi
callq 0x3b1f1
jmp 0x3ae53
movq %rbx, %rdi
callq 0x3c845
jmp 0x3ae53
movq %rbx, %rdi
callq 0x3bbf9
jmp 0x3ae53
movq %rbx, %rdi
callq 0x3ddb3
jmp 0x3ae53
leaq 0x346f3(%rip), %rsi     # 0x6f322
jmp 0x3acf4
leaq 0x34750(%rip), %rsi     # 0x6f38b
jmp 0x3acf4
leaq 0x34721(%rip), %rsi     # 0x6f368
jmp 0x3acf4
movq %rbx, %rdi
callq 0x3b97d
jmp 0x3ae53
movq %rbx, %rdi
callq 0x3b731
jmp 0x3ae53
movq %rbx, %rdi
callq 0x3aea8
jmp 0x3ae53
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3adb5
movq %rbx, %rdi
callq 0x3bd69
jmp 0x3ae53
leaq 0x3471a(%rip), %rsi     # 0x6f3ae
jmp 0x3acf4
movq %rbx, %rdi
callq 0x3bf5c
jmp 0x3ae53
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ad61
movq %rbx, %rdi
callq 0x3c2c5
jmp 0x3ae53
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ad99
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3ae1c
movq %rbx, %rdi
callq 0x3ec09
jmp 0x3ae53
leaq 0x347ad(%rip), %rsi     # 0x6f498
jmp 0x3acf4
leaq 0x3480c(%rip), %rsi     # 0x6f500
xorl %r15d, %r15d
movl $0x2, %edi
xorl %eax, %eax
callq 0x4d55d
jmp 0x3ae64
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3ad73
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ad61
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ad2e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3fb6e
jmp 0x3ae53
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ade5
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ad73
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ad99
movq %rbx, %rdi
movl $0x20, %esi
callq 0x405b5
jmp 0x3ae53
movq %rbx, %rdi
movl $0x10, %esi
callq 0x412fe
jmp 0x3ae53
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3adf4
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3ae03
movq %rbx, %rdi
movl $0x10, %esi
callq 0x40cc3
jmp 0x3ae53
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ade5
movq %rbx, %rdi
movl $0x20, %esi
callq 0x41b27
jmp 0x3ae53
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3adf4
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3ae03
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ae03
movq %rbx, %rdi
movl $0x20, %esi
callq 0x40f68
jmp 0x3ae53
movq %rbx, %rdi
movl $0x20, %esi
callq 0x4021b
jmp 0x3ae53
movq %rbx, %rdi
movl $0x20, %esi
callq 0x40a9d
jmp 0x3ae53
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3ae2b
movq %rbx, %rdi
movl $0x20, %esi
callq 0x41787
jmp 0x3ae53
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3ff95
jmp 0x3ae53
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3ae4e
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3ae4e
movq %rbx, %rdi
movl $0x8, %esi
callq 0x41fba
movl %eax, %r15d
testl %r15d, %r15d
js 0x3ae6d
cmpl $0x12b, %r12d           # imm = 0x12B
jae 0x3ae75
addl $0xfffffc18, %r14d      # imm = 0xFFFFFC18
jmp 0x3ae88
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x3ae98
leal -0x7d0(%r14), %eax
cmpl $0x63, %eax
ja 0x3ae92
addl $0xfffff95c, %r14d      # imm = 0xFFFFF95C
incl 0x9f708(%rbx,%r14,4)
jmp 0x3ae98
incl 0x9f708(%rbx)
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq