#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*/ printf(char *);
int /*<<< orphan*/ system(char *);
void printField(int harePosition, int tortoisePosition) {
  int i;
  system("cls");
  for (i = 1; i <= 70; i++)
    printf("-");
  printf("\n");
  for (i = 1; i <= harePosition; i++)
    printf(" ");
  if (harePosition == tortoisePosition) {
    printf("OUCH!!!\n");
  } else
    printf("H\n");
  for (i = 1; i <= tortoisePosition; i++)
    printf(" ");
  printf("T\n");
  for (i = 1; i <= 70; i++)
    printf("-");
  printf("\n");
}


x86 assembly (clang, -O0):
<printField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <system@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x46,-0xc(%rbp)
jg     1165 <printField+0x45>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <printField+0x21>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     119e <printField+0x7e>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <printField+0x58>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11bb <printField+0x9b>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
jmp    11c7 <printField+0xa7>
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11f4 <printField+0xd4>
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ce <printField+0xae>
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x46,-0xc(%rbp)
jg     122b <printField+0x10b>
lea    0xdec(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1207 <printField+0xe7>
lea    0xddd(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printField>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
mov    $0x46,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <printField+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    118f <printField+0x5f>
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <printField+0x50>
cmp    %ebx,%r14d
lea    0xe6f(%rip),%rax
lea    0xe64(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    11bf <printField+0x8f>
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11b0 <printField+0x80>
lea    0xe40(%rip),%rdi
call   1040 <puts@plt>
mov    $0x46,%ebx
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <printField+0xa0>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [9 x i8] c"OUCH!!!\0A\00"
@.str.5 = [3 x i8] c"H\0A\00"
@.str.6 = [3 x i8] c"T\0A\00"
define void @printField(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 70
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %7
15: ; preds = %7
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %5
br label %17
17: ; preds = %23, %15
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %17
26: ; preds = %17
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %34
32: ; preds = %26
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
store i32 1, i32* %5
br label %35
35: ; preds = %41, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %4
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %35
44: ; preds = %35
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %5
br label %46
46: ; preds = %51, %44
%47 = load i32, i32* %5
%48 = icmp sle i32 %47, 70
br i1 %48, label %49, label %54
49: ; preds = %46
%50 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %49
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %46
54: ; preds = %46
%55 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@str = [2 x i8] c"H\00"
@str.7 = [2 x i8] c"T\00"
@str.8 = [8 x i8] c"OUCH!!!\00"
define void @printField(i32 %0, i32 %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 1, %2 ], [ %7, %4 ]
%6 = tail call i32 @putchar(i32 45)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 71
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = tail call i32 @putchar(i32 10)
%11 = icmp slt i32 %0, 1
br i1 %11, label %17, label %12
12: ; preds = %9, %12
%13 = phi i32 [ %15, %12 ], [ 1, %9 ]
%14 = tail call i32 @putchar(i32 32)
%15 = add nuw i32 %13, 1
%16 = icmp eq i32 %13, %0
br i1 %16, label %17, label %12
17: ; preds = %12, %9
%18 = icmp eq i32 %0, %1
%19 = select i1 %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
%21 = icmp slt i32 %1, 1
br i1 %21, label %27, label %22
22: ; preds = %17, %22
%23 = phi i32 [ %25, %22 ], [ 1, %17 ]
%24 = tail call i32 @putchar(i32 32)
%25 = add nuw i32 %23, 1
%26 = icmp eq i32 %23, %1
br i1 %26, label %27, label %22
27: ; preds = %22, %17
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
br label %29
29: ; preds = %27, %29
%30 = phi i32 [ 1, %27 ], [ %32, %29 ]
%31 = tail call i32 @putchar(i32 45)
%32 = add nuw nsw i32 %30, 1
%33 = icmp eq i32 %32, 71
br i1 %33, label %34, label %29
34: ; preds = %29
%35 = tail call i32 @putchar(i32 10)
ret void
}