#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_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void drawTriangle(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat x3,
                  GLfloat y3, GLfloat z) {
  glBegin(GL_TRIANGLES);
  glVertex3f(x1, y1, z);
  glVertex3f(x2, y2, z);
  glVertex3f(x3, y3, z);
  glEnd();
}


x86 assembly (clang, -O0):
<drawTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x10(%rbp),%edx
call   1030 <glVertex3f@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x10(%rbp),%edx
call   1030 <glVertex3f@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x10(%rbp),%edx
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTriangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x40(%rsp),%r14d
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <glVertex3f@plt>
mov    %r13d,%edi
mov    %r12d,%esi
mov    %r14d,%edx
call   1030 <glVertex3f@plt>
mov    %r15d,%edi
mov    0x4(%rsp),%esi
mov    %r14d,%edx
call   1030 <glVertex3f@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLES = global i32 0
define void @drawTriangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* @GL_TRIANGLES
%16 = call i32 @glBegin(i32 %15)
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = load i32, i32* %14
%20 = call i32 @glVertex3f(i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = load i32, i32* %14
%24 = call i32 @glVertex3f(i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %12
%26 = load i32, i32* %13
%27 = load i32, i32* %14
%28 = call i32 @glVertex3f(i32 %25, i32 %26, i32 %27)
%29 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_TRIANGLES = global i32 0
define void @drawTriangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = load i32, i32* @GL_TRIANGLES
%9 = tail call i32 @glBegin(i32 %8)
%10 = tail call i32 @glVertex3f(i32 %0, i32 %1, i32 %6)
%11 = tail call i32 @glVertex3f(i32 %2, i32 %3, i32 %6)
%12 = tail call i32 @glVertex3f(i32 %4, i32 %5, i32 %6)
%13 = tail call i32 (...) @glEnd()
ret void
}