// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/RscpExampleMain.cpp
// Function: WBProcess(SRscpFrameBuffer*)
int WBProcess(SRscpFrameBuffer * frameBuffer) {
/*   Steuerung der Wallbox
*/
    const int cMinimumladestand = 15;
    const int iMaxcurrent=31;
    static float_t iDyLadeende;
    static uint8_t WBChar_alt = 0;
    static int32_t iWBMinimumPower = 1300; // MinimumPower bei 6A
    static int iLadeleistung[27][4]; //27*4 Zellen
    static bool bWBOn = false; // Wallbox eingeschaltet

//    if (!bWBLademodus) // WB Steuerung nur bei Sonnenmodus
//    return 0;

    if (iWBStatus == 0)  {

        iDyLadeende = e3dc_config.ladeschwelle;
        iFc = 0;
        iBattLoad = 100;
        
        if (fBatt_SOC > iDyLadeende) iDyLadeende = fBatt_SOC;

        
        
        memcpy(WBchar6,"\x00\x06\x00\x00\x00\x00",6);
        WBchar6[1]=WBchar[2];

        if (WBchar[2]==32)
            bWBmaxLadestrom = true; else
            bWBmaxLadestrom = false;

        
            if (WBchar[2] > 4)
            iWBStatus = 5;
            else return 0;
        
//            createRequestWBData(frameBuffer);
    }
    
    if (iWBStatus == 1) {
        if (bWBmaxLadestrom)  {//Wenn der Ladestrom auf 32, dann erfolgt keine
            if ((fBatt_SOC>cMinimumladestand)&&(fAvPower_Grid<400)) { //Wenn der Ladestrom auf 32, dann erfolgt keine Begrenzung des Ladestroms im Sonnenmodus
            if ((WBchar6[1]<32)&&(fBatt_SOC>(cMinimumladestand+2))) {
                WBchar6[1]=32;
                createRequestWBData(frameBuffer);
                WBChar_alt = WBchar6[1];
                iWBStatus = 7; }
        }
        }     else if ((!bWBLademodus)&& (WBchar6[1] > 6)&&(fPower_WB == 0))  // Immer von 6A aus starten
{ // Wallbox lädt nicht
    if ((not bWBmaxLadestrom)&&(not bWBOn))
    { WBchar6[1] = 6;
//      WBchar6[4] = 1; // Laden starten
        bWBOn = true;
        createRequestWBData(frameBuffer);
        WBchar6[4] = 0; // toggle aus
        iWBStatus = 7;
    }
    else WBchar6[1] = 32;
}

        
        if (fBatt_SOC > iDyLadeende) iDyLadeende = fBatt_SOC;
        if ((fPower_WB == 0)&&(iWBStatus==1)&&bWBLademodus) {
            iDyLadeende = cMinimumladestand;
        }
                if ( (fPower_WB == 0) &&bWBLademodus &&
               ( ((fPower_Grid - iPower_Bat)< -5500)
             ||(
                ( ((fPower_Grid - iPower_Bat)< (iWBMinimumPower*-1))&&(fBatt_SOC>cMinimumladestand) )
             ||
                ( ((fPower_Grid - iPower_Bat)< -1800)&&(fBatt_SOC>cMinimumladestand)&&
                 ((fAvBatterie>iFc)||(fBatt_SOC>94)) ) // größer Mindesladeschwellex
             ||
                ((fAvPower_Grid< -500)&&(fBatt_SOC>=iDyLadeende))
                )
             )
//            && (WBchar6[1] != 6)  // Immer von 6A aus starten
            ) { // Wallbox lädt nicht
            if ((not bWBmaxLadestrom)&&(iWBStatus==1))
                { WBchar6[1] = 6;
                    int x1,x2;
                    for (x1=1;x1<=33;x1++) {};

                WBchar6[4] = 1; // Laden starten
                if (not bWBOn)
                createRequestWBData(frameBuffer);
                bWBOn = true;
                WBchar6[4] = 0; // Toggle aus
                WBChar_alt = WBchar6[1];
                iWBStatus = 20;
                }
                    else WBchar6[1] = 32;
        }
        if ((fPower_WB > 1000) && not (bWBmaxLadestrom)) { // Wallbox lädt
            if (WBchar6[1]==6) iWBMinimumPower = fPower_WB;
            if (((fPower_Grid< -200)&&(fAvPower_Grid < -100)) && (iPower_Bat >= 0) && (WBchar6[1]<iMaxcurrent)){
                WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -10*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -9*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -8*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -7*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -6*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                if ((fPower_Grid-iPower_Bat < -5*700) && (iPower_Bat >= 0)&& (WBchar6[1]<iMaxcurrent)) WBchar6[1]++;
                    createRequestWBData(frameBuffer);
//                if ((WBchar6[1]>16)&&(WBChar_alt<= 16)) iWBStatus = 30; else
                    iWBStatus = 12;
                WBChar_alt = WBchar6[1];

                // Länger warten bei Wechsel von <= 16A auf > 16A hohen Stömen

             }
            if (
                 ((iPower_Bat-fPower_Grid < -2600)&&(WBchar6[1] > 6)) ||
                 ((iPower_Bat-fPower_Grid < -2000)&&(fAvBatterie<-1000)&&(WBchar6[1] > 6)) ||
                 ((iPower_Bat < 2000) && (iPower_Bat+400 < iBattLoad) &&(fBatt_SOC < cMinimumladestand)&&(WBchar6[1] > 6)) ||
//                ((fBatt_SOC < e3dc_config.ladeende)&&
                ((((fBatt_SOC < e3dc_config.ladeende)&&(iPower_Bat<(2000)))||
                ((fBatt_SOC >= e3dc_config.ladeende)&&(fBatt_SOC < 93)&&
                 (iPower_Bat<(1500))))&&
                  ((iPower_Bat+800)<iBattLoad)&&
                  ((iPower_Bat+400)<iFc)&&
//                   ((iPower_Bat)<iMinLade)&&
                  ((fAvBatterie+200)<iFc)&&
//                  ((fAvBatterie)<iMinLade)&&
                  (WBchar6[1]>6))
                 ) { // Mind. 2000W Batterieladen
                WBchar6[1]--;
                for (int X1 = 3; X1 < 20; X1++)
                    if (((iPower_Bat-fPower_Grid) < (iBattLoad-700*X1))&& (WBchar6[1]>6)) WBchar6[1]--; else break;
                
                if (WBchar6[1]==31) WBchar6[1]--;;
                createRequestWBData(frameBuffer);
                WBChar_alt = WBchar6[1];
//                if (WBchar6[1]>16) iWBStatus = 15; else // Länger warten bei hohen Stömen
                iWBStatus = 12;  // Länger warten bei hohen Stömen

            } else
// Bedingung zum Wallbox abschalten ermitteln
//
                
                
            if (
                   ((iPower_Bat-fPower_Grid < -2700)&&(fBatt_SOC < 94))
                || ((fPower_Grid > 3000)&&(iPower_Bat<1000))   //Speicher > 94%
                || ((iPower_Bat-fPower_Grid < -2000)&&(fBatt_SOC < iDyLadeende-1)&&(iBattLoad>0))
                || ((iPower_Bat-fPower_Grid < -1500)&&(fBatt_SOC < iDyLadeende-1.5)&&(iBattLoad>0))
                || ((iPower_Bat-fPower_Grid < -1000)&&(fBatt_SOC < iDyLadeende-2)&&(iBattLoad>0))
                || ((iPower_Bat-fPower_Grid < -500)&&(fBatt_SOC < iDyLadeende-2.5)&&(iBattLoad>0))
                || (fAvPower_Grid>400)          // Hohem Netzbezug
                                                // Bei Speicher < 94%
                || ((iPower_Bat-fPower_Grid < -1500)&&(fAvBatterie<-1000)&&(fBatt_SOC < 94)&&(iBattLoad>0))
                || ((iPower_Bat-fPower_Grid < -1000)&&((fAvBatterie<(iFc-400))||(fAvBatterie<0))&&(fBatt_SOC < 94)&&(iBattLoad>0))
                )  { // höchstens. 1500W Batterieentladen wenn voll
                {if ((WBchar6[1] > 5)&&bWBLademodus)
                    WBchar6[1]--;

                    for (int X1 = 3; X1 < 20; X1++)
                        if (((iPower_Bat-fPower_Grid) < (iBattLoad-700*X1))&& (WBchar6[1]>6)) WBchar6[1]--;
                        else break;


                    if (WBchar6[1]!=WBchar[2]){
                        if (WBchar6[1]==5) {(WBchar6[1]=6);
                            WBchar6[4] = 1;
                            bWBOn = false;
                        } // Laden beenden
                        createRequestWBData(frameBuffer);}
                    WBChar_alt = WBchar6[1];
                    if (WBchar6[4] == 0)
                        iWBStatus = 7; else // Warten bis Neustart
                        iWBStatus = 20;  // Warten bis Neustart
                }}
    }
        }
        printf("Power %0i DyLadeende %0.01f ",iWBMinimumPower, iDyLadeende);
    printf(" iWBStatus %i",iWBStatus);
    if (iWBStatus > 1) iWBStatus--;
return 0;
}

