// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::debug_draw_body(Physics::Body*)
void debug_draw_body(Body *body) {
    Shape shape = find_shape(body->shape);
    for (u32 i = 0; i < shape.points.length; i++)
    {
        u32 v_i = i;
        u32 u_i = (i + 1) % shape.points.length;
        Vec2 v = rotate(
                hadamard(shape.points[v_i], body->scale) + body->offset,
                body->rotation);
        v += body->position;
        Vec2 u = rotate(
                hadamard(shape.points[u_i], body->scale) + body->offset,
                body->rotation);
        u += body->position;

        Renderer::push_point(MAX_LAYER, v, V4(0.1f, 0.2f, 0.7f, 1.0f));
        Renderer::push_line(MAX_LAYER, u, v, V4(0.7f, 0.2f, 0.1f, 1.0f));
    }

    Vec2 middle = body->position + body->offset;
    for (u32 i = 0; i < shape.normals.length; i++)
    {
        Vec2 normal = normalize(rotate(hadamard(shape.normals[i],
                                                inverse(body->scale)),
                            body->rotation)) * 0.5;
        Renderer::push_line(MAX_LAYER, middle - normal, middle + normal,
                            V4(0.2f, 0.7f, 0.1f, 1.0f));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x48(%rbp), %rdi
callq 0x326a0
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x32ce6
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
incl %eax
leaq -0x20(%rbp), %rdi
movq %rdi, -0x198(%rbp)
movl -0x1c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x54(%rbp)
movl -0x50(%rbp), %esi
callq 0x43650
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x1c(%rax), %rax
movq %rax, -0x80(%rbp)
movsd -0x78(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
callq 0xb450
movlpd %xmm0, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
leaq -0x6c(%rbp), %rdi
callq 0x40dc0
movlpd %xmm0, -0x64(%rbp)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm1
movsd -0x64(%rbp), %xmm0
callq 0xb500
movlpd %xmm0, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq 0x14(%rax), %rax
movq %rax, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
leaq -0x5c(%rbp), %rdi
callq 0x5410
movq -0x198(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x43650
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rax
movq 0x1c(%rax), %rax
movq %rax, -0xb8(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
callq 0xb450
movlpd %xmm0, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
leaq -0xa8(%rbp), %rdi
callq 0x40dc0
movlpd %xmm0, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm1
movsd -0xa0(%rbp), %xmm0
callq 0xb500
movlpd %xmm0, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq 0x14(%rax), %rax
movq %rax, -0xc8(%rbp)
movsd -0xc8(%rbp), %xmm0
leaq -0x98(%rbp), %rdi
callq 0x5410
movq -0x5c(%rbp), %rax
movq %rax, -0xd0(%rbp)
movss 0x12633(%rip), %xmm0    # 0x45214
movss %xmm0, -0x188(%rbp)
movss 0x1241b(%rip), %xmm1    # 0x4500c
movss %xmm1, -0x18c(%rbp)
movss 0x1263f(%rip), %xmm2    # 0x45240
movss %xmm2, -0x190(%rbp)
movss 0x123f7(%rip), %xmm3    # 0x45008
movss %xmm3, -0x184(%rbp)
callq 0xbc90
movlpd %xmm0, -0xe0(%rbp)
movlpd %xmm1, -0xd8(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm2
movl $0xe, %edi
movss 0x125f1(%rip), %xmm3    # 0x45244
callq 0x2d8e0
movss -0x190(%rbp), %xmm0
movss -0x18c(%rbp), %xmm1
movss -0x188(%rbp), %xmm2
movss -0x184(%rbp), %xmm3
movq -0x98(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x5c(%rbp), %rax
movq %rax, -0xf0(%rbp)
callq 0xbc90
movlpd %xmm0, -0x100(%rbp)
movlpd %xmm1, -0xf8(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
movsd -0x100(%rbp), %xmm2
movsd -0xf8(%rbp), %xmm3
movl $0xe, %edi
movss 0x12569(%rip), %xmm4    # 0x4523c
callq 0x2d860
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x32a65
movq -0x8(%rbp), %rax
movq %rax, %rdi
addq $0x14, %rdi
movq 0x8(%rax), %rax
movq %rax, -0x110(%rbp)
movsd -0x110(%rbp), %xmm0
callq 0x40dc0
movlpd %xmm0, -0x108(%rbp)
movl $0x0, -0x114(%rbp)
movl -0x114(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x32ea9
leaq -0x38(%rbp), %rdi
movl -0x114(%rbp), %esi
callq 0x43650
movq (%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x8(%rbp), %rax
movq 0x1c(%rax), %rax
movq %rax, -0x150(%rbp)
movsd -0x150(%rbp), %xmm0
callq 0xb490
movlpd %xmm0, -0x148(%rbp)
movsd -0x140(%rbp), %xmm0
movsd -0x148(%rbp), %xmm1
callq 0xb450
movlpd %xmm0, -0x134(%rbp)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm1
movsd -0x134(%rbp), %xmm0
callq 0xb500
movlpd %xmm0, -0x12c(%rbp)
movsd -0x12c(%rbp), %xmm0
callq 0xb410
movlpd %xmm0, -0x124(%rbp)
leaq -0x124(%rbp), %rdi
movss 0x1224a(%rip), %xmm0    # 0x45010
callq 0x5810
movlpd %xmm0, -0x11c(%rbp)
movq -0x11c(%rbp), %rax
movq %rax, -0x160(%rbp)
movsd -0x160(%rbp), %xmm0
leaq -0x108(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x5850
movq -0x1a0(%rbp), %rdi
movlpd %xmm0, -0x158(%rbp)
movq -0x11c(%rbp), %rax
movq %rax, -0x170(%rbp)
movsd -0x170(%rbp), %xmm0
callq 0x40dc0
movlpd %xmm0, -0x168(%rbp)
movss 0x121d6(%rip), %xmm0    # 0x4500c
movss 0x12402(%rip), %xmm1    # 0x45240
movss 0x123ce(%rip), %xmm2    # 0x45214
movss 0x121ba(%rip), %xmm3    # 0x45008
callq 0xbc90
movlpd %xmm0, -0x180(%rbp)
movlpd %xmm1, -0x178(%rbp)
movsd -0x158(%rbp), %xmm0
movsd -0x168(%rbp), %xmm1
movsd -0x180(%rbp), %xmm2
movsd -0x178(%rbp), %xmm3
movl $0xe, %edi
movss 0x123ac(%rip), %xmm4    # 0x4523c
callq 0x2d860
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x32d1b
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)