#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_COMPILE;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ glNewList(int, int /*<<< orphan*/);
void material(int dlist, GLfloat *ambient, GLfloat *diffuse, GLfloat *specular,
              GLfloat shininess) {
  glNewList(dlist, GL_COMPILE);
  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
  glEndList();
}


x86 assembly (clang, -O0):
<material>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
call   1040 <glNewList@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
mov    0x2e2e(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
mov    0x2e1b(%rip),%rax
mov    (%rax),%esi
mov    -0x24(%rbp),%edx
call   1030 <glMaterialf@plt>
mov    $0x0,%al
call   1060 <glEndList@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<material>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    0x2e5d(%rip),%rax
mov    (%rax),%esi
call   1040 <glNewList@plt>
mov    0x2e67(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1050 <glMaterialfv@plt>
mov    0x0(%rbp),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdx
call   1050 <glMaterialfv@plt>
mov    0x0(%rbp),%edi
mov    0x2e45(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdx
call   1050 <glMaterialfv@plt>
mov    0x0(%rbp),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edx
call   1030 <glMaterialf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE = global i32 0
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @material(i32 %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* @GL_COMPILE
%13 = call i32 @glNewList(i32 %11, i32 %12)
%14 = load i32, i32* @GL_FRONT
%15 = load i32, i32* @GL_AMBIENT
%16 = load i32*, i32** %7
%17 = call i32 @glMaterialfv(i32 %14, i32 %15, i32* %16)
%18 = load i32, i32* @GL_FRONT
%19 = load i32, i32* @GL_DIFFUSE
%20 = load i32*, i32** %8
%21 = call i32 @glMaterialfv(i32 %18, i32 %19, i32* %20)
%22 = load i32, i32* @GL_FRONT
%23 = load i32, i32* @GL_SPECULAR
%24 = load i32*, i32** %9
%25 = call i32 @glMaterialfv(i32 %22, i32 %23, i32* %24)
%26 = load i32, i32* @GL_FRONT
%27 = load i32, i32* @GL_SHININESS
%28 = load i32, i32* %10
%29 = call i32 @glMaterialf(i32 %26, i32 %27, i32 %28)
%30 = call i32 (...) @glEndList()
ret void
}

LLVM IR (-O2):
@GL_COMPILE = global i32 0
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @material(i32 %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = load i32, i32* @GL_COMPILE
%7 = tail call i32 @glNewList(i32 %0, i32 %6)
%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_DIFFUSE
%13 = tail call i32 @glMaterialfv(i32 %11, i32 %12, i32* %2)
%14 = load i32, i32* @GL_FRONT
%15 = load i32, i32* @GL_SPECULAR
%16 = tail call i32 @glMaterialfv(i32 %14, i32 %15, i32* %3)
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_SHININESS
%19 = tail call i32 @glMaterialf(i32 %17, i32 %18, i32 %4)
%20 = tail call i32 (...) @glEndList()
ret void
}