// File: Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImFontAtlasBuildWithStbTruetype(ImFontAtlas*)
bool    ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
{
    IM_ASSERT(atlas->ConfigData.Size > 0);

    ImFontAtlasBuildInit(atlas);

    // Clear atlas
    atlas->TexID = (ImTextureID)NULL;
    atlas->TexWidth = atlas->TexHeight = 0;
    atlas->TexUvScale = ImVec2(0.0f, 0.0f);
    atlas->TexUvWhitePixel = ImVec2(0.0f, 0.0f);
    atlas->ClearTexData();

    // Temporary storage for building
    ImVector<ImFontBuildSrcData> src_tmp_array;
    ImVector<ImFontBuildDstData> dst_tmp_array;
    src_tmp_array.resize(atlas->ConfigData.Size);
    dst_tmp_array.resize(atlas->Fonts.Size);
    memset(src_tmp_array.Data, 0, (size_t)src_tmp_array.size_in_bytes());
    memset(dst_tmp_array.Data, 0, (size_t)dst_tmp_array.size_in_bytes());

    // 1. Initialize font loading structure, check font data validity
    for (int src_i = 0; src_i < atlas->ConfigData.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        ImFontConfig& cfg = atlas->ConfigData[src_i];
        IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == atlas));

        // Find index from cfg.DstFont (we allow the user to set cfg.DstFont. Also it makes casual debugging nicer than when storing indices)
        src_tmp.DstIndex = -1;
        for (int output_i = 0; output_i < atlas->Fonts.Size && src_tmp.DstIndex == -1; output_i++)
            if (cfg.DstFont == atlas->Fonts[output_i])
                src_tmp.DstIndex = output_i;
        if (src_tmp.DstIndex == -1)
        {
            IM_ASSERT(src_tmp.DstIndex != -1); // cfg.DstFont not pointing within atlas->Fonts[] array?
            return false;
        }
        // Initialize helper structure for font loading and verify that the TTF/OTF data is correct
        const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo);
        IM_ASSERT(font_offset >= 0 && "FontData is incorrect, or FontNo cannot be found.");
        if (!stbtt_InitFont(&src_tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset))
            return false;

        // Measure highest codepoints
        ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
        src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
        for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
            src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
        dst_tmp.SrcCount++;
        dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
    }

    // 2. For every requested codepoint, check for their presence in the font data, and handle redundancy or overlaps between source fonts to avoid unused glyphs.
    int total_glyphs_count = 0;
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
        src_tmp.GlyphsSet.Create(src_tmp.GlyphsHighest + 1);
        if (dst_tmp.GlyphsSet.Storage.empty())
            dst_tmp.GlyphsSet.Create(dst_tmp.GlyphsHighest + 1);

        for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
            for (unsigned int codepoint = src_range[0]; codepoint <= src_range[1]; codepoint++)
            {
                if (dst_tmp.GlyphsSet.TestBit(codepoint))    // Don't overwrite existing glyphs. We could make this an option for MergeMode (e.g. MergeOverwrite==true)
                    continue;
                if (!stbtt_FindGlyphIndex(&src_tmp.FontInfo, codepoint))    // It is actually in the font?
                    continue;

                // Add to avail set/counters
                src_tmp.GlyphsCount++;
                dst_tmp.GlyphsCount++;
                src_tmp.GlyphsSet.SetBit(codepoint);
                dst_tmp.GlyphsSet.SetBit(codepoint);
                total_glyphs_count++;
            }
    }

    // 3. Unpack our bit map into a flat list (we now have all the Unicode points that we know are requested _and_ available _and_ not overlapping another)
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        src_tmp.GlyphsList.reserve(src_tmp.GlyphsCount);
        UnpackBitVectorToFlatIndexList(&src_tmp.GlyphsSet, &src_tmp.GlyphsList);
        src_tmp.GlyphsSet.Clear();
        IM_ASSERT(src_tmp.GlyphsList.Size == src_tmp.GlyphsCount);
    }
    for (int dst_i = 0; dst_i < dst_tmp_array.Size; dst_i++)
        dst_tmp_array[dst_i].GlyphsSet.Clear();
    dst_tmp_array.clear();

    // Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0)
    // (We technically don't need to zero-clear buf_rects, but let's do it for the sake of sanity)
    ImVector<stbrp_rect> buf_rects;
    ImVector<stbtt_packedchar> buf_packedchars;
    buf_rects.resize(total_glyphs_count);
    buf_packedchars.resize(total_glyphs_count);
    memset(buf_rects.Data, 0, (size_t)buf_rects.size_in_bytes());
    memset(buf_packedchars.Data, 0, (size_t)buf_packedchars.size_in_bytes());

    // 4. Gather glyphs sizes so we can pack them in our virtual canvas.
    int total_surface = 0;
    int buf_rects_out_n = 0;
    int buf_packedchars_out_n = 0;
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        if (src_tmp.GlyphsCount == 0)
            continue;

        src_tmp.Rects = &buf_rects[buf_rects_out_n];
        src_tmp.PackedChars = &buf_packedchars[buf_packedchars_out_n];
        buf_rects_out_n += src_tmp.GlyphsCount;
        buf_packedchars_out_n += src_tmp.GlyphsCount;

        // Convert our ranges in the format stb_truetype wants
        ImFontConfig& cfg = atlas->ConfigData[src_i];
        src_tmp.PackRange.font_size = cfg.SizePixels;
        src_tmp.PackRange.first_unicode_codepoint_in_range = 0;
        src_tmp.PackRange.array_of_unicode_codepoints = src_tmp.GlyphsList.Data;
        src_tmp.PackRange.num_chars = src_tmp.GlyphsList.Size;
        src_tmp.PackRange.chardata_for_range = src_tmp.PackedChars;
        src_tmp.PackRange.h_oversample = (unsigned char)cfg.OversampleH;
        src_tmp.PackRange.v_oversample = (unsigned char)cfg.OversampleV;

        // Gather the sizes of all rectangles we will need to pack (this loop is based on stbtt_PackFontRangesGatherRects)
        const float scale = (cfg.SizePixels > 0) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -cfg.SizePixels);
        const int padding = atlas->TexGlyphPadding;
        for (int glyph_i = 0; glyph_i < src_tmp.GlyphsList.Size; glyph_i++)
        {
            int x0, y0, x1, y1;
            const int glyph_index_in_font = stbtt_FindGlyphIndex(&src_tmp.FontInfo, src_tmp.GlyphsList[glyph_i]);
            IM_ASSERT(glyph_index_in_font != 0);
            stbtt_GetGlyphBitmapBoxSubpixel(&src_tmp.FontInfo, glyph_index_in_font, scale * cfg.OversampleH, scale * cfg.OversampleV, 0, 0, &x0, &y0, &x1, &y1);
            src_tmp.Rects[glyph_i].w = (stbrp_coord)(x1 - x0 + padding + cfg.OversampleH - 1);
            src_tmp.Rects[glyph_i].h = (stbrp_coord)(y1 - y0 + padding + cfg.OversampleV - 1);
            total_surface += src_tmp.Rects[glyph_i].w * src_tmp.Rects[glyph_i].h;
        }
    }

    // We need a width for the skyline algorithm, any width!
    // The exact width doesn't really matter much, but some API/GPU have texture size limitations and increasing width can decrease height.
    // User can override TexDesiredWidth and TexGlyphPadding if they wish, otherwise we use a simple heuristic to select the width based on expected surface.
    const int surface_sqrt = (int)ImSqrt((float)total_surface) + 1;
    atlas->TexHeight = 0;
    if (atlas->TexDesiredWidth > 0)
        atlas->TexWidth = atlas->TexDesiredWidth;
    else
        atlas->TexWidth = (surface_sqrt >= 4096 * 0.7f) ? 4096 : (surface_sqrt >= 2048 * 0.7f) ? 2048 : (surface_sqrt >= 1024 * 0.7f) ? 1024 : 512;

    // 5. Start packing
    // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values).
    const int TEX_HEIGHT_MAX = 1024 * 32;
    stbtt_pack_context spc = {};
    stbtt_PackBegin(&spc, NULL, atlas->TexWidth, TEX_HEIGHT_MAX, 0, atlas->TexGlyphPadding, NULL);
    ImFontAtlasBuildPackCustomRects(atlas, spc.pack_info);

    // 6. Pack each source font. No rendering yet, we are working with rectangles in an infinitely tall texture at this point.
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        if (src_tmp.GlyphsCount == 0)
            continue;

        stbrp_pack_rects((stbrp_context*)spc.pack_info, src_tmp.Rects, src_tmp.GlyphsCount);

        // Extend texture height and mark missing glyphs as non-packed so we won't render them.
        // FIXME: We are not handling packing failure here (would happen if we got off TEX_HEIGHT_MAX or if a single if larger than TexWidth?)
        for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
            if (src_tmp.Rects[glyph_i].was_packed)
                atlas->TexHeight = ImMax(atlas->TexHeight, src_tmp.Rects[glyph_i].y + src_tmp.Rects[glyph_i].h);
    }

    // 7. Allocate texture
    atlas->TexHeight = (atlas->Flags & ImFontAtlasFlags_NoPowerOfTwoHeight) ? (atlas->TexHeight + 1) : ImUpperPowerOfTwo(atlas->TexHeight);
    atlas->TexUvScale = ImVec2(1.0f / atlas->TexWidth, 1.0f / atlas->TexHeight);
    atlas->TexPixelsAlpha8 = (unsigned char*)IM_ALLOC(atlas->TexWidth * atlas->TexHeight);
    memset(atlas->TexPixelsAlpha8, 0, atlas->TexWidth * atlas->TexHeight);
    spc.pixels = atlas->TexPixelsAlpha8;
    spc.height = atlas->TexHeight;

    // 8. Render/rasterize font characters into the texture
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontConfig& cfg = atlas->ConfigData[src_i];
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        if (src_tmp.GlyphsCount == 0)
            continue;

        stbtt_PackFontRangesRenderIntoRects(&spc, &src_tmp.FontInfo, &src_tmp.PackRange, 1, src_tmp.Rects);

        // Apply multiply operator
        if (cfg.RasterizerMultiply != 1.0f)
        {
            unsigned char multiply_table[256];
            ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, cfg.RasterizerMultiply);
            stbrp_rect* r = &src_tmp.Rects[0];
            for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++, r++)
                if (r->was_packed)
                    ImFontAtlasBuildMultiplyRectAlpha8(multiply_table, atlas->TexPixelsAlpha8, r->x, r->y, r->w, r->h, atlas->TexWidth * 1);
        }
        src_tmp.Rects = NULL;
    }

    // End packing
    stbtt_PackEnd(&spc);
    buf_rects.clear();

    // 9. Setup ImFont and glyphs for runtime
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
        if (src_tmp.GlyphsCount == 0)
            continue;

        // When merging fonts with MergeMode=true:
        // - We can have multiple input fonts writing into a same destination font.
        // - dst_font->ConfigData is != from cfg which is our source configuration.
        ImFontConfig& cfg = atlas->ConfigData[src_i];
        ImFont* dst_font = cfg.DstFont;

        const float font_scale = stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels);
        int unscaled_ascent, unscaled_descent, unscaled_line_gap;
        stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap);

        const float ascent = ImFloor(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1));
        const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1));
        ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
        const float font_off_x = cfg.GlyphOffset.x;
        const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);

        for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
        {
            // Register glyph
            const int codepoint = src_tmp.GlyphsList[glyph_i];
            const stbtt_packedchar& pc = src_tmp.PackedChars[glyph_i];
            stbtt_aligned_quad q;
            float unused_x = 0.0f, unused_y = 0.0f;
            stbtt_GetPackedQuad(src_tmp.PackedChars, atlas->TexWidth, atlas->TexHeight, glyph_i, &unused_x, &unused_y, &q, 0);
            dst_font->AddGlyph(&cfg, (ImWchar)codepoint, q.x0 + font_off_x, q.y0 + font_off_y, q.x1 + font_off_x, q.y1 + font_off_y, q.s0, q.t0, q.s1, q.t1, pc.xadvance);
        }
    }

    // Cleanup temporary (ImVector doesn't honor destructor)
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
        src_tmp_array[src_i].~ImFontBuildSrcData();

    ImFontAtlasBuildFinish(atlas);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x11765b
