#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 main(int argc, char *argv[]) {
  int line = 0;
  int count = 0;
  int width = 5;
start:
  if (line == 0)
    goto drawTopLine;
  else if (line < width - 1)
    goto drawMiddleLine;
  else
    goto drawBottomLine;
drawTopLine:
  if (count < width)
    goto star;
  else
    goto newline;
drawMiddleLine:
  if (count < width) {
    if (count == 0 || count == width - 1)
      goto star;
    else
      goto space;
  } else
    goto newline;
drawBottomLine:
  if (line == width)
    goto end;
  if (count < width)
    goto star;
  else
    goto newline;
star:
  printf("*");
  count++;
  goto start;
space:
  printf(" ");
  count++;
  goto start;
newline:
  printf("\n");
  line++;
  count = 0;
  goto start;
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x5,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114a <main+0x3a>
jmp    1165 <main+0x55>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1160 <main+0x50>
jmp    117b <main+0x6b>
jmp    11b1 <main+0xa1>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1176 <main+0x66>
jmp    11d8 <main+0xc8>
jmp    120c <main+0xfc>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11ac <main+0x9c>
cmpl   $0x0,-0x18(%rbp)
je     11a2 <main+0x92>
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11a7 <main+0x97>
jmp    11d8 <main+0xc8>
jmp    11f2 <main+0xe2>
jmp    120c <main+0xfc>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11c2 <main+0xb2>
jmp    122d <main+0x11d>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d3 <main+0xc3>
jmp    11d8 <main+0xc8>
jmp    120c <main+0xfc>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <main+0x2b>
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <main+0x2b>
lea    0xdf1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    $0x2a,%r14d
jmp    112d <main+0x1d>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
xor    %ebp,%ebp
jmp    1148 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%ebp
test   %ebx,%ebx
je     1170 <main+0x60>
cmp    $0x4,%ebx
jb     1180 <main+0x70>
cmp    $0x5,%ebx
je     1196 <main+0x86>
mov    $0x2a,%edi
cmp    $0x4,%ebp
jbe    1140 <main+0x30>
jmp    1120 <main+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
cmp    $0x5,%ebp
jb     1140 <main+0x30>
jmp    1120 <main+0x10>
nopl   0x0(%rax)
cmp    $0x4,%ebp
ja     1120 <main+0x10>
test   $0x7ffffffb,%ebp
mov    $0x20,%edi
cmove  %r14d,%edi
jmp    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %26, %2
%4 = phi i32 [ %28, %26 ], [ 0, %2 ]
%5 = icmp eq i32 %4, 0
%6 = icmp ult i32 %4, 4
%7 = icmp eq i32 %4, 5
br label %8
8: ; preds = %22, %3
%9 = phi i32 [ 0, %3 ], [ %25, %22 ]
br i1 %5, label %11, label %10
10: ; preds = %8
br i1 %6, label %13, label %19
11: ; preds = %8
%12 = icmp ult i32 %9, 5
br i1 %12, label %22, label %26
13: ; preds = %10
%14 = icmp ult i32 %9, 5
br i1 %14, label %15, label %26
15: ; preds = %13
%16 = and i32 %9, 2147483643
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 42, i32 32
br label %22
19: ; preds = %10
br i1 %7, label %29, label %20
20: ; preds = %19
%21 = icmp ult i32 %9, 5
br i1 %21, label %22, label %26
22: ; preds = %11, %20, %15
%23 = phi i32 [ %18, %15 ], [ 42, %20 ], [ 42, %11 ]
%24 = tail call i32 @putchar(i32 %23)
%25 = add nuw nsw i32 %9, 1
br label %8
26: ; preds = %20, %13, %11
%27 = tail call i32 @putchar(i32 10)
%28 = add nuw nsw i32 %4, 1
br label %3
29: ; preds = %19
ret i32 0
}