#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*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ triangleMake(int);
int main() {
  int counter = 1;
  int triangle = 1;
  while (triangle < 4) {
    triangleMake(triangle);
    triangle++;
  }
  for (int m = 0; m < 3; ++m) {
    printf(" ");
  }
  printf("|\n");
  printf("=======\n");
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    116d <main+0x3d>
mov    -0xc(%rbp),%edi
call   1050 <triangleMake@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x1d>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1198 <main+0x68>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1174 <main+0x44>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <triangleMake@plt>
mov    $0x2,%edi
call   1060 <triangleMake@plt>
mov    $0x3,%edi
call   1060 <triangleMake@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"|\00"
@str.3 = [8 x i8] c"=======\00"
define i32 @main() {
%1 = tail call i32 @triangleMake(i32 1)
%2 = tail call i32 @triangleMake(i32 2)
%3 = tail call i32 @triangleMake(i32 3)
%4 = tail call i32 @putchar(i32 32)
%5 = tail call i32 @putchar(i32 32)
%6 = tail call i32 @putchar(i32 32)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 (...) @getchar()
%10 = tail call i32 (...) @getchar()
ret i32 0
}