jmp 0x11767a
leaq 0x733db(%rip), %rdi     # 0x18aa3d
leaq 0x72b0d(%rip), %rsi     # 0x18a176
movl $0x85f, %edx            # imm = 0x85F
leaq 0x733e3(%rip), %rcx     # 0x18aa58
callq 0xd180
movq -0x10(%rbp), %rdi
callq 0x118ee0
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x28(%rax)
leaq -0x18(%rbp), %rdi
xorps %xmm1, %xmm1
movss %xmm1, -0x318(%rbp)
movaps %xmm1, %xmm0
callq 0xbf4c0
movss -0x318(%rbp), %xmm1
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x30(%rax)
leaq -0x20(%rbp), %rdi
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
callq 0x1160d0
leaq -0x30(%rbp), %rdi
callq 0x127c60
leaq -0x40(%rbp), %rdi
callq 0x127c90
jmp 0x117705
movq -0x10(%rbp), %rax
movl 0x60(%rax), %esi
leaq -0x30(%rbp), %rdi
callq 0x127cc0
jmp 0x117717
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x127d10
jmp 0x117729
movq -0x28(%rbp), %rax
movq %rax, -0x328(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x127d60
movl %eax, -0x31c(%rbp)
jmp 0x117745
movq -0x328(%rbp), %rdi
movl -0x31c(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xd2f0
movq -0x38(%rbp), %rax
movq %rax, -0x338(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x127d80
movl %eax, -0x32c(%rbp)
jmp 0x117778
movq -0x338(%rbp), %rdi
movl -0x32c(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xd2f0
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x60(%rcx), %eax
jge 0x117b64
movl -0x50(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x340(%rbp)
jmp 0x1177bb
movq -0x340(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movl -0x50(%rbp), %esi
callq 0x1278b0
movq %rax, -0x348(%rbp)
jmp 0x1177df
movq -0x348(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x80(%rcx)
movb %al, -0x349(%rbp)
je 0x117855
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0xea840
movb %al, -0x34a(%rbp)
jmp 0x117818
movb -0x34a(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x34b(%rbp)
jne 0x11782d
jmp 0x117849
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x40(%rax), %rax
cmpq -0x10(%rbp), %rax
sete %al
movb %al, -0x34b(%rbp)
movb -0x34b(%rbp), %al
movb %al, -0x349(%rbp)
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0x117861
jmp 0x117863
jmp 0x1178a4
leaq 0x73222(%rip), %rdi     # 0x18aa8c
leaq 0x72905(%rip), %rsi     # 0x18a176
movl $0x877, %edx            # imm = 0x877
leaq 0x731db(%rip), %rcx     # 0x18aa58
callq 0xd180
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x118dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x118db2
movq -0x58(%rbp), %rax
movl $0xffffffff, 0xe0(%rax) # imm = 0xFFFFFFFF
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x40(%rdx), %ecx
movb %al, -0x34c(%rbp)
jge 0x1178e1
movq -0x58(%rbp), %rax
cmpl $-0x1, 0xe0(%rax)
sete %al
movb %al, -0x34c(%rbp)
movb -0x34c(%rbp), %al
testb $0x1, %al
jne 0x1178ed
jmp 0x117948
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x360(%rbp)
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
movl -0x64(%rbp), %esi
callq 0xede60
movq %rax, -0x358(%rbp)
jmp 0x117918
movq -0x360(%rbp), %rax
movq -0x358(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x117938
movl -0x64(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xe0(%rax)
jmp 0x11793a
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1178b9
movq -0x58(%rbp), %rax
cmpl $-0x1, 0xe0(%rax)
jne 0x117993
movq -0x58(%rbp), %rax
cmpl $-0x1, 0xe0(%rax)
je 0x117964
jmp 0x117983
leaq 0x73173(%rip), %rdi     # 0x18aade
leaq 0x72804(%rip), %rsi     # 0x18a176
movl $0x880, %edx            # imm = 0x880
leaq 0x730da(%rip), %rcx     # 0x18aa58
callq 0xd180
movb $0x0, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x118d92
movq -0x60(%rbp), %rax
movq (%rax), %rdi
movl 0x10(%rax), %esi
callq 0x118f90
movl %eax, -0x364(%rbp)
jmp 0x1179aa
movl -0x364(%rbp), %eax
movl %eax, -0x6c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x6c(%rbp)
movb %al, -0x365(%rbp)
jl 0x1179cb
movb $0x1, %al
movb %al, -0x365(%rbp)
jmp 0x1179cb
movb -0x365(%rbp), %al
testb $0x1, %al
jne 0x1179d7
jmp 0x1179d9
jmp 0x1179f8
leaq 0x73147(%rip), %rdi     # 0x18ab27
leaq 0x7278f(%rip), %rsi     # 0x18a176
movl $0x885, %edx            # imm = 0x885
leaq 0x73065(%rip), %rcx     # 0x18aa58
callq 0xd180
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rax
movq (%rax), %rsi
movl -0x6c(%rbp), %edx
callq 0x118fc0
movl %eax, -0x36c(%rbp)
jmp 0x117a13
movl -0x36c(%rbp), %eax
cmpl $0x0, %eax
jne 0x117a2e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x118d92
movq -0x58(%rbp), %rax
movl 0xe0(%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x127e20
movq %rax, -0x378(%rbp)
jmp 0x117a4a
movq -0x378(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x117a71
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x380(%rbp)
jmp 0x117a93
movq -0x10(%rbp), %rdi
callq 0x116840
movq %rax, -0x388(%rbp)
jmp 0x117a83
movq -0x388(%rbp), %rax
movq %rax, -0x380(%rbp)
jmp 0x117a93
movq -0x380(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x58(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rcx
xorl %eax, %eax
cmpw $0x0, (%rcx)
movb %al, -0x389(%rbp)
je 0x117ad8
movq -0x80(%rbp), %rax
cmpw $0x0, 0x2(%rax)
setne %al
movb %al, -0x389(%rbp)
movb -0x389(%rbp), %al
testb $0x1, %al
jne 0x117ae4
jmp 0x117b21
movq -0x58(%rbp), %rax
movl 0xe4(%rax), %edi
movq -0x80(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x118ff0
movl %eax, -0x390(%rbp)
jmp 0x117b03
movl -0x390(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xe4(%rax)
movq -0x80(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x80(%rbp)
jmp 0x117ab4
movq -0x78(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x58(%rbp), %rax
movl 0xe4(%rax), %esi
callq 0x118ff0
movl %eax, -0x394(%rbp)
jmp 0x117b49
movl -0x394(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x117796
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x117db0
movl -0x88(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x3a0(%rbp)
jmp 0x117b9f
movq -0x3a0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movl 0xe0(%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x127e20
movq %rax, -0x3a8(%rbp)
jmp 0x117bcc
movq -0x3a8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rax
movq %rax, %rdi
addq $0xf0, %rdi
movl 0xe4(%rax), %esi
incl %esi
callq 0x127ea0
jmp 0x117bfa
movq -0x98(%rbp), %rdi
addq $0x10, %rdi
callq 0x127ef0
movb %al, -0x3a9(%rbp)
jmp 0x117c12
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x117c1e
jmp 0x117c3a
movq -0x98(%rbp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movl 0x4(%rax), %esi
incl %esi
callq 0x127ea0
jmp 0x117c38
jmp 0x117c3a
movq -0x90(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rcx
xorl %eax, %eax
cmpw $0x0, (%rcx)
movb %al, -0x3aa(%rbp)
je 0x117c79
movq -0xa0(%rbp), %rax
cmpw $0x0, 0x2(%rax)
setne %al
movb %al, -0x3aa(%rbp)
movb -0x3aa(%rbp), %al
testb $0x1, %al
jne 0x117c88
jmp 0x117d9a
movq -0xa0(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movq -0xa0(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
cmpl %ecx, %eax
ja 0x117d81
movq -0x98(%rbp), %rdi
addq $0x10, %rdi
movl -0xa4(%rbp), %esi
callq 0x127f10
movb %al, -0x3ab(%rbp)
jmp 0x117ccf
movb -0x3ab(%rbp), %al
testb $0x1, %al
jne 0x117cdb
jmp 0x117ce0
jmp 0x117d6d
movq -0x90(%rbp), %rdi
movl -0xa4(%rbp), %esi
callq 0x119020
movl %eax, -0x3b0(%rbp)
jmp 0x117cfa
movl -0x3b0(%rbp), %eax
cmpl $0x0, %eax
jne 0x117d07
jmp 0x117d6d
movq -0x90(%rbp), %rax
movl 0xe8(%rax), %ecx
incl %ecx
movl %ecx, 0xe8(%rax)
movq -0x98(%rbp), %rax
movl 0x8(%rax), %ecx
incl %ecx
movl %ecx, 0x8(%rax)
movq -0x90(%rbp), %rdi
addq $0xf0, %rdi
movl -0xa4(%rbp), %esi
callq 0x127f70
jmp 0x117d46
movq -0x98(%rbp), %rdi
addq $0x10, %rdi
movl -0xa4(%rbp), %esi
callq 0x127f70
jmp 0x117d5e
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x117c98
jmp 0x117d83
movq -0xa0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa0(%rbp)
jmp 0x117c4f
jmp 0x117d9c
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x117b78
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x117e94
movl -0xa8(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x3b8(%rbp)
jmp 0x117de1
movq -0x3b8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movl 0xe8(%rax), %esi
callq 0xef4f0
jmp 0x117e0d
movq -0xb0(%rbp), %rsi
movq %rsi, %rdi
addq $0xf0, %rdi
addq $0x100, %rsi            # imm = 0x100
callq 0x119560
jmp 0x117e2c
movq -0xb0(%rbp), %rdi
addq $0xf0, %rdi
callq 0x127fd0
jmp 0x117e41
movq -0xb0(%rbp), %rax
movl 0x100(%rax), %eax
movq -0xb0(%rbp), %rcx
cmpl 0xe8(%rcx), %eax
jne 0x117e5f
jmp 0x117e7e
leaq 0x72d09(%rip), %rdi     # 0x18ab6f
leaq 0x72309(%rip), %rsi     # 0x18a176
movl $0x8b4, %edx            # imm = 0x8B4
leaq 0x72bdf(%rip), %rcx     # 0x18aa58
callq 0xd180
jmp 0x117e80
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x117dba
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x117ee6
movl -0xb4(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x127e20
movq %rax, -0x3c0(%rbp)
jmp 0x117ec1
movq -0x3c0(%rbp), %rdi
addq $0x10, %rdi
callq 0x127fd0
jmp 0x117ed3
jmp 0x117ed5
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x117e9e
leaq -0x40(%rbp), %rdi
callq 0x127ff0
jmp 0x117ef1
leaq -0xc8(%rbp), %rdi
callq 0x128040
jmp 0x117eff
leaq -0xd8(%rbp), %rdi
callq 0x128070
jmp 0x117f0d
movl -0x84(%rbp), %esi
leaq -0xc8(%rbp), %rdi
callq 0x1280a0
jmp 0x117f21
movl -0x84(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x1280f0
jmp 0x117f35
movq -0xc0(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x128140
movl %eax, -0x3c4(%rbp)
jmp 0x117f57
movq -0x3d0(%rbp), %rdi
movl -0x3c4(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xd2f0
movq -0xd0(%rbp), %rax
movq %rax, -0x3e0(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x128160
movl %eax, -0x3d4(%rbp)
jmp 0x117f90
movq -0x3e0(%rbp), %rdi
movl -0x3d4(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xd2f0
movl $0x0, -0xdc(%rbp)
movl $0x0, -0xe0(%rbp)
movl $0x0, -0xe4(%rbp)
movl $0x0, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x118451
movl -0xe8(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x3e8(%rbp)
jmp 0x117ff6
movq -0x3e8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
jne 0x118047
jmp 0x11843d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x118d84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x128310
jmp 0x118d84
movl -0xe0(%rbp), %esi
leaq -0xc8(%rbp), %rdi
callq 0x128180
movq %rax, -0x3f0(%rbp)
jmp 0x118062
movq -0x3f0(%rbp), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, 0xc8(%rax)
movl -0xe4(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x128200
movq %rax, -0x3f8(%rbp)
jmp 0x118092
movq -0x3f8(%rbp), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0xf0(%rbp), %rax
movl 0xe8(%rax), %ecx
movl -0xe0(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xe0(%rbp)
movq -0xf0(%rbp), %rax
movl 0xe8(%rax), %ecx
movl -0xe4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xe4(%rbp)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movl -0xe8(%rbp), %esi
callq 0x1278b0
movq %rax, -0x400(%rbp)
jmp 0x1180f9
movq -0x400(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movss 0x14(%rax), %xmm0
movq -0xf0(%rbp), %rax
movss %xmm0, 0xa0(%rax)
movq -0xf0(%rbp), %rax
movl $0x0, 0xa4(%rax)
movq -0xf0(%rbp), %rax
movq 0x108(%rax), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0xf0(%rbp), %rax
movl 0x100(%rax), %ecx
movq -0xf0(%rbp), %rax
movl %ecx, 0xb0(%rax)
movq -0xf0(%rbp), %rax
movq 0xd0(%rax), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0xf8(%rbp), %rax
movl 0x18(%rax), %eax
movb %al, %cl
movq -0xf0(%rbp), %rax
movb %cl, 0xc0(%rax)
movq -0xf8(%rbp), %rax
movl 0x1c(%rax), %eax
movb %al, %cl
movq -0xf0(%rbp), %rax
movb %cl, 0xc1(%rax)
movq -0xf8(%rbp), %rax
movss 0x14(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1181ff
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %rax
movss 0x14(%rax), %xmm0
callq 0x119620
movss %xmm0, -0x404(%rbp)
jmp 0x1181ed
movss -0x404(%rbp), %xmm0
movss %xmm0, -0x408(%rbp)
jmp 0x11823e
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %rax
movss 0x14(%rax), %xmm0
movaps 0x59dd7(%rip), %xmm1    # 0x171ff0
pxor %xmm1, %xmm0
callq 0x119690
movss %xmm0, -0x40c(%rbp)
jmp 0x11822c
movss -0x40c(%rbp), %xmm0
movss %xmm0, -0x408(%rbp)
jmp 0x11823e
movss -0x408(%rbp), %xmm0
movss %xmm0, -0xfc(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x100(%rbp)
movl $0x0, -0x104(%rbp)
movl -0x104(%rbp), %eax
movq -0xf0(%rbp), %rcx
cmpl 0x100(%rcx), %eax
jge 0x11843b
movq -0xf0(%rbp), %rdi
movq %rdi, -0x420(%rbp)
addq $0x100, %rdi            # imm = 0x100
movl -0x104(%rbp), %esi
callq 0x1090b0
movq %rax, -0x418(%rbp)
jmp 0x1182a7
movq -0x420(%rbp), %rdi
movq -0x418(%rbp), %rax
movl (%rax), %esi
callq 0x119020
movl %eax, -0x424(%rbp)
jmp 0x1182c4
movl -0x424(%rbp), %eax
movl %eax, -0x118(%rbp)
cmpl $0x0, -0x118(%rbp)
je 0x1182db
jmp 0x1182fa
leaq 0x728bc(%rip), %rdi     # 0x18ab9e
leaq 0x71e8d(%rip), %rsi     # 0x18a176
movl $0x8e3, %edx            # imm = 0x8E3
leaq 0x72763(%rip), %rcx     # 0x18aa58
callq 0xd180
movq -0xf0(%rbp), %rdi
movl -0x118(%rbp), %esi
movss -0xfc(%rbp), %xmm1
movq -0xf8(%rbp), %rax
cvtsi2ssl 0x18(%rax), %xmm2
movaps %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtsi2ssl 0x1c(%rax), %xmm2
mulss %xmm2, %xmm1
xorps %xmm3, %xmm3
leaq -0x108(%rbp), %rdx
leaq -0x10c(%rbp), %rcx
leaq -0x110(%rbp), %r8
leaq -0x114(%rbp), %r9
movaps %xmm3, %xmm2
callq 0x1196e0
jmp 0x118354
movl -0x110(%rbp), %eax
subl -0x108(%rbp), %eax
addl -0x100(%rbp), %eax
movq -0xf8(%rbp), %rcx
addl 0x18(%rcx), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0xf0(%rbp), %rax
movq 0xc8(%rax), %rax
movslq -0x104(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0x4(%rax)
movl -0x114(%rbp), %eax
subl -0x10c(%rbp), %eax
addl -0x100(%rbp), %eax
movq -0xf8(%rbp), %rcx
addl 0x1c(%rcx), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0xf0(%rbp), %rax
movq 0xc8(%rax), %rax
movslq -0x104(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0x6(%rax)
movq -0xf0(%rbp), %rax
movq 0xc8(%rax), %rax
movslq -0x104(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
movq -0xf0(%rbp), %rcx
movq 0xc8(%rcx), %rcx
movslq -0x104(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movzwl 0x6(%rcx), %ecx
imull %ecx, %eax
addl -0xdc(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x118265
jmp 0x11843d
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x117fcf
cvtsi2ssl -0xdc(%rbp), %xmm0
callq 0xd960
cvttss2si %xmm0, %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x118493
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x118516
cvtsi2ssl -0x11c(%rbp), %xmm0
movss 0x6b589(%rip), %xmm1    # 0x183a2c
ucomiss %xmm1, %xmm0
jb 0x1184b5
movl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x428(%rbp)
jmp 0x118509
cvtsi2ssl -0x11c(%rbp), %xmm0
movss 0x6b56b(%rip), %xmm1    # 0x183a30
ucomiss %xmm1, %xmm0
jb 0x1184d7
movl $0x800, %eax            # imm = 0x800
movl %eax, -0x42c(%rbp)
jmp 0x1184fd
cvtsi2ssl -0x11c(%rbp), %xmm0
movss 0x6b54d(%rip), %xmm1    # 0x183a34
movl $0x200, %eax            # imm = 0x200
movl $0x400, %ecx            # imm = 0x400
ucomiss %xmm1, %xmm0
cmovael %ecx, %eax
movl %eax, -0x42c(%rbp)
movl -0x42c(%rbp), %eax
movl %eax, -0x428(%rbp)
movl -0x428(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movl $0x8000, -0x120(%rbp)   # imm = 0x8000
xorps %xmm0, %xmm0
movaps %xmm0, -0x130(%rbp)
movaps %xmm0, -0x140(%rbp)
movaps %xmm0, -0x150(%rbp)
movaps %xmm0, -0x160(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %r9d
movl 0x28(%rax), %edx
movq %rsp, %rax
movq $0x0, (%rax)
xorl %r8d, %r8d
movl %r8d, %esi
leaq -0x160(%rbp), %rdi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x119850
jmp 0x11856d
movq -0x10(%rbp), %rdi
movq -0x158(%rbp), %rsi
callq 0x1199b0
jmp 0x11857f
movl $0x0, -0x164(%rbp)
movl -0x164(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x1186a8
movl -0x164(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x438(%rbp)
jmp 0x1185b0
movq -0x438(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
jne 0x1185d3
jmp 0x118694
movq -0x158(%rbp), %rdi
movq -0x170(%rbp), %rax
movq 0xc8(%rax), %rsi
movl 0xe8(%rax), %edx
callq 0x119dc0
jmp 0x1185f5
movl $0x0, -0x174(%rbp)
movl -0x174(%rbp), %eax
movq -0x170(%rbp), %rcx
cmpl 0xe8(%rcx), %eax
jge 0x118692
movq -0x170(%rbp), %rax
movq 0xc8(%rax), %rax
movslq -0x174(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x0, 0xc(%rax)
je 0x11867c
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %edi
movq -0x170(%rbp), %rax
movq 0xc8(%rax), %rax
movslq -0x174(%rbp), %rcx
shlq $0x4, %rcx
movzwl 0xa(%rax,%rcx), %esi
movzwl 0x6(%rax,%rcx), %eax
addl %eax, %esi
callq 0x118ff0
movl %eax, -0x43c(%rbp)
jmp 0x11866f
movl -0x43c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x11867e
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x1185ff
jmp 0x118694
movl -0x164(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x164(%rbp)
jmp 0x118589
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1186c9
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
addl $0x1, %eax
movl %eax, -0x440(%rbp)
jmp 0x1186eb
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x11a000
movl %eax, -0x444(%rbp)
jmp 0x1186dd
movl -0x444(%rbp), %eax
movl %eax, -0x440(%rbp)
jmp 0x1186eb
movl -0x440(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rax
cvtsi2ssl 0x28(%rax), %xmm2
movss 0x58533(%rip), %xmm1    # 0x170c3c
movaps %xmm1, %xmm0
divss %xmm2, %xmm0
cvtsi2ssl 0x2c(%rax), %xmm2
divss %xmm2, %xmm1
leaq -0x17c(%rbp), %rdi
callq 0xbf4c0
jmp 0x118727
movq -0x10(%rbp), %rax
movq -0x17c(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %eax
movl 0x2c(%rcx), %ecx
imull %ecx, %eax
movslq %eax, %rdi
callq 0xc4820
movq %rax, -0x450(%rbp)
jmp 0x118754
movq -0x450(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x10(%rbp), %rcx
imull 0x2c(%rcx), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0xd2f0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x14c(%rbp)
movl $0x0, -0x180(%rbp)
movl -0x180(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x118965
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movl -0x180(%rbp), %esi
callq 0x1278b0
movq %rax, -0x458(%rbp)
jmp 0x1187d5
movq -0x458(%rbp), %rax
movq %rax, -0x188(%rbp)
movl -0x180(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x460(%rbp)
jmp 0x1187fb
movq -0x460(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
jne 0x11881e
jmp 0x118951
movq -0x190(%rbp), %rsi
movq %rsi, %rdx
addq $0xa0, %rdx
movq 0xc8(%rsi), %r8
leaq -0x160(%rbp), %rdi
movl $0x1, %ecx
callq 0x11a060
jmp 0x118849
movq -0x188(%rbp), %rax
movss 0x50(%rax), %xmm0
movss 0x583df(%rip), %xmm1    # 0x170c3c
ucomiss %xmm1, %xmm0
jne 0x118869
jp 0x118869
jmp 0x11893f
leaq -0x290(%rbp), %rdi
movq -0x188(%rbp), %rax
movss 0x50(%rax), %xmm0
callq 0x118dd0
movq -0x190(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x298(%rbp)
movl $0x0, -0x29c(%rbp)
movl -0x29c(%rbp), %eax
movq -0x190(%rbp), %rcx
cmpl 0xe8(%rcx), %eax
jge 0x11893d
movq -0x298(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x118915
leaq -0x290(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x298(%rbp), %rax
movzwl 0x8(%rax), %edx
movq -0x298(%rbp), %rax
movzwl 0xa(%rax), %ecx
movq -0x298(%rbp), %rax
movzwl 0x4(%rax), %r8d
movq -0x298(%rbp), %rax
movzwl 0x6(%rax), %r9d
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
shll $0x0, %eax
movl %eax, (%rsp)
callq 0x118e40
jmp 0x118917
movl -0x29c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x29c(%rbp)
movq -0x298(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x298(%rbp)
jmp 0x1188a0
jmp 0x11893f
movq -0x190(%rbp), %rax
movq $0x0, 0xc8(%rax)
movl -0x180(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x180(%rbp)
jmp 0x1187aa
leaq -0x160(%rbp), %rdi
callq 0x11a5e0
jmp 0x118973
leaq -0xc8(%rbp), %rdi
callq 0x128280
jmp 0x118981
movl $0x0, -0x2a0(%rbp)
movl -0x2a0(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x118d0a
movl -0x2a0(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x468(%rbp)
jmp 0x1189b2
movq -0x468(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
jne 0x1189d5
jmp 0x118cf6
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movl -0x2a0(%rbp), %esi
callq 0x1278b0
movq %rax, -0x470(%rbp)
jmp 0x1189f1
movq -0x470(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2b0(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2a8(%rbp), %rdi
movq -0x2b0(%rbp), %rax
movss 0x14(%rax), %xmm0
callq 0x119620
movss %xmm0, -0x474(%rbp)
jmp 0x118a36
movss -0x474(%rbp), %xmm0
movss %xmm0, -0x2bc(%rbp)
movq -0x2a8(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
leaq -0x2c4(%rbp), %rdx
leaq -0x2c8(%rbp), %rcx
callq 0x11a610
jmp 0x118a69
cvtsi2ssl -0x2c0(%rbp), %xmm0
movss -0x2bc(%rbp), %xmm2
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
seta %al
movzbl %al, %ecx
movl %ecx, %eax
leal -0x1(%rax,%rax), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x11a6c0
movss %xmm0, -0x478(%rbp)
jmp 0x118aa6
movss -0x478(%rbp), %xmm0
movss %xmm0, -0x2cc(%rbp)
cvtsi2ssl -0x2c4(%rbp), %xmm0
movss -0x2bc(%rbp), %xmm2
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
seta %al
movzbl %al, %ecx
movl %ecx, %eax
leal -0x1(%rax,%rax), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x11a6c0
movss %xmm0, -0x47c(%rbp)
jmp 0x118af3
movss -0x47c(%rbp), %xmm0
movss %xmm0, -0x2d0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x2b8(%rbp), %rsi
movq -0x2b0(%rbp), %rdx
movss -0x2cc(%rbp), %xmm0
movss -0x2d0(%rbp), %xmm1
callq 0x11a6e0
jmp 0x118b2c
movq -0x2b0(%rbp), %rax
movss 0x2c(%rax), %xmm0
movss %xmm0, -0x2d4(%rbp)
movq -0x2b0(%rbp), %rax
movss 0x30(%rax), %xmm0
movq -0x2b8(%rbp), %rax
movss 0x5947d(%rip), %xmm1    # 0x171fd8
addss 0x5c(%rax), %xmm1
cvttss2si %xmm1, %eax
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x2d8(%rbp)
movl $0x0, -0x2dc(%rbp)
movl -0x2dc(%rbp), %eax
movq -0x2a8(%rbp), %rcx
cmpl 0xe8(%rcx), %eax
jge 0x118cf4
movq -0x2a8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movl -0x2dc(%rbp), %esi
callq 0x1090b0
movq %rax, -0x488(%rbp)
jmp 0x118bb9
movq -0x488(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2e0(%rbp)
movq -0x2a8(%rbp), %rax
movq 0xd0(%rax), %rax
movslq -0x2dc(%rbp), %rdx
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x2e8(%rbp)
movl $0x0, -0x30c(%rbp)
movl $0x0, -0x310(%rbp)
movq -0x2a8(%rbp), %rax
movq 0xd0(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
movl 0x2c(%rax), %edx
movl -0x2dc(%rbp), %ecx
movq %rsp, %rax
leaq -0x308(%rbp), %r8
movq %r8, (%rax)
movl $0x0, 0x8(%rax)
leaq -0x30c(%rbp), %r8
leaq -0x310(%rbp), %r9
callq 0x11a780
jmp 0x118c4d
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rsi
movzwl -0x2e0(%rbp), %edx
movss -0x2d4(%rbp), %xmm3
movss -0x308(%rbp), %xmm0
movss -0x304(%rbp), %xmm1
addss %xmm3, %xmm0
movss -0x2d8(%rbp), %xmm4
addss %xmm4, %xmm1
movss -0x2f8(%rbp), %xmm2
addss %xmm3, %xmm2
movss -0x2f4(%rbp), %xmm3
addss %xmm4, %xmm3
movss -0x300(%rbp), %xmm4
movss -0x2fc(%rbp), %xmm5
movss -0x2f0(%rbp), %xmm6
movss -0x2ec(%rbp), %xmm7
movq -0x2e8(%rbp), %rax
movss 0x10(%rax), %xmm8
movq %rsp, %rax
movss %xmm8, (%rax)
callq 0x11a9a0
jmp 0x118cde
jmp 0x118ce0
movl -0x2dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2dc(%rbp)
jmp 0x118b7e
jmp 0x118cf6
movl -0x2a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a0(%rbp)
jmp 0x11898b
movl $0x0, -0x314(%rbp)
movl -0x314(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x118d54
movl -0x314(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x127da0
movq %rax, -0x490(%rbp)
jmp 0x118d37
movq -0x490(%rbp), %rdi
callq 0x1282d0
movl -0x314(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x314(%rbp)
jmp 0x118d14
movq -0x10(%rbp), %rdi
callq 0x11ac70
jmp 0x118d5f
movb $0x1, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x128310
leaq -0xc8(%rbp), %rdi
callq 0x128350
jmp 0x118d92
leaq -0xc8(%rbp), %rdi
callq 0x128350
jmp 0x118db2
leaq -0x40(%rbp), %rdi
callq 0x128390
leaq -0x30(%rbp), %rdi
callq 0x1283d0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x128390
leaq -0x30(%rbp), %rdi
callq 0x1283d0
movq -0x48(%rbp), %rdi
callq 0xd620
nopl (%rax)