#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 fun03(int n) {
  int i, j;
  for (i = 0; i < n; i++) {
    int esp = n - (i + 1);
    int ast = n - esp;
    for (j = 0; j < esp; j++) {
      printf(" ");
    }
    for (j = 0; j < ast; j++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<fun03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b9 <fun03+0xa9>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1172 <fun03+0x62>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <fun03+0x3c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119f <fun03+0x8f>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <fun03+0x69>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <fun03+0x12>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun03>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1181 <fun03+0x71>
mov    %edi,%r14d
xor    %r15d,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    %r14d,%r15d
jge    1151 <fun03+0x41>
mov    %r14d,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    1140 <fun03+0x30>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1160 <fun03+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    %r14d,%r15d
jne    1130 <fun03+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fun03(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1, %21
%4 = phi i32 [ %23, %21 ], [ 1, %1 ]
%5 = phi i32 [ %7, %21 ], [ %0, %1 ]
%6 = phi i32 [ %8, %21 ], [ 0, %1 ]
%7 = add i32 %5, -1
%8 = add nuw nsw i32 %6, 1
%9 = icmp slt i32 %8, %0
br i1 %9, label %10, label %15
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 @putchar(i32 32)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %7
br i1 %14, label %15, label %10
15: ; preds = %10, %3
br label %16
16: ; preds = %15, %16
%17 = phi i32 [ %19, %16 ], [ 0, %15 ]
%18 = tail call i32 @putchar(i32 42)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, %4
br i1 %20, label %21, label %16
21: ; preds = %16
%22 = tail call i32 @putchar(i32 10)
%23 = add nuw i32 %4, 1
%24 = icmp eq i32 %8, %0
br i1 %24, label %25, label %3
25: ; preds = %21, %1
ret i32 0
}