#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*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glVertex3f(float, float, double);
int /*<<< orphan*/ glutSwapBuffers();
void render2(unsigned long ipos, unsigned long im, int n_bodies) {
  float *pos = (float *)ipos;
  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);
  for (i = 0; i < n_bodies; i++) {
    glBegin(GL_POINTS);
    glVertex3f(pos[i * 4], pos[i * 4 + 1], 0.0);
    glEnd();
  }
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<render2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
mov    0x2e35(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
xorps  %xmm1,%xmm1
movsd  0xe3c(%rip),%xmm2
movaps %xmm1,%xmm0
call   1090 <glTranslatef@plt>
movsd  0xe24(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    124c <render2+0xcc>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ee <render2+0x6e>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2e3d(%rip),%rax
mov    0x2e4e(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe4e(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTranslatef@plt>
movsd  0xe43(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1080 <glColor3f@plt>
test   %ebp,%ebp
jle    121f <render2+0x9f>
mov    %ebp,%r15d
shl    $0x2,%r15
mov    0x2dfe(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14),%edi
call   10a0 <glBegin@plt>
mov    %ebp,%eax
movss  (%rbx,%rax,4),%xmm0
lea    0x1(%rbp),%eax
movss  (%rbx,%rax,4),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
add    $0x4,%rbp
cmp    %rbp,%r15
jne    11f0 <render2+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 @render2(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%10 = load i64, i64* %4
%11 = inttoptr i64 %10 to float*
store float* %11, float** %7
%12 = load i64, i64* %5
%13 = inttoptr i64 %12 to float*
store float* %13, float** %8
%14 = load i32, i32* @GL_COLOR_BUFFER_BIT
%15 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%16 = or i32 %14, %15
%17 = call i32 @glClear(i32 %16)
%18 = call i32 (...) @glLoadIdentity()
%19 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -3.000000e+01)
%20 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
store i32 0, i32* %9
br label %21
21: ; preds = %43, %3
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %46
25: ; preds = %21
%26 = load i32, i32* @GL_POINTS
%27 = call i32 @glBegin(i32 %26)
%28 = load float*, float** %7
%29 = load i32, i32* %9
%30 = mul nsw i32 %29, 4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %28, i64 %31
%33 = load float, float* %32
%34 = load float*, float** %7
%35 = load i32, i32* %9
%36 = mul nsw i32 %35, 4
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds float, float* %34, i64 %38
%40 = load float, float* %39
%41 = call i32 @glVertex3f(float %33, float %40, double 0.000000e+00)
%42 = call i32 (...) @glEnd()
br label %43
43: ; preds = %25
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %21
46: ; preds = %21
%47 = 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 @render2(i64 %0, i64 %1, i32 %2) {
%4 = inttoptr i64 %0 to float*
%5 = load i32, i32* @GL_COLOR_BUFFER_BIT
%6 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%7 = or i32 %6, %5
%8 = tail call i32 @glClear(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
%10 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -3.000000e+01)
%11 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%12 = icmp sgt i32 %2, 0
br i1 %12, label %13, label %32
13: ; preds = %3
%14 = zext i32 %2 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %30, %15 ]
%17 = load i32, i32* @GL_POINTS
%18 = tail call i32 @glBegin(i32 %17)
%19 = trunc i64 %16 to i32
%20 = shl nsw i32 %19, 2
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds float, float* %4, i64 %21
%23 = load float, float* %22
%24 = or i32 %20, 1
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds float, float* %4, i64 %25
%27 = load float, float* %26
%28 = tail call i32 @glVertex3f(float %23, float %27, double 0.000000e+00)
%29 = tail call i32 (...) @glEnd()
%30 = add nuw nsw i64 %16, 1
%31 = icmp eq i64 %30, %14
br i1 %31, label %32, label %15
32: ; preds = %15, %3
%33 = tail call i32 (...) @glutSwapBuffers()
ret void
}