// File: /workspace/github_cpp_makefile_star2_O3/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, %r12d
movq %rdx, -0x40(%rbp)
movl %r12d, %eax
orb %r8b, %al
je 0x5c1dc
movq 0x9fda3(%rip), %rbx     # 0xfbcd0
cmpl $0x0, 0x10(%rsi)
jle 0x5bf39
movq 0x18(%rsi), %r14
jmp 0x5bf3c
xorl %r14d, %r14d
leaq 0x1f38(%rbx), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rdx
movl 0x18(%rdx), %eax
leaq (%rax,%rax,4), %r13
shlq $0x2, %r13
addq 0x28(%rsi), %r13
movss (%rdx), %xmm0
movss 0x4(%rdx), %xmm1
movss 0x8(%rdx), %xmm3
movss 0xc(%rdx), %xmm2
movl 0x1f68(%rbx), %eax
movl %eax, -0x30(%rbp)
andl $-0x2, %eax
movl %eax, 0x1f68(%rbx)
movl 0x1c(%rdx), %eax
movl 0x20(%rdx), %esi
leal (%rsi,%rax), %edx
cmpl %edx, %eax
jae 0x5c114
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm3, -0xe0(%rbp)
movaps %xmm2, -0xf0(%rbp)
movl %r8d, -0x2c(%rbp)
movq %rbx, -0xa8(%rbp)
movss 0x598e9(%rip), %xmm5    # 0xb58a8
movss 0x59879(%rip), %xmm6    # 0xb5840
xorps %xmm4, %xmm4
movl %eax, %ebx
movaps %xmm6, %xmm8
movaps %xmm5, %xmm7
movaps %xmm4, -0xa0(%rbp)
movq $0x0, -0x90(%rbp)
movl %ebx, %ebx
xorl %r15d, %r15d
movaps %xmm6, %xmm3
movaps %xmm8, %xmm0
movaps %xmm5, %xmm1
movaps %xmm7, %xmm2
leaq (%rbx,%r15), %rdx
testq %r14, %r14
je 0x5c007
movl %edx, %edx
movzwl (%r14,%rdx,2), %edx
movl %edx, %edx
leaq (%rdx,%rdx,4), %rdx
movq (%r13,%rdx,4), %rdx
movq %rdx, -0xa0(%rbp,%r15,8)
movd %edx, %xmm5
movdqa %xmm5, %xmm6
minss %xmm3, %xmm6
shrq $0x20, %rdx
movd %edx, %xmm7
movdqa %xmm7, %xmm8
minss %xmm0, %xmm8
maxss %xmm1, %xmm5
maxss %xmm2, %xmm7
incq %r15
movaps %xmm6, %xmm3
movaps %xmm8, %xmm0
movaps %xmm5, %xmm1
movaps %xmm7, %xmm2
cmpq $0x3, %r15
jne 0x5bff7
testb %r12b, %r12b
je 0x5c0b2
movq -0x38(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0x3, %edx
movl $0xff00ffff, %ecx       # imm = 0xFF00FFFF
movl $0x1, %r8d
movss 0x58f66(%rip), %xmm0    # 0xb4fe4
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
movaps %xmm8, -0x50(%rbp)
callq 0x76296
movaps -0x50(%rbp), %xmm8
movaps -0x60(%rbp), %xmm7
movaps -0x70(%rbp), %xmm6
movaps -0x80(%rbp), %xmm5
xorps %xmm4, %xmm4
movq -0x40(%rbp), %rdx
movl 0x1c(%rdx), %eax
movl 0x20(%rdx), %esi
addq %r15, %rbx
leal (%rsi,%rax), %edx
cmpl %edx, %ebx
jb 0x5bfd3
cvttps2dq %xmm6, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
cvttps2dq %xmm8, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
cvttps2dq %xmm5, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
cvttps2dq %xmm7, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0xa8(%rbp), %rbx
movl -0x2c(%rbp), %r8d
movaps -0xf0(%rbp), %xmm2
movaps -0xe0(%rbp), %xmm3
movaps -0xd0(%rbp), %xmm1
movaps -0xc0(%rbp), %xmm0
testb %r8b, %r8b
je 0x5c1c1
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 -0xa0(%rbp), %r14
movlps %xmm0, (%r14)
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 0x58e87(%rip), %xmm1    # 0xb4fe4
xorps %xmm0, %xmm0
movq -0x38(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
movl $0xf, %r8d
callq 0x7851c
movaps -0x80(%rbp), %xmm0
unpcklps -0x60(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, (%r14)
movaps -0x70(%rbp), %xmm0
unpcklps -0x50(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlps %xmm0, (%r15)
leaq -0xa0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
xorps %xmm0, %xmm0
movq %r12, %rdi
movl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0xf, %r8d
movss 0x58e28(%rip), %xmm1    # 0xb4fe4
callq 0x7851c
movl -0x30(%rbp), %eax
movl %eax, 0x1f68(%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d01f(%rip), %rdi     # 0xb9202
leaq 0x59f7b(%rip), %rsi     # 0xb6165
leaq 0x5d028(%rip), %rcx     # 0xb9219
movl $0x2ae5, %edx           # imm = 0x2AE5
callq 0xc140