#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 */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_AMBIENT;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ drawOct();
int /*<<< orphan*/ drawOctSides();
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(int, double, double, double);
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
void drawSatellite(GLfloat diffuse[4], GLfloat ambient[4], GLfloat specular[4],
                   GLfloat shiny[1]) {
  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
  glMaterialfv(GL_FRONT, GL_SHININESS, shiny);
  glPushMatrix();
  glScalef(0.3, 0.3, 0.9);
  glPushMatrix();
  drawOctSides();
  glPopMatrix();
  glPushMatrix();
  glTranslatef(0.0, 0.0, 0.0);
  drawOct();
  glPopMatrix();
  glPushMatrix();
  glRotatef(180, 1.0, 0.0, 0.0);
  glTranslatef(0.0, 0.0, 1.0);
  drawOct();
  glPopMatrix();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawSatellite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
mov    0x2e18(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    0x2e2d(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
mov    0x2def(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
movsd  0xdf5(%rip),%xmm1
movsd  0xdf5(%rip),%xmm2
movaps %xmm1,%xmm0
call   1040 <glScalef@plt>
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
mov    $0x0,%al
call   1060 <drawOctSides@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glTranslatef@plt>
mov    $0x0,%al
call   1070 <drawOct@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
mov    $0xb4,%edi
movsd  0xd91(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   10a0 <glRotatef@plt>
xorps  %xmm1,%xmm1
movsd  0xd7b(%rip),%xmm2
movaps %xmm1,%xmm0
call   1080 <glTranslatef@plt>
mov    $0x0,%al
call   1070 <drawOct@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSatellite>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rdx
mov    0x2e35(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
call   1090 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdx
call   1090 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2e19(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdx
call   1090 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1090 <glMaterialfv@plt>
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movsd  0xe0d(%rip),%xmm0
movsd  0xe0d(%rip),%xmm2
movaps %xmm0,%xmm1
call   1040 <glScalef@plt>
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
xor    %eax,%eax
call   1060 <drawOctSides@plt>
xor    %eax,%eax
call   1030 <glPopMatrix@plt>
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1080 <glTranslatef@plt>
xor    %eax,%eax
call   1070 <drawOct@plt>
xor    %eax,%eax
call   1030 <glPopMatrix@plt>
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movsd  0xdc6(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0xb4,%edi
call   10a0 <glRotatef@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xda8(%rip),%xmm2
call   1080 <glTranslatef@plt>
xor    %eax,%eax
call   1070 <drawOct@plt>
xor    %eax,%eax
call   1030 <glPopMatrix@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @drawSatellite(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* @GL_FRONT
%10 = load i32, i32* @GL_DIFFUSE
%11 = load i32*, i32** %5
%12 = call i32 @glMaterialfv(i32 %9, i32 %10, i32* %11)
%13 = load i32, i32* @GL_FRONT
%14 = load i32, i32* @GL_AMBIENT
%15 = load i32*, i32** %6
%16 = call i32 @glMaterialfv(i32 %13, i32 %14, i32* %15)
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_SPECULAR
%19 = load i32*, i32** %7
%20 = call i32 @glMaterialfv(i32 %17, i32 %18, i32* %19)
%21 = load i32, i32* @GL_FRONT
%22 = load i32, i32* @GL_SHININESS
%23 = load i32*, i32** %8
%24 = call i32 @glMaterialfv(i32 %21, i32 %22, i32* %23)
%25 = call i32 (...) @glPushMatrix()
%26 = call i32 @glScalef(double 3.000000e-01, double 3.000000e-01, double 9.000000e-01)
%27 = call i32 (...) @glPushMatrix()
%28 = call i32 (...) @drawOctSides()
%29 = call i32 (...) @glPopMatrix()
%30 = call i32 (...) @glPushMatrix()
%31 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%32 = call i32 (...) @drawOct()
%33 = call i32 (...) @glPopMatrix()
%34 = call i32 (...) @glPushMatrix()
%35 = call i32 @glRotatef(i32 180, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%36 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%37 = call i32 (...) @drawOct()
%38 = call i32 (...) @glPopMatrix()
%39 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @drawSatellite(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* @GL_FRONT
%6 = load i32, i32* @GL_DIFFUSE
%7 = tail call i32 @glMaterialfv(i32 %5, i32 %6, i32* %0)
%8 = load i32, i32* @GL_FRONT
%9 = load i32, i32* @GL_AMBIENT
%10 = tail call i32 @glMaterialfv(i32 %8, i32 %9, i32* %1)
%11 = load i32, i32* @GL_FRONT
%12 = load i32, i32* @GL_SPECULAR
%13 = tail call i32 @glMaterialfv(i32 %11, i32 %12, i32* %2)
%14 = load i32, i32* @GL_FRONT
%15 = load i32, i32* @GL_SHININESS
%16 = tail call i32 @glMaterialfv(i32 %14, i32 %15, i32* %3)
%17 = tail call i32 (...) @glPushMatrix()
%18 = tail call i32 @glScalef(double 3.000000e-01, double 3.000000e-01, double 9.000000e-01)
%19 = tail call i32 (...) @glPushMatrix()
%20 = tail call i32 (...) @drawOctSides()
%21 = tail call i32 (...) @glPopMatrix()
%22 = tail call i32 (...) @glPushMatrix()
%23 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%24 = tail call i32 (...) @drawOct()
%25 = tail call i32 (...) @glPopMatrix()
%26 = tail call i32 (...) @glPushMatrix()
%27 = tail call i32 @glRotatef(i32 180, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%28 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%29 = tail call i32 (...) @drawOct()
%30 = tail call i32 (...) @glPopMatrix()
%31 = tail call i32 (...) @glPopMatrix()
ret void
}