#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 double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_COMPILE;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ GL_STENCIL_TEST;
int /*<<< orphan*/ glClearStencil(int);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/, double);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glNewList(int, int /*<<< orphan*/);
void stencil_init(void) {
  GLfloat yellow_diffuse[] = {0.7, 0.7, 0.0, 1.0};
  GLfloat yellow_specular[] = {1.0, 1.0, 1, 0, 1.0};
  GLfloat blue_diffuse[] = {0.1, 0.1, 0.7, 1.0};
  GLfloat blue_specular[] = {0.1, 1.0, 1.0, 1.0};
  GLfloat position_one[] = {1.0, 1.0, 1.0, 0.0};
  glNewList(1, GL_COMPILE);
  glMaterialfv(GL_FRONT, GL_DIFFUSE, yellow_diffuse);
  glMaterialfv(GL_FRONT, GL_SPECULAR, yellow_specular);
  glMaterialf(GL_FRONT, GL_SHININESS, 64.0);
  glEndList();
  glNewList(2, GL_COMPILE);
  glMaterialfv(GL_FRONT, GL_DIFFUSE, blue_diffuse);
  glMaterialfv(GL_FRONT, GL_SPECULAR, blue_specular);
  glMaterialf(GL_FRONT, GL_SHININESS, 45.0);
  glEndList();
  glLightfv(GL_LIGHT0, GL_POSITION, position_one);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_DEPTH_TEST);
  glClearStencil(0x0);
  glEnable(GL_STENCIL_TEST);
}


