// File: /workspace/github_c_makefile_star2_O1/hiperiondev[P]hpsdrsim/src/hpsdr_sim.c
// Function: process_ep2
void process_ep2(uint8_t *frame) {
    uint16_t data;
    int rc;
    int mod;

    chk_data(frame[0] & 1, ptt, "PTT", ep2_ptt);
    switch (frame[0]) {
    case 0:
    case 1:
        chk_data((frame[1] & 0x03) >> 0, rate, "SampleRate", ep2_samplerate);
        chk_data((frame[1] & 0x0C) >> 3, ref10, "Ref10MHz", ep2_ref10mhz);
        chk_data((frame[1] & 0x10) >> 4, src122, "Source122MHz", ep2_src122mhz);
        chk_data((frame[1] & 0x60) >> 5, PMconfig, "Penelope/Mercury config", ep2_pm_config);
        chk_data((frame[1] & 0x80) >> 7, MicSrc, "MicSource", ep2_micsrc);

        chk_data(frame[2] & 1, TX_class_E, "TX CLASS-E", ep2_txclasse);
        chk_data((frame[2] & 0xfe) >> 1, OpenCollectorOutputs, "OpenCollector", ep2_opencollector);

        chk_data(((frame[4] >> 3) & 7) + 1, receivers, "RECEIVERS", ep2_receivers);
        chk_data(((frame[4] >> 6) & 1), MicTS, "TimeStampMic", ep2_timestampmic);
        chk_data(((frame[4] >> 7) & 1), CommonMercuryFreq, "Common Mercury Freq", ep2_commonmercuryfreq);

        mod = 0;
        rc = frame[3] & 0x03;
        if (rc != AlexAtt) {
            mod = 1;
            AlexAtt = rc;
        }
        rc = (frame[3] & 0x04) >> 2;
        if (rc != preamp) {
            mod = 1;
            preamp = rc;
        }
        rc = (frame[3] & 0x08) >> 3;
        if (rc != LTdither) {
            mod = 1;
            LTdither = rc;
        }
        rc = (frame[3] & 0x10) >> 4;
        if (rc != LTrandom) {
            mod = 1;
            LTrandom = rc;
        }
        if (mod)
            dbg_printf(1, "AlexAtt=%d Preamp=%d Dither=%d Random=%d\n", AlexAtt, preamp, LTdither, LTrandom);

        mod = 0;
        rc = (frame[3] & 0x60) >> 5;
        if (rc != alexRXant) {
            mod = 1;
            alexRXant = rc;
        }
        rc = (frame[3] & 0x80) >> 7;
        if (rc != alexRXout) {
            mod = 1;
            alexRXout = rc;
        }
        rc = (frame[4] >> 0) & 3;
        if (rc != AlexTXrel) {
            mod = 1;
            AlexTXrel = rc;
        }
        rc = (frame[4] >> 2) & 1;
        if (rc != duplex) {
            mod = 1;
            duplex = rc;
        }
        if (mod)
            dbg_printf(1, "RXout=%d RXant=%d TXrel=%d Duplex=%d\n", alexRXout, alexRXant, AlexTXrel, duplex);

        if (OLDDEVICE == DEVICE_C25) {
            // Charly25: has two 18-dB preamps that are switched with "preamp" and "dither"
            //           and two attenuators encoded in Alex-ATT
            //           Both only applies to RX1!
            rxatt_dbl[0] = pow(10.0, -0.05 * (12 * AlexAtt - 18 * LTdither - 18 * preamp));
            rxatt_dbl[1] = 1.0;
        } else {
            // Assume that it has ALEX attenuators in addition to the Step Attenuators
            rxatt_dbl[0] = pow(10.0, -0.05 * (10 * AlexAtt + rx_att[0]));
            rxatt_dbl[1] = 1.0;
        }
        break;

    case 2:
    case 3:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), tx_freq, "TX FREQ", ep2_txfreq);
        break;

    case 4:
    case 5:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[0], "RX FREQ1", ep2_rxfreq1);
        break;

    case 6:
    case 7:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[1], "RX FREQ2", ep2_rxfreq2);
        break;

    case 8:
    case 9:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[2], "RX FREQ3", ep2_rxfreq3);
        break;

    case 10:
    case 11:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[3], "RX FREQ4", ep2_rxfreq4);
        break;

    case 12:
    case 13:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[4], "RX FREQ5", ep2_rxfreq5);
        break;

    case 14:
    case 15:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[5], "RX FREQ6", ep2_rxfreq6);
        break;

    case 16:
    case 17:
        chk_data(frame[4] | (frame[3] << 8) | (frame[2] << 16) | (frame[1] << 24), rx_freq[6], "RX FREQ7", ep2_rxfreq7);
        break;

    case 18:
    case 19:
        chk_data(frame[1], txdrive, "TX DRIVE", ep2_txdrive);
        chk_data(frame[2] & 0x3F, hermes_config, "HERMES CONFIG", ep2_hermesconfig);
        chk_data((frame[2] >> 6) & 0x01, alex_manual, "ALEX manual HPF/LPF", ep2_alexmanhpflpf);
        chk_data((frame[2] >> 7) & 0x01, vna, "VNA mode", ep2_vnamode);
        chk_data(frame[3] & 0x1F, alex_hpf, "ALEX HPF", ep2_alexhpf);
        chk_data((frame[3] >> 5) & 0x01, alex_bypass, "ALEX Bypass HPFs", ep2_alexbyphpfs);
        chk_data((frame[3] >> 6) & 0x01, lna6m, "ALEX 6m LNA", ep2_alex6mlna);
        chk_data((frame[3] >> 7) & 0x01, alexTRdisable, "ALEX T/R disable", ep2_alextrdis);
        chk_data(frame[4], alex_lpf, "ALEX LPF", ep2_alexlpf);
        // reset TX level. Leve a little head-room for noise
        txdrv_dbl = (double) txdrive * 0.00390625;  // div. by. 256
        break;

    case 20:
    case 21:
        chk_data((frame[1] & 0x01) >> 0, rx_preamp[0], "ADC1 preamp", ep2_adc1preamp);
        chk_data((frame[1] & 0x02) >> 1, rx_preamp[1], "ADC2 preamp", ep2_adc2preamp);
        chk_data((frame[1] & 0x04) >> 2, rx_preamp[2], "ADC3 preamp", ep2_adc3preamp);
        chk_data((frame[1] & 0x08) >> 3, rx_preamp[3], "ADC4 preamp", ep2_adc4preamp);
        chk_data((frame[1] & 0x10) >> 4, tip_ring, "TIP/Ring", ep2_tipring);
        chk_data((frame[1] & 0x20) >> 5, MicBias, "MicBias", ep2_micbias);
        chk_data((frame[1] & 0x40) >> 6, MicPTT, "MicPTT", ep2_micptt);

        chk_data((frame[2] & 0x1F) >> 0, LineGain, "LineGain", ep2_linegain);
        chk_data((frame[2] & 0x20) >> 5, MerTxATT0, "Mercury Att on TX/0", ep2_mercuryattontx0);
        chk_data((frame[2] & 0x40) >> 6, PureSignal, "PureSignal", ep2_puresignal);
        chk_data((frame[2] & 0x80) >> 7, PeneSel, "PenelopeSelect", ep2_penelopeselect);

        chk_data((frame[3] & 0x0F) >> 0, MetisDB9, "MetisDB9", ep2_metisdb9);
        chk_data((frame[3] & 0x10) >> 4, MerTxATT1, "Mercury Att on TX/1", ep2_mercuryattontx1);

        if (frame[4] & 0x40) {
            // Some firmware/emulators use bit6 to indicate a 6-bit format
            // for a combined attenuator/preamplifier with the AD9866 chip.
            // The value is between 0 and 60 and formally correspondes to
            // to an RX gain of -12 to +48 dB. However, we set here that
            // a value of +16 (that is, 28 on the 0-60 scale) corresponds to
            // "zero attenuation"
            chk_data(37 - (frame[4] & 0x3F), rx_att[0], "RX1 HL ATT/GAIN", ep2_rx1hlattgain);
        } else {
            chk_data((frame[4] & 0x1F) >> 0, rx_att[0], "RX1 ATT", ep2_rx1att);
            chk_data((frame[4] & 0x20) >> 5, rx1_attE, "RX1 ATT enable", ep2_rx1attenable);
            //
            // Some hardware emulates "switching off ATT and preamp" by setting ATT
            // to 20 dB, because the preamp cannot be switched.
            // if (!rx1_attE) rx_att[0]=20;
        }
        if (OLDDEVICE != DEVICE_C25) {
            // Set RX amplification factors. No switchable preamps available normally.
            rxatt_dbl[0] = pow(10.0, -0.05 * (10 * AlexAtt + rx_att[0]));
            rxatt_dbl[1] = pow(10.0, -0.05 * (rx_att[1]));
            rxatt_dbl[2] = 1.0;
            rxatt_dbl[3] = 1.0;
        }
        break;

    case 22:
    case 23:
        chk_data(frame[1] & 0x1f, rx_att[1], "RX2 ATT", ep2_rx2att);
        chk_data((frame[2] >> 6) & 1, cw_reversed, "CW REV", ep2_cwrev);
        chk_data(frame[3] & 63, cw_speed, "CW SPEED", ep2_cwspeed);
        chk_data((frame[3] >> 6) & 3, cw_mode, "CW MODE", ep2_cw_mode);
        chk_data(frame[4] & 127, cw_weight, "CW WEIGHT", ep2_cwweight);
        chk_data((frame[4] >> 7) & 1, cw_spacing, "CW SPACING", ep2_cwspacing);

        // Set RX amplification factors.
        rxatt_dbl[1] = pow(10.0, -0.05 * (rx_att[1]));
        break;

    case 24:
    case 25:
        data = frame[1];
        data |= frame[2] << 8;
        chk_data((frame[2] << 8) | frame[1], c25_ext_board_i2c_data, "C25 EXT BOARD DATA", ep2_c25extboarddata);
        break;

    case 28:
    case 29:
        chk_data((frame[1] & 0x03) >> 0, rx_adc[0], "RX1 ADC", ep2_rx1adc);
        chk_data((frame[1] & 0x0C) >> 2, rx_adc[1], "RX2 ADC", ep2_rx2adc);
        chk_data((frame[1] & 0x30) >> 4, rx_adc[2], "RX3 ADC", ep2_rx3adc);
        chk_data((frame[1] & 0xC0) >> 6, rx_adc[3], "RX4 ADC", ep2_rx4adc);
        chk_data((frame[2] & 0x03) >> 0, rx_adc[4], "RX5 ADC", ep2_rx5adc);
        chk_data((frame[2] & 0x0C) >> 2, rx_adc[5], "RX6 ADC", ep2_rx6adc);
        chk_data((frame[2] & 0x30) >> 4, rx_adc[6], "RX7 ADC", ep2_rx7adc);
        chk_data((frame[3] & 0x1f), txatt, "TX ATT", ep2_txatt);
        txatt_dbl = pow(10.0, -0.05 * (double) txatt);
        if (OLDDEVICE == DEVICE_C25) {
            // RedPitaya: Hard-wired ADC settings.
            rx_adc[0] = 0;
            rx_adc[1] = 1;
            rx_adc[2] = 1;
        }
        break;

    case 30:
    case 31:
        chk_data(frame[1] & 1, cw_internal, "CW INT", ep2_cwint);
        chk_data(frame[2], sidetone_volume, "SIDE TONE VOLUME", ep2_sidetonevolume);
        chk_data(frame[3], cw_delay, "CW DELAY", ep2_cwdelay);
        cw_delay = frame[3];
        break;

    case 32:
    case 33:
        chk_data((frame[1] << 2) | (frame[2] & 3), cw_hang, "CW HANG", ep2_cwhang);
        chk_data((frame[3] << 4) | (frame[4] & 255), freq, "SIDE TONE FREQ", ep2_sidetonefreq);
        break;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzbl (%rdi), %edx
