#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_s(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int i, j, length;
  printf("Enter length: ");
  scanf_s("%d", &length);
  for (i = 0; i < length; i++) {
    for (j = 0; j < length; j++) {
      if ((i > 0 && i < length - 1) && (j > 0 && j < length - 1) && (i != j)) {
        printf(" ");
      } else
        printf("*");
    }
    printf("\n");
  }
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf_s@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    120d <main+0xdd>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11f3 <main+0xc3>
cmpl   $0x0,-0x8(%rbp)
jle    11d4 <main+0xa4>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11d4 <main+0xa4>
cmpl   $0x0,-0xc(%rbp)
jle    11d4 <main+0xa4>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11d4 <main+0xa4>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11d4 <main+0xa4>
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
jmp    11e0 <main+0xb0>
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
jmp    11e5 <main+0xb5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x45>
lea    0xe1a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x32>
lea    0xe02(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf_s@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11c3 <main+0x83>
xor    %ebx,%ebx
jmp    1185 <main+0x45>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
jge    11c3 <main+0x83>
test   %eax,%eax
jle    1170 <main+0x30>
xor    %ebp,%ebp
jmp    11a5 <main+0x65>
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jge    1170 <main+0x30>
test   %ebx,%ebx
je     1190 <main+0x50>
add    $0xffffffff,%eax
cmp    %eax,%ebx
jge    1190 <main+0x50>
test   %ebp,%ebp
je     1190 <main+0x50>
cmp    %eax,%ebp
jge    1190 <main+0x50>
mov    $0x20,%edi
cmp    %ebp,%ebx
jne    1195 <main+0x55>
jmp    1190 <main+0x50>
lea    0xe48(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Enter length: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %37
7: ; preds = %0, %32
%8 = phi i32 [ %35, %32 ], [ %5, %0 ]
%9 = phi i32 [ %34, %32 ], [ 0, %0 ]
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %32
11: ; preds = %7
%12 = icmp eq i32 %9, 0
br label %13
13: ; preds = %11, %26
%14 = phi i32 [ %8, %11 ], [ %30, %26 ]
%15 = phi i32 [ 0, %11 ], [ %29, %26 ]
br i1 %12, label %25, label %16
16: ; preds = %13
%17 = add nsw i32 %14, -1
%18 = icmp sge i32 %9, %17
%19 = icmp eq i32 %15, 0
%20 = select i1 %18, i1 true, i1 %19
%21 = icmp sge i32 %15, %17
%22 = select i1 %20, i1 true, i1 %21
%23 = icmp eq i32 %9, %15
%24 = select i1 %22, i1 true, i1 %23
br i1 %24, label %25, label %26
25: ; preds = %16, %13
br label %26
26: ; preds = %16, %25
%27 = phi i32 [ 42, %25 ], [ 32, %16 ]
%28 = call i32 @putchar(i32 %27)
%29 = add nuw nsw i32 %15, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %29, %30
br i1 %31, label %13, label %32
32: ; preds = %26, %7
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %9, 1
%35 = load i32, i32* %1
%36 = icmp slt i32 %34, %35
br i1 %36, label %7, label %37
37: ; preds = %32, %0
%38 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}