#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 a, b, c;
  scanf("%d", &c);
  for (a = 1; a <= c; a++) {
    for (b = 1; b <= a; b++)
      if (a == b) {
        printf("*");
        printf("\n");
      } else
        printf(" ");
  }
  for (a = 1; a <= c; a++) {
    for (b = 1; b <= c; b++)
      if ((a + b) == c)
        printf("*");
      else
        printf(" ");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11c0 <main+0xa0>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ad <main+0x8d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    118e <main+0x6e>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    119a <main+0x7a>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x7f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x39>
jmp    11b2 <main+0x92>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     123f <main+0x11f>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1225 <main+0x105>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1206 <main+0xe6>
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11da <main+0xba>
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <main+0xa7>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1204 <main+0xe4>
mov    $0x1,%ebx
jmp    115d <main+0x3d>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    1195 <main+0x75>
mov    %ebx,%ebp
jmp    117a <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
je     1150 <main+0x30>
mov    $0x20,%edi
cmp    $0x1,%ebp
jne    1170 <main+0x50>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
jmp    1170 <main+0x50>
test   %eax,%eax
jle    1204 <main+0xe4>
mov    $0x1,%r14d
mov    $0x2,%r15d
jmp    11ce <main+0xae>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0x4(%rsp),%eax
add    $0x1,%r15d
cmp    %eax,%r14d
mov    %ecx,%r14d
jge    1204 <main+0xe4>
test   %eax,%eax
jle    11b0 <main+0x90>
xor    %ebx,%ebx
jmp    11f0 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
add    $0x1,%ebx
cmp    %eax,%ebx
jge    11b0 <main+0x90>
lea    (%r15,%rbx,1),%ecx
mov    $0x2a,%edi
cmp    %eax,%ecx
je     11e0 <main+0xc0>
mov    $0x20,%edi
jmp    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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