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

/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(int, double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, int /*<<< orphan*/);
int /*<<< orphan*/ gluCylinder(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int);
int /*<<< orphan*/ gluDisk(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int, int);
void myCylinder(GLUquadricObj *object, GLdouble outerRadius,
                GLdouble innerRadius, GLdouble lenght) {
  glPushMatrix();
  gluCylinder(object, outerRadius, outerRadius, lenght, 20, 1);
  glPushMatrix();
  glRotatef(180, 0.0, 1.0, 0.0);
  gluDisk(object, innerRadius, outerRadius, 20, 1);
  glPopMatrix();
  glTranslatef(0.0, 0.0, lenght);
  gluDisk(object, innerRadius, outerRadius, 20, 1);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<myCylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x14,%r8d
mov    $0x1,%r9d
call   1050 <gluCylinder@plt>
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
mov    $0xb4,%edi
xorps  %xmm2,%xmm2
movsd  0xe4f(%rip),%xmm1
movaps %xmm2,%xmm0
call   1080 <glRotatef@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x14,%ecx
mov    $0x1,%r8d
call   1060 <gluDisk@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
mov    -0x14(%rbp),%edi
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1070 <glTranslatef@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x14,%ecx
mov    $0x1,%r8d
call   1060 <gluDisk@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myCylinder>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <glPushMatrix@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    $0x14,%r8d
mov    $0x1,%r9d
call   1050 <gluCylinder@plt>
xor    %eax,%eax
call   1040 <glPushMatrix@plt>
movsd  0xe5d(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
mov    $0xb4,%edi
call   1080 <glRotatef@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    $0x14,%ecx
mov    $0x1,%r8d
call   1060 <gluDisk@plt>
xor    %eax,%eax
call   1030 <glPopMatrix@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %r15d,%edi
call   1070 <glTranslatef@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    $0x14,%ecx
mov    $0x1,%r8d
call   1060 <gluDisk@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @myCylinder(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 = call i32 (...) @glPushMatrix()
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %8
%14 = call i32 @gluCylinder(i32* %10, i32 %11, i32 %12, i32 %13, i32 20, i32 1)
%15 = call i32 (...) @glPushMatrix()
%16 = call i32 @glRotatef(i32 180, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%17 = load i32*, i32** %5
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @gluDisk(i32* %17, i32 %18, i32 %19, i32 20, i32 1)
%21 = call i32 (...) @glPopMatrix()
%22 = load i32, i32* %8
%23 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, i32 %22)
%24 = load i32*, i32** %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @gluDisk(i32* %24, i32 %25, i32 %26, i32 20, i32 1)
%28 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @myCylinder(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @glPushMatrix()
%6 = tail call i32 @gluCylinder(i32* %0, i32 %1, i32 %1, i32 %3, i32 20, i32 1)
%7 = tail call i32 (...) @glPushMatrix()
%8 = tail call i32 @glRotatef(i32 180, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%9 = tail call i32 @gluDisk(i32* %0, i32 %2, i32 %1, i32 20, i32 1)
%10 = tail call i32 (...) @glPopMatrix()
%11 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, i32 %3)
%12 = tail call i32 @gluDisk(i32* %0, i32 %2, i32 %1, i32 20, i32 1)
%13 = tail call i32 (...) @glPopMatrix()
ret void
}