#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 *, ...);
void main() {
  char diamond[][5] = {{' ', ' ', '*'},
                       {' ', '*', ' ', '*'},
                       {'*', ' ', ' ', ' ', '*'},
                       {' ', '*', ' ', '*'},
                       {' ', ' ', '*'}};
  int i, j;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++)
      printf("%c", diamond[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11b3 <main+0xa3>
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    1197 <main+0x87>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115a <main+0x4a>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1149 <main+0x39>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @putchar(i32 32)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 0)
%5 = tail call i32 @putchar(i32 0)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @putchar(i32 32)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 32)
%10 = tail call i32 @putchar(i32 42)
%11 = tail call i32 @putchar(i32 0)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @putchar(i32 42)
%14 = tail call i32 @putchar(i32 32)
%15 = tail call i32 @putchar(i32 32)
%16 = tail call i32 @putchar(i32 32)
%17 = tail call i32 @putchar(i32 42)
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @putchar(i32 32)
%20 = tail call i32 @putchar(i32 42)
%21 = tail call i32 @putchar(i32 32)
%22 = tail call i32 @putchar(i32 42)
%23 = tail call i32 @putchar(i32 0)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @putchar(i32 32)
%26 = tail call i32 @putchar(i32 32)
%27 = tail call i32 @putchar(i32 42)
%28 = tail call i32 @putchar(i32 0)
%29 = tail call i32 @putchar(i32 0)
%30 = tail call i32 @putchar(i32 10)
ret void
}