#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*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  printf(" ? lines: ");
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = n - i; j > 0; j--)
      printf(" ");
    for (int j = 0; j < i; j++)
      printf("*");
    for (int j = 0; j < i - 1; j++)
      printf("*");
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     120b <main+0xeb>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1192 <main+0x72>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11bf <main+0x9f>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1199 <main+0x79>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11f1 <main+0xd1>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c6 <main+0xa6>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1159 <main+0x39>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    1204 <main+0xd4>
mov    $0x1,%r12d
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    11a3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
mov    0xc(%rsp),%ebp
add    $0x1,%r15d
add    $0xffffffff,%r14d
cmp    %r12d,%ebp
mov    %eax,%r12d
jle    1204 <main+0xd4>
mov    %r12d,%ebx
cmp    %r12d,%ebp
jle    11d0 <main+0xa0>
add    %r14d,%ebp
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11b0 <main+0x80>
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0xa0>
mov    %r15d,%ebx
cmp    $0x2,%r12d
jb     1180 <main+0x50>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11f0 <main+0xc0>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c" ? lines: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %29, %2
ret i32 0
10: ; preds = %2, %29
%11 = phi i32 [ %34, %29 ], [ 0, %2 ]
%12 = phi i32 [ %32, %29 ], [ %7, %2 ]
%13 = phi i32 [ %31, %29 ], [ 1, %2 ]
%14 = sub nsw i32 %12, %13
%15 = icmp sgt i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %17, %10
br label %24
17: ; preds = %10, %17
%18 = phi i32 [ %20, %17 ], [ %14, %10 ]
%19 = call i32 @putchar(i32 32)
%20 = add nsw i32 %18, -1
%21 = icmp ugt i32 %18, 1
br i1 %21, label %17, label %16
22: ; preds = %24
%23 = icmp ugt i32 %13, 1
br i1 %23, label %35, label %29
24: ; preds = %16, %24
%25 = phi i32 [ %27, %24 ], [ 0, %16 ]
%26 = call i32 @putchar(i32 42)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, %13
br i1 %28, label %22, label %24
29: ; preds = %35, %22
%30 = call i32 @putchar(i32 10)
%31 = add nuw nsw i32 %13, 1
%32 = load i32, i32* %3
%33 = icmp sgt i32 %32, %13
%34 = add nuw nsw i32 %11, 1
br i1 %33, label %10, label %9
35: ; preds = %22, %35
%36 = phi i32 [ %38, %35 ], [ 0, %22 ]
%37 = call i32 @putchar(i32 42)
%38 = add nuw nsw i32 %36, 1
%39 = icmp eq i32 %38, %11
br i1 %39, label %29, label %35
}