#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*/ Display();
int /*<<< orphan*/ drawTriangle(int, int, int, int, int, int, int);
int /*<<< orphan*/ usleep(int);
void testdrawtriangle() {
  short i = 0;
  for (i = 0; i < (((128) < (32)) ? (128) : (32)) / 2; i += 5) {
    drawTriangle(128 / 2, 32 / 2 - i, 128 / 2 - i, 32 / 2 + i, 128 / 2 + i,
                 32 / 2 + i, 1);
    Display();
    usleep(1000);
  }
}


x86 assembly (clang, -O0):
<testdrawtriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x10,%eax
jge    11b2 <testdrawtriangle+0x82>
movswl -0x2(%rbp),%eax
mov    $0x10,%esi
sub    %eax,%esi
movswl -0x2(%rbp),%eax
mov    $0x40,%edx
sub    %eax,%edx
movswl -0x2(%rbp),%ecx
add    $0x10,%ecx
movswl -0x2(%rbp),%r8d
add    $0x40,%r8d
movswl -0x2(%rbp),%r9d
add    $0x10,%r9d
mov    $0x40,%edi
movl   $0x1,(%rsp)
call   1030 <drawTriangle@plt>
mov    $0x0,%al
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
movswl -0x2(%rbp),%eax
add    $0x5,%eax
mov    %ax,-0x2(%rbp)
jmp    1144 <testdrawtriangle+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdrawtriangle>:
push   %rax
movl   $0x1,(%rsp)
mov    $0x40,%edi
mov    $0x10,%esi
mov    $0x40,%edx
mov    $0x10,%ecx
mov    $0x40,%r8d
mov    $0x10,%r9d
call   1030 <drawTriangle@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
movl   $0x1,(%rsp)
mov    $0x40,%edi
mov    $0xb,%esi
mov    $0x3b,%edx
mov    $0x15,%ecx
mov    $0x45,%r8d
mov    $0x15,%r9d
call   1030 <drawTriangle@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
movl   $0x1,(%rsp)
mov    $0x40,%edi
mov    $0x6,%esi
mov    $0x36,%edx
mov    $0x1a,%ecx
mov    $0x4a,%r8d
mov    $0x1a,%r9d
call   1030 <drawTriangle@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
movl   $0x1,(%rsp)
mov    $0x40,%edi
mov    $0x1,%esi
mov    $0x31,%edx
mov    $0x1f,%ecx
mov    $0x4f,%r8d
mov    $0x1f,%r9d
call   1030 <drawTriangle@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1050 <usleep@plt>

LLVM IR (-O0):
define void @testdrawtriangle() {
%1 = alloca i16
store i16 0, i16* %1
store i16 0, i16* %1
br label %2
2: ; preds = %25, %0
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %30
6: ; preds = %2
%7 = load i16, i16* %1
%8 = sext i16 %7 to i32
%9 = sub nsw i32 16, %8
%10 = load i16, i16* %1
%11 = sext i16 %10 to i32
%12 = sub nsw i32 64, %11
%13 = load i16, i16* %1
%14 = sext i16 %13 to i32
%15 = add nsw i32 16, %14
%16 = load i16, i16* %1
%17 = sext i16 %16 to i32
%18 = add nsw i32 64, %17
%19 = load i16, i16* %1
%20 = sext i16 %19 to i32
%21 = add nsw i32 16, %20
%22 = call i32 @drawTriangle(i32 64, i32 %9, i32 %12, i32 %15, i32 %18, i32 %21, i32 1)
%23 = call i32 (...) @Display()
%24 = call i32 @usleep(i32 1000)
br label %25
25: ; preds = %6
%26 = load i16, i16* %1
%27 = sext i16 %26 to i32
%28 = add nsw i32 %27, 5
%29 = trunc i32 %28 to i16
store i16 %29, i16* %1
br label %2
30: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @testdrawtriangle() {
%1 = tail call i32 @drawTriangle(i32 64, i32 16, i32 64, i32 16, i32 64, i32 16, i32 1)
%2 = tail call i32 (...) @Display()
%3 = tail call i32 @usleep(i32 1000)
%4 = tail call i32 @drawTriangle(i32 64, i32 11, i32 59, i32 21, i32 69, i32 21, i32 1)
%5 = tail call i32 (...) @Display()
%6 = tail call i32 @usleep(i32 1000)
%7 = tail call i32 @drawTriangle(i32 64, i32 6, i32 54, i32 26, i32 74, i32 26, i32 1)
%8 = tail call i32 (...) @Display()
%9 = tail call i32 @usleep(i32 1000)
%10 = tail call i32 @drawTriangle(i32 64, i32 1, i32 49, i32 31, i32 79, i32 31, i32 1)
%11 = tail call i32 (...) @Display()
%12 = tail call i32 @usleep(i32 1000)
ret void
}