// File: /workspace/github_cpp_makefile_star2_O1/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 0x4e341
movl %eax, %r14d
movl 0x9f0c0(%rbx), %edx
leaq 0x34088(%rip), %rsi     # 0x6ef10
movl $0x3, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x4ded0
cmpl $0x0, 0xc(%rbx)
je 0x3aeba
leaq 0x9b9d0(%rbx), %rdi
movl 0x9f0c0(%rbx), %ecx
leaq 0x3407f(%rip), %rsi     # 0x6ef2f
movl %r14d, %edx
xorl %eax, %eax
callq 0x8120
leaq 0x9fd48(%rbx), %rdi
leaq 0x34077(%rip), %rsi     # 0x6ef3f
callq 0x8160
testq %rax, %rax
je 0x3af07
callq 0x4febe
movq %rax, %rdi
callq 0x5040e
leaq -0x28(%rbp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x4fc2d
movl (%r15), %r15d
callq 0x8ad0
movl %r15d, %edi
callq 0x4fbc6
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
xorl %r15d, %r15d
leal -0x3e9(%r14), %r12d
cmpl $0x106, %r12d           # imm = 0x106
ja 0x3af34
leaq 0x337bf(%rip), %rax     # 0x6e6e0
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3af8e
leal -0xb(%r14), %eax
cmpl $0x3, %eax
ja 0x3afcd
leaq 0x33788(%rip), %rcx     # 0x6e6d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b4a2
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3af8e
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3af8e
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3af8e
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3af8e
movq %rbx, %rdi
movl $0x10, %esi
callq 0x415d3
jmp 0x3b4a7
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x42e21
jmp 0x3afb2
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x43167
testl %eax, %eax
js 0x3afe4
xorl %r15d, %r15d
cmpl $0x0, -0x24(%rbp)
sete %r15b
movl %r15d, 0x9bdd0(%rbx)
jmp 0x3b4aa
cmpl $0x3f, %r14d
jne 0x3b4aa
movq %rbx, %rdi
callq 0x3fa72
jmp 0x3b4a7
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x3b4aa
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b382
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b439
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b448
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b382
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b382
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b47f
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b3c7
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b3b5
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b409
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b457
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3b382
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b470
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3b3ed
leaq 0x34a69(%rip), %rsi     # 0x6fb08
jmp 0x3b348
leaq 0x343ca(%rip), %rsi     # 0x6f475
jmp 0x3b348
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b409
leaq 0x344a5(%rip), %rsi     # 0x6f569
jmp 0x3b348
movq %rbx, %rdi
callq 0x3ebc5
jmp 0x3b4a7
leaq 0x34469(%rip), %rsi     # 0x6f546
jmp 0x3b348
movq %rbx, %rdi
callq 0x3def0
jmp 0x3b4a7
leaq 0x342db(%rip), %rsi     # 0x6f3d1
jmp 0x3b348
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b448
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b470
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b3c7
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b409
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b470
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b3ed
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3b47f
leaq 0x342f5(%rip), %rsi     # 0x6f452
jmp 0x3b348
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b457
movq %rbx, %rdi
callq 0x3e071
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b448
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b439
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b3b5
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b3c7
leaq 0x343d5(%rip), %rsi     # 0x6f58c
jmp 0x3b348
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b470
leaq 0x3412f(%rip), %rsi     # 0x6f2ff
jmp 0x3b348
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b439
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b3ed
movq %rbx, %rdi
callq 0x3d673
jmp 0x3b4a7
leaq 0x34142(%rip), %rsi     # 0x6f345
jmp 0x3b348
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b3b5
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b409
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b47f
leaq 0x342ed(%rip), %rsi     # 0x6f523
jmp 0x3b348
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b47f
movq %rbx, %rdi
callq 0x3b857
jmp 0x3b4a7
movq %rbx, %rdi
callq 0x3cf02
jmp 0x3b4a7
movq %rbx, %rdi
callq 0x3c27c
jmp 0x3b4a7
movq %rbx, %rdi
callq 0x3e46f
jmp 0x3b4a7
leaq 0x3409f(%rip), %rsi     # 0x6f322
jmp 0x3b348
leaq 0x340fc(%rip), %rsi     # 0x6f38b
jmp 0x3b348
leaq 0x340cd(%rip), %rsi     # 0x6f368
jmp 0x3b348
movq %rbx, %rdi
callq 0x3c000
jmp 0x3b4a7
movq %rbx, %rdi
callq 0x3bdb4
jmp 0x3b4a7
movq %rbx, %rdi
callq 0x3b4f4
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b409
movq %rbx, %rdi
callq 0x3c3ec
jmp 0x3b4a7
leaq 0x340c6(%rip), %rsi     # 0x6f3ae
jmp 0x3b348
movq %rbx, %rdi
callq 0x3c5df
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b3b5
movq %rbx, %rdi
callq 0x3c962
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b3ed
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3b470
movq %rbx, %rdi
callq 0x3f2d2
jmp 0x3b4a7
leaq 0x34159(%rip), %rsi     # 0x6f498
jmp 0x3b348
leaq 0x341b8(%rip), %rsi     # 0x6f500
xorl %r15d, %r15d
movl $0x2, %edi
xorl %eax, %eax
callq 0x4ded0
jmp 0x3b4aa
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3b3c7
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b3b5
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b382
movq %rbx, %rdi
movl $0x1, %esi
callq 0x40238
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b439
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b3c7
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b3ed
movq %rbx, %rdi
movl $0x20, %esi
callq 0x40c71
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x10, %esi
callq 0x41a3d
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b448
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x3b457
movq %rbx, %rdi
movl $0x10, %esi
callq 0x41396
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b439
movq %rbx, %rdi
movl $0x20, %esi
callq 0x4233f
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b448
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x3b457
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b457
movq %rbx, %rdi
movl $0x20, %esi
callq 0x41641
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x20, %esi
callq 0x408c4
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x20, %esi
callq 0x4116a
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x3b47f
movq %rbx, %rdi
movl $0x20, %esi
callq 0x41f4a
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x2, %esi
callq 0x4063c
jmp 0x3b4a7
movq %rbx, %rdi
movl $0x10, %esi
jmp 0x3b4a2
movq %rbx, %rdi
movl $0x20, %esi
jmp 0x3b4a2
movq %rbx, %rdi
movl $0x8, %esi
callq 0x4284c
movl %eax, %r15d
testl %r15d, %r15d
js 0x3b4e4
cmpl $0x12a, %r12d           # imm = 0x12A
ja 0x3b4c1
addl $0xfffffc18, %r14d      # imm = 0xFFFFFC18
jmp 0x3b4d4
leal -0x7d0(%r14), %eax
cmpl $0x63, %eax
ja 0x3b4de
addl $0xfffff95c, %r14d      # imm = 0xFFFFF95C
incl 0x9f708(%rbx,%r14,4)
jmp 0x3b4e4
incl 0x9f708(%rbx)
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq