// File: /workspace/github_c_makefile_star2_O0/Matthias-Wandel[P]imgcomp/src/exposure.c
// Function: CalcExposureAdjust
int CalcExposureAdjust(MemImage_t * pic)
{
    Region_t Region = Regions.DetectReg;
    if (Region.y2 > pic->height) Region.y2 = pic->height;
    if (Region.x2 > pic->width) Region.x2 = pic->width;

    int BrHistogram[256] = {0}; // Brightness histogram, for red green and blue channels.
    int NumPix = 0;
    int width = pic->width;

    int rowbytes = pic->width*3;
    for (int row=Region.y1;row<Region.y2;row++){
        unsigned char *p1;
        p1 = pic->pixels+rowbytes*row;
        int * ExRow = NULL;
        if (WeightMap) ExRow = &WeightMap->values[width*row];
        for (int col=Region.x1;col<Region.x2;col++){
            if (ExRow && ExRow[col]){
                // Apply the colors to the histogram separately (saturating one is saturated enough)
                BrHistogram[p1[0]] += 2; // Red,   1/3 weight
                BrHistogram[p1[1]] += 3; // Green, 1/2 weight
                BrHistogram[p1[2]] += 1; // Blue,  1/6 weight
                NumPix += 1;
            }
            p1 += 3;
        }
    }
    NumPix *= 6;

    static int ShowPeriodic = 45;
    if (++ShowPeriodic >= 60) ShowPeriodic = 0;

    if (ShowPeriodic == 0){
        // Show histogram bargraph
        int maxv = 0;
        int skz = 1;
        for (int a=0;a<256;a+=2){
            int twobin = BrHistogram[a]+BrHistogram[a+1];
            if (twobin > maxv) maxv = twobin;
        }
        fprintf(Log,"Brighness histogram\n");
        for (int a=0;a<256;a+=2){
            if (a == 26){
                fprintf(Log,"...........\n");// Skip middle part of histogram, not that interesting.
                a = 210;
                skz = 1;
            }
            int twobin = BrHistogram[a]+BrHistogram[a+1];
            if (twobin == 0 && skz) continue;
            skz = 0;
            fprintf(Log,"%3d %6d %6d ",a,BrHistogram[a], BrHistogram[a+1]);
            static char * Bargraph = "#########################################################################";
            fprintf(Log,"%.*s\n", (50*twobin+maxv/2)/maxv, Bargraph);
        }
    }

    double ExposureMult = 1.0;

    // figure out what threshold value has no more than 0.4% of pixels above.
    int satpix = NumPix / 64;  // Allowable pixels near saturation
    int medpix = NumPix / 20;  // Don't make the image overall too bright.
    int sat, med;
    int SatVal;
    for (sat=255;sat>=0;sat--){
        satpix -= BrHistogram[sat];
        if (satpix <= 0) break;
    }
    for (med=255;med>=0;med--){
        medpix -= BrHistogram[med];
        if (medpix <= 0) break;
    }


    double SatFrac;
    if (ex.SatVal){
        SatVal = ex.SatVal;
    }else{
        SatVal = 253;
        if (memcmp(ImageInfo.CameraModel, "RP_ov5647",10) == 0){
            // 5 megapixel module saturates around pixel value of 245, not 255.
            // Newer modules pixel values saturate closer to 255
            SatVal = 240;
        }
    }
    int SatPix = 0;
    for (int a=SatVal;a<256;a++){
        SatPix += BrHistogram[a];
    }
    SatFrac = (double)SatPix/NumPix;


    // Adjust exposure upwards becauase very few pixels are near
    // maximum values, so there's exposure headroom.
    double Mult=10,Mult2=10;
    if (sat) Mult = 0.96*SatVal/sat;
    if (med) Mult2 = 0.93*SatVal/med;
    if (Mult2 < Mult) Mult = Mult2;
    if (Mult > 32) Mult = 32; // Do't try to adjust more than this!
    ExposureMult = Mult;

    // Adjsut exposure downward because too many pixels
    // have saturated.  It's impossible to calculate how far down
    // we really need to adjust cause it's saturating, so just guess.
    if (SatFrac > 0.03) ExposureMult = 0.8;
    if (SatFrac > 0.06) ExposureMult = 0.7;
    if (SatFrac > 0.12) ExposureMult = 0.6;
    if (SatFrac > 0.20) ExposureMult = 0.5;
    if (SatFrac > 0.40) ExposureMult = 0.4;

    double LightMult = pow(ExposureMult, 2.2); // assume camer gamma is 2.2 for light level calculation

    // LightMult indicates how much more the light should have been,
    // or how much to multiply exposure time or ISO or combination of both by.

    double ImgIsoTimesExp = ImageInfo.ExposureTime * ImageInfo.ISOequivalent;
    
    if (ShowPeriodic == 0){
        fprintf(Log, "Brightness: 3%%>%d  25%%>%d  Sat%%=%3.1f  Iso*Ex=%4.1f Adjust *%4.2f\n",sat,med, SatFrac*100, ImgIsoTimesExp, LightMult);
        ShowPeriodic = 0;
    }

    // Compute a measure of how steady the light is.  If it's really steady,
    // ten lower the threshold for making exposure adjustments.
    static double LightMult_ra = 1;
    static double LightMultVariance_ra = 1;
    const double newweight = 0.05;
    LightMult_ra = LightMult_ra*(1-newweight)+LightMult*newweight;
    double diff  = LightMult-LightMult_ra;
    LightMultVariance_ra = LightMultVariance_ra*(1-newweight) + diff*diff*newweight;
    if (ShowPeriodic == 0) fprintf(Log, "Mult:%5.2f mra:%5.2f stdev:%5.2f\n",LightMult, LightMult_ra, sqrt(LightMultVariance_ra));

    double ExposureThresholdRatio = 1.2;
    if (LightMultVariance_ra < (0.2*0.2)){
        // Light has been very steady for a while, so be willing to make fine adjustments to exposure.
        ExposureThresholdRatio = 1.06;
        //printf("fine ");
    }

    if ((LightMult >= ExposureThresholdRatio && ExMaxLimitHit == 0)
        || (LightMult <= 1/ExposureThresholdRatio && ExMinLimitHit == 0)){
        // If adjustment is called for, *and* we haven't hit an exposure limit:
        fprintf(Log, "Brightness: 1.5%%>%d  5%%>%d  Sat%%=%3.1f Adjust *%4.2f\n",sat,med, SatFrac*100, LightMult);
        ShowPeriodic = 0;

        fprintf(Log,"Adjust exposure.  Was: t=%0.5f",ImageInfo.ExposureTime);
        fprintf(Log," ISO=%d   ISO*Exp=%.0f\n",ImageInfo.ISOequivalent, ImgIsoTimesExp);

        ISOtimesExp = ImgIsoTimesExp * LightMult;
        GetRaspistillExpParms();

        // Reset exposure adjust running averages (avoid fine adjust too soon)
        LightMult_ra = 1;
        LightMultVariance_ra = 1;

        return 1; // And signal raspistill needs restarting.
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4f0, %rsp            # imm = 0x4F0
movq %rdi, -0x10(%rbp)
leaq 0x7c62(%rip), %rax      # 0x14e18
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0xd1db
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xd1ef
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x31b0
movl $0x0, -0x424(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x428(%rbp)
movq -0x10(%rbp), %rax
imull $0x3, (%rax), %eax
movl %eax, -0x42c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x430(%rbp)
movl -0x430(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xd377
movq -0x10(%rbp), %rax
addq $0xc, %rax
movl -0x42c(%rbp), %ecx
imull -0x430(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x438(%rbp)
movq $0x0, -0x440(%rbp)
leaq 0x81f7(%rip), %rax      # 0x15468
cmpq $0x0, (%rax)
je 0xd2a3
leaq 0x81ea(%rip), %rax      # 0x15468
movq (%rax), %rax
addq $0x8, %rax
movl -0x428(%rbp), %ecx
imull -0x430(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x440(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x444(%rbp)
movl -0x444(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xd361
cmpq $0x0, -0x440(%rbp)
je 0xd33b
movq -0x440(%rbp), %rax
movslq -0x444(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xd33b
movq -0x438(%rbp), %rax
movzbl (%rax), %eax
movl -0x420(%rbp,%rax,4), %ecx
addl $0x2, %ecx
movl %ecx, -0x420(%rbp,%rax,4)
movq -0x438(%rbp), %rax
movzbl 0x1(%rax), %eax
movl -0x420(%rbp,%rax,4), %ecx
addl $0x3, %ecx
movl %ecx, -0x420(%rbp,%rax,4)
movq -0x438(%rbp), %rax
movzbl 0x2(%rax), %eax
movl -0x420(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x420(%rbp,%rax,4)
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
movq -0x438(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x438(%rbp)
movl -0x444(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x444(%rbp)
jmp 0xd2ac
jmp 0xd363
movl -0x430(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x430(%rbp)
jmp 0xd22e
imull $0x6, -0x424(%rbp), %eax
movl %eax, -0x424(%rbp)
movl 0x6fa6(%rip), %eax      # 0x14330
addl $0x1, %eax
movl %eax, 0x6f9d(%rip)      # 0x14330
cmpl $0x3c, %eax
jl 0xd3a2
movl $0x0, 0x6f8e(%rip)      # 0x14330
cmpl $0x0, 0x6f87(%rip)      # 0x14330
jne 0xd57e
movl $0x0, -0x448(%rbp)
movl $0x1, -0x44c(%rbp)
movl $0x0, -0x450(%rbp)
cmpl $0x100, -0x450(%rbp)    # imm = 0x100
jge 0xd42d
movslq -0x450(%rbp), %rax
movl -0x420(%rbp,%rax,4), %eax
movl -0x450(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addl -0x420(%rbp,%rcx,4), %eax
movl %eax, -0x454(%rbp)
movl -0x454(%rbp), %eax
cmpl -0x448(%rbp), %eax
jle 0xd41a
movl -0x454(%rbp), %eax
movl %eax, -0x448(%rbp)
jmp 0xd41c
movl -0x450(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x450(%rbp)
jmp 0xd3cd
leaq 0x7be4(%rip), %rax      # 0x15018
movq (%rax), %rdi
leaq 0x4295(%rip), %rsi      # 0x116d3
movb $0x0, %al
callq 0x3290
movl $0x0, -0x458(%rbp)
cmpl $0x100, -0x458(%rbp)    # imm = 0x100
jge 0xd57c
cmpl $0x1a, -0x458(%rbp)
jne 0xd494
leaq 0x7ba9(%rip), %rax      # 0x15018
movq (%rax), %rdi
leaq 0x426f(%rip), %rsi      # 0x116e8
movb $0x0, %al
callq 0x3290
movl $0xd2, -0x458(%rbp)
movl $0x1, -0x44c(%rbp)
movslq -0x458(%rbp), %rax
movl -0x420(%rbp,%rax,4), %eax
movl -0x458(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addl -0x420(%rbp,%rcx,4), %eax
movl %eax, -0x45c(%rbp)
cmpl $0x0, -0x45c(%rbp)
jne 0xd4d2
cmpl $0x0, -0x44c(%rbp)
je 0xd4d2
jmp 0xd568
movl $0x0, -0x44c(%rbp)
leaq 0x7b35(%rip), %rax      # 0x15018
movq (%rax), %rdi
movl -0x458(%rbp), %edx
movslq -0x458(%rbp), %rax
movl -0x420(%rbp,%rax,4), %ecx
movl -0x458(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x420(%rbp,%rax,4), %r8d
leaq 0x41e1(%rip), %rsi      # 0x116f5
movb $0x0, %al
callq 0x3290
leaq 0x7af6(%rip), %rax      # 0x15018
movq (%rax), %rdi
imull $0x32, -0x45c(%rbp), %eax
movl %eax, -0x4cc(%rbp)
movl -0x448(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4cc(%rbp), %eax
addl %ecx, %eax
cltd
idivl -0x448(%rbp)
movl %eax, %edx
movq 0x6dde(%rip), %rcx      # 0x14338
leaq 0x41eb(%rip), %rsi      # 0x1174c
movb $0x0, %al
callq 0x3290
movl -0x458(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x458(%rbp)
jmp 0xd44f
jmp 0xd57e
movsd 0x2162(%rip), %xmm0     # 0xf6e8
movsd %xmm0, -0x468(%rbp)
movl -0x424(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, -0x46c(%rbp)
movl -0x424(%rbp), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, -0x470(%rbp)
movl $0xff, -0x474(%rbp)
cmpl $0x0, -0x474(%rbp)
jl 0xd603
movslq -0x474(%rbp), %rax
movl -0x420(%rbp,%rax,4), %ecx
movl -0x46c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x46c(%rbp)
cmpl $0x0, -0x46c(%rbp)
jg 0xd5f0
jmp 0xd603
jmp 0xd5f2
movl -0x474(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x474(%rbp)
jmp 0xd5c0
movl $0xff, -0x478(%rbp)
cmpl $0x0, -0x478(%rbp)
jl 0xd650
movslq -0x478(%rbp), %rax
movl -0x420(%rbp,%rax,4), %ecx
movl -0x470(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x470(%rbp)
cmpl $0x0, -0x470(%rbp)
jg 0xd63d
jmp 0xd650
jmp 0xd63f
movl -0x478(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x478(%rbp)
jmp 0xd60d
cmpl $0x0, 0xa559(%rip)      # 0x17bb0
je 0xd667
movl 0xa551(%rip), %eax      # 0x17bb0
movl %eax, -0x47c(%rbp)
jmp 0xd6a1
movl $0xfd, -0x47c(%rbp)
leaq 0x7e40(%rip), %rdi      # 0x154b8
addq $0x1028, %rdi           # imm = 0x1028
leaq 0x3fb6(%rip), %rsi      # 0x1163c
movl $0xa, %edx
callq 0x3210
cmpl $0x0, %eax
jne 0xd69f
movl $0xf0, -0x47c(%rbp)
jmp 0xd6a1
movl $0x0, -0x48c(%rbp)
movl -0x47c(%rbp), %eax
movl %eax, -0x490(%rbp)
cmpl $0x100, -0x490(%rbp)    # imm = 0x100
jge 0xd6ee
movslq -0x490(%rbp), %rax
movl -0x420(%rbp,%rax,4), %eax
addl -0x48c(%rbp), %eax
movl %eax, -0x48c(%rbp)
movl -0x490(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x490(%rbp)
jmp 0xd6b7
cvtsi2sdl -0x48c(%rbp), %xmm0
cvtsi2sdl -0x424(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x488(%rbp)
movsd 0x272e(%rip), %xmm0     # 0xfe40
movsd %xmm0, -0x498(%rbp)
movsd 0x271e(%rip), %xmm0     # 0xfe40
movsd %xmm0, -0x4a0(%rbp)
cmpl $0x0, -0x474(%rbp)
je 0xd75b
cvtsi2sdl -0x47c(%rbp), %xmm1
movsd 0x3e5d(%rip), %xmm0     # 0x115a0
mulsd %xmm1, %xmm0
cvtsi2sdl -0x474(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x498(%rbp)
cmpl $0x0, -0x478(%rbp)
je 0xd78c
cvtsi2sdl -0x47c(%rbp), %xmm1
movsd 0x3e34(%rip), %xmm0     # 0x115a8
mulsd %xmm1, %xmm0
cvtsi2sdl -0x478(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x4a0(%rbp)
movsd -0x4a0(%rbp), %xmm1
movsd -0x498(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd7b2
movsd -0x4a0(%rbp), %xmm0
movsd %xmm0, -0x498(%rbp)
movsd -0x498(%rbp), %xmm0
movsd 0x3dee(%rip), %xmm1     # 0x115b0
ucomisd %xmm1, %xmm0
jbe 0xd7d8
movsd 0x3de0(%rip), %xmm0     # 0x115b0
movsd %xmm0, -0x498(%rbp)
movsd -0x498(%rbp), %xmm0
movsd %xmm0, -0x468(%rbp)
movsd -0x488(%rbp), %xmm0
movsd 0x3dc0(%rip), %xmm1     # 0x115b8
ucomisd %xmm1, %xmm0
jbe 0xd80e
movsd 0x3dba(%rip), %xmm0     # 0x115c0
movsd %xmm0, -0x468(%rbp)
movsd -0x488(%rbp), %xmm0
movsd 0x3daa(%rip), %xmm1     # 0x115c8
ucomisd %xmm1, %xmm0
jbe 0xd834
movsd 0x3da4(%rip), %xmm0     # 0x115d0
movsd %xmm0, -0x468(%rbp)
movsd -0x488(%rbp), %xmm0
movsd 0x3d94(%rip), %xmm1     # 0x115d8
ucomisd %xmm1, %xmm0
jbe 0xd85a
movsd 0x3d8e(%rip), %xmm0     # 0x115e0
movsd %xmm0, -0x468(%rbp)
movsd -0x488(%rbp), %xmm0
movsd 0x3d7e(%rip), %xmm1     # 0x115e8
ucomisd %xmm1, %xmm0
jbe 0xd880
movsd 0x798(%rip), %xmm0      # 0xe010
movsd %xmm0, -0x468(%rbp)
movsd -0x488(%rbp), %xmm0
movsd 0x3d60(%rip), %xmm1     # 0x115f0
ucomisd %xmm1, %xmm0
jbe 0xd8a6
movsd 0x3d52(%rip), %xmm0     # 0x115f0
movsd %xmm0, -0x468(%rbp)
movsd -0x468(%rbp), %xmm0
movsd 0x3d42(%rip), %xmm1     # 0x115f8
callq 0x3100
movsd %xmm0, -0x4a8(%rbp)
leaq 0x7bee(%rip), %rax      # 0x154b8
movss 0x1080(%rax), %xmm0
leaq 0x7bdf(%rip), %rax      # 0x154b8
cvtsi2ssl 0x10a8(%rax), %xmm1
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x4b0(%rbp)
cmpl $0x0, 0x6a38(%rip)      # 0x14330
jne 0xd948
leaq 0x7717(%rip), %rax      # 0x15018
movq (%rax), %rdi
movl -0x474(%rbp), %edx
movl -0x478(%rbp), %ecx
movsd 0x3ce8(%rip), %xmm0     # 0x11600
mulsd -0x488(%rbp), %xmm0
movsd -0x4b0(%rbp), %xmm1
movsd -0x4a8(%rbp), %xmm2
leaq 0x3e1b(%rip), %rsi      # 0x11752
movb $0x3, %al
callq 0x3290
movl $0x0, 0x69e8(%rip)      # 0x14330
movsd 0x3cc0(%rip), %xmm0     # 0x11610
movsd %xmm0, -0x4b8(%rbp)
movsd 0x69e0(%rip), %xmm0     # 0x14340
movsd 0x3ca8(%rip), %xmm1     # 0x11610
mulsd -0x4a8(%rbp), %xmm1
movsd 0x3c90(%rip), %xmm2     # 0x11608
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x69b8(%rip)     # 0x14340
movsd -0x4a8(%rbp), %xmm0
subsd 0x69a8(%rip), %xmm0     # 0x14340
movsd %xmm0, -0x4c0(%rbp)
movsd 0x69a0(%rip), %xmm0     # 0x14348
movsd -0x4c0(%rbp), %xmm1
mulsd -0x4c0(%rbp), %xmm1
movsd 0x3c50(%rip), %xmm2     # 0x11610
mulsd %xmm2, %xmm1
movsd 0x3c3c(%rip), %xmm2     # 0x11608
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x696c(%rip)     # 0x14348
cmpl $0x0, 0x694d(%rip)      # 0x14330
jne 0xda4b
leaq 0x762c(%rip), %rax      # 0x15018
movq (%rax), %rax
movq %rax, -0x4e8(%rbp)
movsd -0x4a8(%rbp), %xmm0
movsd %xmm0, -0x4d8(%rbp)
movsd 0x6932(%rip), %xmm0     # 0x14340
movsd %xmm0, -0x4e0(%rbp)
movsd 0x692a(%rip), %xmm0     # 0x14348
callq 0x34a0
movq -0x4e8(%rbp), %rdi
movsd -0x4e0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x4d8(%rbp), %xmm0
leaq 0x3d54(%rip), %rsi      # 0x11798
movb $0x3, %al
callq 0x3290
movsd 0x3bcd(%rip), %xmm0     # 0x11620
movsd %xmm0, -0x4c8(%rbp)
movsd 0x3bb5(%rip), %xmm0     # 0x11618
ucomisd 0x68dd(%rip), %xmm0     # 0x14348
jbe 0xda7d
movsd 0x3bb3(%rip), %xmm0     # 0x11628
movsd %xmm0, -0x4c8(%rbp)
movsd -0x4a8(%rbp), %xmm0
ucomisd -0x4c8(%rbp), %xmm0
jb 0xda98
cmpl $0x0, 0xa126(%rip)      # 0x17bbc
je 0xdac7
movsd -0x4a8(%rbp), %xmm1
movsd 0x1c40(%rip), %xmm0     # 0xf6e8
divsd -0x4c8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xdbab
cmpl $0x0, 0xa0f7(%rip)      # 0x17bb8
jne 0xdbab
leaq 0x754a(%rip), %rax      # 0x15018
movq (%rax), %rdi
movl -0x474(%rbp), %edx
movl -0x478(%rbp), %ecx
movsd 0x3b1b(%rip), %xmm0     # 0x11600
mulsd -0x488(%rbp), %xmm0
movsd -0x4a8(%rbp), %xmm1
leaq 0x3cbe(%rip), %rsi      # 0x117ba
movb $0x2, %al
callq 0x3290
movl $0x0, 0x6823(%rip)      # 0x14330
leaq 0x7504(%rip), %rax      # 0x15018
movq (%rax), %rdi
leaq 0x799a(%rip), %rax      # 0x154b8
movss 0x1080(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3cc2(%rip), %rsi      # 0x117f3
movb $0x1, %al
callq 0x3290
leaq 0x74d9(%rip), %rax      # 0x15018
movq (%rax), %rdi
leaq 0x796f(%rip), %rax      # 0x154b8
movl 0x10a8(%rax), %edx
movsd -0x4b0(%rbp), %xmm0
leaq 0x3cb4(%rip), %rsi      # 0x11812
movb $0x1, %al
callq 0x3290
movsd -0x4b0(%rbp), %xmm0
mulsd -0x4a8(%rbp), %xmm0
movsd %xmm0, 0x67ab(%rip)     # 0x14328
callq 0xce50
movsd 0x1b5e(%rip), %xmm0     # 0xf6e8
movsd %xmm0, 0x67ae(%rip)     # 0x14340
movsd 0x1b4e(%rip), %xmm0     # 0xf6e8
movsd %xmm0, 0x67a6(%rip)     # 0x14348
movl $0x1, -0x4(%rbp)
jmp 0xdbb2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbp
retq