// File: misohena[P]drawstars/drawstars.cpp
// Function: main
int main(int argc, char *argv[])
{
    Options options = {};
    setOptionsDefault(options);
    if(!parseCommandLine(options, argc, argv)){
        return -1;
    }

    const char * const GAIA_FILE = "gaia/gaia_ra_dec_g_bp_rp_teff.dat";
    const char * const HIP_FILE = "hip2/hip2_ra_dec_mag_bv.dat";
    const ProjectionMode projectionMode = options.projectionMode;
    // Input Options
    const std::string catalogDir(options.catalogDir);
    const std::string gaiaFile = catalogDir + "/" + GAIA_FILE;
    const std::string hipFile = catalogDir + "/" + HIP_FILE;

    // Rendering Options
    const unsigned int canvasWidth = options.width;
    const unsigned int canvasHeight = options.height;
    const StarAppearanceOptions starAppearanceOptions= {
        options.fluxOffset,
        options.fluxMultiplier,
        1.0f / options.fluxGamma,
        options.fluxMax,
        options.fluxIncRadius,
        options.radiusDefault,
        options.radiusMax
    };

    // Output Options
    std::string outputFloatsFile(options.outputFloatsFile);
    std::string outputImageFile(options.outputImageFile);

    // prepare rendering target
    ImageType canvas(canvasWidth, canvasHeight);

    if(0){
        // 描画テスト
        for(int y = -900; y <= 900; y += 100){
            drawStarOnEquirectangular(canvas, HipStar{float(180*DEG2RAD), float((y+0)*PI/canvasHeight), 0, 0}, StarAppearanceOptions{1.0, 0.5, 2.0});
            drawStarOnEquirectangular(canvas, HipStar{float(185*DEG2RAD), float((y+0.25)*PI/canvasHeight), 0, 0}, StarAppearanceOptions{1.0, 0.5, 2.0});
            drawStarOnEquirectangular(canvas, HipStar{float(190*DEG2RAD), float((y+0.5)*PI/canvasHeight), 0, 0}, StarAppearanceOptions{1.0, 0.5, 2.0});
            drawStarOnEquirectangular(canvas, HipStar{float(195*DEG2RAD), float((y+0.75)*PI/canvasHeight), 0, 0}, StarAppearanceOptions{1.0, 0.5, 2.0});
            drawStarOnEquirectangular(canvas, HipStar{float(200*DEG2RAD), float((y+1.0)*PI/canvasHeight), 0, 0}, StarAppearanceOptions{1.0, 0.5, 2.0});
        }
    }
    else if(projectionMode == PROJ_LOAD_FLOATS){
        canvas = readRawFile<ImageType>(outputFloatsFile.c_str());
        if(!canvas){
            printf("Failed to load %s\n", outputFloatsFile.c_str());
            return -1;
        }
        printf("%s loaded\n", outputFloatsFile.c_str());
    }
    else if(projectionMode == PROJ_EQUIRECTANGULAR){
        if(options.gaiaEnabled && !drawStars<GaiaStar>(
               canvas, gaiaFile.c_str(),
               [=](ImageType &canvas, GaiaStarRange stars){
                   drawStarsOnEquirectangular(canvas, stars, std::max(options.gaiaMinMag, options.minMag), options.maxMag, starAppearanceOptions);
               })){
            return -1;
        }
        if(options.hip2Enabled && !drawStars<HipStar>(
               canvas, hipFile.c_str(),
               [=](ImageType &canvas, HipStarRange stars){
                   drawStarsOnEquirectangular(canvas, stars, options.minMag, std::min(options.maxMag, options.hip2MaxMag), starAppearanceOptions);
               })){
            return -1;
        }
    }
    else{
        // calculate matrix
        printf("unixSeconds=%lf\n", options.unixSeconds);
        const Mat4F matEquToHor = createEquatorialToHorizontalMatrix(options.lat, options.lng, options.unixSeconds);
        float viewAz = options.viewAz;
        float viewEl = options.viewEl;
        if((options.hasViewRA && options.hasViewDec) || !(options.hasViewAz || options.hasViewEl)){
            const float viewRA = options.viewRA;
            const float viewDec = options.viewDec;
            const std::pair<float, float> viewAzEl = convertRADecToAzEl(options.viewRA*DEG2RAD, options.viewDec*DEG2RAD, matEquToHor);
            viewAz += viewAzEl.first; //deg
            viewEl += viewAzEl.second; //deg
        }
        printf("az=%lf el=%lf roll=%lf\n", viewAz, viewEl, options.viewRoll);
        const Mat4F mat = createProjectionMatrix(canvasWidth, canvasHeight, options.fovYDeg, options.viewZ)
            * createViewMatrix(viewAz, viewEl, options.viewRoll)
            * matEquToHor;
        // draw stars
        if(options.gaiaEnabled && !drawStars<GaiaStar>(
               canvas, gaiaFile.c_str(),
               [=](ImageType &canvas, GaiaStarRange stars){
                   drawStarsPerspective(canvas, stars, mat, std::max(options.gaiaMinMag, options.minMag), options.maxMag, starAppearanceOptions);
               })){
            return -1;
        }
        if(options.hip2Enabled && !drawStars<HipStar>(
               canvas, hipFile.c_str(),
               [=](ImageType &canvas, HipStarRange stars){
                   drawStarsPerspective(canvas, stars, mat, options.minMag, std::min(options.maxMag, options.hip2MaxMag), starAppearanceOptions);
               })){
            return -1;
        }
    }

    //
    // output results
    //
    writeRawFile(outputFloatsFile.c_str(), canvas);

    const ColorType postOffsetColor(options.postOffset, options.postOffset, options.postOffset);
    const double invG = 1.0/options.postGamma;
    ImageType image = apply(
        canvas,
        [&](ColorType p){
            return pow(postOffsetColor + options.postMultiplier * p, invG);
        });
    if(options.postKeepColor){
        image.apply([&](ColorType p){return saturateKeepColor(p);});
    }
    writeImageFile(outputImageFile.c_str(), image, options.jpegQuality);

    return 0;
}