andl $0x1, %edx
cmpl %edx, 0x18cdb24(%rip)   # 0x18d3a88
je 0x5f7c
leaq 0x18cdb1b(%rip), %rsi   # 0x18d3a88
leaq 0x3a88(%rip), %rcx      # 0x99fc
movq %rbx, %rdi
callq 0x198b
movzbl (%rbx), %eax
cmpq $0x21, %rax
ja 0x6be7
leaq 0x30ec(%rip), %rcx      # 0x907c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl 0x1(%rbx), %edx
andl $0x3, %edx
cmpl %edx, 0x61b6(%rip)      # 0xc15c
je 0x5fbe
leaq 0x61ad(%rip), %rsi      # 0xc15c
leaq 0x3870(%rip), %rcx      # 0x9826
movq %rbx, %rdi
callq 0x1c26
movzbl 0x1(%rbx), %edx
shrl $0x3, %edx
andl $0x1, %edx
cmpl %edx, 0x619a(%rip)      # 0xc168
je 0x5fe6
leaq 0x6191(%rip), %rsi      # 0xc168
leaq 0x3853(%rip), %rcx      # 0x9831
movq %rbx, %rdi
callq 0x19e5
movzbl 0x1(%rbx), %edx
shrl $0x4, %edx
andl $0x1, %edx
cmpl %edx, 0x6176(%rip)      # 0xc16c
je 0x600e
leaq 0x616d(%rip), %rsi      # 0xc16c
leaq 0x3834(%rip), %rcx      # 0x983a
movq %rbx, %rdi
callq 0x1c80
movzbl 0x1(%rbx), %edx
shrl $0x5, %edx
andl $0x3, %edx
cmpl %edx, 0x6152(%rip)      # 0xc170
je 0x6036
leaq 0x6149(%rip), %rsi      # 0xc170
leaq 0x3819(%rip), %rcx      # 0x9847
movq %rbx, %rdi
callq 0x196d
movzbl 0x1(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x6131(%rip)      # 0xc174
je 0x605b
leaq 0x6128(%rip), %rsi      # 0xc174
leaq 0x380c(%rip), %rcx      # 0x985f
movq %rbx, %rdi
callq 0x1913
movzbl 0x2(%rbx), %edx
andl $0x1, %edx
cmpl %edx, 0x6110(%rip)      # 0xc178
je 0x6080
leaq 0x6107(%rip), %rsi      # 0xc178
leaq 0x37f1(%rip), %rcx      # 0x9869
movq %rbx, %rdi
callq 0x1cf8
movzbl 0x2(%rbx), %edx
shrl %edx
cmpl %edx, 0x60f0(%rip)      # 0xc17c
je 0x60a4
leaq 0x60e7(%rip), %rsi      # 0xc17c
leaq 0x37d8(%rip), %rcx      # 0x9874
movq %rbx, %rdi
callq 0x1931
movzbl 0x4(%rbx), %edx
shrl $0x3, %edx
andl $0x7, %edx
incl %edx
cmpl %edx, 0x60ca(%rip)      # 0xc180
je 0x60ce
leaq 0x60c1(%rip), %rsi      # 0xc180
leaq 0x37bc(%rip), %rcx      # 0x9882
movq %rbx, %rdi
callq 0x19c7
movzbl 0x4(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x60a6(%rip)      # 0xc184
je 0x60f6
leaq 0x609d(%rip), %rsi      # 0xc184
leaq 0x379e(%rip), %rcx      # 0x988c
movq %rbx, %rdi
callq 0x1c9e
movzbl 0x4(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x6085(%rip)      # 0xc188
je 0x611b
leaq 0x607c(%rip), %rsi      # 0xc188
leaq 0x3786(%rip), %rcx      # 0x9899
movq %rbx, %rdi
callq 0x1733
movzbl 0x3(%rbx), %eax
movl %eax, %edx
andl $0x3, %edx
xorl %ecx, %ecx
cmpl %edx, 0x6060(%rip)      # 0xc18c
je 0x6139
movl %edx, 0x6058(%rip)      # 0xc18c
movl $0x1, %ecx
movl %eax, %edx
shrl $0x2, %edx
andl $0x1, %edx
cmpl %edx, 0x6049(%rip)      # 0xc190
je 0x6154
movl %edx, 0x6041(%rip)      # 0xc190
movl $0x1, %ecx
movl %eax, %edx
shrl $0x3, %edx
andl $0x1, %edx
cmpl %edx, 0x6032(%rip)      # 0xc194
je 0x616f
movl %edx, 0x602a(%rip)      # 0xc194
movl $0x1, %ecx
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl %eax, 0x601b(%rip)      # 0xc198
je 0x618a
movl %eax, 0x6013(%rip)      # 0xc198
movl $0x1, %ecx
testl %ecx, %ecx
je 0x61bb
movl 0x5ff8(%rip), %edx      # 0xc18c
movl 0x5ff6(%rip), %ecx      # 0xc190
movl 0x5ff3(%rip), %r8d      # 0xc194
movl 0x5ff0(%rip), %r9d      # 0xc198
leaq 0x36fe(%rip), %rsi      # 0x98ad
movl $0x1, %edi
xorl %eax, %eax
callq 0x13aa
movzbl 0x3(%rbx), %ecx
movl %ecx, %edx
shrl $0x5, %edx
andl $0x3, %edx
xorl %eax, %eax
cmpl %edx, 0x5fcd(%rip)      # 0xc19c
je 0x61dc
movl %edx, 0x5fc5(%rip)      # 0xc19c
movl $0x1, %eax
shrl $0x7, %ecx
cmpl %ecx, 0x5fbb(%rip)      # 0xc1a0
je 0x61f2
movl %ecx, 0x5fb3(%rip)      # 0xc1a0
movl $0x1, %eax
movzbl 0x4(%rbx), %ecx
movl %ecx, %edx
andl $0x3, %edx
cmpl %edx, 0x5fa3(%rip)      # 0xc1a4
je 0x620e
movl %edx, 0x5f9b(%rip)      # 0xc1a4
movl $0x1, %eax
shrl $0x2, %ecx
andl $0x1, %ecx
cmpl %ecx, 0x5f8e(%rip)      # 0xc1a8
je 0x6227
movl %ecx, 0x5f86(%rip)      # 0xc1a8
movl $0x1, %eax
testl %eax, %eax
je 0x6258
movl 0x5f6f(%rip), %edx      # 0xc1a0
movl 0x5f65(%rip), %ecx      # 0xc19c
movl 0x5f66(%rip), %r8d      # 0xc1a4
movl 0x5f63(%rip), %r9d      # 0xc1a8
leaq 0x368b(%rip), %rsi      # 0x98d7
movl $0x1, %edi
xorl %eax, %eax
callq 0x13aa
cmpl $0x64, 0x63b5(%rip)     # 0xc614
movl 0x5f27(%rip), %eax      # 0xc18c
jne 0x6b18
shll $0x2, %eax
movl 0x5f1c(%rip), %ecx      # 0xc190
addl 0x5f1a(%rip), %ecx      # 0xc194
leal (%rax,%rax,2), %eax
addl %ecx, %ecx
leal (%rcx,%rcx,8), %ecx
subl %ecx, %eax
jmp 0x6b23
movzwl 0x1(%rbx), %edx
cmpl 0x5ff9(%rip), %edx      # 0xc28c
je 0x6be7
leaq 0x5fec(%rip), %rsi      # 0xc28c
leaq 0x3809(%rip), %rcx      # 0x9ab0
movq %rbx, %rdi
popq %rbx
jmp 0x1715
movzbl 0x1(%rbx), %edx
andl $0x1f, %edx
cmpl %edx, 0x5f0f(%rip)      # 0xc1cc
je 0x62d5
leaq 0x5f06(%rip), %rsi      # 0xc1cc
leaq 0x37ae(%rip), %rcx      # 0x9a7b
movq %rbx, %rdi
callq 0x1a99
movzbl 0x2(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x5f93(%rip)      # 0xc278
je 0x62fd
leaq 0x5f8a(%rip), %rsi      # 0xc278
leaq 0x378e(%rip), %rcx      # 0x9a83
movq %rbx, %rdi
callq 0x17c9
movzbl 0x3(%rbx), %edx
andl $0x3f, %edx
cmpl %edx, 0x5f72(%rip)      # 0xc27c
je 0x6322
leaq 0x5f69(%rip), %rsi      # 0xc27c
leaq 0x3770(%rip), %rcx      # 0x9a8a
movq %rbx, %rdi
callq 0x1805
movzbl 0x3(%rbx), %edx
shrl $0x6, %edx
cmpl %edx, 0x5f51(%rip)      # 0xc280
je 0x6347
leaq 0x5f48(%rip), %rsi      # 0xc280
leaq 0x3754(%rip), %rcx      # 0x9a93
movq %rbx, %rdi
callq 0x17ab
movzbl 0x4(%rbx), %edx
andl $0x7f, %edx
cmpl %edx, 0x5f30(%rip)      # 0xc284
je 0x636c
leaq 0x5f27(%rip), %rsi      # 0xc284
leaq 0x3737(%rip), %rcx      # 0x9a9b
movq %rbx, %rdi
callq 0x1823
movzbl 0x4(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x5f0f(%rip)      # 0xc288
je 0x6bbf
leaq 0x5f02(%rip), %rsi      # 0xc288
leaq 0x3718(%rip), %rcx      # 0x9aa5
movq %rbx, %rdi
callq 0x17e7
jmp 0x6bbf
movzbl 0x1(%rbx), %eax
movzbl 0x2(%rbx), %ecx
andl $0x3, %ecx
leal (%rcx,%rax,4), %edx
cmpl 0x5f16(%rip), %edx      # 0xc2c4
je 0x63c6
leaq 0x5f0d(%rip), %rsi      # 0xc2c4
leaq 0x3765(%rip), %rcx      # 0x9b23
movq %rbx, %rdi
callq 0x176f
movzbl 0x3(%rbx), %eax
shll $0x4, %eax
movzbl 0x4(%rbx), %edx
orl %eax, %edx
cmpl 0x5eef(%rip), %edx      # 0xc2c8
je 0x6be7
leaq 0x5ee2(%rip), %rsi      # 0xc2c8
leaq 0x373e(%rip), %rcx      # 0x9b2b
movq %rbx, %rdi
popq %rbx
jmp 0x1c44
movzbl 0x1(%rbx), %edx
andl $0x1, %edx
cmpl %edx, 0x5eb5(%rip)      # 0xc2b8
je 0x641b
leaq 0x5eac(%rip), %rsi      # 0xc2b8
leaq 0x36ef(%rip), %rcx      # 0x9b02
movq %rbx, %rdi
callq 0x178d
movzbl 0x2(%rbx), %edx
cmpl %edx, 0x5e97(%rip)      # 0xc2bc
je 0x643d
leaq 0x5e8e(%rip), %rsi      # 0xc2bc
leaq 0x36d4(%rip), %rcx      # 0x9b09
movq %rbx, %rdi
callq 0x1c62
movzbl 0x3(%rbx), %edx
cmpl %edx, 0x5e79(%rip)      # 0xc2c0
je 0x645f
leaq 0x5e70(%rip), %rsi      # 0xc2c0
leaq 0x36c3(%rip), %rcx      # 0x9b1a
movq %rbx, %rdi
callq 0x1751
movzbl 0x3(%rbx), %eax
movl %eax, 0x5e57(%rip)      # 0xc2c0
jmp 0x6be7
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x5d7b(%rip)      # 0xc1f8
je 0x6be7
leaq 0x5d6e(%rip), %rsi      # 0xc1f8
leaq 0x348f(%rip), %rcx      # 0x9920
movq %rbx, %rdi
popq %rbx
jmp 0x1baa
movzbl 0x1(%rbx), %edx
andl $0x3, %edx
cmpl %edx, 0x5de9(%rip)      # 0xc290
je 0x64bf
leaq 0x5de0(%rip), %rsi      # 0xc290
leaq 0x360c(%rip), %rcx      # 0x9ac3
movq %rbx, %rdi
callq 0x1a03
movzbl 0x1(%rbx), %edx
shrl $0x2, %edx
andl $0x3, %edx
cmpl %edx, 0x5dc5(%rip)      # 0xc294
je 0x64e7
leaq 0x5dbc(%rip), %rsi      # 0xc294
leaq 0x35ec(%rip), %rcx      # 0x9acb
movq %rbx, %rdi
callq 0x1a7b
movzbl 0x1(%rbx), %edx
shrl $0x4, %edx
andl $0x3, %edx
cmpl %edx, 0x5da1(%rip)      # 0xc298
je 0x650f
leaq 0x5d98(%rip), %rsi      # 0xc298
leaq 0x35cc(%rip), %rcx      # 0x9ad3
movq %rbx, %rdi
callq 0x1ab7
movzbl 0x1(%rbx), %edx
shrl $0x6, %edx
cmpl %edx, 0x5d80(%rip)      # 0xc29c
je 0x6534
leaq 0x5d77(%rip), %rsi      # 0xc29c
leaq 0x35af(%rip), %rcx      # 0x9adb
movq %rbx, %rdi
callq 0x1ad5
movzbl 0x2(%rbx), %edx
andl $0x3, %edx
cmpl %edx, 0x5d5f(%rip)      # 0xc2a0
je 0x6559
leaq 0x5d56(%rip), %rsi      # 0xc2a0
leaq 0x3592(%rip), %rcx      # 0x9ae3
movq %rbx, %rdi
callq 0x1af3
movzbl 0x2(%rbx), %edx
shrl $0x2, %edx
andl $0x3, %edx
cmpl %edx, 0x5d3b(%rip)      # 0xc2a4
je 0x6581
leaq 0x5d32(%rip), %rsi      # 0xc2a4
leaq 0x3572(%rip), %rcx      # 0x9aeb
movq %rbx, %rdi
callq 0x1b11
movzbl 0x2(%rbx), %edx
shrl $0x4, %edx
andl $0x3, %edx
cmpl %edx, 0x5d17(%rip)      # 0xc2a8
je 0x65a9
leaq 0x5d0e(%rip), %rsi      # 0xc2a8
leaq 0x3552(%rip), %rcx      # 0x9af3
movq %rbx, %rdi
callq 0x1b2f
movzbl 0x3(%rbx), %edx
andl $0x1f, %edx
cmpl %edx, 0x18cd4da(%rip)   # 0x18d3a90
je 0x65ce
leaq 0x18cd4d1(%rip), %rsi   # 0x18d3a90
leaq 0x3535(%rip), %rcx      # 0x9afb
movq %rbx, %rdi
callq 0x1cda
cvtsi2sdl 0x18cd4ba(%rip), %xmm1 # 0x18d3a90
mulsd 0x1a92(%rip), %xmm1     # 0x8070
movsd 0x1a92(%rip), %xmm0     # 0x8078
callq 0x10a0
movsd %xmm0, 0x5cbd(%rip)     # 0xc2b0
cmpl $0x64, 0x601a(%rip)     # 0xc614
jne 0x6be7
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x5c7f(%rip)      # 0xc290
movl $0x1, 0x5c7d(%rip)      # 0xc298
jmp 0x6be7
movzbl 0x1(%rbx), %edx
cmpl %edx, 0x18cd462(%rip)   # 0x18d3a8c
je 0x6642
leaq 0x18cd459(%rip), %rsi   # 0x18d3a8c
leaq 0x330a(%rip), %rcx      # 0x9944
movq %rbx, %rdi
callq 0x1d16
movzbl 0x2(%rbx), %edx
andl $0x3f, %edx
cmpl %edx, 0x5bc9(%rip)      # 0xc218
je 0x6667
leaq 0x5bc0(%rip), %rsi      # 0xc218
leaq 0x32ee(%rip), %rcx      # 0x994d
movq %rbx, %rdi
callq 0x1841
movzbl 0x2(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x5ba5(%rip)      # 0xc21c
je 0x668f
leaq 0x5b9c(%rip), %rsi      # 0xc21c
leaq 0x32d4(%rip), %rcx      # 0x995b
movq %rbx, %rdi
callq 0x16d9
movzbl 0x2(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x5b84(%rip)      # 0xc220
je 0x66b4
leaq 0x5b7b(%rip), %rsi      # 0xc220
leaq 0x32c3(%rip), %rcx      # 0x996f
movq %rbx, %rdi
callq 0x1d53
movzbl 0x3(%rbx), %edx
andl $0x1f, %edx
cmpl %edx, 0x5b63(%rip)      # 0xc224
je 0x66d9
leaq 0x5b5a(%rip), %rsi      # 0xc224
leaq 0x32a7(%rip), %rcx      # 0x9978
movq %rbx, %rdi
callq 0x169d
movzbl 0x3(%rbx), %edx
shrl $0x5, %edx
andl $0x1, %edx
cmpl %edx, 0x5b3f(%rip)      # 0xc228
je 0x6701
leaq 0x5b36(%rip), %rsi      # 0xc228
leaq 0x3288(%rip), %rcx      # 0x9981
movq %rbx, %rdi
callq 0x167f
movzbl 0x3(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x5b1b(%rip)      # 0xc22c
je 0x6729
leaq 0x5b12(%rip), %rsi      # 0xc22c
leaq 0x3271(%rip), %rcx      # 0x9992
movq %rbx, %rdi
callq 0x1661
movzbl 0x3(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x5afa(%rip)      # 0xc230
je 0x674e
leaq 0x5af1(%rip), %rsi      # 0xc230
leaq 0x3258(%rip), %rcx      # 0x999e
movq %rbx, %rdi
callq 0x16f7
movzbl 0x4(%rbx), %edx
cmpl %edx, 0x5adc(%rip)      # 0xc234
je 0x6770
leaq 0x5ad3(%rip), %rsi      # 0xc234
leaq 0x3247(%rip), %rcx      # 0x99af
movq %rbx, %rdi
callq 0x16bb
cvtsi2sdl 0x18cd314(%rip), %xmm0 # 0x18d3a8c
mulsd 0x2880(%rip), %xmm0     # 0x9000
movsd %xmm0, 0x59d8(%rip)     # 0xc160
jmp 0x6be7
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x5a34(%rip)      # 0xc1d0
je 0x6be7
leaq 0x5a27(%rip), %rsi      # 0xc1d0
leaq 0x314d(%rip), %rcx      # 0x98fd
movq %rbx, %rdi
popq %rbx
jmp 0x1d34
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x5a20(%rip)      # 0xc1e8
je 0x6be7
leaq 0x5a13(%rip), %rsi      # 0xc1e8
leaq 0x3132(%rip), %rcx      # 0x990e
movq %rbx, %rdi
popq %rbx
jmp 0x1b6c
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x5a0c(%rip)      # 0xc200
je 0x6be7
leaq 0x59ff(%rip), %rsi      # 0xc200
leaq 0x3121(%rip), %rcx      # 0x9929
movq %rbx, %rdi
popq %rbx
jmp 0x1bc9
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x59c0(%rip)      # 0xc1e0
je 0x6be7
leaq 0x59b3(%rip), %rsi      # 0xc1e0
leaq 0x30d1(%rip), %rcx      # 0x9905
movq %rbx, %rdi
popq %rbx
jmp 0x1b4d
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x59a4(%rip)      # 0xc1f0
je 0x6be7
leaq 0x5997(%rip), %rsi      # 0xc1f0
leaq 0x30b7(%rip), %rcx      # 0x9917
movq %rbx, %rdi
popq %rbx
jmp 0x1b8b
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x5990(%rip)      # 0xc208
je 0x6be7
leaq 0x5983(%rip), %rsi      # 0xc208
leaq 0x30a6(%rip), %rcx      # 0x9932
movq %rbx, %rdi
popq %rbx
jmp 0x1be8
movl 0x1(%rbx), %edx
bswapl %edx
movslq %edx, %rax
cmpq %rax, 0x596c(%rip)      # 0xc210
je 0x6be7
leaq 0x595f(%rip), %rsi      # 0xc210
leaq 0x3083(%rip), %rcx      # 0x993b
movq %rbx, %rdi
popq %rbx
jmp 0x1c07
movzbl 0x1(%rbx), %edx
andl $0x1, %edx
cmpl %edx, 0x5972(%rip)      # 0xc240
je 0x68e6
leaq 0x5969(%rip), %rsi      # 0xc240
leaq 0x30da(%rip), %rcx      # 0x99b8
movq %rbx, %rdi
callq 0x15e9
movzbl 0x1(%rbx), %edx
shrl %edx
andl $0x1, %edx
cmpl %edx, 0x594f(%rip)      # 0xc244
je 0x690d
leaq 0x5946(%rip), %rsi      # 0xc244
leaq 0x30bf(%rip), %rcx      # 0x99c4
movq %rbx, %rdi
callq 0x1607
movzbl 0x1(%rbx), %edx
shrl $0x2, %edx
andl $0x1, %edx
cmpl %edx, 0x592b(%rip)      # 0xc248
je 0x6935
leaq 0x5922(%rip), %rsi      # 0xc248
leaq 0x30a3(%rip), %rcx      # 0x99d0
movq %rbx, %rdi
callq 0x1625
movzbl 0x1(%rbx), %edx
shrl $0x3, %edx
andl $0x1, %edx
cmpl %edx, 0x5907(%rip)      # 0xc24c
je 0x695d
leaq 0x58fe(%rip), %rsi      # 0xc24c
leaq 0x3087(%rip), %rcx      # 0x99dc
movq %rbx, %rdi
callq 0x1643
movzbl 0x1(%rbx), %edx
shrl $0x4, %edx
andl $0x1, %edx
cmpl %edx, 0x58e3(%rip)      # 0xc250
je 0x6985
leaq 0x58da(%rip), %rsi      # 0xc250
leaq 0x306b(%rip), %rcx      # 0x99e8
movq %rbx, %rdi
callq 0x1cbc
movzbl 0x1(%rbx), %edx
shrl $0x5, %edx
andl $0x1, %edx
cmpl %edx, 0x58bf(%rip)      # 0xc254
je 0x69ad
leaq 0x58b6(%rip), %rsi      # 0xc254
leaq 0x304c(%rip), %rcx      # 0x99f1
movq %rbx, %rdi
callq 0x18d7
movzbl 0x1(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x589b(%rip)      # 0xc258
je 0x69d5
leaq 0x5892(%rip), %rsi      # 0xc258
leaq 0x302c(%rip), %rcx      # 0x99f9
movq %rbx, %rdi
callq 0x18f5
movzbl 0x2(%rbx), %edx
andl $0x1f, %edx
cmpl %edx, 0x587a(%rip)      # 0xc25c
je 0x69fa
leaq 0x5871(%rip), %rsi      # 0xc25c
leaq 0x300e(%rip), %rcx      # 0x9a00
movq %rbx, %rdi
callq 0x185f
movzbl 0x2(%rbx), %edx
shrl $0x5, %edx
andl $0x1, %edx
cmpl %edx, 0x5856(%rip)      # 0xc260
je 0x6a22
leaq 0x584d(%rip), %rsi      # 0xc260
leaq 0x2fef(%rip), %rcx      # 0x9a09
movq %rbx, %rdi
callq 0x187d
movzbl 0x2(%rbx), %edx
shrl $0x6, %edx
andl $0x1, %edx
cmpl %edx, 0x5832(%rip)      # 0xc264
je 0x6a4a
leaq 0x5829(%rip), %rsi      # 0xc264
leaq 0x2fdb(%rip), %rcx      # 0x9a1d
movq %rbx, %rdi
callq 0x19a9
movzbl 0x2(%rbx), %edx
shrl $0x7, %edx
cmpl %edx, 0x5811(%rip)      # 0xc268
je 0x6a6f
leaq 0x5808(%rip), %rsi      # 0xc268
leaq 0x2fc1(%rip), %rcx      # 0x9a28
movq %rbx, %rdi
callq 0x194f
movzbl 0x3(%rbx), %edx
andl $0xf, %edx
cmpl %edx, 0x57f0(%rip)      # 0xc26c
je 0x6a94
leaq 0x57e7(%rip), %rsi      # 0xc26c
leaq 0x2fab(%rip), %rcx      # 0x9a37
movq %rbx, %rdi
callq 0x18b9
movzbl 0x3(%rbx), %edx
shrl $0x4, %edx
andl $0x1, %edx
cmpl %edx, 0x57cc(%rip)      # 0xc270
je 0x6abc
leaq 0x57c3(%rip), %rsi      # 0xc270
leaq 0x2f8c(%rip), %rcx      # 0x9a40
movq %rbx, %rdi
callq 0x189b
movzbl 0x4(%rbx), %edx
testb $0x40, %dl
jne 0x6b5a
andl $0x1f, %edx
cmpl 0x56f6(%rip), %edx      # 0xc1c8
je 0x6aea
leaq 0x56ed(%rip), %rsi      # 0xc1c8
leaq 0x2f82(%rip), %rcx      # 0x9a64
movq %rbx, %rdi
callq 0x1a3f
movzbl 0x4(%rbx), %edx
shrl $0x5, %edx
andl $0x1, %edx
cmpl %edx, 0x577a(%rip)      # 0xc274
je 0x6b84
leaq 0x576d(%rip), %rsi      # 0xc274
leaq 0x2f5e(%rip), %rcx      # 0x9a6c
movq %rbx, %rdi
callq 0x1a21
jmp 0x6b84
leal (%rax,%rax,4), %eax
addl %eax, %eax
addl 0x56a5(%rip), %eax      # 0xc1c8
cvtsi2sd %eax, %xmm1
mulsd 0x1541(%rip), %xmm1     # 0x8070
movsd 0x1541(%rip), %xmm0     # 0x8078
callq 0x10a0
movsd %xmm0, 0x566c(%rip)     # 0xc1b0
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x566b(%rip)      # 0xc1c0
jmp 0x6be7
andl $0x3f, %edx
movl $0x25, %eax
subl %edx, %eax
cmpl 0x565e(%rip), %eax      # 0xc1c8
je 0x6b84
leaq 0x5655(%rip), %rsi      # 0xc1c8
leaq 0x2eda(%rip), %rcx      # 0x9a54
movq %rbx, %rdi
movl %eax, %edx
callq 0x1a5d
cmpl $0x64, 0x5a89(%rip)     # 0xc614
je 0x6be7
movl 0x55f9(%rip), %eax      # 0xc18c
leal (%rax,%rax,4), %eax
addl %eax, %eax
addl 0x562a(%rip), %eax      # 0xc1c8
cvtsi2sd %eax, %xmm1
mulsd 0x14c6(%rip), %xmm1     # 0x8070
movsd 0x14c6(%rip), %xmm0     # 0x8078
callq 0x10a0
movsd %xmm0, 0x55f1(%rip)     # 0xc1b0
xorps %xmm1, %xmm1
cvtsi2sdl 0x5602(%rip), %xmm1 # 0xc1cc
mulsd 0x149e(%rip), %xmm1     # 0x8070
movsd 0x149e(%rip), %xmm0     # 0x8078
callq 0x10a0
movsd %xmm0, 0x55d9(%rip)     # 0xc1c0
popq %rbx
retq