// Assembly:
pushq %rbx
movl 0x126ce(%rip), %eax     # 0x157c4
cmpl $0x1, %eax
je 0x3172
testl %eax, %eax
jne 0x357c
movzbl 0x12680(%rip), %eax     # 0x1578a
cvtsi2ss %eax, %xmm1
movss %xmm1, 0x12722(%rip)    # 0x15838
andl $0x0, 0x126eb(%rip)     # 0x15808
movl $0x64, 0x126e9(%rip)    # 0x15810
movss 0x126bd(%rip), %xmm0    # 0x157ec
ucomiss %xmm1, %xmm0
jbe 0x313c
movss %xmm0, 0x126fc(%rip)    # 0x15838
andw $0x0, 0x12688(%rip)     # 0x157cc
movl $0x600, 0x1267a(%rip)   # imm = 0x600
movb 0x126ee(%rip), %al      # 0x15842
movb %al, 0x1266f(%rip)      # 0x157c9
cmpb $0x20, %al
sete 0x126e5(%rip)           # 0x15848
cmpb $0x4, %al
jbe 0x35bf
pushq $0x5
jmp 0x3575
movq %rdi, %rbx
cmpb $0x1, 0x126cc(%rip)     # 0x15848
jne 0x31d5
movss 0x12666(%rip), %xmm0    # 0x157ec
xorl %eax, %eax
ucomiss 0xde91(%rip), %xmm0     # 0x11020
movb $0x1, %cl
jbe 0x323c
movss 0xde85(%rip), %xmm1     # 0x11024
ucomiss 0x126a6(%rip), %xmm1    # 0x1584c
jbe 0x323c
xorl %eax, %eax
ucomiss 0xde73(%rip), %xmm0     # 0x11028
jbe 0x323c
cmpb $0x1f, 0x12607(%rip)    # 0x157c9
ja 0x323c
movb $0x20, 0x125fe(%rip)    # 0x157c9
movq %rbx, %rdi
callq 0x2763
jmp 0x322e
movb $0x1, %cl
xorl %eax, %eax
cmpb $0x0, 0x12670(%rip)     # 0x15850
jne 0x323c
cmpb $0x7, 0x125e0(%rip)     # 0x157c9
jb 0x323c
movss 0x1263d(%rip), %xmm0    # 0x15830
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x323c
jp 0x323c
cmpb $0x0, 0x12638(%rip)     # 0x1583c
je 0x3211
movb $0x20, 0x125bc(%rip)    # 0x157c9
xorl %eax, %eax
jmp 0x323c
movb $0x6, 0x125b1(%rip)     # 0x157c9
movb $0x1, 0x1261d(%rip)     # 0x1583c
movq %rbx, %rdi
callq 0x2763
movb $0x0, 0x1259e(%rip)     # 0x157cc
movl $0x7, 0x1258c(%rip)     # 0x157c4
movb $0x1, %al
xorl %ecx, %ecx
movss 0x125a8(%rip), %xmm1    # 0x157ec
movss 0x125ec(%rip), %xmm2    # 0x15838
ucomiss %xmm2, %xmm1
jbe 0x325c
movss %xmm1, 0x125df(%rip)    # 0x15838
movaps %xmm1, %xmm2
movss 0x125cc(%rip), %xmm0    # 0x15830
xorps %xmm3, %xmm3
ucomiss %xmm0, %xmm3
setp %dl
setne %sil
orb %dl, %sil
xorb $0x1, %cl
orb %sil, %cl
jne 0x3297
cmpb $0x1, 0x125cd(%rip)     # 0x15850
jne 0x3297
movl $0x41700000, 0x125a9(%rip) # imm = 0x41700000
movss 0xdd89(%rip), %xmm2     # 0x11020
ucomiss %xmm3, %xmm0
jne 0x338a
jp 0x338a
cmpb $0x1, 0x125a3(%rip)     # 0x15850
jne 0x338a
movss 0x12565(%rip), %xmm3    # 0x15820
cvtsi2ssl 0x12559(%rip), %xmm4 # 0x1581c
subss %xmm4, %xmm3
movss 0xdd5d(%rip), %xmm4     # 0x1102c
ucomiss %xmm3, %xmm4
ja 0x3338
ucomiss 0xdd45(%rip), %xmm1     # 0x11020
jbe 0x32ee
xorl %ecx, %ecx
subl 0x11ec7(%rip), %ecx     # 0x151ac
cvtsi2ss %ecx, %xmm4
ucomiss %xmm3, %xmm4
ja 0x3338
ucomiss 0xdd2b(%rip), %xmm1     # 0x11020
jbe 0x3322
movss 0xdd31(%rip), %xmm4     # 0x11030
ucomiss %xmm3, %xmm4
jbe 0x3322
ucomiss 0xdd29(%rip), %xmm1     # 0x11034
ja 0x3338
cvtsi2ssl 0x124f3(%rip), %xmm3 # 0x15808
movss 0x124fb(%rip), %xmm4    # 0x15818
ucomiss %xmm3, %xmm4
ja 0x3338
movss 0xdd0e(%rip), %xmm3     # 0x11038
ucomiss 0x1251b(%rip), %xmm3    # 0x1584c
jbe 0x338a
ucomiss %xmm2, %xmm1
jb 0x338a
orb 0x1250a(%rip), %al      # 0x15848
testb $0x1, %al
je 0x334b
movb $0x20, 0x12480(%rip)    # 0x157c9
jmp 0x338a
movb $0x6, 0x12477(%rip)     # 0x157c9
movb $0x1, 0x12473(%rip)     # 0x157cc
cmpb $0x0, 0x124dc(%rip)     # 0x1583c
jne 0x3372
movq %rbx, %rdi
callq 0x2763
movss 0x124be(%rip), %xmm0    # 0x15830
movb $0x1, 0x124c3(%rip)     # 0x1583c
movb $0x0, 0x1244c(%rip)     # 0x157cc
movl $0x14, 0x1243a(%rip)    # 0x157c4
ucomiss 0xdc87(%rip), %xmm0     # 0x11018
jbe 0x357c
cmpb $0x0, 0x124aa(%rip)     # 0x15848
jne 0x357c
movb 0x1241f(%rip), %al      # 0x157c9
cmpb $0x6, %al
jne 0x33b8
cvttss2si %xmm0, %ecx
movl %ecx, 0x11df4(%rip)     # 0x151ac
movss 0x12460(%rip), %xmm2    # 0x15820
movl 0x12456(%rip), %ecx     # 0x1581c
cmpb $0x1e, %al
ja 0x34c1
movss 0xdc66(%rip), %xmm0     # 0x1103c
ucomiss %xmm2, %xmm0
jbe 0x34c1
movss 0xdc59(%rip), %xmm0     # 0x11040
ucomiss 0x1245e(%rip), %xmm0    # 0x1584c
jbe 0x34c1
testl %ecx, %ecx
js 0x34c1
cvtsi2ss %ecx, %xmm0
subss %xmm0, %xmm2
movss 0xdc38(%rip), %xmm0     # 0x11044
ucomiss %xmm2, %xmm0
seta %cl
cmpb $0x1e, %al
setb %dl
andb %cl, %dl
addb %al, %dl
incb %dl
movss 0xdc23(%rip), %xmm0     # 0x11048
ucomiss %xmm2, %xmm0
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movss 0xdc0f(%rip), %xmm0     # 0x1104c
ucomiss %xmm2, %xmm0
seta %al
cmpb $0x1f, %cl
setb %dl
andb %al, %dl
addb %cl, %dl
movss 0xdbfb(%rip), %xmm0     # 0x11050
ucomiss %xmm2, %xmm0
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movss 0xdbe7(%rip), %xmm0     # 0x11054
ucomiss %xmm2, %xmm0
seta %al
cmpb $0x1f, %cl
setb %dl
andb %al, %dl
addb %cl, %dl
movss 0xdbd3(%rip), %xmm0     # 0x11058
ucomiss %xmm2, %xmm0
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movb %cl, 0x1232e(%rip)      # 0x157c9
movq %rbx, %rdi
callq 0x2763
movl $0xc, 0x12317(%rip)     # 0x157c4
movl 0x12369(%rip), %ecx     # 0x1581c
movss 0x12365(%rip), %xmm2    # 0x15820
movb 0x12308(%rip), %al      # 0x157c9
cvtsi2ss %ecx, %xmm0
subss %xmm2, %xmm0
movss 0xdb8b(%rip), %xmm1     # 0x1105c
ucomiss %xmm0, %xmm1
seta %dl
cmpb $0x7, %al
setae %sil
testb %sil, %dl
jne 0x351d
cmpb $0x7, %al
setae %dl
movss 0x12329(%rip), %xmm1    # 0x15818
movss 0xdb69(%rip), %xmm3     # 0x11060
movaps %xmm0, %xmm5
cmpltps %xmm3, %xmm5
movss 0xdb5e(%rip), %xmm3     # 0x11064
movaps %xmm1, %xmm4
cmpltps %xmm3, %xmm4
andps %xmm4, %xmm5
movd %xmm5, %esi
testb %dl, %sil
je 0x35c3
leal -0x1(%rax), %ecx
movb %cl, 0x122a3(%rip)      # 0x157c9
movl 0x122e4(%rip), %ecx     # 0x15810
addb $-0x2, %al
movl $0xfffff7cc, %edx       # imm = 0xFFFFF7CC
cmpl $0xffffc950, %edx       # imm = 0xFFFFC950
je 0x3560
leal (%rcx,%rdx), %esi
cvtsi2ss %esi, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x3560
leal 0x1(%rax), %esi
cmpb $0x7, %sil
jb 0x3560
movb %al, 0x12273(%rip)      # 0x157c9
decb %al
addl $0xfffffd44, %edx       # imm = 0xFFFFFD44
jmp 0x3533
cmpb $0x1e, %al
jne 0x356b
movb $0x1e, 0x1225e(%rip)    # 0x157c9
movq %rbx, %rdi
callq 0x2763
pushq $0xc
popq %rax
movl %eax, 0x12248(%rip)     # 0x157c4
movl 0x11c2a(%rip), %esi     # 0x151ac
cvtss2sd 0x122ae(%rip), %xmm0    # 0x15838
leaq 0xde0d(%rip), %rdi      # 0x1139e
movb $0x1, %al
callq 0x2040
movl 0x12226(%rip), %esi     # 0x157c4
leaq 0xde16(%rip), %rdi      # 0x113bb
xorl %eax, %eax
callq 0x2040
movl 0x12212(%rip), %eax     # 0x157c4
cmpl $0x2, %eax
jl 0x35bf
decl %eax
movl %eax, 0x12205(%rip)     # 0x157c4
xorl %eax, %eax
popq %rbx
retq
movss 0x12221(%rip), %xmm3    # 0x157ec
cmpl $0x7cf, %ecx            # imm = 0x7CF
jg 0x3603
cmpb $0x7, %al
setae %dl
leal 0x190(%rcx), %esi
cmpl 0x1222c(%rip), %esi     # 0x15810
setl %sil
movss 0xda30(%rip), %xmm5     # 0x11020
ucomiss %xmm3, %xmm5
seta %dil
andb %sil, %dil
testb %dl, %dil
jne 0x351d
movzbl 0x12181(%rip), %edx     # 0x1578b
cvtsi2ss %edx, %xmm5
cmpl $0x7cf, %ecx            # imm = 0x7CF
jg 0x361b
ucomiss %xmm3, %xmm5
ja 0x3635
cmpl $0x5db, %ecx            # imm = 0x5DB
jg 0x367a
movss 0xd9e5(%rip), %xmm6     # 0x11010
ucomiss %xmm3, %xmm6
jbe 0x367a
ucomiss %xmm5, %xmm3
jb 0x367a
leal 0x320(%rcx), %edx
cmpl 0x121cf(%rip), %edx     # 0x15810
jge 0x367a
leal 0x190(%rcx), %esi
movl 0x121b9(%rip), %edx     # 0x15808
cmpl %edx, %esi
jge 0x367a
cmpb $0x7, %al
setae %sil
movaps %xmm1, %xmm5
cvtsi2ss %edx, %xmm6
addss 0xda00(%rip), %xmm5     # 0x11068
ucomiss %xmm5, %xmm6
seta %dl
andb %sil, %dl
cmpb $0x1, %dl
je 0x351d
movss 0xd9ea(%rip), %xmm5     # 0x1106c
ucomiss %xmm0, %xmm5
jbe 0x3694
movss 0xd9a5(%rip), %xmm5     # 0x11034
ucomiss %xmm3, %xmm5
ja 0x36ad
cmpl $0x3e7, %ecx            # imm = 0x3E7
jg 0x3747
ucomiss 0xd9c9(%rip), %xmm2     # 0x11070
jbe 0x3747
cmpb $0x6, %al
jb 0x36c2
cmpb $0x1, 0x12198(%rip)     # 0x15850
jne 0x36c2
decb %al
movb %al, 0x12107(%rip)      # 0x157c9
movzbl %al, %eax
movl $0xfffff7cc, %edx       # imm = 0xFFFFF7CC
addl 0x12140(%rip), %edx     # 0x15810
xorl %ecx, %ecx
leal (%rax,%rcx), %esi
cmpl $-0x11, %ecx
je 0x36ff
cvtsi2ss %edx, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x36ff
cmpb $0x7, %sil
jb 0x36ff
leal (%rcx,%rax), %esi
decl %esi
movb %sil, 0x120d4(%rip)     # 0x157c9
decl %ecx
addl $0xfffffd44, %edx       # imm = 0xFFFFFD44
jmp 0x36d2
xorl %edx, %edx
subb 0x1213b(%rip), %dl      # 0x15842
addb %dl, %sil
je 0x3732
addl %ecx, %eax
addl $-0x5, %eax
testb %al, %al
jne 0x372a
movb $0x6, 0x120ad(%rip)     # 0x157c9
movb $0x1, 0x120a9(%rip)     # 0x157cc
movb $0x0, 0x12112(%rip)     # 0x1583c
movq %rbx, %rdi
callq 0x2763
cmpb $0x0, 0x12093(%rip)     # 0x157cc
pushq $0x7
popq %rcx
pushq $0x14
popq %rax
cmovel %ecx, %eax
jmp 0x3576
movss 0xd911(%rip), %xmm2     # 0x11060
ucomiss %xmm0, %xmm2
jbe 0x3776
movss 0x120dc(%rip), %xmm2    # 0x15838
addss 0xd910(%rip), %xmm2     # 0x11074
ucomiss %xmm3, %xmm2
jbe 0x3776
cmpl $0x0, 0x120a0(%rip)     # 0x15810
jg 0x36ad
movss 0xd8fa(%rip), %xmm2     # 0x11078
ucomiss %xmm0, %xmm2
cvtss2sd %xmm3, %xmm5
jbe 0x37aa
cvtss2sd 0x120a9(%rip), %xmm2    # 0x15838
addsd 0xd949(%rip), %xmm2     # 0x110e0
ucomisd %xmm5, %xmm2
jbe 0x37aa
cmpl $0x0, 0x1206c(%rip)     # 0x15810
jg 0x36ad
movss 0xd8b2(%rip), %xmm2     # 0x11064
ucomiss %xmm0, %xmm2
jbe 0x37d9
movss 0x12079(%rip), %xmm6    # 0x15838
addss 0xd8b5(%rip), %xmm6     # 0x1107c
ucomiss %xmm3, %xmm6
jbe 0x37d9
cmpl $0x0, 0x1203d(%rip)     # 0x15810
jg 0x36ad
movss 0xd857(%rip), %xmm6     # 0x11038
ucomiss %xmm0, %xmm6
jbe 0x3828
cvtss2sd 0x1204a(%rip), %xmm6    # 0x15838
addsd 0xd8f2(%rip), %xmm6     # 0x110e8
ucomisd %xmm5, %xmm6
seta %dl
movl 0x1200d(%rip), %ecx     # 0x15810
testl %ecx, %ecx
setg %sil
testb %sil, %dl
jne 0x36ad
movss 0x12032(%rip), %xmm5    # 0x1584c
ucomiss 0xd803(%rip), %xmm5     # 0x11024
jbe 0x3843
jmp 0x36ad
movss 0x1201c(%rip), %xmm5    # 0x1584c
ucomiss 0xd7ed(%rip), %xmm5     # 0x11024
ja 0x36ad
movl 0x11fcd(%rip), %ecx     # 0x15810
movss 0xd7e9(%rip), %xmm5     # 0x11034
ucomiss %xmm3, %xmm5
seta %dl
movss 0xd81f(%rip), %xmm6     # 0x11078
movaps %xmm0, %xmm7
cmpltps %xmm6, %xmm7
andps %xmm4, %xmm7
movd %xmm7, %esi
andb %dl, %sil
testl %ecx, %ecx
setg %dl
testb %dl, %sil
jne 0x36ad
ucomiss %xmm0, %xmm2
jbe 0x357c
testl %ecx, %ecx
setg %cl
ucomiss %xmm3, %xmm5
seta %dl
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
addl 0x11f71(%rip), %esi     # 0x15808
cvtsi2ss %esi, %xmm2
xorps %xmm3, %xmm3
movaps %xmm1, %xmm4
cmpltps %xmm3, %xmm4
cmpltps %xmm2, %xmm1
orps %xmm4, %xmm1
movd %xmm1, %esi
andb %cl, %dl
andb %sil, %dl
cmpb $0x1, %dl
jne 0x357c
jmp 0x36ad