#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 main() {
  int n, i, h, z;
  char simvol;
  printf("Vuvedi vid simvol\n");
  scanf("%c", &simvol);
  printf("Vuvedi broi redove\n");
  scanf("%d", &n);
  for (i = 0; i <= n; i++) {
    h = n - i;
    for (z = 0; z < n * 2; z++) {
      if (z >= h && n * 2 - 1 - z > h) {
        printf("%c", simvol);
      } else
        printf(" ");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1218 <main+0xf8>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11fc <main+0xdc>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11db <main+0xbb>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
sub    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11db <main+0xbb>
movsbl -0x15(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ee <main+0xce>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1192 <main+0x72>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x56>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb6(%rip),%rdi
xor    %r14d,%r14d
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xe97(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jns    11aa <main+0x7a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0x4(%rsp),%eax
cmp    %r14d,%eax
mov    %ecx,%r14d
jle    1180 <main+0x50>
test   %eax,%eax
jle    1190 <main+0x60>
mov    %eax,%r15d
sub    %r14d,%r15d
add    %eax,%eax
xor    %ebx,%ebx
mov    $0xffffffff,%ebp
jmp    11d5 <main+0xa5>
nop
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
add    %eax,%eax
add    $0xffffffff,%ebp
cmp    %eax,%ebx
jge    1190 <main+0x60>
mov    $0x20,%edi
cmp    %r15d,%ebx
jl     11c0 <main+0x90>
add    %ebp,%eax
cmp    %r15d,%eax
jle    11c0 <main+0x90>
movsbl 0x3(%rsp),%edi
jmp    11c0 <main+0x90>

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

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