// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movl %ecx, %eax
orb %r8b, %al
je 0x5d387
movq %rdx, %r12
movq 0xa0c09(%rip), %rdi     # 0xfdcd0
cmpl $0x0, 0x10(%rsi)
jle 0x5d0d3
movq 0x18(%rsi), %r14
jmp 0x5d0d6
xorl %r14d, %r14d
leaq 0x1f38(%rdi), %rax
movq %rax, -0x40(%rbp)
movl 0x18(%r12), %eax
leaq (%rax,%rax,4), %r13
shlq $0x2, %r13
addq 0x28(%rsi), %r13
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss 0x8(%r12), %xmm3
movss 0xc(%r12), %xmm2
movl 0x1f68(%rdi), %eax
movl %eax, -0x30(%rbp)
andl $-0x2, %eax
movq %rdi, -0xa8(%rbp)
movl %eax, 0x1f68(%rdi)
movl 0x1c(%r12), %ebx
movl 0x20(%r12), %eax
addl %ebx, %eax
cmpl %eax, %ebx
jae 0x5d2b6
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm3, -0xe0(%rbp)
movaps %xmm2, -0xf0(%rbp)
movl %r8d, -0x2c(%rbp)
movss 0x5a746(%rip), %xmm5    # 0xb78a8
movss 0x5a6d6(%rip), %xmm7    # 0xb7840
xorps %xmm4, %xmm4
movaps %xmm7, %xmm8
movaps %xmm5, %xmm6
movl %ecx, -0x34(%rbp)
movaps %xmm4, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movl %ebx, %ebx
xorl %r15d, %r15d
movaps %xmm7, %xmm0
movaps %xmm8, %xmm1
movaps %xmm5, %xmm2
movaps %xmm6, %xmm3
leaq (%rbx,%r15), %rax
testq %r14, %r14
je 0x5d1a5
movl %eax, %eax
movzwl (%r14,%rax,2), %eax
movl %eax, %eax
leaq (%rax,%rax,4), %rax
movq (%r13,%rax,4), %rax
movq %rax, -0x60(%rbp,%r15,8)
movss -0x60(%rbp,%r15,8), %xmm5
movss -0x5c(%rbp,%r15,8), %xmm6
movaps %xmm5, %xmm7
minss %xmm0, %xmm7
movaps %xmm6, %xmm8
minss %xmm1, %xmm8
maxss %xmm2, %xmm5
maxss %xmm3, %xmm6
incq %r15
movaps %xmm7, %xmm0
movaps %xmm8, %xmm1
movaps %xmm5, %xmm2
movaps %xmm6, %xmm3
cmpq $0x3, %r15
jne 0x5d195
testb %cl, %cl
je 0x5d24e
movq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x3, %edx
movl $0xff00ffff, %ecx       # imm = 0xFF00FFFF
movl $0x1, %r8d
movss 0x59dcf(%rip), %xmm0    # 0xb6fe4
movaps %xmm5, -0xa0(%rbp)
movaps %xmm6, -0x90(%rbp)
movaps %xmm7, -0x80(%rbp)
movaps %xmm8, -0x70(%rbp)
callq 0x77886
movaps -0x70(%rbp), %xmm8
movaps -0x80(%rbp), %xmm7
movaps -0x90(%rbp), %xmm6
movaps -0xa0(%rbp), %xmm5
xorps %xmm4, %xmm4
movl -0x34(%rbp), %ecx
addq %r15, %rbx
movl 0x20(%r12), %eax
addl 0x1c(%r12), %eax
cmpl %eax, %ebx
jb 0x5d177
cvttps2dq %xmm7, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
cvttps2dq %xmm8, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
cvttps2dq %xmm5, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
cvttps2dq %xmm6, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movl -0x2c(%rbp), %r8d
movaps -0xf0(%rbp), %xmm2
movaps -0xe0(%rbp), %xmm3
movaps -0xd0(%rbp), %xmm1
movaps -0xc0(%rbp), %xmm0
testb %r8b, %r8b
je 0x5d365
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x60(%rbp), %r12
movlps %xmm0, (%r12)
cvttps2dq %xmm3, %xmm0
cvtdq2ps %xmm0, %xmm0
cvttps2dq %xmm2, %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xb0(%rbp), %r15
movlps %xmm0, (%r15)
movss 0x59ce7(%rip), %xmm1    # 0xb6fe4
xorps %xmm0, %xmm0
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
movl $0xf, %r8d
callq 0x79c80
movaps -0xa0(%rbp), %xmm0
unpcklps -0x80(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, (%r12)
movaps -0x90(%rbp), %xmm0
unpcklps -0x70(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, (%r15)
leaq -0x60(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
xorps %xmm0, %xmm0
movq %rbx, %rdi
movl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0xf, %r8d
movss 0x59c84(%rip), %xmm1    # 0xb6fe4
callq 0x79c80
movq -0xa8(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, 0x1f68(%rax)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5de74(%rip), %rdi     # 0xbb202
leaq 0x5add0(%rip), %rsi     # 0xb8165
leaq 0x5de7d(%rip), %rcx     # 0xbb219
movl $0x2ae5, %edx           # imm = 0x2AE5
callq 0xc140