// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImGuiWindow*, ImDrawList const*, ImDrawCmd const*, bool, bool)
void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImGuiWindow* window, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb)
{
    IM_ASSERT(show_mesh || show_aabb);
    ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list
    ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL;
    ImDrawVert* vtx_buffer = draw_list->VtxBuffer.Data + draw_cmd->VtxOffset;

    // Draw wire-frame version of all triangles
    ImRect clip_rect = draw_cmd->ClipRect;
    ImRect vtxs_rect(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
    ImDrawListFlags backup_flags = fg_draw_list->Flags;
    fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles.
    for (unsigned int idx_n = draw_cmd->IdxOffset; idx_n < draw_cmd->IdxOffset + draw_cmd->ElemCount; )
    {
        ImVec2 triangle[3];
        for (int n = 0; n < 3; n++, idx_n++)
            vtxs_rect.Add((triangle[n] = vtx_buffer[idx_buffer ? idx_buffer[idx_n] : idx_n].pos));
        if (show_mesh)
            fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), true, 1.0f); // In yellow: mesh triangles
    }
    // Draw bounding boxes
    if (show_aabb)
    {
        fg_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU
        fg_draw_list->AddRect(ImFloor(vtxs_rect.Min), ImFloor(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles
    }
    fg_draw_list->Flags = backup_flags;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %ecx, -0x34(%rbp)
movl %ecx, %eax
orb %r8b, %al
je 0x48bd4
movq 0x9b317(%rip), %rcx     # 0xe3ce0
cmpl $0x0, 0x10(%rsi)
movl %r8d, -0x2c(%rbp)
jle 0x489d9
movq 0x18(%rsi), %r14
jmp 0x489dc
xorl %r14d, %r14d
leaq 0x1f38(%rcx), %rax
movq %rax, -0x40(%rbp)
movl 0x18(%rdx), %eax
imulq $0x14, %rax, %rbx
addq 0x28(%rsi), %rbx
movss (%rdx), %xmm0
movaps %xmm0, -0xa0(%rbp)
movss 0x4(%rdx), %xmm0
movaps %xmm0, -0xb0(%rbp)
movss 0x8(%rdx), %xmm0
movaps %xmm0, -0xc0(%rbp)
movss 0xc(%rdx), %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps 0x53e28(%rip), %xmm0    # 0x9c850
leaq -0x50(%rbp), %r13
movups %xmm0, (%r13)
movl 0x1f68(%rcx), %eax
movl %eax, -0x30(%rbp)
andl $-0x2, %eax
movq %rcx, -0x78(%rbp)
movl %eax, 0x1f68(%rcx)
movl 0x1c(%rdx), %eax
movl %eax, %r15d
movq %rdx, -0x80(%rbp)
addl 0x20(%rdx), %eax
cmpl %eax, %r15d
jae 0x48ad7
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
xorl %r12d, %r12d
cmpq $0x18, %r12
je 0x48aa4
movl %r15d, %eax
testq %r14, %r14
je 0x48a7e
movl %r15d, %eax
movzwl (%r14,%rax,2), %eax
movl %eax, %eax
imulq $0x14, %rax, %rax
leaq (%r12,%rbp), %rsi
addq $-0x70, %rsi
movq (%rbx,%rax), %rax
movq %rax, (%rsi)
movq %r13, %rdi
callq 0x4bc04
incl %r15d
addq $0x8, %r12
jmp 0x48a68
cmpb $0x0, -0x34(%rbp)
je 0x48acb
movq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
pushq $0x3
popq %rdx
movl $0xff00ffff, %ecx       # imm = 0xFF00FFFF
pushq $0x1
popq %r8
movss 0x53532(%rip), %xmm0    # 0x9bff8
callq 0x6270a
movq -0x80(%rbp), %rdx
movl 0x1c(%rdx), %eax
jmp 0x48a51
cmpb $0x0, -0x2c(%rbp)
je 0x48bb5
cvttps2dq -0xa0(%rbp), %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq -0xb0(%rbp), %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x70(%rbp), %r15
movlps %xmm0, (%r15)
cvttps2dq -0xc0(%rbp), %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq -0xd0(%rbp), %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x88(%rbp), %r12
movlps %xmm0, (%r12)
pushq $0xf
popq %r14
movss 0x534c5(%rip), %xmm1    # 0x9bff8
xorps %xmm0, %xmm0
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
movl %r14d, %r8d
callq 0x63f6c
movss -0x50(%rbp), %xmm0
movss -0x4c(%rbp), %xmm1
movss -0x48(%rbp), %xmm2
movss -0x44(%rbp), %xmm3
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, (%r15)
cvttps2dq %xmm2, %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq %xmm3, %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, (%r12)
leaq -0x70(%rbp), %rsi
leaq -0x88(%rbp), %rdx
xorps %xmm0, %xmm0
movq %rbx, %rdi
movl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %r14d, %r8d
movss 0x53448(%rip), %xmm1    # 0x9bff8
callq 0x63f6c
movq -0x78(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, 0x1f68(%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57657(%rip), %rdi     # 0xa0232
leaq 0x545b3(%rip), %rsi     # 0x9d195
leaq 0x57660(%rip), %rcx     # 0xa0249
movl $0x2ae5, %edx           # imm = 0x2AE5
callq 0xc140