#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_AMBIENT;
int /*<<< orphan*/ GL_BACK;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                float *);
void surfacematerials(void) {
  static float front_mat_diffuse[] = {0.2, 0.7, 0.4, 1.0};
  static float front_mat_ambient[] = {0.1, 0.1, 0.1, 1.0};
  static float back_mat_diffuse[] = {1.0, 1.0, 0.2, 1.0};
  static float back_mat_ambient[] = {0.1, 0.1, 0.1, 1.0};
  glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
  glMaterialfv(GL_FRONT, GL_AMBIENT, front_mat_ambient);
  glMaterialfv(GL_BACK, GL_DIFFUSE, back_mat_diffuse);
  glMaterialfv(GL_BACK, GL_AMBIENT, back_mat_ambient);
}


x86 assembly (clang, -O0):
<surfacematerials>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0x2f03(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0x2ef5(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
lea    0x2ee7(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
lea    0x2ed9(%rip),%rdx
call   1030 <glMaterialfv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<surfacematerials>:
push   %r15
push   %r14
push   %rbx
mov    0x2ec4(%rip),%rbx
mov    (%rbx),%edi
mov    0x2ea3(%rip),%r14
mov    (%r14),%esi
lea    0x2f01(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2eb3(%rip),%r15
mov    (%r15),%esi
lea    0x2ef9(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    0x2e7d(%rip),%rbx
mov    (%rbx),%edi
mov    (%r14),%esi
lea    0x2ef1(%rip),%rdx
call   1030 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    (%r15),%esi
lea    0x2ef0(%rip),%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <glMaterialfv@plt>

LLVM IR (-O0):
@surfacematerials.front_mat_diffuse = internal global [4 x float] [float 0x3FC99999A0000000, float 0x3FE6666660000000, float 0x3FD99999A0000000, float 1.000000e+00]
@surfacematerials.front_mat_ambient = internal global [4 x float] [float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 1.000000e+00]
@surfacematerials.back_mat_diffuse = internal global [4 x float] [float 1.000000e+00, float 1.000000e+00, float 0x3FC99999A0000000, float 1.000000e+00]
@surfacematerials.back_mat_ambient = internal global [4 x float] [float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 1.000000e+00]
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_BACK = global i32 0
define void @surfacematerials() {
%1 = load i32, i32* @GL_FRONT
%2 = load i32, i32* @GL_DIFFUSE
%3 = call i32 @glMaterialfv(i32 %1, i32 %2, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.front_mat_diffuse, i64 0, i64 0))
%4 = load i32, i32* @GL_FRONT
%5 = load i32, i32* @GL_AMBIENT
%6 = call i32 @glMaterialfv(i32 %4, i32 %5, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.front_mat_ambient, i64 0, i64 0))
%7 = load i32, i32* @GL_BACK
%8 = load i32, i32* @GL_DIFFUSE
%9 = call i32 @glMaterialfv(i32 %7, i32 %8, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.back_mat_diffuse, i64 0, i64 0))
%10 = load i32, i32* @GL_BACK
%11 = load i32, i32* @GL_AMBIENT
%12 = call i32 @glMaterialfv(i32 %10, i32 %11, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.back_mat_ambient, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@surfacematerials.front_mat_diffuse = internal global [4 x float] [float 0x3FC99999A0000000, float 0x3FE6666660000000, float 0x3FD99999A0000000, float 1.000000e+00]
@surfacematerials.front_mat_ambient = internal global [4 x float] [float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 1.000000e+00]
@surfacematerials.back_mat_diffuse = internal global [4 x float] [float 1.000000e+00, float 1.000000e+00, float 0x3FC99999A0000000, float 1.000000e+00]
@surfacematerials.back_mat_ambient = internal global [4 x float] [float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 0x3FB99999A0000000, float 1.000000e+00]
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_AMBIENT = global i32 0
@GL_BACK = global i32 0
define void @surfacematerials() {
%1 = load i32, i32* @GL_FRONT
%2 = load i32, i32* @GL_DIFFUSE
%3 = tail call i32 @glMaterialfv(i32 %1, i32 %2, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.front_mat_diffuse, i64 0, i64 0))
%4 = load i32, i32* @GL_FRONT
%5 = load i32, i32* @GL_AMBIENT
%6 = tail call i32 @glMaterialfv(i32 %4, i32 %5, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.front_mat_ambient, i64 0, i64 0))
%7 = load i32, i32* @GL_BACK
%8 = load i32, i32* @GL_DIFFUSE
%9 = tail call i32 @glMaterialfv(i32 %7, i32 %8, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.back_mat_diffuse, i64 0, i64 0))
%10 = load i32, i32* @GL_BACK
%11 = load i32, i32* @GL_AMBIENT
%12 = tail call i32 @glMaterialfv(i32 %10, i32 %11, float* getelementptr inbounds ([4 x float], [4 x float]* @surfacematerials.back_mat_ambient, i64 0, i64 0))
ret void
}