#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*/ GL_QUADS;
int /*<<< orphan*/ GL_QUAD_STRIP;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glNormal3d(double, double, double);
int /*<<< orphan*/ glVertex3d(double, double, double);
void kocka(double a) {
  glBegin(GL_QUADS);
  glNormal3d(0.0, 0.0, -1.0);
  glVertex3d(0.0, 0.0, 0.0);
  glVertex3d(0.0, a, 0.0);
  glVertex3d(a, a, 0.0);
  glVertex3d(a, 0.0, 0.0);
  glNormal3d(0.0, 0.0, 1.0);
  glVertex3d(0.0, 0.0, a);
  glVertex3d(a, 0.0, a);
  glVertex3d(a, a, a);
  glVertex3d(0.0, a, a);
  glEnd();
  glBegin(GL_QUAD_STRIP);
  glNormal3d(0.0, -1.0, 0.0);
  glVertex3d(0.0, 0.0, a);
  glVertex3d(0.0, 0.0, 0.0);
  glVertex3d(a, 0.0, a);
  glVertex3d(a, 0.0, 0.0);
  glNormal3d(1.0, 0.0, 0.0);
  glVertex3d(a, a, a);
  glVertex3d(a, a, 0.0);
  glNormal3d(0.0, 1.0, 0.0);
  glVertex3d(0.0, a, a);
  glVertex3d(0.0, a, 0.0);
  glNormal3d(-1.0, 0.0, 0.0);
  glVertex3d(0.0, 0.0, a);
  glVertex3d(0.0, 0.0, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<kocka>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm1,%xmm1
movsd  0xe9a(%rip),%xmm2
movaps %xmm1,%xmm0
call   1030 <glNormal3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  0xe4f(%rip),%xmm2
movaps %xmm1,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
xorps  %xmm0,%xmm0
call   1040 <glVertex3d@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm2,%xmm2
movsd  0xdd7(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  0xd8f(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  0xd53(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
xorps  %xmm0,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1040 <glVertex3d@plt>
movsd  0xd19(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kocka>:
push   %rax
movsd  %xmm0,(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xea4(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
call   1040 <glVertex3d@plt>
movsd  0xe5b(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm2
call   1040 <glVertex3d@plt>
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
movsd  (%rsp),%xmm1
movaps %xmm1,%xmm2
call   1040 <glVertex3d@plt>
xor    %eax,%eax
call   1050 <glEnd@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xde5(%rip),%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xd9c(%rip),%xmm0
call   1030 <glNormal3d@plt>
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xd69(%rip),%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
movsd  (%rsp),%xmm1
movaps %xmm1,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xd2e(%rip),%xmm0
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @kocka(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @GL_QUADS
%4 = call i32 @glBegin(i32 %3)
%5 = call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%6 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%7 = load double, double* %2
%8 = call i32 @glVertex3d(double 0.000000e+00, double %7, double 0.000000e+00)
%9 = load double, double* %2
%10 = load double, double* %2
%11 = call i32 @glVertex3d(double %9, double %10, double 0.000000e+00)
%12 = load double, double* %2
%13 = call i32 @glVertex3d(double %12, double 0.000000e+00, double 0.000000e+00)
%14 = call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%15 = load double, double* %2
%16 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %15)
%17 = load double, double* %2
%18 = load double, double* %2
%19 = call i32 @glVertex3d(double %17, double 0.000000e+00, double %18)
%20 = load double, double* %2
%21 = load double, double* %2
%22 = load double, double* %2
%23 = call i32 @glVertex3d(double %20, double %21, double %22)
%24 = load double, double* %2
%25 = load double, double* %2
%26 = call i32 @glVertex3d(double 0.000000e+00, double %24, double %25)
%27 = call i32 (...) @glEnd()
%28 = load i32, i32* @GL_QUAD_STRIP
%29 = call i32 @glBegin(i32 %28)
%30 = call i32 @glNormal3d(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%31 = load double, double* %2
%32 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %31)
%33 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%34 = load double, double* %2
%35 = load double, double* %2
%36 = call i32 @glVertex3d(double %34, double 0.000000e+00, double %35)
%37 = load double, double* %2
%38 = call i32 @glVertex3d(double %37, double 0.000000e+00, double 0.000000e+00)
%39 = call i32 @glNormal3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%40 = load double, double* %2
%41 = load double, double* %2
%42 = load double, double* %2
%43 = call i32 @glVertex3d(double %40, double %41, double %42)
%44 = load double, double* %2
%45 = load double, double* %2
%46 = call i32 @glVertex3d(double %44, double %45, double 0.000000e+00)
%47 = call i32 @glNormal3d(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%48 = load double, double* %2
%49 = load double, double* %2
%50 = call i32 @glVertex3d(double 0.000000e+00, double %48, double %49)
%51 = load double, double* %2
%52 = call i32 @glVertex3d(double 0.000000e+00, double %51, double 0.000000e+00)
%53 = call i32 @glNormal3d(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%54 = load double, double* %2
%55 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %54)
%56 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%57 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @kocka(double %0) {
%2 = load i32, i32* @GL_QUADS
%3 = tail call i32 @glBegin(i32 %2)
%4 = tail call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%5 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%6 = tail call i32 @glVertex3d(double 0.000000e+00, double %0, double 0.000000e+00)
%7 = tail call i32 @glVertex3d(double %0, double %0, double 0.000000e+00)
%8 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double 0.000000e+00)
%9 = tail call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%10 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %0)
%11 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double %0)
%12 = tail call i32 @glVertex3d(double %0, double %0, double %0)
%13 = tail call i32 @glVertex3d(double 0.000000e+00, double %0, double %0)
%14 = tail call i32 (...) @glEnd()
%15 = load i32, i32* @GL_QUAD_STRIP
%16 = tail call i32 @glBegin(i32 %15)
%17 = tail call i32 @glNormal3d(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%18 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %0)
%19 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%20 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double %0)
%21 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double 0.000000e+00)
%22 = tail call i32 @glNormal3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%23 = tail call i32 @glVertex3d(double %0, double %0, double %0)
%24 = tail call i32 @glVertex3d(double %0, double %0, double 0.000000e+00)
%25 = tail call i32 @glNormal3d(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%26 = tail call i32 @glVertex3d(double 0.000000e+00, double %0, double %0)
%27 = tail call i32 @glVertex3d(double 0.000000e+00, double %0, double 0.000000e+00)
%28 = tail call i32 @glNormal3d(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%29 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %0)
%30 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%31 = tail call i32 (...) @glEnd()
ret void
}