#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 /*<<< orphan*/ spaces(int);
void shapeD(void) {
  printf("Shape D: \n");
  int count = 1;
  int fspaces = 4;
  for (int i = 0; i < 5; i++) {
    spaces(fspaces);
    for (int j = 0; j < count; j++) {
      printf("*");
    }
    spaces(fspaces);
    count += 2;
    fspaces--;
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<shapeD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11bc <shapeD+0x9c>
mov    -0x8(%rbp),%edi
call   1040 <spaces@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1188 <shapeD+0x68>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1162 <shapeD+0x42>
mov    -0x8(%rbp),%edi
call   1040 <spaces@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <shapeD+0x29>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shapeD>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1050 <spaces@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1050 <spaces@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1050 <spaces@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1050 <spaces@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
call   1050 <spaces@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
call   1050 <spaces@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <spaces@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <spaces@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <spaces@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <spaces@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@str = [10 x i8] c"Shape D: \00"
define void @shapeD() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @spaces(i32 4)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @spaces(i32 4)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @spaces(i32 3)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @spaces(i32 3)
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @spaces(i32 2)
%13 = tail call i32 @putchar(i32 42)
%14 = tail call i32 @putchar(i32 42)
%15 = tail call i32 @putchar(i32 42)
%16 = tail call i32 @putchar(i32 42)
%17 = tail call i32 @putchar(i32 42)
%18 = tail call i32 @spaces(i32 2)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @spaces(i32 1)
%21 = tail call i32 @putchar(i32 42)
%22 = tail call i32 @putchar(i32 42)
%23 = tail call i32 @putchar(i32 42)
%24 = tail call i32 @putchar(i32 42)
%25 = tail call i32 @putchar(i32 42)
%26 = tail call i32 @putchar(i32 42)
%27 = tail call i32 @putchar(i32 42)
%28 = tail call i32 @spaces(i32 1)
%29 = tail call i32 @putchar(i32 10)
%30 = tail call i32 @spaces(i32 0)
%31 = tail call i32 @putchar(i32 42)
%32 = tail call i32 @putchar(i32 42)
%33 = tail call i32 @putchar(i32 42)
%34 = tail call i32 @putchar(i32 42)
%35 = tail call i32 @putchar(i32 42)
%36 = tail call i32 @putchar(i32 42)
%37 = tail call i32 @putchar(i32 42)
%38 = tail call i32 @putchar(i32 42)
%39 = tail call i32 @putchar(i32 42)
%40 = tail call i32 @spaces(i32 0)
%41 = tail call i32 @putchar(i32 10)
%42 = tail call i32 @putchar(i32 10)
ret void
}