#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 i = 0;
  int j = 0;
  int s = 0;
  scanf("%i", &s);
  for (i = 0; i < s; i++) {
    printf("*");
  }
  printf("\n");
  for (i = 0; i < (s - 2); i++) {
    printf("*");
    for (j = 0; j < (s - 2); j++) {
      printf(" ");
    }
    printf("*\n");
  }
  for (i = 0; i < s; i++) {
    printf("*");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1181 <main+0x61>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x3b>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11fd <main+0xdd>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11e3 <main+0xc3>
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <main+0x98>
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1194 <main+0x74>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    122a <main+0x10a>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1204 <main+0xe4>
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1173 <main+0x43>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
jl     11ea <main+0xba>
xor    %ebp,%ebp
lea    0xe74(%rip),%r14
jmp    11b6 <main+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
lea    -0x2(%rax),%ecx
cmp    %ecx,%ebp
jge    11ea <main+0xba>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmpl   $0x3,0xc(%rsp)
jl     11a0 <main+0x70>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jl     11d0 <main+0xa0>
jmp    11a0 <main+0x70>
test   %eax,%eax
jle    1203 <main+0xd3>
xor    %ebx,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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