#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(int, int, int, int);
void drawTri(int side_length, int x, int y) {
  int v1x = x;
  int v1y = y;
  int v2x = v1x;
  int v2y = v1y - side_length;
  int v3x = v2x + side_length;
  int v3y = v2y;
  drawLine(v1x, v1y, v2x, v2y);
  drawLine(v2x, v2y, v3x, v3y);
  drawLine(v3x, v3y, v1x, v1y);
}


x86 assembly (clang, -O0):
<drawTri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <drawLine@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1030 <drawLine@plt>
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <drawLine@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTri>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    %edx,%ebp
sub    %edi,%ebp
add    %esi,%ebx
mov    %esi,%edi
mov    %edx,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1030 <drawLine@plt>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <drawLine@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawLine@plt>

LLVM IR (-O0):
define void @drawTri(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = load i32, i32* %5
store i32 %13, i32* %7
%14 = load i32, i32* %6
store i32 %14, i32* %8
%15 = load i32, i32* %7
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
store i32 %21, i32* %11
%22 = load i32, i32* %10
store i32 %22, i32* %12
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = load i32, i32* %9
%26 = load i32, i32* %10
%27 = call i32 @drawLine(i32 %23, i32 %24, i32 %25, i32 %26)
%28 = load i32, i32* %9
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = load i32, i32* %12
%32 = call i32 @drawLine(i32 %28, i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = load i32, i32* %7
%36 = load i32, i32* %8
%37 = call i32 @drawLine(i32 %33, i32 %34, i32 %35, i32 %36)
ret void
}

LLVM IR (-O2):
define void @drawTri(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %0
%5 = add nsw i32 %1, %0
%6 = tail call i32 @drawLine(i32 %1, i32 %2, i32 %1, i32 %4)
%7 = tail call i32 @drawLine(i32 %1, i32 %4, i32 %5, i32 %4)
%8 = tail call i32 @drawLine(i32 %5, i32 %4, i32 %1, i32 %2)
ret void
}