#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*/ GLuint;
typedef char GLchar;

/* Variables and functions */
int /*<<< orphan*/ GL_FRAGMENT_SHADER;
int /*<<< orphan*/ GL_VERTEX_SHADER;
int /*<<< orphan*/ glfxCompileShader(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     char const *);
int /*<<< orphan*/ glfxLinkProgram(int /*<<< orphan*/, int /*<<< orphan*/);
void glfxMakeProgram(const GLchar *fragShaderStr) {
  const char *vertShaderStr =
      "attribute vec4 vPosition; void main() { gl_Position = vPosition; }";
  GLuint fragShader, vertShader;
  glfxCompileShader(&fragShader, GL_FRAGMENT_SHADER, fragShaderStr);
  glfxCompileShader(&vertShader, GL_VERTEX_SHADER, vertShaderStr);
  glfxLinkProgram(fragShader, vertShader);
}


x86 assembly (clang, -O0):
<glfxMakeProgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
lea    -0x14(%rbp),%rdi
call   1040 <glfxCompileShader@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1040 <glfxCompileShader@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <glfxLinkProgram@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glfxMakeProgram>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1040 <glfxCompileShader@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
mov    %rsp,%rdi
call   1040 <glfxCompileShader@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <glfxLinkProgram@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [67 x i8] c"attribute vec4 vPosition; void main() { gl_Position = vPosition; }\00"
@GL_FRAGMENT_SHADER = global i32 0
@GL_VERTEX_SHADER = global i32 0
define void @glfxMakeProgram(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = load i32, i32* @GL_FRAGMENT_SHADER
%7 = load i8*, i8** %2
%8 = call i32 @glfxCompileShader(i32* %4, i32 %6, i8* %7)
%9 = load i32, i32* @GL_VERTEX_SHADER
%10 = load i8*, i8** %3
%11 = call i32 @glfxCompileShader(i32* %5, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @glfxLinkProgram(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"attribute vec4 vPosition; void main() { gl_Position = vPosition; }\00"
@GL_FRAGMENT_SHADER = global i32 0
@GL_VERTEX_SHADER = global i32 0
define void @glfxMakeProgram(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* @GL_FRAGMENT_SHADER
%7 = call i32 @glfxCompileShader(i32* %2, i32 %6, i8* %0)
%8 = load i32, i32* @GL_VERTEX_SHADER
%9 = call i32 @glfxCompileShader(i32* %3, i32 %8, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @glfxLinkProgram(i32 %10, i32 %11)
ret void
}