// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %rbx
cmpl $0x0, 0x1442e(%rip)     # 0x177a4
jne 0x33ee
movzbl 0x143eb(%rip), %eax     # 0x1776a
cvtsi2ss %eax, %xmm1
movss %xmm1, 0x1448d(%rip)    # 0x17818
movl $0x0, 0x14453(%rip)     # 0x177e8
movl $0x64, 0x14451(%rip)    # 0x177f0
movss 0x14425(%rip), %xmm0    # 0x177cc
ucomiss %xmm1, %xmm0
jbe 0x33b4
movss %xmm0, 0x14464(%rip)    # 0x17818
movl $0x600, 0x143ea(%rip)   # imm = 0x600
movw $0x0, 0x143e5(%rip)     # 0x177ac
movb 0x14455(%rip), %al      # 0x17822
movb %al, 0x143d6(%rip)      # 0x177a9
cmpb $0x20, %al
sete 0x1444c(%rip)           # 0x17828
cmpb $0x5, %al
jb 0x3849
movl $0x5, 0x143b6(%rip)     # 0x177a4
cmpl $0x1, 0x143af(%rip)     # 0x177a4
jne 0x3803
cmpb $0x1, 0x14426(%rip)     # 0x17828
jne 0x3451
movss 0x143c0(%rip), %xmm0    # 0x177cc
ucomiss 0xfc0d(%rip), %xmm0     # 0x13020
jbe 0x34ae
movss 0xfc03(%rip), %xmm1     # 0x13024
ucomiss 0x14404(%rip), %xmm1    # 0x1782c
jbe 0x34ae
ucomiss 0xfbf3(%rip), %xmm0     # 0x13028
jbe 0x34ae
cmpb $0x1f, 0x1436b(%rip)    # 0x177a9
ja 0x34ae
movb $0x20, 0x14362(%rip)    # 0x177a9
movq %rbx, %rdi
callq 0x28d4
jmp 0x34a4
cmpb $0x0, 0x143d8(%rip)     # 0x17830
jne 0x34ae
cmpb $0x7, 0x14348(%rip)     # 0x177a9
jb 0x34ae
movss 0x143a5(%rip), %xmm0    # 0x17810
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x34ae
jp 0x34ae
cmpb $0x0, 0x143a0(%rip)     # 0x1781c
je 0x3487
movb $0x20, 0x14324(%rip)    # 0x177a9
jmp 0x34ae
movb $0x6, 0x1431b(%rip)     # 0x177a9
movb $0x1, 0x14387(%rip)     # 0x1781c
movq %rbx, %rdi
callq 0x28d4
movb $0x0, 0x14308(%rip)     # 0x177ac
movl $0x7, 0x142f6(%rip)     # 0x177a4
movss 0x14316(%rip), %xmm0    # 0x177cc
ucomiss 0x1435b(%rip), %xmm0    # 0x17818
jbe 0x34c7
movss %xmm0, 0x14351(%rip)    # 0x17818
movss 0x14341(%rip), %xmm1    # 0x17810
xorps %xmm2, %xmm2
ucomiss %xmm1, %xmm2
setnp %al
sete %cl
andb %al, %cl
movl 0x142c1(%rip), %eax     # 0x177a4
cmpl $0x1, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3503
cmpb $0x1, 0x14339(%rip)     # 0x17830
jne 0x3503
movl $0x41700000, 0x14315(%rip) # imm = 0x41700000
ucomiss %xmm2, %xmm1
jne 0x3601
jp 0x3601
cmpb $0x1, 0x14317(%rip)     # 0x17830
jne 0x3601
movss 0x142d9(%rip), %xmm1    # 0x17800
xorps %xmm2, %xmm2
cvtsi2ssl 0x142ca(%rip), %xmm2 # 0x177fc
subss %xmm2, %xmm1
movss 0xfaee(%rip), %xmm2     # 0x1302c
ucomiss %xmm1, %xmm2
ja 0x35b1
ucomiss 0xfad6(%rip), %xmm0     # 0x13020
jbe 0x3560
xorl %ecx, %ecx
subl 0x13c38(%rip), %ecx     # 0x1718c
xorps %xmm2, %xmm2
cvtsi2ss %ecx, %xmm2
ucomiss %xmm1, %xmm2
ja 0x35b1
ucomiss 0xfab9(%rip), %xmm0     # 0x13020
jbe 0x3597
movss 0xfabf(%rip), %xmm2     # 0x13030
ucomiss %xmm1, %xmm2
jbe 0x3597
ucomiss 0xfab7(%rip), %xmm0     # 0x13034
ja 0x35b1
xorps %xmm1, %xmm1
cvtsi2ssl 0x1425e(%rip), %xmm1 # 0x177e8
movss 0x14266(%rip), %xmm2    # 0x177f8
ucomiss %xmm1, %xmm2
ja 0x35b1
movss 0xfa99(%rip), %xmm1     # 0x13038
ucomiss 0x14286(%rip), %xmm1    # 0x1782c
jbe 0x3601
ucomiss 0x14269(%rip), %xmm0    # 0x17818
jb 0x3601
cmpl $0x1, %eax
setne %al
orb 0x1426b(%rip), %al      # 0x17828
testb $0x1, %al
je 0x35ca
movb $0x20, 0x141e1(%rip)    # 0x177a9
jmp 0x3601
movb $0x6, 0x141d8(%rip)     # 0x177a9
movb $0x1, 0x141d4(%rip)     # 0x177ac
cmpb $0x0, 0x1423d(%rip)     # 0x1781c
jne 0x35e9
movq %rbx, %rdi
callq 0x28d4
movb $0x1, 0x1422c(%rip)     # 0x1781c
movb $0x0, 0x141b5(%rip)     # 0x177ac
movl $0x14, 0x141a3(%rip)    # 0x177a4
movss 0x14207(%rip), %xmm0    # 0x17810
ucomiss 0xfa08(%rip), %xmm0     # 0x13018
jbe 0x3803
cmpb $0x0, 0x1420b(%rip)     # 0x17828
jne 0x3803
movb 0x14180(%rip), %al      # 0x177a9
cmpb $0x6, %al
jne 0x3637
cvttss2si %xmm0, %ecx
movl %ecx, 0x13b55(%rip)     # 0x1718c
cmpb $0x1e, %al
ja 0x372f
movss 0x141b9(%rip), %xmm0    # 0x17800
movss 0xf9ed(%rip), %xmm1     # 0x1303c
ucomiss %xmm0, %xmm1
jbe 0x372f
movss 0xf9e0(%rip), %xmm1     # 0x13040
ucomiss 0x141c5(%rip), %xmm1    # 0x1782c
jbe 0x372f
movl 0x14189(%rip), %ecx     # 0x177fc
testl %ecx, %ecx
js 0x372f
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
subss %xmm1, %xmm0
movss 0xf9b6(%rip), %xmm1     # 0x13044
ucomiss %xmm0, %xmm1
seta %cl
cmpb $0x1e, %al
setb %dl
andb %cl, %dl
addb %al, %dl
incb %dl
movss 0xf9a1(%rip), %xmm1     # 0x13048
ucomiss %xmm0, %xmm1
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movss 0xf98d(%rip), %xmm1     # 0x1304c
ucomiss %xmm0, %xmm1
seta %al
cmpb $0x1f, %cl
setb %dl
andb %al, %dl
addb %cl, %dl
movss 0xf979(%rip), %xmm1     # 0x13050
ucomiss %xmm0, %xmm1
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movss 0xf965(%rip), %xmm1     # 0x13054
ucomiss %xmm0, %xmm1
seta %al
cmpb $0x1f, %cl
setb %dl
andb %al, %dl
addb %cl, %dl
movss 0xf951(%rip), %xmm1     # 0x13058
ucomiss %xmm0, %xmm1
seta %al
cmpb $0x1f, %dl
setb %cl
andb %al, %cl
addb %dl, %cl
movb %cl, 0x1408c(%rip)      # 0x177a9
movq %rbx, %rdi
callq 0x28d4
movl $0xc, 0x14075(%rip)     # 0x177a4
movl 0x140c7(%rip), %ecx     # 0x177fc
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss 0x140bc(%rip), %xmm4    # 0x17800
subss %xmm4, %xmm0
movss 0xf90c(%rip), %xmm1     # 0x1305c
ucomiss %xmm0, %xmm1
seta %dl
movb 0x1404d(%rip), %al      # 0x177a9
cmpb $0x7, %al
setae %sil
testb %sil, %dl
jne 0x37a2
cmpb $0x7, %al
setae %dl
movss 0x14084(%rip), %xmm1    # 0x177f8
movss 0xf8e4(%rip), %xmm2     # 0x13060
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
movss 0xf8d9(%rip), %xmm5     # 0x13064
movaps %xmm1, %xmm2
cmpltps %xmm5, %xmm2
andps %xmm2, %xmm3
movd %xmm3, %esi
testb %dl, %sil
je 0x384d
decb %al
movb %al, 0x13fff(%rip)      # 0x177a9
movl $0xfffff7cc, %ecx       # imm = 0xFFFFF7CC
movl 0x1403b(%rip), %edx     # 0x177f0
leal (%rdx,%rcx), %esi
xorps %xmm1, %xmm1
cvtsi2ss %esi, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x37de
cmpb $0x7, %al
jb 0x37de
decb %al
movb %al, 0x13fd9(%rip)      # 0x177a9
addl $0xfffffd44, %ecx       # imm = 0xFFFFFD44
cmpl $0xffffc950, %ecx       # imm = 0xFFFFC950
jne 0x37b5
movb 0x13fc5(%rip), %al      # 0x177a9
cmpb $0x1f, %al
jne 0x37f0
decb %al
movb %al, 0x13fb9(%rip)      # 0x177a9
movq %rbx, %rdi
callq 0x28d4
movl $0xc, %eax
movl %eax, 0x13fa1(%rip)     # 0x177a4
movl 0x13983(%rip), %esi     # 0x1718c
xorps %xmm0, %xmm0
cvtss2sd 0x14004(%rip), %xmm0    # 0x17818
leaq 0xfbf3(%rip), %rdi      # 0x1340e
movb $0x1, %al
callq 0x2040
movl 0x13f7c(%rip), %esi     # 0x177a4
leaq 0xfbfc(%rip), %rdi      # 0x1342b
xorl %eax, %eax
callq 0x2040
movl 0x13f68(%rip), %eax     # 0x177a4
cmpl $0x2, %eax
jl 0x3849
decl %eax
movl %eax, 0x13f5b(%rip)     # 0x177a4
xorl %eax, %eax
popq %rbx
retq
cmpl $0x7cf, %ecx            # imm = 0x7CF
jg 0x3889
cmpb $0x7, %al
setae %dl
leal 0x190(%rcx), %esi
cmpl 0x13f8a(%rip), %esi     # 0x177f0
setl %sil
movss 0xf7ae(%rip), %xmm3     # 0x13020
ucomiss 0x13f53(%rip), %xmm3    # 0x177cc
seta %dil
andb %sil, %dil
testb %dl, %dil
jne 0x37a2
movss 0x13f3b(%rip), %xmm3    # 0x177cc
movzbl 0x13ed3(%rip), %edx     # 0x1776b
xorps %xmm5, %xmm5
cvtsi2ss %edx, %xmm5
cmpl $0x7cf, %ecx            # imm = 0x7CF
jg 0x38ac
ucomiss %xmm3, %xmm5
ja 0x38c6
cmpl $0x5db, %ecx            # imm = 0x5DB
jg 0x390e
movss 0xf754(%rip), %xmm6     # 0x13010
ucomiss %xmm3, %xmm6
jbe 0x390e
ucomiss %xmm5, %xmm3
jb 0x390e
leal 0x320(%rcx), %edx
cmpl 0x13f1e(%rip), %edx     # 0x177f0
jge 0x390e
leal 0x190(%rcx), %esi
movl 0x13f08(%rip), %edx     # 0x177e8
cmpl %edx, %esi
jge 0x390e
cmpb $0x7, %al
setae %sil
movaps %xmm1, %xmm5
xorps %xmm6, %xmm6
cvtsi2ss %edx, %xmm6
addss 0xf76c(%rip), %xmm5     # 0x13068
ucomiss %xmm5, %xmm6
seta %dl
andb %sil, %dl
cmpb $0x1, %dl
je 0x37a2
movss 0xf756(%rip), %xmm5     # 0x1306c
ucomiss %xmm0, %xmm5
jbe 0x3928
movss 0xf711(%rip), %xmm5     # 0x13034
ucomiss %xmm3, %xmm5
ja 0x3941
cmpl $0x3e7, %ecx            # imm = 0x3E7
jg 0x39d8
ucomiss 0xf735(%rip), %xmm4     # 0x13070
jbe 0x39d8
cmpb $0x6, %al
jb 0x3956
cmpb $0x1, 0x13ee4(%rip)     # 0x17830
jne 0x3956
decb %al
movb %al, 0x13e53(%rip)      # 0x177a9
movb 0x13e4d(%rip), %al      # 0x177a9
movl $0xfffff7cc, %ecx       # imm = 0xFFFFF7CC
movl 0x13e89(%rip), %edx     # 0x177f0
leal (%rdx,%rcx), %esi
xorps %xmm1, %xmm1
cvtsi2ss %esi, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x3990
cmpb $0x7, %al
jb 0x3990
decb %al
movb %al, 0x13e27(%rip)      # 0x177a9
addl $0xfffffd44, %ecx       # imm = 0xFFFFFD44
cmpl $0xffffc950, %ecx       # imm = 0xFFFFC950
jne 0x3967
movb 0x13e13(%rip), %al      # 0x177a9
cmpb 0x13e86(%rip), %al      # 0x17822
je 0x39bf
cmpb $0x5, %al
jne 0x39b7
movb $0x6, 0x13e00(%rip)     # 0x177a9
movb $0x1, 0x13dfc(%rip)     # 0x177ac
movb $0x0, 0x13e65(%rip)     # 0x1781c
movq %rbx, %rdi
callq 0x28d4
cmpb $0x0, 0x13de6(%rip)     # 0x177ac
movl $0x7, %ecx
movl $0x14, %eax
cmovel %ecx, %eax
jmp 0x37fd
movss 0xf680(%rip), %xmm4     # 0x13060
ucomiss %xmm0, %xmm4
jbe 0x3a07
movss 0x13e2b(%rip), %xmm4    # 0x17818
addss 0xf67f(%rip), %xmm4     # 0x13074
ucomiss %xmm3, %xmm4
jbe 0x3a07
cmpl $0x0, 0x13def(%rip)     # 0x177f0
jg 0x3941
movss 0xf669(%rip), %xmm4     # 0x13078
ucomiss %xmm0, %xmm4
jbe 0x3a41
xorps %xmm4, %xmm4
cvtss2sd %xmm3, %xmm4
xorps %xmm5, %xmm5
cvtss2sd 0x13df2(%rip), %xmm5    # 0x17818
addsd 0xf6b2(%rip), %xmm5     # 0x130e0
ucomisd %xmm4, %xmm5
jbe 0x3a41
cmpl $0x0, 0x13db5(%rip)     # 0x177f0
jg 0x3941
movss 0xf61b(%rip), %xmm4     # 0x13064
ucomiss %xmm0, %xmm4
jbe 0x3a70
movss 0x13dc2(%rip), %xmm5    # 0x17818
addss 0xf61e(%rip), %xmm5     # 0x1307c
ucomiss %xmm3, %xmm5
jbe 0x3a70
cmpl $0x0, 0x13d86(%rip)     # 0x177f0
jg 0x3941
movss 0xf5c0(%rip), %xmm5     # 0x13038
ucomiss %xmm0, %xmm5
jbe 0x3ab0
xorps %xmm5, %xmm5
cvtss2sd %xmm3, %xmm5
xorps %xmm6, %xmm6
cvtss2sd 0x13d89(%rip), %xmm6    # 0x17818
addsd 0xf651(%rip), %xmm6     # 0x130e8
ucomisd %xmm5, %xmm6
seta %cl
cmpl $0x0, 0x13d4b(%rip)     # 0x177f0
setg %dl
testb %dl, %cl
jne 0x3941
movss 0x13d74(%rip), %xmm5    # 0x1782c
ucomiss 0xf565(%rip), %xmm5     # 0x13024
ja 0x3941
movss 0xf567(%rip), %xmm5     # 0x13034
ucomiss %xmm3, %xmm5
seta %cl
movss 0xf59d(%rip), %xmm6     # 0x13078
movaps %xmm0, %xmm7
cmpltps %xmm6, %xmm7
andps %xmm2, %xmm7
movd %xmm7, %edx
andb %cl, %dl
movl 0x13cff(%rip), %ecx     # 0x177f0
testl %ecx, %ecx
setg %sil
testb %sil, %dl
jne 0x3941
ucomiss %xmm0, %xmm4
jbe 0x3803
testl %ecx, %ecx
setg %cl
ucomiss %xmm3, %xmm5
seta %dl
movl $0xfffffe70, %esi       # imm = 0xFFFFFE70
addl 0x13cc9(%rip), %esi     # 0x177e8
xorps %xmm2, %xmm2
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 0x3803
jmp 0x3941