#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*/ fillRoundRect(short, short, int, int, int, short);
int /*<<< orphan*/ usleep(int);
void testfillroundrect() {
  short color = 1, i = 0;
  for (i = 0; i < 32 / 2 - 2; i += 2) {
    fillRoundRect(i, i, 128 - 2 * i, 32 - 2 * i, 32 / 4, color);
    if (color == 1)
      color = 0;
    else
      color = 1;
    Display();
    usleep(1000);
  }
}


x86 assembly (clang, -O0):
<testfillroundrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x1,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0xe,%eax
jge    11d0 <testfillroundrect+0xa0>
mov    -0x4(%rbp),%si
mov    -0x4(%rbp),%ax
movswl -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    $0x80,%edx
sub    %ecx,%edx
movswl -0x4(%rbp),%edi
shl    $0x1,%edi
mov    $0x20,%ecx
sub    %edi,%ecx
mov    $0x8,%r8d
movswl %si,%edi
movswl %ax,%esi
movswl -0x2(%rbp),%r9d
call   1030 <fillRoundRect@plt>
movswl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    11a9 <testfillroundrect+0x79>
movw   $0x0,-0x2(%rbp)
jmp    11af <testfillroundrect+0x7f>
movw   $0x1,-0x2(%rbp)
mov    $0x0,%al
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
movswl -0x4(%rbp),%eax
add    $0x2,%eax
mov    %ax,-0x4(%rbp)
jmp    114a <testfillroundrect+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfillroundrect>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x80,%edx
mov    $0x20,%ecx
mov    $0x8,%r8d
mov    $0x1,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    $0x7c,%edx
mov    $0x1c,%ecx
mov    $0x8,%r8d
xor    %r9d,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x78,%edx
mov    $0x18,%ecx
mov    $0x8,%r8d
mov    $0x1,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0x6,%edi
mov    $0x6,%esi
mov    $0x74,%edx
mov    $0x14,%ecx
mov    $0x8,%r8d
xor    %r9d,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0x8,%edi
mov    $0x8,%esi
mov    $0x70,%edx
mov    $0x10,%ecx
mov    $0x8,%r8d
mov    $0x1,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0xa,%edi
mov    $0xa,%esi
mov    $0x6c,%edx
mov    $0xc,%ecx
mov    $0x8,%r8d
xor    %r9d,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    $0xc,%edi
mov    $0xc,%esi
mov    $0x68,%edx
mov    $0x8,%ecx
mov    $0x8,%r8d
mov    $0x1,%r9d
call   1030 <fillRoundRect@plt>
xor    %eax,%eax
call   1040 <Display@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1050 <usleep@plt>

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

LLVM IR (-O2):
define void @testfillroundrect() {
%1 = tail call i32 @fillRoundRect(i16 signext 0, i16 signext 0, i32 128, i32 32, i32 8, i16 signext 1)
%2 = tail call i32 (...) @Display()
%3 = tail call i32 @usleep(i32 1000)
%4 = tail call i32 @fillRoundRect(i16 signext 2, i16 signext 2, i32 124, i32 28, i32 8, i16 signext 0)
%5 = tail call i32 (...) @Display()
%6 = tail call i32 @usleep(i32 1000)
%7 = tail call i32 @fillRoundRect(i16 signext 4, i16 signext 4, i32 120, i32 24, i32 8, i16 signext 1)
%8 = tail call i32 (...) @Display()
%9 = tail call i32 @usleep(i32 1000)
%10 = tail call i32 @fillRoundRect(i16 signext 6, i16 signext 6, i32 116, i32 20, i32 8, i16 signext 0)
%11 = tail call i32 (...) @Display()
%12 = tail call i32 @usleep(i32 1000)
%13 = tail call i32 @fillRoundRect(i16 signext 8, i16 signext 8, i32 112, i32 16, i32 8, i16 signext 1)
%14 = tail call i32 (...) @Display()
%15 = tail call i32 @usleep(i32 1000)
%16 = tail call i32 @fillRoundRect(i16 signext 10, i16 signext 10, i32 108, i32 12, i32 8, i16 signext 0)
%17 = tail call i32 (...) @Display()
%18 = tail call i32 @usleep(i32 1000)
%19 = tail call i32 @fillRoundRect(i16 signext 12, i16 signext 12, i32 104, i32 8, i32 8, i16 signext 1)
%20 = tail call i32 (...) @Display()
%21 = tail call i32 @usleep(i32 1000)
ret void
}