// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: iModbusTCP()
int iModbusTCP()
{
// jede Minute wird die Temperatur abgefragt, innerhalb 10sec muss die Antwort da sein, ansonsten wird die Verbindug geschlossen.
    static time_t tlast = 0;
    time_t now;
    time(&now);
    static time_t t_OeK;

    Modbus_send Msend;
    printf("ÖK%i",now-t_OeK);
    if ((now-t_OeK)>40)
    {
        if (t_OeK>0&&(now-t_OeK)>300)
            e3dc_config.stop = 100;
        t_OeK = now;
        if (isocket>0)
        {
            SocketClose(isocket);
            isocket = -1;
        }
    }
    if (e3dc_config.debug) printf("ÖKa%i",now-tlast);
    if (brequest||(not brequest&&(now-tlast)>10)) // 10 Sekunden auf die Antwoert warten
    {
        if (isocket <= 0)
        {
            if (e3dc_config.debug) printf("ÖKb%i",now-t_OeK);
            sprintf(server_ip,e3dc_config.heizung_ip);
            if (e3dc_config.debug)
                printf("BSC");
            
            isocket = SocketConnect(server_ip, 502);
            if (e3dc_config.debug)
                printf("ASC");
            iLength = 0;

        }
        if (e3dc_config.debug) printf("ÖKc%i",now-t_OeK);
        if (isocket > 0&&not brequest&&(now-tlast)>10) // Nur alle 10sec Anfrage starten
        {
            tlast = now;
            if (e3dc_config.debug) printf("ÖKd%i",now-t_OeK);
            send.resize(12);
            if (e3dc_config.debug)
                printf("RV");
            receive.resize(1024);
            if (e3dc_config.debug)
                printf("ARV");

// Heizkreise schalten in Abhängigkeit vom EVU und Status des jeweiligen heizkreis
// Wenn WP und oekofen aus sind, dann heizkreise ausschalten
// Wenn WP oder oekofen laufen Heizkreise einschalten
            
            if (temp[13] > 0 && not brequest && (now-t_OeK<20))
// Temperatur Puffer gesetzt?
            {
//  Kessel in Abhängigleit zu Aussentemperatur zu- und abschalten
//  Regelgröße ist die Zulufttemperatur der LWWP
//  daneben die aktuelle Temperatur vom Wetterportal
// und anstatt die Mitteltemperatur die aktuelle Temperatur zur Verifizierung
                if (wolf.size()>0)
                {
                    if (
                        (
                         (now - wolf[wpzl].t < 300)&&wolf[wpzl].wert>-90)
                        &&
                        //                        ((now - wolf[wpal].t < 300)&&wolf[wpal].wert<wolf[wpzl].wert)
                        //                        &&
                        ((now - wolf[wphl].t < 300)&&wolf[wphl].wert>0)
                        
                        )
                        isttemp = wolf[wpzl].wert;
                    if (wetter.size() > 0)
                    {
                        isttemp  = (isttemp  + wetter[0].temp)/2;
                        if (
                            (now - wolf[wpzl].t > 300)||wolf[wpzl].wert<-90
                            )
                            isttemp = wetter[0].temp;
                    }
                    // Wenn die Wolf läuft, dann die Berechnung isttemp mit zulufttemperatur bei Abtaubetrieb aussetzen
                    if (
                        (((now - wolf[wppw].t < 300)&&wolf[wppw].wert>0)
                         ||
                         ((now - wolf[wpalv].t < 300)&&wolf[wpalv].wert>0))
                        &&
                        ((now - wolf[wphl].t < 300)&&wolf[wphl].wert>0)
                        &&
                        ((now - wolf[wpzl].t < 300)&&wolf[wpzl].wert>-90)
                        )
                        isttemp = (wolf[wpzl].wert + wetter[0].temp)/2 + 1;
                    // wenn die WP läuft wird die isttemp um 1° hochgesetzt ???? überprüfen
                    if (isttemp>-99)
                    {
                        if ((isttemp<(e3dc_config.WPZWE))&&temp[17]==0)
                            //                if (temp[0]<(e3dc_config.WPZWE)*10&&temp[17]==0)
                        {
                            iLength  = iModbusTCP_Set(101,1,101); //Heizkessel register 101
                            iLength  = iModbusTCP_Get(101,0,101); //Heizkessel
                            //                    brequest = true;
                        }
                        // Pellets wird nur ausgeschaltet, wenn die WP-Anforderung für die WP da ist
                        if (isttemp>(e3dc_config.WPZWE+2)&&temp[17]==1)
                        {
                            iLength  = iModbusTCP_Set(101,0,101); //Heizkessel
                            iLength  = iModbusTCP_Get(101,0,101); //Heizkessel
                            //                    brequest = true;
                        }
                    }
                }
// Heizkreise schalten nur beim Abtauen nicht oder wenn WP aus
                if (temp[1]==0&&
                    (
//                     ((now - wolf[wphl].t < 300)&&wolf[wphl].wert>0)||
//                     (now - wolf[wphl].t > 300)||
//                     (now - wolf[wppw].t > 300)||
                     (wolf[wpeevk].wert==0)
                     ||
                      (now - wolf[wpbhg].t < 100&&wolf[wpbhg].wert!=6&&temp[17]==0)
//                     ||
//                     ((now - wolf[wppw].t < 300)&&wolf[wppw].wert==0)
                     )
                    &&

                    (
                        ((tasmota_status[0]==0||temp[14]>300)&&bHK1off==0)
                     ||
                        temp[17]>0)
                    )
// EVU Aus und Heizkreis Aus und fbh Anforderung ein -> einschalten
                {
                    iLength  = iModbusTCP_Set(11,1,11); //FBH? register 11
                    iLength  = iModbusTCP_Get(11,1,11); //FBH?
  //                  brequest = true;
                }
                if (temp[7]==0&&
                    (
//                     ((now - wolf[wphl].t < 300)&&wolf[wphl].wert>3)||
//                     (now - wolf[wphl].t > 300)||
//                     (now - wolf[wppw].t > 300)||
                     (wolf[wpeevk].wert==0)
                     ||
                      (now - wolf[wpbhg].t < 100&&wolf[wpbhg].wert!=6&&temp[17]==0)
//                     ||
//                     ((now - wolf[wppw].t < 300)&&wolf[wppw].wert==0)
                     )
                    &&
                    (
                     (
                      (tasmota_status[0]==0||temp[14]>300)&&bHK2off==0
                      )
                     ||temp[17]>0)
                    )
//                if ((tasmota_status[0]==0||temp[17]>0)&&temp[7]==0&&bHK2off==0)
                    // EVU Aus und Heizkreis Aus und WW Anforderung aus -> einschalten
                {
                    iLength  = iModbusTCP_Set(31,1,31); //HZK? register 31
                    iLength  = iModbusTCP_Get(31,1,31); //HZK?
//                    brequest = true;
                } // HK werden nur beim Abtauen abgeschaltet, wenn der pellets nicht läuft
                if (temp[1]==1&&
                    (
                     (tasmota_status[0]==1&&temp[17]==0&&temp[14]<300)
// wenn der Puffer > 30° läuft die FBH nach
                    ||
                     (bHK1off>0)
                    ||
                     ((now - wolf[wphl].t < 300)&&wolf[wphl].wert<0
//                      &&(now - wolf[wppw].t < 300)&&wolf[wppw].wert>0&&temp[17]==0
                      )
                    ||
                     (now - wolf[wpeevk].t < 300&&wolf[wpeevk].wert>0&&temp[17]==0)
                    ||
                     (now - wolf[wpbhg].t < 100&&wolf[wpbhg].wert==6&&temp[17]==0)

                    )
                    )
// EVU aus und Kessel aus ODER fbh Anforderung aus aber  Heizkreis aktiv -> HK ausschalten
                {
                    iLength  = iModbusTCP_Set(11,0,11); //FBH?
                    iLength  = iModbusTCP_Get(11,1,11); //FBH?
//                    brequest = true;
                }
                if (temp[7]==1&&
                    (
                     (tasmota_status[0]==1&&temp[17]==0&&temp[14]<300)
                    ||
                     (bHK2off>0)
                     ||
                      (
                       (now - wolf[wphl].t < 300)&&wolf[wphl].wert<0
//                       &&(now - wolf[wppw].t < 300)&&wolf[wppw].wert>0&&temp[17]==0
                       )
                     ||
                      (now - wolf[wpeevk].t < 300&&wolf[wpeevk].wert>0&&temp[17]==0)
                     ||
                      (now - wolf[wpbhg].t < 100&&wolf[wpbhg].wert==6&&temp[17]==0)
                     )
                    )
// wenn Puffer > 30° läuft die HKZ nach
// EVU aus und Kessel aus ODER WW Anforderung + Heizkreis aktiv -> HK ausschalten
                {
                    iLength  = iModbusTCP_Set(31,0,31); //HZK?
                    iLength  = iModbusTCP_Get(31,1,31); //HZK?
//                    brequest = true;

                }
            }
            {
                if (not brequest||t-t_OeK>30)
                {
                    brequest = false;
                    if (e3dc_config.debug)
                        printf("BGE");
                    iLength = iModbusTCP_Get(2,105,2); // Alle Register auf einmal abfragen
                    if (e3dc_config.debug)
                        printf("AGE");
                    myiLength = iLength;
                }
            }
        }
        else
            if (brequest)
            {
                if (e3dc_config.debug) printf("ÖKd%i",now-t_OeK);
                if (isocket > 0&&iLength < 0)
                    iLength = SocketRecvData(isocket,&receive[0],receive.size());
                if (e3dc_config.debug) printf("ÖKe%i",receive.size());
                if (iLength > 0)
                {
                    if (iLength > 100)
                        t_OeK = now;
                    int x2 = 9;
                    int x3 = 0;
                    x1 = receive[0]; // Startregister tan
                    iRegister = receive[0]; // Startregister tan
//                    x3 = x1;
                    for (x3=0;x3<oekofen.size()&&oekofen[x3] != x1;x3++);
                    
                    if (receive[7]==3)
                        while (x2 < iLength&&x3<oekofen.size())
                        {
//                            if (e3dc_config.debug) printf("ÖKe%i",x3);

                            if (oekofen[x3] == x1) // suchen der gewünschten register
                            {
                                temp[x3] = (receive[x2]*256+receive[x2+1]);
                                x3++;
                            }
                            WWTemp = float(receive[x2]*256+receive[x2+1])/10;
                            x1++;x2++;x2++;
                        }
                    else
                        WWTemp = float(receive[10]*256+receive[11])/10;
                    
                    //                SocketClose(isocket);
                    if (e3dc_config.debug) printf("ÖKf%i",x1);
                    SocketClose(isocket);
                    isocket = -1;
                    brequest = false;
                } else
//                    if (iLength <= 0)
                    {
                        SocketClose(isocket);
                        isocket = -1;
                        brequest = false;
                    }

            }}
    return iLength;
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
leaq 0x1a0(%rsp), %rdi
callq 0x2280
movq 0x1a0(%rsp), %rsi
subq 0x69d65(%rip), %rsi     # 0x6fd98
leaq 0x5a8a5(%rip), %rdi     # 0x608df
movb $0x0, %al
callq 0x2040
movq 0x1a0(%rsp), %rax
subq 0x69d48(%rip), %rax     # 0x6fd98
cmpq $0x28, %rax
jle 0x60ad
cmpq $0x0, 0x69d3a(%rip)     # 0x6fd98
jle 0x607e
movq 0x1a0(%rsp), %rax
subq 0x69d29(%rip), %rax     # 0x6fd98
cmpq $0x12c, %rax            # imm = 0x12C
jle 0x607e
movb $0x64, 0x68df8(%rip)    # 0x6ee76
movq 0x1a0(%rsp), %rax
movq %rax, 0x69d0b(%rip)     # 0x6fd98
cmpl $0x0, 0x69cf4(%rip)     # 0x6fd88
jle 0x60ab
movl 0x69cec(%rip), %edi     # 0x6fd88
callq 0x364b0
movl $0xffffffff, 0x69cdd(%rip) # imm = 0xFFFFFFFF
jmp 0x60ad
testb $0x1, 0x68dad(%rip)     # 0x6ee61
je 0x60d3
movq 0x1a0(%rsp), %rsi
subq 0x69ccb(%rip), %rsi     # 0x6fd90
leaq 0x5a819(%rip), %rdi     # 0x608e5
movb $0x0, %al
callq 0x2040
testb $0x1, 0x69cb2(%rip)     # 0x6fd8c
jne 0x6102
testb $0x1, 0x69ca9(%rip)     # 0x6fd8c
jne 0x7054
movq 0x1a0(%rsp), %rax
subq 0x69c98(%rip), %rax     # 0x6fd90
cmpq $0xa, %rax
jle 0x7054
cmpl $0x0, 0x69c7f(%rip)     # 0x6fd88
jg 0x619e
testb $0x1, 0x68d4b(%rip)     # 0x6ee61
je 0x6135
movq 0x1a0(%rsp), %rsi
subq 0x69c71(%rip), %rsi     # 0x6fd98
leaq 0x5a7be(%rip), %rdi     # 0x608ec
movb $0x0, %al
callq 0x2040
leaq 0x69b84(%rip), %rdi     # 0x6fcc0
leaq 0x687f1(%rip), %rsi     # 0x6e934
addq $0x28, %rsi
movb $0x0, %al
callq 0x2060
testb $0x1, 0x68d0c(%rip)     # 0x6ee61
je 0x6165
leaq 0x5a74e(%rip), %rdi     # 0x608ac
movb $0x0, %al
callq 0x2040
leaq 0x69b54(%rip), %rdi     # 0x6fcc0
movl $0x1f6, %esi            # imm = 0x1F6
callq 0x360d0
movl %eax, 0x69c0c(%rip)     # 0x6fd88
testb $0x1, 0x68cde(%rip)     # 0x6ee61
je 0x6193
leaq 0x5a724(%rip), %rdi     # 0x608b0
movb $0x0, %al
callq 0x2040
movq $0x0, 0x69ac2(%rip) # 0x6fc60
testb $0x1, 0x68cbc(%rip)     # 0x6ee61
je 0x61c4
movq 0x1a0(%rsp), %rsi
subq 0x69be2(%rip), %rsi     # 0x6fd98
leaq 0x5a736(%rip), %rdi     # 0x608f3
movb $0x0, %al
callq 0x2040
cmpl $0x0, 0x69bbd(%rip)     # 0x6fd88
jle 0x6c86
testb $0x1, 0x69bb4(%rip)     # 0x6fd8c
jne 0x6c86
movq 0x1a0(%rsp), %rax
subq 0x69ba3(%rip), %rax     # 0x6fd90
cmpq $0xa, %rax
jle 0x6c86
movq 0x1a0(%rsp), %rax
movq %rax, 0x69b8a(%rip)     # 0x6fd90
testb $0x1, 0x68c54(%rip)     # 0x6ee61
je 0x622c
movq 0x1a0(%rsp), %rsi
subq 0x69b7a(%rip), %rsi     # 0x6fd98
leaq 0x5a6d5(%rip), %rdi     # 0x608fa
movb $0x0, %al
callq 0x2040
leaq 0x69a4d(%rip), %rdi     # 0x6fc80
movl $0xc, %esi
callq 0x1cb60
testb $0x1, 0x68c1d(%rip)     # 0x6ee61
je 0x6254
leaq 0x5a6b5(%rip), %rdi     # 0x60902
movb $0x0, %al
callq 0x2040
leaq 0x69a3d(%rip), %rdi     # 0x6fc98
movl $0x400, %esi            # imm = 0x400
callq 0x1cb60
testb $0x1, 0x68bf5(%rip)     # 0x6ee61
je 0x627c
leaq 0x5a68c(%rip), %rdi     # 0x60901
movb $0x0, %al
callq 0x2040
movswl 0x69b37(%rip), %eax     # 0x6fdba
cmpl $0x0, %eax
jle 0x6c09
testb $0x1, 0x69af9(%rip)     # 0x6fd8c
jne 0x6c09
movq 0x1a0(%rsp), %rax
subq 0x69af0(%rip), %rax     # 0x6fd98
cmpq $0x14, %rax
jge 0x6c09
leaq 0x6817f(%rip), %rdi     # 0x6e438
callq 0x1cc40
cmpq $0x0, %rax
jbe 0x6705
movq 0x1a0(%rsp), %rax
movq %rax, 0xb8(%rsp)
movslq 0x6994d(%rip), %rsi     # 0x6fc2c
leaq 0x68152(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0xb8(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x63a3
movslq 0x69920(%rip), %rsi     # 0x6fc2c
leaq 0x68125(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x59d2f(%rip), %xmm1    # 0x60054
ucomiss %xmm1, %xmm0
jbe 0x63a3
movq 0x1a0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movslq 0x698d3(%rip), %rsi     # 0x6fc14
leaq 0x680f0(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0xb0(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x63a3
movslq 0x698aa(%rip), %rsi     # 0x6fc14
leaq 0x680c7(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x63a3
movslq 0x698a2(%rip), %rsi     # 0x6fc2c
leaq 0x680a7(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss %xmm0, 0x67f85(%rip)    # 0x6e328
leaq 0x68076(%rip), %rdi     # 0x6e420
callq 0x1cc80
cmpq $0x0, %rax
jbe 0x6475
movss 0x67f67(%rip), %xmm0    # 0x6e328
movss %xmm0, 0xa4(%rsp)
leaq 0x6804f(%rip), %rdi     # 0x6e420
xorl %eax, %eax
movl %eax, %esi
callq 0x1cca0
movss 0xa4(%rsp), %xmm0
addss 0x8(%rax), %xmm0
movss 0x59c14(%rip), %xmm1    # 0x60004
divss %xmm1, %xmm0
movss %xmm0, 0x67f2c(%rip)    # 0x6e328
movq 0x1a0(%rsp), %rax
movq %rax, 0xa8(%rsp)
movslq 0x69819(%rip), %rsi     # 0x6fc2c
leaq 0x6801e(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0xa8(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jg 0x6456
movslq 0x697f0(%rip), %rsi     # 0x6fc2c
leaq 0x67ff5(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x59c04(%rip), %xmm0    # 0x60054
ucomiss 0x68(%rax), %xmm0
jbe 0x6473
leaq 0x67fc3(%rip), %rdi     # 0x6e420
xorl %eax, %eax
movl %eax, %esi
callq 0x1cca0
movss 0x8(%rax), %xmm0
movss %xmm0, 0x67eb5(%rip)    # 0x6e328
jmp 0x6475
movq 0x1a0(%rsp), %rax
movq %rax, 0x98(%rsp)
movslq 0x6978c(%rip), %rsi     # 0x6fc18
leaq 0x67fa5(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x98(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x64ce
movslq 0x69763(%rip), %rsi     # 0x6fc18
leaq 0x67f7c(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
ja 0x652f
movq 0x1a0(%rsp), %rax
movq %rax, 0x90(%rsp)
movslq 0x6974b(%rip), %rsi     # 0x6fc30
leaq 0x67f4c(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x90(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6647
movslq 0x6971e(%rip), %rsi     # 0x6fc30
leaq 0x67f1f(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6647
movq 0x1a0(%rsp), %rax
movq %rax, 0x88(%rsp)
movslq 0x696ce(%rip), %rsi     # 0x6fc14
leaq 0x67eeb(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x88(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6647
movslq 0x696a1(%rip), %rsi     # 0x6fc14
leaq 0x67ebe(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6647
movq 0x1a0(%rsp), %rax
movq %rax, 0x80(%rsp)
movslq 0x69685(%rip), %rsi     # 0x6fc2c
leaq 0x67e8a(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x80(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6647
movslq 0x6965c(%rip), %rsi     # 0x6fc2c
leaq 0x67e61(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x59a6b(%rip), %xmm1    # 0x60054
ucomiss %xmm1, %xmm0
jbe 0x6647
movslq 0x69637(%rip), %rsi     # 0x6fc2c
leaq 0x67e3c(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss %xmm0, 0x7c(%rsp)
leaq 0x67e0d(%rip), %rdi     # 0x6e420
xorl %eax, %eax
movl %eax, %esi
callq 0x1cca0
movss 0x7c(%rsp), %xmm0
addss 0x8(%rax), %xmm0
movss 0x599d5(%rip), %xmm1    # 0x60004
divss %xmm1, %xmm0
movss 0x599e1(%rip), %xmm1    # 0x6001c
addss %xmm1, %xmm0
movss %xmm0, 0x67ce1(%rip)    # 0x6e328
movss 0x67cd9(%rip), %xmm0    # 0x6e328
movss 0x599b5(%rip), %xmm1    # 0x6000c
ucomiss %xmm1, %xmm0
jbe 0x6703
movss 0x67cc0(%rip), %xmm1    # 0x6e328
movss 0x688e4(%rip), %xmm0    # 0x6ef54
ucomiss %xmm1, %xmm0
jbe 0x66ae
movswl 0x69746(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x66ae
movl $0x65, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x695c7(%rip)     # 0x6fc60
movl $0x65, %edx
xorl %esi, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x695b2(%rip)     # 0x6fc60
movss 0x67c72(%rip), %xmm0    # 0x6e328
movss 0x59946(%rip), %xmm1    # 0x60004
addss 0x6888e(%rip), %xmm1    # 0x6ef54
ucomiss %xmm1, %xmm0
jbe 0x6701
movswl 0x696f0(%rip), %eax     # 0x6fdc2
cmpl $0x1, %eax
jne 0x6701
movl $0x65, %edx
xorl %esi, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x69574(%rip)     # 0x6fc60
movl $0x65, %edx
xorl %esi, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x6955f(%rip)     # 0x6fc60
jmp 0x6703
jmp 0x6705
movswl 0x69696(%rip), %eax     # 0x6fda2
cmpl $0x0, %eax
jne 0x67ff
movslq 0x6951c(%rip), %rsi     # 0x6fc38
leaq 0x67d15(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x6739
jp 0x6739
jmp 0x67a3
movq 0x1a0(%rsp), %rax
movq %rax, 0x70(%rsp)
movslq 0x694ef(%rip), %rsi     # 0x6fc3c
leaq 0x67ce4(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x70(%rsp), %rax
subq (%rcx), %rax
cmpq $0x64, %rax
jge 0x67ff
movslq 0x694c7(%rip), %rsi     # 0x6fc3c
leaq 0x67cbc(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x598ca(%rip), %xmm1    # 0x60058
ucomiss %xmm1, %xmm0
jne 0x6797
jp 0x6797
jmp 0x67ff
movswl 0x69624(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x67ff
cmpl $0x0, 0x67b86(%rip)     # 0x6e330
je 0x67ba
movswl 0x69609(%rip), %eax     # 0x6fdbc
cmpl $0x12c, %eax            # imm = 0x12C
jle 0x67c3
cmpl $0x0, 0x69607(%rip)     # 0x6fdc8
je 0x67cf
movswl 0x695f8(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jle 0x67ff
movl $0xb, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x69479(%rip)     # 0x6fc60
movl $0xb, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x69461(%rip)     # 0x6fc60
movswl 0x695a8(%rip), %eax     # 0x6fdae
cmpl $0x0, %eax
jne 0x68f9
movslq 0x69422(%rip), %rsi     # 0x6fc38
leaq 0x67c1b(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x6833
jp 0x6833
jmp 0x689d
movq 0x1a0(%rsp), %rax
movq %rax, 0x68(%rsp)
movslq 0x693f5(%rip), %rsi     # 0x6fc3c
leaq 0x67bea(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x68(%rsp), %rax
subq (%rcx), %rax
cmpq $0x64, %rax
jge 0x68f9
movslq 0x693cd(%rip), %rsi     # 0x6fc3c
leaq 0x67bc2(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x597d0(%rip), %xmm1    # 0x60058
ucomiss %xmm1, %xmm0
jne 0x6891
jp 0x6891
jmp 0x68f9
movswl 0x6952a(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x68f9
cmpl $0x0, 0x67a8c(%rip)     # 0x6e330
je 0x68b4
movswl 0x6950f(%rip), %eax     # 0x6fdbc
cmpl $0x12c, %eax            # imm = 0x12C
jle 0x68bd
cmpl $0x0, 0x69511(%rip)     # 0x6fdcc
je 0x68c9
movswl 0x694fe(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jle 0x68f9
movl $0x1f, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x6937f(%rip)     # 0x6fc60
movl $0x1f, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x69367(%rip)     # 0x6fc60
movswl 0x694a2(%rip), %eax     # 0x6fda2
cmpl $0x1, %eax
jne 0x6a80
cmpl $0x1, 0x67a20(%rip)     # 0x6e330
jne 0x6930
movswl 0x694a9(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x6930
movswl 0x69497(%rip), %eax     # 0x6fdbc
cmpl $0x12c, %eax            # imm = 0x12C
jl 0x6a53
cmpl $0x0, 0x69491(%rip)     # 0x6fdc8
jg 0x6a53
movq 0x1a0(%rsp), %rax
movq %rax, 0x60(%rsp)
movslq 0x692c3(%rip), %rsi     # 0x6fc14
leaq 0x67ae0(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x60(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6990
movslq 0x6929d(%rip), %rsi     # 0x6fc14
leaq 0x67aba(%rip), %rdi     # 0x6e438
callq 0x1cc60
xorps %xmm0, %xmm0
ucomiss 0x68(%rax), %xmm0
ja 0x6a53
movq 0x1a0(%rsp), %rax
movq %rax, 0x58(%rsp)
movslq 0x69294(%rip), %rsi     # 0x6fc38
leaq 0x67a8d(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x58(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x69ef
movslq 0x6926e(%rip), %rsi     # 0x6fc38
leaq 0x67a67(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x69ef
movswl 0x693d8(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
je 0x6a53
movq 0x1a0(%rsp), %rax
movq %rax, 0x50(%rsp)
movslq 0x69239(%rip), %rsi     # 0x6fc3c
leaq 0x67a2e(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x50(%rsp), %rax
subq (%rcx), %rax
cmpq $0x64, %rax
jge 0x6a80
movslq 0x69215(%rip), %rsi     # 0x6fc3c
leaq 0x67a0a(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x59618(%rip), %xmm1    # 0x60058
ucomiss %xmm1, %xmm0
jne 0x6a80
jp 0x6a80
movswl 0x69374(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x6a80
movl $0xb, %edx
xorl %esi, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x691f8(%rip)     # 0x6fc60
movl $0xb, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x691e0(%rip)     # 0x6fc60
movswl 0x69327(%rip), %eax     # 0x6fdae
cmpl $0x1, %eax
jne 0x6c07
cmpl $0x1, 0x67899(%rip)     # 0x6e330
jne 0x6ab7
movswl 0x69322(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x6ab7
movswl 0x69310(%rip), %eax     # 0x6fdbc
cmpl $0x12c, %eax            # imm = 0x12C
jl 0x6bda
cmpl $0x0, 0x6930e(%rip)     # 0x6fdcc
jg 0x6bda
movq 0x1a0(%rsp), %rax
movq %rax, 0x48(%rsp)
movslq 0x6913c(%rip), %rsi     # 0x6fc14
leaq 0x67959(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x48(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6b17
movslq 0x69116(%rip), %rsi     # 0x6fc14
leaq 0x67933(%rip), %rdi     # 0x6e438
callq 0x1cc60
xorps %xmm0, %xmm0
ucomiss 0x68(%rax), %xmm0
ja 0x6bda
movq 0x1a0(%rsp), %rax
movq %rax, 0x40(%rsp)
movslq 0x6910d(%rip), %rsi     # 0x6fc38
leaq 0x67906(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x40(%rsp), %rax
subq (%rcx), %rax
cmpq $0x12c, %rax            # imm = 0x12C
jge 0x6b76
movslq 0x690e7(%rip), %rsi     # 0x6fc38
leaq 0x678e0(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6b76
movswl 0x69251(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
je 0x6bda
movq 0x1a0(%rsp), %rax
movq %rax, 0x38(%rsp)
movslq 0x690b2(%rip), %rsi     # 0x6fc3c
leaq 0x678a7(%rip), %rdi     # 0x6e438
callq 0x1cc60
movq %rax, %rcx
movq 0x38(%rsp), %rax
subq (%rcx), %rax
cmpq $0x64, %rax
jge 0x6c07
movslq 0x6908e(%rip), %rsi     # 0x6fc3c
leaq 0x67883(%rip), %rdi     # 0x6e438
callq 0x1cc60
movss 0x68(%rax), %xmm0
movss 0x59491(%rip), %xmm1    # 0x60058
ucomiss %xmm1, %xmm0
jne 0x6c07
jp 0x6c07
movswl 0x691ed(%rip), %eax     # 0x6fdc2
cmpl $0x0, %eax
jne 0x6c07
movl $0x1f, %edx
xorl %esi, %esi
movl %edx, %edi
callq 0x5ac0
movq %rax, 0x69071(%rip)     # 0x6fc60
movl $0x1f, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x69059(%rip)     # 0x6fc60
jmp 0x6c09
testb $0x1, 0x6917c(%rip)     # 0x6fd8c
je 0x6c26
movq 0x68fdf(%rip), %rax     # 0x6fbf8
subq 0x69178(%rip), %rax     # 0x6fd98
cmpq $0x1e, %rax
jle 0x6c81
movb $0x0, 0x6915f(%rip)     # 0x6fd8c
testb $0x1, 0x6822d(%rip)     # 0x6ee61
je 0x6c44
leaq 0x59cc8(%rip), %rdi     # 0x60905
movb $0x0, %al
callq 0x2040
movl $0x2, %edx
movl $0x69, %esi
movl %edx, %edi
callq 0x5d90
movq %rax, 0x69004(%rip)     # 0x6fc60
testb $0x1, 0x681fe(%rip)     # 0x6ee61
je 0x6c73
leaq 0x59c9d(%rip), %rdi     # 0x60909
movb $0x0, %al
callq 0x2040
movq 0x68fe6(%rip), %rax     # 0x6fc60
movq %rax, 0x68fe7(%rip)     # 0x6fc68
jmp 0x7052
testb $0x1, 0x690ff(%rip)     # 0x6fd8c
je 0x7050
testb $0x1, 0x681c7(%rip)     # 0x6ee61
je 0x6cb9
movq 0x1a0(%rsp), %rsi
subq 0x690ed(%rip), %rsi     # 0x6fd98
leaq 0x59c48(%rip), %rdi     # 0x608fa
movb $0x0, %al
callq 0x2040
cmpl $0x0, 0x690c8(%rip)     # 0x6fd88
jle 0x6d10
cmpq $0x0, 0x68f96(%rip)     # 0x6fc60
jge 0x6d10
movl 0x690b6(%rip), %eax     # 0x6fd88
movl %eax, 0x2c(%rsp)
leaq 0x68fbb(%rip), %rdi     # 0x6fc98
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movq %rax, 0x30(%rsp)
leaq 0x68fa6(%rip), %rdi     # 0x6fc98
callq 0x1cc20
movl 0x2c(%rsp), %edi
movq 0x30(%rsp), %rsi
movl %eax, %edx
callq 0x36590
cltq
movq %rax, 0x68f50(%rip)     # 0x6fc60
testb $0x1, 0x6814a(%rip)     # 0x6ee61
je 0x6d36
leaq 0x68f78(%rip), %rdi     # 0x6fc98
callq 0x1cc20
movq %rax, %rsi
leaq 0x59bde(%rip), %rdi     # 0x6090d
movb $0x0, %al
callq 0x2040
cmpq $0x0, 0x68f22(%rip)     # 0x6fc60
jle 0x7032
cmpq $0x64, 0x68f14(%rip)    # 0x6fc60
jle 0x6d5d
movq 0x1a0(%rsp), %rax
movq %rax, 0x6903b(%rip)     # 0x6fd98
movl $0x9, 0xc8(%rsp)
movl $0x0, 0xc4(%rsp)
leaq 0x68f1e(%rip), %rdi     # 0x6fc98
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movzbl (%rax), %eax
movl %eax, 0x69044(%rip)     # 0x6fdd0
leaq 0x68f05(%rip), %rdi     # 0x6fc98
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movzbl (%rax), %eax
movl %eax, 0x68ecb(%rip)     # 0x6fc70
movl $0x0, 0xc4(%rsp)
movslq 0xc4(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x67510(%rip), %rdi     # 0x6e2d4
callq 0x1ccc0
movq 0x20(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x2b(%rsp)
jae 0x6dff
movslq 0xc4(%rsp), %rsi
leaq 0x674e9(%rip), %rdi     # 0x6e2d4
callq 0x1ccd0
movl (%rax), %eax
cmpl 0x68fd8(%rip), %eax     # 0x6fdd0
setne %al
movb %al, 0x2b(%rsp)
movb 0x2b(%rsp), %al
testb $0x1, %al
jne 0x6e09
jmp 0x6e1e
jmp 0x6e0b
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x6db0
leaq 0x68e73(%rip), %rdi     # 0x6fc98
movl $0x7, %esi
callq 0x1cc00
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x6fa7
jmp 0x6e3d
movslq 0xc8(%rsp), %rcx
xorl %eax, %eax
cmpq 0x68e12(%rip), %rcx     # 0x6fc60
movb %al, 0x1f(%rsp)
jge 0x6e7f
movslq 0xc4(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x6746c(%rip), %rdi     # 0x6e2d4
callq 0x1ccc0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x6e8c
jmp 0x6fa5
movslq 0xc4(%rsp), %rsi
leaq 0x67439(%rip), %rdi     # 0x6e2d4
callq 0x1ccd0
movl (%rax), %eax
cmpl 0x68f28(%rip), %eax     # 0x6fdd0
jne 0x6f14
movslq 0xc8(%rsp), %rsi
leaq 0x68ddf(%rip), %rdi     # 0x6fc98
callq 0x1cc00
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, 0xc(%rsp)
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x68dbc(%rip), %rdi     # 0x6fc98
callq 0x1cc00
movq %rax, %rcx
movl 0xc(%rsp), %eax
movzbl (%rcx), %ecx
addl %ecx, %eax
movw %ax, %dx
movslq 0xc4(%rsp), %rcx
leaq 0x68ea1(%rip), %rax     # 0x6fda0
movw %dx, (%rax,%rcx,2)
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
movslq 0xc8(%rsp), %rsi
leaq 0x68d75(%rip), %rdi     # 0x6fc98
callq 0x1cc00
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, 0x8(%rsp)
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x68d52(%rip), %rdi     # 0x6fc98
callq 0x1cc00
movq %rax, %rcx
movl 0x8(%rsp), %eax
movzbl (%rcx), %ecx
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
movss 0x590c1(%rip), %xmm1    # 0x60024
divss %xmm1, %xmm0
movss %xmm0, 0x67915(%rip)    # 0x6e884
movl 0x68e5b(%rip), %eax     # 0x6fdd0
addl $0x1, %eax
movl %eax, 0x68e52(%rip)     # 0x6fdd0
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0x6e3d
jmp 0x6ff7
leaq 0x68cea(%rip), %rdi     # 0x6fc98
movl $0xa, %esi
callq 0x1cc00
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, 0x4(%rsp)
leaq 0x68ccf(%rip), %rdi     # 0x6fc98
movl $0xb, %esi
callq 0x1cc00
movq %rax, %rcx
movl 0x4(%rsp), %eax
movzbl (%rcx), %ecx
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
movss 0x59039(%rip), %xmm1    # 0x60024
divss %xmm1, %xmm0
movss %xmm0, 0x6788d(%rip)    # 0x6e884
testb $0x1, 0x67e63(%rip)     # 0x6ee61
je 0x7014
movl 0x68dca(%rip), %esi     # 0x6fdd0
leaq 0x59907(%rip), %rdi     # 0x60914
movb $0x0, %al
callq 0x2040
movl 0x68d6e(%rip), %edi     # 0x6fd88
callq 0x364b0
movl $0xffffffff, 0x68d5f(%rip) # imm = 0xFFFFFFFF
movb $0x0, 0x68d5c(%rip)     # 0x6fd8c
jmp 0x704e
movl 0x68d50(%rip), %edi     # 0x6fd88
callq 0x364b0
movl $0xffffffff, 0x68d41(%rip) # imm = 0xFFFFFFFF
movb $0x0, 0x68d3e(%rip)     # 0x6fd8c
jmp 0x7050
jmp 0x7052
jmp 0x7054
movq 0x68c05(%rip), %rax     # 0x6fc60
addq $0x1a8, %rsp            # imm = 0x1A8
retq
nopw %cs:(%rax,%rax)