// File: /workspace/github_c_makefile_star2_O2/hiperiondev[P]hpsdrsim/src/hpsdr_newprotocol.c
// Function: highprio_thread
void* highprio_thread(void *data) {
    dbg_printf(1, "-- Start highprio_thread port: %d\n", hp_port);
    int sock;
    struct sockaddr_in addr;
    socklen_t lenaddr = sizeof(addr);
    unsigned long seqnum, seqold;
    unsigned char buffer[2000];
    struct timeval tv;
    int yes = 1;
    int rc;
    unsigned long freq;
    int i;

    seqnum = 0;

    sock = socket(AF_INET, SOCK_DGRAM, 0);
    if (sock < 0) {
        dbg_printf(1, "***** ERROR: HP: socket\n");
        return NULL;
    }

    setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*) &yes, sizeof(yes));
    setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (void*) &yes, sizeof(yes));
    tv.tv_sec = 0;
    tv.tv_usec = 10000;
    setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (void*) &tv, sizeof(tv));

    memset(&addr, 0, sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
    addr.sin_port = htons(hp_port);

    if (bind(sock, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
        dbg_printf(1, "***** ERROR: HP: bind\n");
        close(sock);
        return NULL;
    }

    while (1) {
        rc = recvfrom(sock, buffer, 1444, 0, (struct sockaddr*) &addr, &lenaddr);
        if (rc < 0 && errno != EAGAIN) {
            dbg_printf(1, "***** ERROR: HighPrio thread: recvmsg\n");
            break;
        }
        if (rc < 0)
            continue;
        if (rc != 1444) {
            dbg_printf(1, "Received HighPrio packet with incorrect length\n");
            break;
        }
        seqold = seqnum;
        seqnum = (buffer[0] >> 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3];
        if (seqnum != 0 && seqnum != seqold + 1) {
            dbg_printf(1, "HP: SEQ ERROR, old=%lu new=%lu\n", seqold, seqnum);
        }
        rc = (buffer[4] >> 0) & 0x01;
        if (rc != run) {
            run = rc;
            dbg_printf(1, "HP: Run=%d\n", rc);
            // if run=0, wait for threads to complete, otherwise spawn them off
            if (run) {
                if (pthread_create(&ddc_specific_thread_id, NULL, ddc_specific_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create DDC specific thread\n");
                }
                if (pthread_create(&duc_specific_thread_id, NULL, duc_specific_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create DUC specific thread\n");
                }
                for (i = 0; i < NUMRECEIVERS; i++) {
                    if (pthread_create(&rx_thread_id[i], NULL, rx_thread, (void*) (uintptr_t) i) < 0) {
                        dbg_printf(1, "***** ERROR: Create RX thread\n");
                    }
                    if (pthread_create(&rx_hardware_thread_id[i], NULL, rx_hardware_thread, (void*) (uintptr_t) i) < 0) {
                        dbg_printf(1, "***** ERROR: Create RX Hardware thread %d\n", i);
                    }
                }
                if (pthread_create(&tx_thread_id, NULL, tx_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create TX thread\n");
                }
                if (pthread_create(&tx_hardware_thread_id, NULL, tx_hardware_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create TX Hardware thread\n");
                }
                if (pthread_create(&send_highprio_thread_id, NULL, send_highprio_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create SendHighPrio thread\n");
                }
                if (pthread_create(&mic_thread_id, NULL, mic_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create Mic thread\n");
                }
                if (pthread_create(&audio_thread_id, NULL, audio_thread, NULL) < 0) {
                    dbg_printf(1, "***** ERROR: Create Audio thread\n");
                }
            } else {
                pthread_join(ddc_specific_thread_id, NULL);
                pthread_join(duc_specific_thread_id, NULL);
                for (i = 0; i < NUMRECEIVERS; i++) {
                    pthread_join(rx_thread_id[i], NULL);
                }
                pthread_join(send_highprio_thread_id, NULL);
                pthread_join(tx_thread_id, NULL);
                pthread_join(mic_thread_id, NULL);
                pthread_join(audio_thread_id, NULL);
                highprio_thread_id = 0;
                dbg_printf(1, "HP thread terminated.\n");
                close(sock);
                return NULL;
            }
        }
        rc = (buffer[4] >> 1) & 0x01;
        if (rc != ptt) {
            ptt = rc;
            dbg_printf(1, "HP: PTT=%d\n", rc);
            if (ptt == 0) {
                memset(isample, 0, sizeof(float) * NEWRTXLEN);
                memset(qsample, 0, sizeof(float) * NEWRTXLEN);
            }
        }
        rc = (buffer[5] >> 0) & 0x01;
        if (rc != cwx) {
            cwx = rc;
            dbg_printf(1, "HP: CWX=%d\n", rc);
        }
        rc = (buffer[5] >> 1) & 0x01;
        if (rc != dot) {
            dot = rc;
            dbg_printf(1, "HP: DOT=%d\n", rc);
        }
        rc = (buffer[5] >> 2) & 0x01;
        if (rc != dash) {
            dash = rc;
            dbg_printf(1, "HP: DASH=%d\n", rc);
        }
        for (i = 0; i < NUMRECEIVERS; i++) {
            freq = (buffer[9 + 4 * i] << 24) + (buffer[10 + 4 * i] << 16) + (buffer[11 + 4 * i] << 8) + buffer[12 + 4 * i];
            if (bits & 0x08) {
                freq = round(122880000.0 * (double) freq / 4294967296.0);
            }
            if (freq != rxfreq[i]) {
                rxfreq[i] = freq;
                dbg_printf(1, "HP: DDC%d freq: %lu\n", i, freq);
            }
        }
        freq = (buffer[329] << 24) + (buffer[330] << 16) + (buffer[331] << 8) + buffer[332];
        if (bits & 0x08) {
            freq = round(122880000.0 * (double) freq / 4294967296.0);
        }
        if (freq != txfreq) {
            txfreq = freq;
            dbg_printf(1, "HP: DUC freq: %lu\n", freq);
        }
        rc = buffer[345];
        if (rc != txdrive) {
            txdrive = rc;
            txdrv_dbl = (double) txdrive * 0.003921568627;
            dbg_printf(1, "HP: TX drive= %d (%f)\n", txdrive, txdrv_dbl);
        }
        rc = buffer[1400];
        if (rc != w1400) {
            w1400 = rc;
            dbg_printf(1, "HP: Xvtr/Audio enable=%x\n", rc);
        }
        rc = buffer[1401];
        if (rc != ocout) {
            ocout = rc;
            dbg_printf(1, "HP: OC outputs=%x\n", rc);
        }
        rc = buffer[1402];
        if (rc != db9) {
            db9 = rc;
            dbg_printf(1, "HP: Outputs DB9=%x\n", rc);
        }
        rc = buffer[1403];
        if (rc != mercury_atts) {
            mercury_atts = rc;
            dbg_printf(1, "HP: MercuryAtts=%x\n", rc);
        }
        // Store Alex0 and Alex1 bits in separate ints
        freq = (buffer[1428] << 24) + (buffer[1429] << 16) + (buffer[1430] << 8) + buffer[1431];
        for (i = 0; i < 32; i++) {
            rc = (freq >> i) & 0x01;
            if (rc != alex1[i]) {
                alex1[i] = rc;
                dbg_printf(1, "HP: ALEX1 bit%d set to %d\n", i, rc);
            }
        }
        freq = (buffer[1432] << 24) + (buffer[1433] << 16) + (buffer[1434] << 8) + buffer[1435];
        for (i = 0; i < 32; i++) {
            rc = (freq >> i) & 0x01;
            if (rc != alex0[i]) {
                alex0[i] = rc;
                dbg_printf(1, "HP: ALEX0 bit%d set to %d\n", i, rc);
            }
        }
        rc = buffer[1442];
        if (rc != stepatt1) {
            stepatt1 = rc;
            rxatt1_dbl = pow(10.0, -0.05 * stepatt1);
            dbg_printf(1, "HP: StepAtt1 = %d\n", rc);
        }
        rc = buffer[1443];
        if (rc != stepatt0) {
            stepatt0 = rc;
            dbg_printf(1, "HP: StepAtt0 = %d\n", stepatt0);
        }
        // rxatt0 depends both on ALEX att and Step Att, so re-calc. it each time
        if (NEWDEVICE == NEW_DEVICE_ORION2) {
            // There is no step attenuator on ANAN7000
            rxatt0_dbl = pow(10.0, -0.05 * stepatt0);
        } else {
            rxatt0_dbl = pow(10.0, -0.05 * (stepatt0 + 10 * alex0[14] + 20 * alex0[13]));
        }
    }
    close(sock);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movl 0xaf08(%rip), %edx      # 0xd2f8
leaq 0x6489(%rip), %rsi      # 0x8880
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x131a
movl $0x10, 0x4(%rsp)
movl $0x1, (%rsp)
pushq $0x2
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x1200
testl %eax, %eax
js 0x2bfb
movl %eax, %ebx
pushq $0x1
popq %rbp
pushq $0x2
popq %rdx
movq %rsp, %r14
pushq $0x4
popq %r15
movl %eax, %edi
movl %ebp, %esi
movq %r14, %rcx
movl %r15d, %r8d
callq 0x1070
pushq $0xf
popq %rdx
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rcx
movl %r15d, %r8d
callq 0x1070
leaq 0x20(%rsp), %rcx
andq $0x0, (%rcx)
movq $0x2710, 0x8(%rcx)      # imm = 0x2710
pushq $0x14
popq %rdx
pushq $0x10
popq %r14
movl %ebx, %edi
movl %ebp, %esi
movl %r14d, %r8d
callq 0x1070
leaq 0x10(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
andl $0x0, 0x4(%rsi)
movzwl 0xae66(%rip), %eax      # 0xd2f8
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
movl %ebx, %edi
movl %r14d, %edx
callq 0x1150
testl %eax, %eax
js 0x2c17
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x4(%rsp), %r13
pushq $0x1
popq %rbp
xorl %r14d, %r14d
movl $0x5a4, %edx            # imm = 0x5A4
movl %ebx, %edi
movq %r15, %rsi
xorl %ecx, %ecx
movq %r12, %r8
movq %r13, %r9
callq 0x1140
testl %eax, %eax
jns 0x24eb
callq 0x1030
cmpl $0xb, (%rax)
je 0x24c1
jmp 0x2c0e
cmpl $0x5a4, %eax            # imm = 0x5A4
jne 0x2c43
movzbl 0x31(%rsp), %eax
shll $0x10, %eax
movzbl 0x32(%rsp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x33(%rsp), %r15d
orq %rcx, %r15
testq %r15, %r15
sete %al
leaq 0x1(%r14), %rcx
cmpq %rcx, %r15
sete %cl
orb %al, %cl
jne 0x253b
movl %ebp, %edi
leaq 0x63fc(%rip), %rsi      # 0x892a
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x131a
movq %r15, 0x8(%rsp)
movzbl 0x34(%rsp), %edx
andl $0x1, %edx
cmpl %edx, 0xad92(%rip)      # 0xd2e0
leaq 0x6597(%rip), %r12      # 0x8aec
je 0x2729
movl %edx, 0xad7f(%rip)      # 0xd2e0
movl %ebp, %edi
leaq 0x63e0(%rip), %rsi      # 0x894a
xorl %eax, %eax
callq 0x131a
cmpl $0x0, 0xad68(%rip)      # 0xd2e0
je 0x2c4c
leaq 0xafc3(%rip), %rdi      # 0xd548
xorl %esi, %esi
leaq 0x747(%rip), %rdx       # 0x2cd5
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x25a9
movl %ebp, %edi
leaq 0x63b4(%rip), %rsi      # 0x8956
xorl %eax, %eax
callq 0x131a
leaq 0xafa0(%rip), %rdi      # 0xd550
xorl %esi, %esi
leaq 0xb28(%rip), %rdx       # 0x30e1
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x25d4
movl %ebp, %edi
leaq 0x63b2(%rip), %rsi      # 0x897f
xorl %eax, %eax
callq 0x131a
leaq 0xaf85(%rip), %r14      # 0xd560
leaq 0xaf9e(%rip), %r15      # 0xd580
xorl %r12d, %r12d
cmpq $0x4, %r12
je 0x264b
movq %r14, %rdi
xorl %esi, %esi
leaq 0xeed(%rip), %rdx       # 0x34e4
movq %r12, %rcx
callq 0x1160
testl %eax, %eax
jns 0x2613
movl %ebp, %edi
leaq 0x639c(%rip), %rsi      # 0x89a8
xorl %eax, %eax
callq 0x131a
movq %r15, %rdi
xorl %esi, %esi
leaq 0x1591(%rip), %rdx      # 0x3bb0
movq %r12, %rcx
callq 0x1160
testl %eax, %eax
jns 0x263e
movl %ebp, %edi
leaq 0x6393(%rip), %rsi      # 0x89c7
movl %r12d, %edx
xorl %eax, %eax
callq 0x131a
incq %r12
addq $0x8, %r15
addq $0x8, %r14
jmp 0x25e5
leaq 0xaf4e(%rip), %rdi      # 0xd5a0
xorl %esi, %esi
leaq 0x1575(%rip), %rdx      # 0x3bd0
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x2676
movl %ebp, %edi
leaq 0x6383(%rip), %rsi      # 0x89f2
xorl %eax, %eax
callq 0x131a
leaq 0xaf2b(%rip), %rdi      # 0xd5a8
xorl %esi, %esi
leaq 0x1802(%rip), %rdx      # 0x3e88
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
leaq 0x6456(%rip), %r12      # 0x8aec
jns 0x26a8
movl %ebp, %edi
leaq 0x6370(%rip), %rsi      # 0x8a11
xorl %eax, %eax
callq 0x131a
leaq 0xaf01(%rip), %rdi      # 0xd5b0
xorl %esi, %esi
leaq 0x17ed(%rip), %rdx      # 0x3ea5
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x26d3
movl %ebp, %edi
leaq 0x636d(%rip), %rsi      # 0x8a39
xorl %eax, %eax
callq 0x131a
leaq 0xaede(%rip), %rdi      # 0xd5b8
xorl %esi, %esi
leaq 0x19af(%rip), %rdx      # 0x4092
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x26fe
movl %ebp, %edi
leaq 0x636b(%rip), %rsi      # 0x8a62
xorl %eax, %eax
callq 0x131a
leaq 0xaebb(%rip), %rdi      # 0xd5c0
xorl %esi, %esi
leaq 0x1b20(%rip), %rdx      # 0x422e
xorl %ecx, %ecx
callq 0x1160
testl %eax, %eax
jns 0x2729
movl %ebp, %edi
leaq 0x6360(%rip), %rsi      # 0x8a82
xorl %eax, %eax
callq 0x131a
movl 0x34(%rsp), %edx
shrl %edx
andl $0x1, %edx
cmpl %edx, 0xae90(%rip)      # 0xd5c8
je 0x277f
movl %edx, 0xae88(%rip)      # 0xd5c8
movl %ebp, %edi
leaq 0x6372(%rip), %rsi      # 0x8abb
xorl %eax, %eax
callq 0x131a
cmpl $0x0, 0xae71(%rip)      # 0xd5c8
jne 0x277f
movl $0x3ed00, %edx          # imm = 0x3ED00
leaq 0x17d62cb(%rip), %rdi   # 0x17d8a30
xorl %esi, %esi
callq 0x10d0
movl $0x3ed00, %edx          # imm = 0x3ED00
leaq 0x18542b8(%rip), %rdi   # 0x1856a30
xorl %esi, %esi
callq 0x10d0
movzbl 0x35(%rsp), %eax
movl %eax, %edx
andl $0x1, %edx
cmpl %edx, 0xae3d(%rip)      # 0xd5cc
je 0x27ab
movl %edx, 0xae35(%rip)      # 0xd5cc
movl %ebp, %edi
leaq 0x6327(%rip), %rsi      # 0x8ac7
xorl %eax, %eax
callq 0x131a
movb 0x35(%rsp), %al
movl %eax, %ecx
shrb %cl
andb $0x1, %cl
movzbl %cl, %edx
cmpl %edx, 0xae15(%rip)      # 0xd5d0
je 0x27d7
movl %edx, 0xae0d(%rip)      # 0xd5d0
movl %ebp, %edi
leaq 0x6307(%rip), %rsi      # 0x8ad3
xorl %eax, %eax
callq 0x131a
movb 0x35(%rsp), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %edx
cmpl %edx, 0xadef(%rip)      # 0xd5d4
je 0x27fd
movl %edx, 0xade7(%rip)      # 0xd5d4
movl %ebp, %edi
leaq 0x62e9(%rip), %rsi      # 0x8adf
xorl %eax, %eax
callq 0x131a
leaq 0xabcc(%rip), %r15      # 0xd3d0
xorl %r14d, %r14d
cmpq $0x4, %r14
je 0x28be
movzbl 0x39(%rsp,%r14,4), %eax
shll $0x18, %eax
movzbl 0x3a(%rsp,%r14,4), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x3b(%rsp,%r14,4), %edx
shll $0x8, %edx
orq %rax, %rdx
movzbl 0x3c(%rsp,%r14,4), %ecx
orq %rdx, %rcx
testb $0x8, 0xaaf4(%rip)      # 0xd338
je 0x289b
movq %rcx, %xmm1
punpckldq 0x57dd(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x57e5(%rip), %xmm1     # 0x8040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x57f1(%rip), %xmm0     # 0x8060
mulsd 0x57f1(%rip), %xmm0     # 0x8068
callq 0x1040
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
subsd 0x57e0(%rip), %xmm0     # 0x8070
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rax, %rcx
cmpq (%r15), %rcx
je 0x28b2
movq %rcx, (%r15)
movl %ebp, %edi
movq %r12, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x131a
incq %r14
addq $0x8, %r15
jmp 0x2807
movzbl 0x179(%rsp), %eax
shll $0x18, %eax
movzbl 0x17a(%rsp), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x17b(%rsp), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x17c(%rsp), %edx
orq %rcx, %rdx
testb $0x8, 0xaa3f(%rip)      # 0xd338
je 0x2950
movq %rdx, %xmm1
punpckldq 0x5728(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5730(%rip), %xmm1     # 0x8040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x573c(%rip), %xmm0     # 0x8060
mulsd 0x573c(%rip), %xmm0     # 0x8068
callq 0x1040
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x572b(%rip), %xmm0     # 0x8070
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
cmpq 0xac81(%rip), %rdx      # 0xd5d8
je 0x2970
movq %rdx, 0xac78(%rip)      # 0xd5d8
movl %ebp, %edi
leaq 0x6198(%rip), %rsi      # 0x8b01
xorl %eax, %eax
callq 0x131a
movzbl 0x189(%rsp), %edx
cmpl %edx, 0xac62(%rip)      # 0xd5e0
je 0x29aa
movl %edx, 0xac5a(%rip)      # 0xd5e0
cvtsi2sd %edx, %xmm0
mulsd 0x56e6(%rip), %xmm0     # 0x8078
movsd %xmm0, 0xac4e(%rip)     # 0xd5e8
movl %ebp, %edi
leaq 0x6171(%rip), %rsi      # 0x8b14
movb $0x1, %al
callq 0x131a
movzbl 0x5a8(%rsp), %edx
cmpl %edx, 0xac38(%rip)      # 0xd5f0
je 0x29d0
movl %edx, 0xac30(%rip)      # 0xd5f0
movl %ebp, %edi
leaq 0x6162(%rip), %rsi      # 0x8b2b
xorl %eax, %eax
callq 0x131a
movzbl 0x5a9(%rsp), %edx
cmpl %edx, 0xac16(%rip)      # 0xd5f4
je 0x29f6
movl %edx, 0xac0e(%rip)      # 0xd5f4
movl %ebp, %edi
leaq 0x6156(%rip), %rsi      # 0x8b45
xorl %eax, %eax
callq 0x131a
movzbl 0x5aa(%rsp), %edx
cmpl %edx, 0xabf4(%rip)      # 0xd5f8
je 0x2a1c
movl %edx, 0xabec(%rip)      # 0xd5f8
movl %ebp, %edi
leaq 0x6143(%rip), %rsi      # 0x8b58
xorl %eax, %eax
callq 0x131a
movzbl 0x5ab(%rsp), %edx
cmpl %edx, 0xabd2(%rip)      # 0xd5fc
je 0x2a42
movl %edx, 0xabca(%rip)      # 0xd5fc
movl %ebp, %edi
leaq 0x6131(%rip), %rsi      # 0x8b6c
xorl %eax, %eax
callq 0x131a
movl 0x5c4(%rsp), %eax
shll $0x18, %eax
movzbl 0x5c5(%rsp), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x5c6(%rsp), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x5c7(%rsp), %r15d
orq %rcx, %r15
leaq 0xa9f3(%rip), %r12      # 0xd470
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x2ab5
xorl %ecx, %ecx
btq %r14, %r15
setb %cl
cmpl (%r12), %ecx
je 0x2aac
movl %ecx, (%r12)
movl %ebp, %edi
leaq 0x60de(%rip), %rsi      # 0x8b80
movl %r14d, %edx
xorl %eax, %eax
callq 0x131a
incq %r14
addq $0x4, %r12
jmp 0x2a80
movl 0x5c8(%rsp), %eax
shll $0x18, %eax
movzbl 0x5c9(%rsp), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x5ca(%rsp), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x5cb(%rsp), %r15d
orq %rcx, %r15
leaq 0xa900(%rip), %r12      # 0xd3f0
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x2b28
xorl %ecx, %ecx
btq %r14, %r15
setb %cl
cmpl (%r12), %ecx
je 0x2b1f
movl %ecx, (%r12)
movl %ebp, %edi
leaq 0x6086(%rip), %rsi      # 0x8b9b
movl %r14d, %edx
xorl %eax, %eax
callq 0x131a
incq %r14
addq $0x4, %r12
jmp 0x2af3
movzbl 0x5d2(%rsp), %r14d
cmpl %r14d, 0xaac8(%rip)     # 0xd600
je 0x2b76
movl %r14d, 0xaabf(%rip)     # 0xd600
cvtsi2sd %r14d, %xmm1
mulsd 0x5532(%rip), %xmm1     # 0x8080
movsd 0x5532(%rip), %xmm0     # 0x8088
callq 0x10a0
movsd %xmm0, 0xa5cd(%rip)     # 0xd130
movl %ebp, %edi
leaq 0x604a(%rip), %rsi      # 0x8bb6
movl %r14d, %edx
xorl %eax, %eax
callq 0x131a
movzbl 0x5d3(%rsp), %edx
cmpl %edx, 0xaa80(%rip)      # 0xd604
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
je 0x2ba6
movl %edx, 0xaa6e(%rip)      # 0xd604
movl %ebp, %edi
leaq 0x602a(%rip), %rsi      # 0x8bc9
xorl %eax, %eax
callq 0x131a
leaq 0xaa6b(%rip), %rax      # 0xd618
cmpl $0x5, (%rax)
movl 0xaa4e(%rip), %eax      # 0xd604
jne 0x2bbe
cvtsi2sd %eax, %xmm1
jmp 0x2bd4
imull $0xa, 0xa863(%rip), %ecx # 0xd428
imull $0x14, 0xa858(%rip), %edx # 0xd424
addl %eax, %ecx
addl %ecx, %edx
cvtsi2sd %edx, %xmm1
mulsd 0x54a4(%rip), %xmm1     # 0x8080
movsd 0x54a4(%rip), %xmm0     # 0x8088
callq 0x10a0
movsd %xmm0, 0xa547(%rip)     # 0xd138
movq 0x8(%rsp), %r14
jmp 0x24c1
leaq 0x5ca1(%rip), %rsi      # 0x88a3
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x131a
jmp 0x2c2f
leaq 0x5cbe(%rip), %rsi      # 0x88d3
jmp 0x2c1e
leaq 0x5c9e(%rip), %rsi      # 0x88bc
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x131a
movl %ebx, %edi
callq 0x10f0
xorl %eax, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5cb0(%rip), %rsi      # 0x88fa
jmp 0x2c1e
movq 0xa8f5(%rip), %rdi      # 0xd548
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x11d0
movq 0xa8ec(%rip), %rdi      # 0xd550
xorl %esi, %esi
callq 0x11d0
leaq 0xa8ee(%rip), %r15      # 0xd560
cmpq $0x20, %r14
je 0x2c89
movq (%r14,%r15), %rdi
xorl %esi, %esi
callq 0x11d0
addq $0x8, %r14
jmp 0x2c72
movq 0xa920(%rip), %rdi      # 0xd5b0
xorl %esi, %esi
callq 0x11d0
movq 0xa902(%rip), %rdi      # 0xd5a0
xorl %esi, %esi
callq 0x11d0
movq 0xa90c(%rip), %rdi      # 0xd5b8
xorl %esi, %esi
callq 0x11d0
movq 0xa906(%rip), %rdi      # 0xd5c0
xorl %esi, %esi
callq 0x11d0
andq $0x0, 0xa687(%rip)      # 0xd350
leaq 0x5dd4(%rip), %rsi      # 0x8aa4
jmp 0x2c1e