#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 /*<<< orphan*/ glColor3f(int, int, int);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glTranslated(double, double, double);
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void ball(double x, double y, double z, double r, int red, int green,
          int blue) {
  glPushMatrix();
  glTranslated(x, y, z);
  glScaled(r, r, r);
  glColor3f(red, green, blue);
  glutSolidSphere(1.0, 16, 16);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<ball>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1080 <glTranslated@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <glScaled@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1040 <glColor3f@plt>
movsd  0xe36(%rip),%xmm0
mov    $0x10,%esi
mov    %esi,%edi
call   1070 <glutSolidSphere@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ball>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1080 <glTranslated@plt>
movsd  0x18(%rsp),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glScaled@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <glColor3f@plt>
movsd  0xe38(%rip),%xmm0
mov    $0x10,%edi
mov    $0x10,%esi
call   1070 <glutSolidSphere@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @ball(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = call i32 (...) @glPushMatrix()
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = call i32 @glTranslated(double %16, double %17, double %18)
%20 = load double, double* %11
%21 = load double, double* %11
%22 = load double, double* %11
%23 = call i32 @glScaled(double %20, double %21, double %22)
%24 = load i32, i32* %12
%25 = load i32, i32* %13
%26 = load i32, i32* %14
%27 = call i32 @glColor3f(i32 %24, i32 %25, i32 %26)
%28 = call i32 @glutSolidSphere(double 1.000000e+00, i32 16, i32 16)
%29 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @ball(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 (...) @glPushMatrix()
%9 = tail call i32 @glTranslated(double %0, double %1, double %2)
%10 = tail call i32 @glScaled(double %3, double %3, double %3)
%11 = tail call i32 @glColor3f(i32 %4, i32 %5, i32 %6)
%12 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 16, i32 16)
%13 = tail call i32 (...) @glPopMatrix()
ret void
}