#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 lines, counter, temp, counter2;
  printf("Input number of lines.\n");
  scanf("%d", &lines);
  for (counter = 0; counter <= lines; counter++) {
    temp = lines - counter;
    for (counter2 = 0; counter2 < lines * 2; counter2++) {
      if (counter2 >= temp && lines * 2 - 1 - counter2 > temp) {
        printf("+");
      } 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
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ea <main+0xca>
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    11d0 <main+0xb0>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11b1 <main+0x91>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
sub    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11b1 <main+0x91>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x9d>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <main+0x4e>
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x32>
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    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     11cd <main+0x9d>
xor    %r14d,%r14d
jmp    118a <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0x4(%rsp),%eax
cmp    %r14d,%eax
mov    %ecx,%r14d
jle    11cd <main+0x9d>
test   %eax,%eax
jle    1170 <main+0x40>
mov    %eax,%r15d
sub    %r14d,%r15d
add    %eax,%eax
xor    %ebx,%ebx
mov    $0xffffffff,%ebp
jmp    11ba <main+0x8a>
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
add    %eax,%eax
add    $0xffffffff,%ebp
cmp    %eax,%ebx
jge    1170 <main+0x40>
cmp    %r15d,%ebx
jl     11a0 <main+0x70>
add    %ebp,%eax
mov    $0x2b,%edi
cmp    %r15d,%eax
jle    11a0 <main+0x70>
jmp    11a5 <main+0x75>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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