#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  int contl;
  int contc;
  printf("digite um numero: ");
  scanf("%d", &num);
  for (contl = 1; num >= contl; contl++) {
    for (contc = 1; num >= contc; contc++) {
      if (contc == 1 || contc == num) {
        printf(contl == 1 || contl == num ? "+ " : "| ");
      } else {
        printf(contl == 1 || contl == num ? "- " : "  ");
      }
    }
    printf("\n");
  }
  return EXIT_SUCCESS;
}


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    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1229 <main+0x109>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     120f <main+0xef>
cmpl   $0x1,-0x10(%rbp)
je     1187 <main+0x67>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11c4 <main+0xa4>
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x11(%rbp)
je     11a2 <main+0x82>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
lea    0xe6d(%rip),%rdi
lea    0xe63(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x12(%rbp)
je     11df <main+0xbf>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%cl
lea    0xe36(%rip),%rdi
lea    0xe2c(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <main+0x45>
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x32>
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
add    $0x20,%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
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11eb <main+0xbb>
mov    $0x1,%ebp
lea    0xea6(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xe9e(%rip),%r12
lea    0xe9a(%rip),%r13
jmp    11a7 <main+0x77>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%ecx
mov    0x4(%rsp),%eax
cmp    %ebp,%eax
mov    %ecx,%ebp
jle    11eb <main+0xbb>
test   %eax,%eax
jle    1190 <main+0x60>
xor    %ecx,%ecx
nopl   (%rax)
cmp    $0x1,%ebp
sete   %dl
cmp    %eax,%ebp
sete   %bl
or     %dl,%bl
mov    %r15,%rdx
cmovne %r14,%rdx
mov    %r13,%rdi
cmovne %r12,%rdi
lea    0x1(%rcx),%ebx
cmp    %eax,%ebx
cmove  %rdx,%rdi
test   %ecx,%ecx
cmove  %rdx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    %ebx,%ecx
cmp    %ebx,%eax
jg     11b0 <main+0x80>
jmp    1190 <main+0x60>
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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