x86 assembly (clang, -O0):
<stencil_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0xe8e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1080 <memset@plt>
movsd  0xe41(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe34(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe27(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe1a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0xe3e(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe3b(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe38(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe35(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe32(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe2c(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe26(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe23(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe20(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe1a(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe14(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xe0e(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1070 <glNewList@plt>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
mov    0x2cf4(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
mov    0x2d19(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
mov    0x2d06(%rip),%rax
mov    (%rax),%esi
movsd  0xd14(%rip),%xmm0
call   1040 <glMaterialf@plt>
mov    $0x0,%al
call   10a0 <glEndList@plt>
mov    0x2c99(%rip),%rax
mov    (%rax),%esi
mov    $0x2,%edi
call   1070 <glNewList@plt>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
mov    0x2c85(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
mov    0x2caa(%rip),%rax
mov    (%rax),%esi
lea    -0x90(%rbp),%rdx
call   1090 <glMaterialfv@plt>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
movsd  0xc9a(%rip),%xmm0
call   1040 <glMaterialf@plt>
mov    $0x0,%al
call   10a0 <glEndList@plt>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
mov    0x2c3e(%rip),%rax
mov    (%rax),%esi
lea    -0xb0(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2c2b(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2be5(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
xor    %edi,%edi
call   1050 <glClearStencil@plt>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stencil_init>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb0,%rsp
movaps 0xea9(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe53(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x20(%rsp)
movaps 0xe84(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe65(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe6d(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe75(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0x2d89(%rip),%r14
mov    (%r14),%esi
mov    $0x1,%edi
call   1070 <glNewList@plt>
mov    0x2dad(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d74(%rip),%r15
mov    (%r15),%esi
lea    0x90(%rsp),%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2d9b(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2d8e(%rip),%r13
mov    0x0(%r13),%esi
movsd  0xda2(%rip),%xmm0
call   1040 <glMaterialf@plt>
xor    %eax,%eax
call   1090 <glEndList@plt>
mov    (%r14),%esi
mov    $0x2,%edi
call   1070 <glNewList@plt>
mov    (%rbx),%edi
mov    (%r15),%esi
lea    0x70(%rsp),%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    (%r12),%esi
lea    0x50(%rsp),%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x0(%r13),%esi
movsd  0xd64(%rip),%xmm0
call   1040 <glMaterialf@plt>
xor    %eax,%eax
call   1090 <glEndList@plt>
mov    0x2d09(%rip),%rbx
mov    (%rbx),%edi
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    (%rbx),%edi
call   1060 <glEnable@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
xor    %edi,%edi
call   1050 <glClearStencil@plt>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
add    $0xb0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.stencil_init.yellow_diffuse = [4 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0.000000e+00, double 1.000000e+00]
@__const.stencil_init.blue_diffuse = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 0x3FE6666666666666, double 1.000000e+00]
@__const.stencil_init.blue_specular = [4 x double] [double 1.000000e-01, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.stencil_init.position_one = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00]
@GL_COMPILE = global i32 0
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_STENCIL_TEST = global i32 0
define void @stencil_init() {
%1 = alloca [4 x double]
%2 = alloca [5 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [4 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [5 x double]* %2 to i8*
%8 = bitcast i8* %7 to [5 x double]*
%9 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 0
store double 1.000000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 1
store double 1.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 2
store double 1.000000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 4
store double 1.000000e+00, double* %12
%13 = bitcast [4 x double]* %3 to i8*
%14 = bitcast [4 x double]* %4 to i8*
%15 = bitcast [4 x double]* %5 to i8*
%16 = load i32, i32* @GL_COMPILE
%17 = call i32 @glNewList(i32 1, i32 %16)
%18 = load i32, i32* @GL_FRONT
%19 = load i32, i32* @GL_DIFFUSE
%20 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%21 = call i32 @glMaterialfv(i32 %18, i32 %19, double* %20)
%22 = load i32, i32* @GL_FRONT
%23 = load i32, i32* @GL_SPECULAR
%24 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%25 = call i32 @glMaterialfv(i32 %22, i32 %23, double* %24)
%26 = load i32, i32* @GL_FRONT
%27 = load i32, i32* @GL_SHININESS
%28 = call i32 @glMaterialf(i32 %26, i32 %27, double 6.400000e+01)
%29 = call i32 (...) @glEndList()
%30 = load i32, i32* @GL_COMPILE
%31 = call i32 @glNewList(i32 2, i32 %30)
%32 = load i32, i32* @GL_FRONT
%33 = load i32, i32* @GL_DIFFUSE
%34 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%35 = call i32 @glMaterialfv(i32 %32, i32 %33, double* %34)
%36 = load i32, i32* @GL_FRONT
%37 = load i32, i32* @GL_SPECULAR
%38 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%39 = call i32 @glMaterialfv(i32 %36, i32 %37, double* %38)
%40 = load i32, i32* @GL_FRONT
%41 = load i32, i32* @GL_SHININESS
%42 = call i32 @glMaterialf(i32 %40, i32 %41, double 4.500000e+01)
%43 = call i32 (...) @glEndList()
%44 = load i32, i32* @GL_LIGHT0
%45 = load i32, i32* @GL_POSITION
%46 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%47 = call i32 @glLightfv(i32 %44, i32 %45, double* %46)
%48 = load i32, i32* @GL_LIGHTING
%49 = call i32 @glEnable(i32 %48)
%50 = load i32, i32* @GL_LIGHT0
%51 = call i32 @glEnable(i32 %50)
%52 = load i32, i32* @GL_DEPTH_TEST
%53 = call i32 @glEnable(i32 %52)
%54 = call i32 @glClearStencil(i32 0)
%55 = load i32, i32* @GL_STENCIL_TEST
%56 = call i32 @glEnable(i32 %55)
ret void
}

LLVM IR (-O2):
@__const.stencil_init.yellow_diffuse = [4 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0.000000e+00, double 1.000000e+00]
@__const.stencil_init.blue_diffuse = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 0x3FE6666666666666, double 1.000000e+00]
@__const.stencil_init.blue_specular = [4 x double] [double 1.000000e-01, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.stencil_init.position_one = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00]
@GL_COMPILE = global i32 0
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_STENCIL_TEST = global i32 0
define void @stencil_init() {
%1 = alloca [4 x double]
%2 = alloca [5 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [4 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [5 x double]* %2 to i8*
%8 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
%9 = bitcast double* %8 to i8*
%10 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%11 = bitcast [5 x double]* %2 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
store double 1.000000e+00, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 4
store double 1.000000e+00, double* %13
%14 = bitcast [4 x double]* %3 to i8*
%15 = bitcast [4 x double]* %4 to i8*
%16 = bitcast [4 x double]* %5 to i8*
%17 = load i32, i32* @GL_COMPILE
%18 = tail call i32 @glNewList(i32 1, i32 %17)
%19 = load i32, i32* @GL_FRONT
%20 = load i32, i32* @GL_DIFFUSE
%21 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%22 = call i32 @glMaterialfv(i32 %19, i32 %20, double* %21)
%23 = load i32, i32* @GL_FRONT
%24 = load i32, i32* @GL_SPECULAR
%25 = call i32 @glMaterialfv(i32 %23, i32 %24, double* %10)
%26 = load i32, i32* @GL_FRONT
%27 = load i32, i32* @GL_SHININESS
%28 = call i32 @glMaterialf(i32 %26, i32 %27, double 6.400000e+01)
%29 = call i32 (...) @glEndList()
%30 = load i32, i32* @GL_COMPILE
%31 = call i32 @glNewList(i32 2, i32 %30)
%32 = load i32, i32* @GL_FRONT
%33 = load i32, i32* @GL_DIFFUSE
%34 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%35 = call i32 @glMaterialfv(i32 %32, i32 %33, double* %34)
%36 = load i32, i32* @GL_FRONT
%37 = load i32, i32* @GL_SPECULAR
%38 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%39 = call i32 @glMaterialfv(i32 %36, i32 %37, double* %38)
%40 = load i32, i32* @GL_FRONT
%41 = load i32, i32* @GL_SHININESS
%42 = call i32 @glMaterialf(i32 %40, i32 %41, double 4.500000e+01)
%43 = call i32 (...) @glEndList()
%44 = load i32, i32* @GL_LIGHT0
%45 = load i32, i32* @GL_POSITION
%46 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%47 = call i32 @glLightfv(i32 %44, i32 %45, double* %46)
%48 = load i32, i32* @GL_LIGHTING
%49 = call i32 @glEnable(i32 %48)
%50 = load i32, i32* @GL_LIGHT0
%51 = call i32 @glEnable(i32 %50)
%52 = load i32, i32* @GL_DEPTH_TEST
%53 = call i32 @glEnable(i32 %52)
%54 = call i32 @glClearStencil(i32 0)
%55 = load i32, i32* @GL_STENCIL_TEST
%56 = call i32 @glEnable(i32 %55)
ret void
}