#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 scanf(char *, int *);
int main() {
  int x, y, n, m;
  for (m = y = 0 * scanf("%d", &n); y < n; y++, printf("\n")) {
    for (x = 0; x < y; x++, printf("  "))
      ;
    for (x = y; x < n; x++, printf("%d ", ++m))
      ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x0,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e5 <main+0xc5>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1188 <main+0x68>
jmp    116c <main+0x4c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115b <main+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c4 <main+0xa4>
jmp    119f <main+0x7f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118e <main+0x6e>
jmp    11c9 <main+0xa9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1148 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x20,%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
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11ca <main+0x9a>
lea    0xeaa(%rip),%r14
lea    0xea0(%rip),%r15
xor    %ebp,%ebp
xor    %r12d,%r12d
jmp    1187 <main+0x57>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
cmp    %eax,%r12d
jge    11ca <main+0x9a>
mov    %r12d,%ebx
test   %r12d,%r12d
je     11a3 <main+0x73>
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1190 <main+0x60>
mov    0xc(%rsp),%eax
mov    %r12d,%ebx
cmp    %eax,%r12d
jge    1170 <main+0x40>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    0xc(%rsp),%ebx
jl     11b0 <main+0x80>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [4 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 sgt i32 %4, 0
br i1 %5, label %6, label %35
6: ; preds = %0, %29
%7 = phi i32 [ %33, %29 ], [ %4, %0 ]
%8 = phi i32 [ %30, %29 ], [ 0, %0 ]
%9 = phi i32 [ %31, %29 ], [ 0, %0 ]
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %16
11: ; preds = %16
%12 = load i32, i32* %1
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %12, %11 ], [ %7, %6 ]
%15 = icmp slt i32 %9, %14
br i1 %15, label %21, label %29
16: ; preds = %6, %16
%17 = phi i32 [ %18, %16 ], [ 0, %6 ]
%18 = add nuw nsw i32 %17, 1
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32 %18, %9
br i1 %20, label %11, label %16
21: ; preds = %13, %21
%22 = phi i32 [ %25, %21 ], [ %8, %13 ]
%23 = phi i32 [ %24, %21 ], [ %9, %13 ]
%24 = add nuw nsw i32 %23, 1
%25 = add nsw i32 %22, 1
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
%28 = icmp slt i32 %24, %27
br i1 %28, label %21, label %29
29: ; preds = %21, %13
%30 = phi i32 [ %8, %13 ], [ %25, %21 ]
%31 = add nuw nsw i32 %9, 1
%32 = call i32 @putchar(i32 10)
%33 = load i32, i32* %1
%34 = icmp slt i32 %31, %33
br i1 %34, label %6, label %35
35: ; preds = %29, %0
ret i32 0
}