#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_POINTS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glPointSize(int);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glVertex3f(float, float, double);
int /*<<< orphan*/ glutSwapBuffers();
void render(unsigned long ix, unsigned long iy, unsigned long im,
            int n_bodies) {
  float *x = (float *)ix;
  float *y = (float *)iy;
  float *m = (float *)im;
  int i;
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef(0.0, 0.0, -30.0);
  glColor3f(1.0, 1.0, 1.0);
  glPointSize(3);
  for (i = 0; i < n_bodies; i++) {
    glBegin(GL_POINTS);
    glVertex3f(x[i], y[i], 0.0);
    glEnd();
  }
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<render>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
mov    0x2e19(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
xorps  %xmm1,%xmm1
movsd  0xe20(%rip),%xmm2
movaps %xmm1,%xmm0
call   10a0 <glTranslatef@plt>
movsd  0xe08(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
mov    $0x3,%edi
call   1090 <glPointSize@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1265 <render+0xd5>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1214 <render+0x84>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%ebp
mov    %rsi,%r14
mov    %rdi,%r12
mov    0x2e29(%rip),%rax
mov    0x2e3a(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe3a(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   10a0 <glTranslatef@plt>
movsd  0xe2f(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1080 <glColor3f@plt>
mov    $0x3,%edi
call   1090 <glPointSize@plt>
test   %ebp,%ebp
jle    122c <render+0x9c>
mov    %ebp,%ebp
mov    0x2de5(%rip),%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15),%edi
call   10b0 <glBegin@plt>
movss  (%r12,%rbx,4),%xmm0
movss  (%r14,%rbx,4),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1200 <render+0x70>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_POINTS = global i32 0
define void @render(i64 %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%13 = load i64, i64* %5
%14 = inttoptr i64 %13 to float*
store float* %14, float** %9
%15 = load i64, i64* %6
%16 = inttoptr i64 %15 to float*
store float* %16, float** %10
%17 = load i64, i64* %7
%18 = inttoptr i64 %17 to float*
store float* %18, float** %11
%19 = load i32, i32* @GL_COLOR_BUFFER_BIT
%20 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%21 = or i32 %19, %20
%22 = call i32 @glClear(i32 %21)
%23 = call i32 (...) @glLoadIdentity()
%24 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -3.000000e+01)
%25 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%26 = call i32 @glPointSize(i32 3)
store i32 0, i32* %12
br label %27
27: ; preds = %46, %4
%28 = load i32, i32* %12
%29 = load i32, i32* %8
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %49
31: ; preds = %27
%32 = load i32, i32* @GL_POINTS
%33 = call i32 @glBegin(i32 %32)
%34 = load float*, float** %9
%35 = load i32, i32* %12
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
%38 = load float, float* %37
%39 = load float*, float** %10
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %39, i64 %41
%43 = load float, float* %42
%44 = call i32 @glVertex3f(float %38, float %43, double 0.000000e+00)
%45 = call i32 (...) @glEnd()
br label %46
46: ; preds = %31
%47 = load i32, i32* %12
%48 = add nsw i32 %47, 1
store i32 %48, i32* %12
br label %27
49: ; preds = %27
%50 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_POINTS = global i32 0
define void @render(i64 %0, i64 %1, i64 %2, i32 %3) {
%5 = inttoptr i64 %0 to float*
%6 = inttoptr i64 %1 to float*
%7 = load i32, i32* @GL_COLOR_BUFFER_BIT
%8 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%9 = or i32 %8, %7
%10 = tail call i32 @glClear(i32 %9)
%11 = tail call i32 (...) @glLoadIdentity()
%12 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -3.000000e+01)
%13 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%14 = tail call i32 @glPointSize(i32 3)
%15 = icmp sgt i32 %3, 0
br i1 %15, label %16, label %30
16: ; preds = %4
%17 = zext i32 %3 to i64
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ 0, %16 ], [ %28, %18 ]
%20 = load i32, i32* @GL_POINTS
%21 = tail call i32 @glBegin(i32 %20)
%22 = getelementptr inbounds float, float* %5, i64 %19
%23 = load float, float* %22
%24 = getelementptr inbounds float, float* %6, i64 %19
%25 = load float, float* %24
%26 = tail call i32 @glVertex3f(float %23, float %25, double 0.000000e+00)
%27 = tail call i32 (...) @glEnd()
%28 = add nuw nsw i64 %19, 1
%29 = icmp eq i64 %28, %17
br i1 %29, label %30, label %18
30: ; preds = %18, %4
%31 = tail call i32 (...) @glutSwapBuffers()
ret void
}