#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 v;
  printf("Visina?");
  scanf("%d", &v);
  int niz[v], i;
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("*");
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("%d ", j + 1);
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("%c ", 'A' + j);
    printf("\n");
  }
  printf("\n");
  int k = 1;
  for (i = 0; i <= v; i++) {
    int j;
    for (j = 0; j <= i; ++j) {
      printf("%2d ", k++);
    }
    printf("\n");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b9 <main+0x99>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     119d <main+0x7d>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1175 <main+0x55>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1162 <main+0x42>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122b <main+0x10b>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     120f <main+0xef>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e1 <main+0xc1>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ce <main+0xae>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    129d <main+0x17d>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1281 <main+0x161>
mov    -0x28(%rbp),%esi
add    $0x41,%esi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1253 <main+0x133>
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1240 <main+0x120>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     131b <main+0x1fb>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     12ff <main+0x1df>
mov    -0x2c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12cc <main+0x1ac>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b9 <main+0x199>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r15
cmpl   $0x0,0x4(%rsp)
jle    11a7 <main+0x77>
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
add    $0x1,%ebx
cmp    0x4(%rsp),%r14d
jl     1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1216 <main+0xe6>
lea    0xe4c(%rip),%r14
xor    %ebp,%ebp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0xffffffff,%ebp
cmp    0x4(%rsp),%r12d
jl     11d0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1286 <main+0x156>
mov    $0xffffffff,%r12d
lea    0xddb(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x41,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x41,%eax
jne    1250 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    $0xffffffff,%r12d
cmp    0x4(%rsp),%ebp
jl     1240 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
js     12f4 <main+0x1c4>
mov    $0x1,%r13d
lea    0xd6f(%rip),%r14
mov    $0x1,%ebp
xor    %r12d,%r12d
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    12c0 <main+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
add    %ebp,%r13d
add    $0x1,%ebp
cmp    0x4(%rsp),%r12d
mov    %eax,%r12d
jl     12b0 <main+0x180>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Visina?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [4 x i8] c"%c \00"
@.str.6 = [5 x i8] c"%2d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 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* %2)
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %3
%16 = alloca i32, i64 %14
store i64 %14, i64* %4
store i32 0, i32* %5
br label %17
17: ; preds = %33, %0
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %36
21: ; preds = %17
store i32 0, i32* %6
br label %22
22: ; preds = %28, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %22
31: ; preds = %22
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %17
36: ; preds = %17
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %38
38: ; preds = %56, %36
%39 = load i32, i32* %5
%40 = load i32, i32* %2
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %59
42: ; preds = %38
store i32 0, i32* %7
br label %43
43: ; preds = %51, %42
%44 = load i32, i32* %7
%45 = load i32, i32* %5
%46 = icmp sle i32 %44, %45
br i1 %46, label %47, label %54
47: ; preds = %43
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %47
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %43
54: ; preds = %43
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %56
56: ; preds = %54
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %38
59: ; preds = %38
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %61
61: ; preds = %79, %59
%62 = load i32, i32* %5
%63 = load i32, i32* %2
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %82
65: ; preds = %61
store i32 0, i32* %8
br label %66
66: ; preds = %74, %65
%67 = load i32, i32* %8
%68 = load i32, i32* %5
%69 = icmp sle i32 %67, %68
br i1 %69, label %70, label %77
70: ; preds = %66
%71 = load i32, i32* %8
%72 = add nsw i32 65, %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %70
%75 = load i32, i32* %8
%76 = add nsw i32 %75, 1
store i32 %76, i32* %8
br label %66
77: ; preds = %66
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %79
79: ; preds = %77
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
br label %61
82: ; preds = %61
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %9
store i32 0, i32* %5
br label %84
84: ; preds = %102, %82
%85 = load i32, i32* %5
%86 = load i32, i32* %2
%87 = icmp sle i32 %85, %86
br i1 %87, label %88, label %105
88: ; preds = %84
store i32 0, i32* %10
br label %89
89: ; preds = %97, %88
%90 = load i32, i32* %10
%91 = load i32, i32* %5
%92 = icmp sle i32 %90, %91
br i1 %92, label %93, label %100
93: ; preds = %89
%94 = load i32, i32* %9
%95 = add nsw i32 %94, 1
store i32 %95, i32* %9
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %94)
br label %97
97: ; preds = %93
%98 = load i32, i32* %10
%99 = add nsw i32 %98, 1
store i32 %99, i32* %10
br label %89
100: ; preds = %89
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %102
102: ; preds = %100
%103 = load i32, i32* %5
%104 = add nsw i32 %103, 1
store i32 %104, i32* %5
br label %84
105: ; preds = %84
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
%107 = load i8*, i8** %3
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
@.str = [8 x i8] c"Visina?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [4 x i8] c"%c \00"
@.str.6 = [5 x i8] c"%2d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i8* @llvm.stacksave()
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %0, %16
%9 = phi i32 [ %21, %16 ], [ 1, %0 ]
%10 = phi i32 [ %18, %16 ], [ 0, %0 ]
br label %11
11: ; preds = %8, %11
%12 = phi i32 [ 0, %8 ], [ %14, %11 ]
%13 = call i32 @putchar(i32 42)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, %9
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = call i32 @putchar(i32 10)
%18 = add nuw nsw i32 %10, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
%21 = add nuw i32 %9, 1
br i1 %20, label %8, label %22
22: ; preds = %16, %0
%23 = call i32 @putchar(i32 10)
%24 = load i32, i32* %1
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %40
26: ; preds = %22, %34
%27 = phi i32 [ %39, %34 ], [ 1, %22 ]
%28 = phi i32 [ %36, %34 ], [ 0, %22 ]
br label %29
29: ; preds = %26, %29
%30 = phi i32 [ 0, %26 ], [ %31, %29 ]
%31 = add nuw nsw i32 %30, 1
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = icmp eq i32 %31, %27
br i1 %33, label %34, label %29
34: ; preds = %29
%35 = call i32 @putchar(i32 10)
%36 = add nuw nsw i32 %28, 1
%37 = load i32, i32* %1
%38 = icmp slt i32 %36, %37
%39 = add nuw i32 %27, 1
br i1 %38, label %26, label %40
40: ; preds = %34, %22
%41 = call i32 @putchar(i32 10)
%42 = load i32, i32* %1
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %59
44: ; preds = %40, %53
%45 = phi i32 [ %58, %53 ], [ 1, %40 ]
%46 = phi i32 [ %55, %53 ], [ 0, %40 ]
br label %47
47: ; preds = %44, %47
%48 = phi i32 [ 0, %44 ], [ %51, %47 ]
%49 = add nuw nsw i32 %48, 65
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %49)
%51 = add nuw nsw i32 %48, 1
%52 = icmp eq i32 %51, %45
br i1 %52, label %53, label %47
53: ; preds = %47
%54 = call i32 @putchar(i32 10)
%55 = add nuw nsw i32 %46, 1
%56 = load i32, i32* %1
%57 = icmp slt i32 %55, %56
%58 = add nuw i32 %45, 1
br i1 %57, label %44, label %59
59: ; preds = %53, %40
%60 = call i32 @putchar(i32 10)
%61 = load i32, i32* %1
%62 = icmp slt i32 %61, 0
br i1 %62, label %79, label %63
63: ; preds = %59, %73
%64 = phi i32 [ %78, %73 ], [ 1, %59 ]
%65 = phi i32 [ %67, %73 ], [ 1, %59 ]
%66 = phi i32 [ %75, %73 ], [ 0, %59 ]
%67 = add i32 %65, %64
br label %68
68: ; preds = %63, %68
%69 = phi i32 [ %65, %63 ], [ %70, %68 ]
%70 = add i32 %69, 1
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %69)
%72 = icmp eq i32 %70, %67
br i1 %72, label %73, label %68
73: ; preds = %68
%74 = call i32 @putchar(i32 10)
%75 = add nuw nsw i32 %66, 1
%76 = load i32, i32* %1
%77 = icmp slt i32 %66, %76
%78 = add nuw i32 %64, 1
br i1 %77, label %63, label %79
79: ; preds = %73, %59
%80 = call i32 @putchar(i32 10)
ret i32 0
}