#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*/ drawLine(short, short, short, short, short);
void drawTriangle(short x0, short y0, short x1, short y1, short x2, short y2,
                  short color) {
  drawLine(x0, y0, x1, y1, color);
  drawLine(x1, y1, x2, y2, color);
  drawLine(x2, y2, x0, y0, color);
}


x86 assembly (clang, -O0):
<drawTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9w,%ax
mov    0x10(%rbp),%r9w
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x6(%rbp),%cx
mov    -0x8(%rbp),%ax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
movswl 0x10(%rbp),%r8d
call   1030 <drawLine@plt>
mov    -0x6(%rbp),%si
mov    -0x8(%rbp),%dx
mov    -0xa(%rbp),%cx
mov    -0xc(%rbp),%ax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
movswl 0x10(%rbp),%r8d
call   1030 <drawLine@plt>
mov    -0xa(%rbp),%si
mov    -0xc(%rbp),%dx
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
movswl 0x10(%rbp),%r8d
call   1030 <drawLine@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,%ebx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%r13d
movswl 0x40(%rsp),%r14d
mov    %r14d,%r8d
call   1030 <drawLine@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    0x4(%rsp),%ebx
mov    %ebx,%ecx
mov    %r14d,%r8d
call   1030 <drawLine@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawLine@plt>

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

LLVM IR (-O2):
define void @drawTriangle(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6) {
%8 = tail call i32 @drawLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %6)
%9 = tail call i32 @drawLine(i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6)
%10 = tail call i32 @drawLine(i16 signext %4, i16 signext %5, i16 signext %0, i16 signext %1, i16 signext %6)
ret void
}