#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*/ pixClearRGB(double, double, double);
scalar_t__ pixInitialize(int, int, char *);
int /*<<< orphan*/ pixRun();
int /*<<< orphan*/ triRender(double *, double *, double *, double *, double *,
                             double *, double *);
int main(void) {
  if (pixInitialize(512, 512, "Pixel Graphics") != 0)
    return 1;
  else {
    pixClearRGB(0.0, 0.0, 0.0);
    double a[2] = {300, 300};
    double b[2] = {50, 300};
    double c[2] = {200, 0};
    double bg[3] = {1.0, 1.0, 1.0};
    double alpha[3] = {1.0, 0.0, 0.0};
    double beta[3] = {0.0, 1.0, 0.0};
    double gamma[3] = {0.0, 0.0, 1.0};
    triRender(a, b, c, bg, alpha, beta, gamma);
    pixRun();
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x200,%esi
lea    0xea2(%rip),%rdx
mov    %esi,%edi
call   1060 <pixInitialize@plt>
cmp    $0x0,%rax
je     117b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    129a <main+0x15a>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <pixClearRGB@plt>
mov    0xe80(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe6e(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe6b(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe68(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe6c(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xe66(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xe60(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe62(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe5c(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe56(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    -0xa0(%rbp),%r9
lea    -0xc0(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRender@plt>
mov    $0x0,%al
call   1040 <pixRun@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xc0,%rsp
lea    0xeb1(%rip),%rdx
mov    $0x200,%edi
mov    $0x200,%esi
call   1060 <pixInitialize@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1248 <main+0x108>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <pixClearRGB@plt>
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
mov    0xea2(%rip),%rax
mov    %rax,0x80(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
mov    0xea7(%rip),%rax
mov    %rax,0x60(%rsp)
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0xeaf(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xeb7(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
lea    0xb0(%rsp),%rdi
lea    0xa0(%rsp),%rsi
lea    0x90(%rsp),%rdx
lea    0x70(%rsp),%rcx
lea    0x50(%rsp),%r8
lea    0x30(%rsp),%r9
call   1030 <triRender@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <pixRun@plt>
mov    %ebx,%eax
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Pixel Graphics\00"
@__const.main.a = [2 x double] [double 3.000000e+02, double 3.000000e+02]
@__const.main.b = [2 x double] [double 5.000000e+01, double 3.000000e+02]
@__const.main.c = [2 x double] [double 2.000000e+02, double 0.000000e+00]
@__const.main.bg = [3 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.main.alpha = [3 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.main.beta = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.main.gamma = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x double]
%3 = alloca [2 x double]
%4 = alloca [2 x double]
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = alloca [3 x double]
store i32 0, i32* %1
%9 = call i64 @pixInitialize(i32 512, i32 512, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %30
12: ; preds = %0
%13 = call i32 @pixClearRGB(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%14 = bitcast [2 x double]* %2 to i8*
%15 = bitcast [2 x double]* %3 to i8*
%16 = bitcast [2 x double]* %4 to i8*
%17 = bitcast [3 x double]* %5 to i8*
%18 = bitcast [3 x double]* %6 to i8*
%19 = bitcast [3 x double]* %7 to i8*
%20 = bitcast [3 x double]* %8 to i8*
%21 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%22 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%23 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%24 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%25 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%26 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%27 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%28 = call i32 @triRender(double* %21, double* %22, double* %23, double* %24, double* %25, double* %26, double* %27)
%29 = call i32 (...) @pixRun()
store i32 0, i32* %1
br label %30
30: ; preds = %12, %11
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [15 x i8] c"Pixel Graphics\00"
@__const.main.a = [2 x double] [double 3.000000e+02, double 3.000000e+02]
@__const.main.b = [2 x double] [double 5.000000e+01, double 3.000000e+02]
@__const.main.c = [2 x double] [double 2.000000e+02, double 0.000000e+00]
@__const.main.bg = [3 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.main.alpha = [3 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.main.beta = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.main.gamma = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
define i32 @main() {
%1 = alloca [2 x double]
%2 = alloca [2 x double]
%3 = alloca [2 x double]
%4 = alloca [3 x double]
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = tail call i64 @pixInitialize(i32 512, i32 512, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %0
%11 = tail call i32 @pixClearRGB(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%12 = bitcast [2 x double]* %1 to i8*
%13 = bitcast [2 x double]* %2 to i8*
%14 = bitcast [2 x double]* %3 to i8*
%15 = bitcast [3 x double]* %4 to i8*
%16 = bitcast [3 x double]* %5 to i8*
%17 = bitcast [3 x double]* %6 to i8*
%18 = bitcast [3 x double]* %7 to i8*
%19 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%20 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%21 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%22 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%23 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%24 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%25 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%26 = call i32 @triRender(double* %19, double* %20, double* %21, double* %22, double* %23, double* %24, double* %25)
%27 = call i32 (...) @pixRun()
br label %28
28: ; preds = %0, %10
%29 = phi i32 [ 0, %10 ], [ 1, %0 ]
ret i32 %29
}