#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) && (contl == 1 || contl == num)) {
        printf("+ ");
      } else if (contl == 1 || contl == num) {
        printf("- ");
      } else if ((contl > 1 && contl < num) && (contc == 1 || contc == num)) {
        printf("| ");
      } else {
        printf("  ");
      }
    }
    printf("\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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     1255 <main+0x135>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     123b <main+0x11b>
cmpl   $0x1,-0x10(%rbp)
je     1187 <main+0x67>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11ae <main+0x8e>
cmpl   $0x1,-0xc(%rbp)
je     119d <main+0x7d>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11ae <main+0x8e>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    1228 <main+0x108>
cmpl   $0x1,-0xc(%rbp)
je     11c4 <main+0xa4>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11d5 <main+0xb5>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
cmpl   $0x1,-0xc(%rbp)
jle    1212 <main+0xf2>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1212 <main+0xf2>
cmpl   $0x1,-0x10(%rbp)
je     1201 <main+0xe1>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1212 <main+0xf2>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
jmp    121e <main+0xfe>
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
jmp    1228 <main+0x108>
jmp    122d <main+0x10d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <main+0x45>
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x32>
mov    0x2d84(%rip),%rax
mov    (%rax),%eax
add    $0x10,%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    1229 <main+0xf9>
mov    $0x1,%r15d
lea    0xea5(%rip),%r14
lea    0xea7(%rip),%r12
lea    0xe9a(%rip),%r13
jmp    11aa <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%ecx
mov    0x4(%rsp),%eax
cmp    %r15d,%eax
mov    %ecx,%r15d
jle    1229 <main+0xf9>
test   %eax,%eax
jle    1190 <main+0x60>
xor    %ebp,%ebp
jmp    11d0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %ebp,%eax
jle    1190 <main+0x60>
mov    %ebp,%ecx
cmp    $0x1,%r15d
sete   %bl
test   %ebp,%ebp
lea    0x1(%rcx),%ebp
sete   %dl
cmp    %eax,%ebp
sete   %cl
or     %dl,%cl
cmp    %eax,%r15d
sete   %dl
or     %bl,%dl
cmp    $0x1,%cl
jne    1220 <main+0xf0>
mov    %r14,%rdi
test   %dl,%dl
jne    11c3 <main+0x93>
cmp    $0x2,%r15d
jb     11c0 <main+0x90>
cmp    %eax,%r15d
jge    11c0 <main+0x90>
xor    $0x1,%cl
lea    0xe0b(%rip),%rdi
je     11c3 <main+0x93>
jmp    11c0 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
test   %dl,%dl
je     11c0 <main+0x90>
jmp    11c3 <main+0x93>
mov    0x2db0(%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 = %67, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %70
11: ; preds = %7
store i32 1, i32* %4
br label %12
12: ; preds = %62, %11
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %65
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 %32
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 i1 %29, label %30, label %32
30: ; preds = %26, %23
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %61
32: ; preds = %26, %19
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 1
br i1 %34, label %39, label %35
35: ; preds = %32
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %35, %32
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %60
41: ; preds = %35
%42 = load i32, i32* %3
%43 = icmp sgt i32 %42, 1
br i1 %43, label %44, label %57
44: ; preds = %41
%45 = load i32, i32* %3
%46 = load i32, i32* %2
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %57
48: ; preds = %44
%49 = load i32, i32* %4
%50 = icmp eq i32 %49, 1
br i1 %50, label %55, label %51
51: ; preds = %48
%52 = load i32, i32* %4
%53 = load i32, i32* %2
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %51, %48
%56 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %59
57: ; preds = %51, %44, %41
%58 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %59
59: ; preds = %57, %55
br label %60
60: ; preds = %59, %39
br label %61
61: ; preds = %60, %30
br label %62
62: ; preds = %61
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %12
65: ; preds = %12
%66 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %67
67: ; preds = %65
%68 = load i32, i32* %3
%69 = add nsw i32 %68, 1
store i32 %69, i32* %3
br label %7
70: ; preds = %7
%71 = load i32, i32* @EXIT_SUCCESS
ret i32 %71
}

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 %41, label %7
7: ; preds = %0, %36
%8 = phi i32 [ %39, %36 ], [ %5, %0 ]
%9 = phi i32 [ %38, %36 ], [ 1, %0 ]
%10 = icmp slt i32 %8, 1
br i1 %10, label %36, label %11
11: ; preds = %7
%12 = icmp eq i32 %9, 1
%13 = icmp ult i32 %9, 2
br label %14
14: ; preds = %11, %30
%15 = phi i32 [ %8, %11 ], [ %34, %30 ]
%16 = phi i32 [ 1, %11 ], [ %33, %30 ]
%17 = icmp eq i32 %16, 1
%18 = icmp eq i32 %16, %15
%19 = select i1 %17, i1 true, i1 %18
%20 = icmp eq i32 %9, %15
%21 = select i1 %12, i1 true, i1 %20
br i1 %19, label %22, label %23
22: ; preds = %14
br i1 %21, label %30, label %24
23: ; preds = %14
br i1 %21, label %30, label %29
24: ; preds = %22
%25 = icmp sge i32 %9, %15
%26 = select i1 %13, i1 true, i1 %25
%27 = xor i1 %19, true
%28 = select i1 %26, i1 true, i1 %27
br i1 %28, label %29, label %30
29: ; preds = %23, %24
br label %30
30: ; preds = %24, %23, %22, %29
%31 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %29 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %22 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %23 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %24 ]
%32 = call i32 @printf(i8* dereferenceable(1) %31)
%33 = add nuw nsw i32 %16, 1
%34 = load i32, i32* %1
%35 = icmp sgt i32 %34, %16
br i1 %35, label %14, label %36
36: ; preds = %30, %7
%37 = call i32 @putchar(i32 10)
%38 = add nuw nsw i32 %9, 1
%39 = load i32, i32* %1
%40 = icmp sgt i32 %39, %9
br i1 %40, label %7, label %41
41: ; preds = %36, %0
%42 = load i32, i32* @EXIT_SUCCESS
ret i32 %42
}