#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 j = 0;
  int spaces = 0;
  int steps = 0;
  int step = 0;
  while (steps < 5) {
    j = spaces * 4;
    while (j--) {
      printf(" ");
    }
    if (step < 2) {
      printf("|");
      step++;
      if (!(step % 2)) {
        printf("____\n");
        spaces++;
        step = 0;
        steps++;
      } else {
        printf("\n");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11e6 <main+0xd6>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1173 <main+0x63>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <main+0x3e>
cmpl   $0x2,-0x14(%rbp)
jge    11e1 <main+0xd1>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d0 <main+0xc0>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11dc <main+0xcc>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xd1>
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
lea    0xecf(%rip),%r14
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    114b <main+0x2b>
nopl   0x0(%rax)
mov    $0x2,%ebp
cmp    $0x5,%r15d
jge    11a6 <main+0x86>
test   %r12d,%r12d
je     116e <main+0x4e>
lea    0x0(,%r12,4),%ebx
neg    %ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
inc    %ebx
jne    1160 <main+0x40>
cmp    $0x1,%ebp
jg     1140 <main+0x20>
mov    $0x7c,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
test   $0x1,%bpl
je     1192 <main+0x72>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1145 <main+0x25>
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0x1,%r12d
add    $0x1,%r15d
xor    %ebp,%ebp
jmp    1145 <main+0x25>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [6 x i8] c"____\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %37, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %38
9: ; preds = %6
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 4
store i32 %11, i32* %2
br label %12
12: ; preds = %16, %9
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
%15 = icmp ne i32 %13, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
18: ; preds = %12
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 2
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = srem i32 %25, 2
%27 = icmp ne i32 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %21
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
store i32 0, i32* %5
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %36
34: ; preds = %21
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %34, %28
br label %37
37: ; preds = %36, %18
br label %6
38: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"____\00"
define i32 @main() {
br label %1
1: ; preds = %0, %26
%2 = phi i32 [ 0, %0 ], [ %29, %26 ]
%3 = phi i32 [ 0, %0 ], [ %28, %26 ]
%4 = phi i32 [ 0, %0 ], [ %27, %26 ]
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = shl nsw i32 %4, 2
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %10, %8 ], [ %7, %6 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 @putchar(i32 32)
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %1
%14 = icmp slt i32 %2, 2
br i1 %14, label %15, label %26
15: ; preds = %13
%16 = tail call i32 @putchar(i32 124)
%17 = add nsw i32 %2, 1
%18 = and i32 %17, 1
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%22 = add nsw i32 %4, 1
%23 = add nsw i32 %3, 1
br label %26
24: ; preds = %15
%25 = tail call i32 @putchar(i32 10)
br label %26
26: ; preds = %20, %24, %13
%27 = phi i32 [ %4, %24 ], [ %22, %20 ], [ %4, %13 ]
%28 = phi i32 [ %3, %24 ], [ %23, %20 ], [ %3, %13 ]
%29 = phi i32 [ %17, %24 ], [ 0, %20 ], [ 2, %13 ]
%30 = icmp slt i32 %28, 5
br i1 %30, label %1, label %31
31: ; preds = %26
ret i32 0
}