#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 */
typedef int /*<<< orphan*/ block_line;
typedef int /*<<< orphan*/ block;

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char block = '#';
  char block_line[7];
  int pyramid_height = sizeof(block_line);
  int increment = sizeof(block);
  int step = 0;
  for (; step < pyramid_height; step += increment) {
    block_line[step] = block;
    printf("%s\n", block_line);
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x23,-0x5(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117d <main+0x5d>
mov    -0x5(%rbp),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0xc(%rbp,%rax,1)
lea    -0xc(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <main+0x28>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x23,0x1(%rsp)
lea    0xed0(%rip),%rbx
lea    0x1(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x2(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x3(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x4(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x5(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x6(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movb   $0x23,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
store i8 35, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 1
store i8 35, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 2
store i8 35, i8* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 3
store i8 35, i8* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 4
store i8 35, i8* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 5
store i8 35, i8* %12
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 6
store i8 35, i8* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%16 = call i32 (...) @getchar()
ret i32 0
}