// Assembly:
subq $0x978, %rsp            # imm = 0x978
movl $0x0, 0x974(%rsp)
movl %edi, 0x970(%rsp)
movq %rsi, 0x968(%rsp)
leaq 0x8b0(%rsp), %rdi
callq 0x10750
movb $0x0, 0x8c0(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x8c4(%rsp)
movb $0x0, 0x8c8(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x8cc(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x8d0(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x8d4(%rsp)
leaq 0x8b0(%rsp), %rdi
addq $0x28, %rdi
callq 0x10750
leaq 0x8b0(%rsp), %rdi
addq $0x38, %rdi
callq 0x10750
movl $0x0, 0x8f8(%rsp)
movl $0x0, 0x8fc(%rsp)
movl $0x0, 0x900(%rsp)
movl $0x0, 0x904(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x908(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x90c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x910(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x914(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x918(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x91c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x920(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x924(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x928(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x92c(%rsp)
movb $0x0, 0x930(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x938(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x940(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x944(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x948(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x94c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x950(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x954(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x958(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x95c(%rsp)
movb $0x0, 0x960(%rsp)
movb $0x0, 0x961(%rsp)
movb $0x0, 0x962(%rsp)
movb $0x0, 0x963(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x964(%rsp)
leaq 0x8b0(%rsp), %rdi
callq 0x8bc0
movl 0x970(%rsp), %esi
movq 0x968(%rsp), %rdx
leaq 0x8b0(%rsp), %rdi
callq 0x9020
testb $0x1, %al
jne 0x9691
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
jmp 0xa2c1
leaq 0x14d85(%rip), %rax     # 0x1e41d
movq %rax, 0x8a8(%rsp)
leaq 0x14d98(%rip), %rax     # 0x1e43f
movq %rax, 0x8a0(%rsp)
movl 0x8fc(%rsp), %eax
movl %eax, 0x89c(%rsp)
leaq 0x877(%rsp), %rdi
movq %rdi, 0x1a8(%rsp)
callq 0x4600
movq 0x1a8(%rsp), %rdx
leaq 0x878(%rsp), %rdi
leaq 0x8b0(%rsp), %rsi
callq 0xf890
jmp 0x96f1
leaq 0x877(%rsp), %rdi
callq 0x43e0
leaq 0x14d56(%rip), %rdx     # 0x1e45b
leaq 0x820(%rsp), %rdi
leaq 0x878(%rsp), %rsi
callq 0x10860
jmp 0x971c
leaq 0x14cfa(%rip), %rdx     # 0x1e41d
leaq 0x840(%rsp), %rdi
leaq 0x820(%rsp), %rsi
callq 0x10810
jmp 0x973a
leaq 0x820(%rsp), %rdi
callq 0x4240
leaq 0x14d0d(%rip), %rdx     # 0x1e45b
leaq 0x7e0(%rsp), %rdi
leaq 0x878(%rsp), %rsi
callq 0x10860
jmp 0x9765
leaq 0x14cd3(%rip), %rdx     # 0x1e43f
leaq 0x800(%rsp), %rdi
leaq 0x7e0(%rsp), %rsi
callq 0x10810
jmp 0x9783
leaq 0x7e0(%rsp), %rdi
callq 0x4240
movl 0x900(%rsp), %eax
movl %eax, 0x7dc(%rsp)
movl 0x904(%rsp), %eax
movl %eax, 0x7d8(%rsp)
movss 0x908(%rsp), %xmm0
movss %xmm0, 0x7bc(%rsp)
movss 0x90c(%rsp), %xmm0
movss %xmm0, 0x7c0(%rsp)
movss 0x910(%rsp), %xmm1
movss 0x1482b(%rip), %xmm0    # 0x1e00c
divss %xmm1, %xmm0
movss %xmm0, 0x7c4(%rsp)
movss 0x914(%rsp), %xmm0
movss %xmm0, 0x7c8(%rsp)
movss 0x918(%rsp), %xmm0
movss %xmm0, 0x7cc(%rsp)
movss 0x91c(%rsp), %xmm0
movss %xmm0, 0x7d0(%rsp)
movss 0x920(%rsp), %xmm0
movss %xmm0, 0x7d4(%rsp)
leaq 0x8d8(%rsp), %rax
movq %rax, 0x198(%rsp)
leaq 0x797(%rsp), %rdi
movq %rdi, 0x1a0(%rsp)
callq 0x4600
movq 0x198(%rsp), %rsi
movq 0x1a0(%rsp), %rdx
leaq 0x798(%rsp), %rdi
callq 0xf890
jmp 0x987a
leaq 0x797(%rsp), %rdi
callq 0x43e0
leaq 0x8e8(%rsp), %rax
movq %rax, 0x188(%rsp)
leaq 0x76f(%rsp), %rdi
movq %rdi, 0x190(%rsp)
callq 0x4600
movq 0x188(%rsp), %rsi
movq 0x190(%rsp), %rdx
leaq 0x770(%rsp), %rdi
callq 0xf890
jmp 0x98cb
leaq 0x76f(%rsp), %rdi
callq 0x43e0
movl 0x7dc(%rsp), %esi
movl 0x7d8(%rsp), %edx
leaq 0x758(%rsp), %rdi
callq 0x108f0
jmp 0x98f5
cmpl $0x2, 0x89c(%rsp)
jne 0x9b15
leaq 0x798(%rsp), %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x748(%rsp), %rdi
callq 0x109f0
jmp 0x9922
leaq 0x758(%rsp), %rdi
leaq 0x748(%rsp), %rsi
callq 0x10bc0
jmp 0x9939
leaq 0x748(%rsp), %rdi
callq 0x10c10
leaq 0x758(%rsp), %rdi
callq 0x10c30
movb %al, 0x187(%rsp)
jmp 0x995c
movb 0x187(%rsp), %al
testb $0x1, %al
jne 0x9af0
jmp 0x996d
leaq 0x798(%rsp), %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x14ad9(%rip), %rdi     # 0x1e45d
xorl %eax, %eax
callq 0x4050
jmp 0x998d
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x744(%rsp)
jmp 0xa221
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x877(%rsp), %rdi
callq 0x43e0
jmp 0xa2d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
jmp 0xa2b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x820(%rsp), %rdi
callq 0x4240
jmp 0xa2b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
jmp 0xa2a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x7e0(%rsp), %rdi
callq 0x4240
jmp 0xa2a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x797(%rsp), %rdi
callq 0x43e0
jmp 0xa298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x76f(%rsp), %rdi
callq 0x43e0
jmp 0xa28b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
jmp 0xa27e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
jmp 0xa271
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x748(%rsp), %rdi
callq 0x10c10
jmp 0xa271
leaq 0x798(%rsp), %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x14969(%rip), %rdi     # 0x1e470
xorl %eax, %eax
callq 0x4050
jmp 0x9b10
jmp 0xa0d3
cmpl $0x0, 0x89c(%rsp)
jne 0x9ca4
testb $0x1, 0x8c0(%rsp)
je 0x9be1
leaq 0x840(%rsp), %rdi
callq 0x4150
movq %rax, 0x178(%rsp)
leaq 0x668(%rsp), %rdi
movq %rdi, 0x170(%rsp)
leaq 0x8b0(%rsp), %rsi
movl $0xb8, %edx
callq 0x4300
movq 0x170(%rsp), %rsi
movups 0x7bc(%rsp), %xmm0
movups 0x7c8(%rsp), %xmm1
movups %xmm1, 0x72c(%rsp)
movups %xmm0, 0x720(%rsp)
movq %rsp, %rdi
movl $0x1b, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq 0x178(%rsp), %rsi
leaq 0x758(%rsp), %rdi
callq 0xa2e0
movb %al, 0x186(%rsp)
jmp 0x9bb9
movb 0x186(%rsp), %al
testb $0x1, %al
jne 0x9be1
jmp 0x9bc6
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x744(%rsp)
jmp 0xa221
testb $0x1, 0x8c8(%rsp)
je 0x9c9f
leaq 0x800(%rsp), %rdi
callq 0x4150
movq %rax, 0x160(%rsp)
leaq 0x590(%rsp), %rdi
movq %rdi, 0x158(%rsp)
leaq 0x8b0(%rsp), %rsi
movl $0xb8, %edx
callq 0x4300
movq 0x158(%rsp), %rsi
movups 0x7bc(%rsp), %xmm0
movups 0x7c8(%rsp), %xmm1
movups %xmm1, 0x654(%rsp)
movups %xmm0, 0x648(%rsp)
movq %rsp, %rdi
movl $0x1b, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq 0x160(%rsp), %rsi
leaq 0x758(%rsp), %rdi
callq 0xab90
movb %al, 0x16f(%rsp)
jmp 0x9c77
movb 0x16f(%rsp), %al
testb $0x1, %al
jne 0x9c9f
jmp 0x9c84
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x744(%rsp)
jmp 0xa221
jmp 0xa0d1
movsd 0x938(%rsp), %xmm0
leaq 0x147c7(%rip), %rdi     # 0x1e47b
movb $0x1, %al
callq 0x4050
jmp 0x9cbd
movss 0x940(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x944(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x938(%rsp), %xmm2
leaq 0x550(%rsp), %rdi
callq 0x8480
jmp 0x9cef
movss 0x94c(%rsp), %xmm0
movss %xmm0, 0x54c(%rsp)
movss 0x950(%rsp), %xmm0
movss %xmm0, 0x548(%rsp)
testb $0x1, 0x962(%rsp)
je 0x9d27
testb $0x1, 0x963(%rsp)
jne 0x9d43
testb $0x1, 0x960(%rsp)
jne 0x9df7
testb $0x1, 0x961(%rsp)
jne 0x9df7
movss 0x954(%rsp), %xmm0
movss %xmm0, 0x544(%rsp)
movss 0x958(%rsp), %xmm0
movss %xmm0, 0x540(%rsp)
movss 0x954(%rsp), %xmm0
movss 0x958(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x143ab(%rip), %xmm2    # 0x1e130
mulsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
leaq 0x550(%rsp), %rdi
callq 0x8220
movaps %xmm0, 0x140(%rsp)
jmp 0x9db0
movaps 0x140(%rsp), %xmm0
movlpd %xmm0, 0x538(%rsp)
movss 0x538(%rsp), %xmm0
addss 0x54c(%rsp), %xmm0
movss %xmm0, 0x54c(%rsp)
movss 0x53c(%rsp), %xmm0
addss 0x548(%rsp), %xmm0
movss %xmm0, 0x548(%rsp)
movss 0x54c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x548(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x948(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x14667(%rip), %rdi     # 0x1e48c
movb $0x3, %al
callq 0x4050
jmp 0x9e2e
movl 0x7dc(%rsp), %eax
cvtsi2sd %rax, %xmm0
movl 0x7d8(%rsp), %eax
cvtsi2sd %rax, %xmm1
movss 0x95c(%rsp), %xmm2
movss 0x964(%rsp), %xmm3
cvtss2sd %xmm2, %xmm2
cvtss2sd %xmm3, %xmm3
leaq 0x478(%rsp), %rdi
callq 0x8670
jmp 0x9e6f
movss 0x54c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x548(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x948(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x438(%rsp), %rdi
callq 0x8560
jmp 0x9ea5
leaq 0x4b8(%rsp), %rdi
leaq 0x478(%rsp), %rsi
leaq 0x438(%rsp), %rdx
callq 0xec30
jmp 0x9ec4
leaq 0x4f8(%rsp), %rdi
leaq 0x4b8(%rsp), %rsi
leaq 0x550(%rsp), %rdx
callq 0xec30
jmp 0x9ee3
testb $0x1, 0x8c0(%rsp)
je 0x9fd9
leaq 0x840(%rsp), %rdi
callq 0x4150
movq %rax, 0x130(%rsp)
movups 0x4f8(%rsp), %xmm0
movups 0x508(%rsp), %xmm1
movups 0x518(%rsp), %xmm2
movups 0x528(%rsp), %xmm3
movaps %xmm3, 0x350(%rsp)
movaps %xmm2, 0x340(%rsp)
movaps %xmm1, 0x330(%rsp)
movaps %xmm0, 0x320(%rsp)
leaq 0x360(%rsp), %rdi
leaq 0x8b0(%rsp), %rsi
movl $0xb8, %edx
callq 0x4300
movups 0x7bc(%rsp), %xmm0
movups 0x7c8(%rsp), %xmm1
movups %xmm1, 0x424(%rsp)
movups %xmm0, 0x418(%rsp)
movq %rsp, %rdi
movl $0x23, %ecx
leaq 0x320(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x130(%rsp), %rsi
leaq 0x758(%rsp), %rdi
callq 0xb3a0
movb %al, 0x13f(%rsp)
jmp 0x9fb1
movb 0x13f(%rsp), %al
testb $0x1, %al
jne 0x9fd9
jmp 0x9fbe
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x744(%rsp)
jmp 0xa221
testb $0x1, 0x8c8(%rsp)
je 0xa0cf
leaq 0x800(%rsp), %rdi
callq 0x4150
movq %rax, 0x120(%rsp)
movups 0x4f8(%rsp), %xmm0
movups 0x508(%rsp), %xmm1
movups 0x518(%rsp), %xmm2
movups 0x528(%rsp), %xmm3
movaps %xmm3, 0x230(%rsp)
movaps %xmm2, 0x220(%rsp)
movaps %xmm1, 0x210(%rsp)
movaps %xmm0, 0x200(%rsp)
leaq 0x240(%rsp), %rdi
leaq 0x8b0(%rsp), %rsi
movl $0xb8, %edx
callq 0x4300
movups 0x7bc(%rsp), %xmm0
movups 0x7c8(%rsp), %xmm1
movups %xmm1, 0x304(%rsp)
movups %xmm0, 0x2f8(%rsp)
movq %rsp, %rdi
movl $0x23, %ecx
leaq 0x200(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x120(%rsp), %rsi
leaq 0x758(%rsp), %rdi
callq 0xbbb0
movb %al, 0x12f(%rsp)
jmp 0xa0a7
movb 0x12f(%rsp), %al
testb $0x1, %al
jne 0xa0cf
jmp 0xa0b4
movl $0xffffffff, 0x974(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x744(%rsp)
jmp 0xa221
jmp 0xa0d1
jmp 0xa0d3
leaq 0x798(%rsp), %rdi
callq 0x4150
movq %rax, %rdi
leaq 0x758(%rsp), %rsi
callq 0x10c50
jmp 0xa0f2
movss 0x924(%rsp), %xmm0
cvtss2sd %xmm0, %xmm2
leaq 0x1e8(%rsp), %rdi
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xd810
jmp 0xa114
movss 0x92c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x13f2f(%rip), %xmm0    # 0x1e058
divsd %xmm1, %xmm0
movsd %xmm0, 0x1e0(%rsp)
leaq 0x1e8(%rsp), %rax
movq %rax, 0x1b8(%rsp)
leaq 0x8b0(%rsp), %rax
movq %rax, 0x1c0(%rsp)
leaq 0x1e0(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x1c8(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups 0x1b8(%rsp), %xmm0
movups %xmm0, (%rax)
leaq 0x1d0(%rsp), %rdi
leaq 0x758(%rsp), %rsi
callq 0xc3c0
jmp 0xa197
testb $0x1, 0x930(%rsp)
je 0xa1d8
leaq 0x1d0(%rsp), %rdi
callq 0xc580
jmp 0xa1b0
jmp 0xa1d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x868(%rsp)
movl %eax, 0x864(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x10c10
jmp 0xa271
leaq 0x770(%rsp), %rdi
callq 0x4150
movq %rax, %rdi
movl 0x8f8(%rsp), %edx
leaq 0x1d0(%rsp), %rsi
callq 0x7c70
jmp 0xa1fe
movl $0x0, 0x974(%rsp)
movl $0x1, 0x744(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x10c10
leaq 0x758(%rsp), %rdi
callq 0x10c10
leaq 0x770(%rsp), %rdi
callq 0x4240
leaq 0x798(%rsp), %rdi
callq 0x4240
leaq 0x800(%rsp), %rdi
callq 0x4240
leaq 0x840(%rsp), %rdi
callq 0x4240
leaq 0x878(%rsp), %rdi
callq 0x4240
jmp 0xa2c1
leaq 0x758(%rsp), %rdi
callq 0x10c10
leaq 0x770(%rsp), %rdi
callq 0x4240
leaq 0x798(%rsp), %rdi
callq 0x4240
leaq 0x800(%rsp), %rdi
callq 0x4240
leaq 0x840(%rsp), %rdi
callq 0x4240
leaq 0x878(%rsp), %rdi
callq 0x4240
jmp 0xa2d0
movl 0x974(%rsp), %eax
addq $0x978, %rsp            # imm = 0x978
retq
movq 0x868(%rsp), %rdi
callq 0x45f0
nopl (%rax)