#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0, n = 5;
  char *stars = (char *)calloc(sizeof(char), n * 2 + 1);
  char *spaces = (char *)calloc(sizeof(char), n);
  memset(stars, '*', n * 2);
  stars[n * 2 - 1] = '\n';
  memset(spaces, ' ', n - 1);
  for (i = 1; i < n * 2; i++) {
    int yildiz = i <= n ? i : 2 * n - i;
    printf(&spaces[yildiz - 1]);
    printf(&stars[(n * 2) - (2 * yildiz)]);
  }
  free(stars);
  free(spaces);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    $0x1,%edi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1060 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    $0x2a,%esi
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    $0x20,%esi
call   1050 <memset@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1240 <main+0x100>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11f0 <main+0xb0>
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11fc <main+0xbc>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cltq
add    %rax,%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
cltq
add    %rax,%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c8 <main+0x88>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%edi
mov    $0xb,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
mov    $0x1,%edi
mov    $0x5,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x2a,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movb   $0xa,0x9(%r14)
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0x8(%r14),%rdi
mov    %rdi,0x10(%rsp)
call   1040 <printf@plt>
lea    0x1(%rbx),%rdi
mov    %rdi,0x8(%rsp)
call   1040 <printf@plt>
lea    0x6(%r14),%rdi
mov    %rdi,(%rsp)
call   1040 <printf@plt>
lea    0x2(%rbx),%rbp
mov    %rbp,%rdi
call   1040 <printf@plt>
lea    0x4(%r14),%r15
mov    %r15,%rdi
call   1040 <printf@plt>
lea    0x3(%rbx),%r12
mov    %r12,%rdi
call   1040 <printf@plt>
lea    0x2(%r14),%r13
mov    %r13,%rdi
call   1040 <printf@plt>
lea    0x4(%rbx),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%rdi
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 5, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 2
%9 = add nsw i32 %8, 1
%10 = call i64 @calloc(i32 1, i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i32, i32* %3
%13 = call i64 @calloc(i32 1, i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %4
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, 2
%18 = call i32 @memset(i8* %15, i8 signext 42, i32 %17)
%19 = load i8*, i8** %4
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, 2
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %19, i64 %23
store i8 10, i8* %24
%25 = load i8*, i8** %5
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
%28 = call i32 @memset(i8* %25, i8 signext 32, i32 %27)
store i32 1, i32* %2
br label %29
29: ; preds = %62, %0
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = mul nsw i32 %31, 2
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %65
34: ; preds = %29
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load i32, i32* %2
br label %45
40: ; preds = %34
%41 = load i32, i32* %3
%42 = mul nsw i32 2, %41
%43 = load i32, i32* %2
%44 = sub nsw i32 %42, %43
br label %45
45: ; preds = %40, %38
%46 = phi i32 [ %39, %38 ], [ %44, %40 ]
store i32 %46, i32* %6
%47 = load i8*, i8** %5
%48 = load i32, i32* %6
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %47, i64 %50
%52 = call i32 @printf(i8* %51)
%53 = load i8*, i8** %4
%54 = load i32, i32* %3
%55 = mul nsw i32 %54, 2
%56 = load i32, i32* %6
%57 = mul nsw i32 2, %56
%58 = sub nsw i32 %55, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %53, i64 %59
%61 = call i32 @printf(i8* %60)
br label %62
62: ; preds = %45
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
br label %29
65: ; preds = %29
%66 = load i8*, i8** %4
%67 = call i32 @free(i8* %66)
%68 = load i8*, i8** %5
%69 = call i32 @free(i8* %68)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @calloc(i32 1, i32 11)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @calloc(i32 1, i32 5)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memset(i8* %2, i8 signext 42, i32 10)
%6 = getelementptr inbounds i8, i8* %2, i64 9
store i8 10, i8* %6
%7 = tail call i32 @memset(i8* %4, i8 signext 32, i32 4)
%8 = tail call i32 @printf(i8* dereferenceable(1) %4)
%9 = getelementptr inbounds i8, i8* %2, i64 8
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = tail call i32 @printf(i8* dereferenceable(1) %11)
%13 = getelementptr inbounds i8, i8* %2, i64 6
%14 = tail call i32 @printf(i8* dereferenceable(1) %13)
%15 = getelementptr inbounds i8, i8* %4, i64 2
%16 = tail call i32 @printf(i8* dereferenceable(1) %15)
%17 = getelementptr inbounds i8, i8* %2, i64 4
%18 = tail call i32 @printf(i8* dereferenceable(1) %17)
%19 = getelementptr inbounds i8, i8* %4, i64 3
%20 = tail call i32 @printf(i8* dereferenceable(1) %19)
%21 = getelementptr inbounds i8, i8* %2, i64 2
%22 = tail call i32 @printf(i8* dereferenceable(1) %21)
%23 = getelementptr inbounds i8, i8* %4, i64 4
%24 = tail call i32 @printf(i8* dereferenceable(1) %23)
%25 = tail call i32 @printf(i8* dereferenceable(1) %2)
%26 = tail call i32 @printf(i8* dereferenceable(1) %19)
%27 = tail call i32 @printf(i8* dereferenceable(1) %21)
%28 = tail call i32 @printf(i8* dereferenceable(1) %15)
%29 = tail call i32 @printf(i8* dereferenceable(1) %17)
%30 = tail call i32 @printf(i8* dereferenceable(1) %11)
%31 = tail call i32 @printf(i8* dereferenceable(1) %13)
%32 = tail call i32 @printf(i8* dereferenceable(1) %4)
%33 = tail call i32 @printf(i8* dereferenceable(1) %9)
%34 = tail call i32 @free(i8* %2)
%35 = tail call i32 @free(i8* %4)
ret i32 0
}