#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 a, b, c;
  scanf("%d", &c);
  for (a = 1; a <= c; a++) {
    for (b = 1; b <= c; b++) {
      if (a == c || b == c || a == 1 || b == 1 || (a + b) % 2 == 0)
        printf("*");
      else
        printf(" ");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f2 <main+0xd2>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d8 <main+0xb8>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11a8 <main+0x88>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11a8 <main+0x88>
cmpl   $0x1,-0x8(%rbp)
je     11a8 <main+0x88>
cmpl   $0x1,-0xc(%rbp)
je     11a8 <main+0x88>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b9 <main+0x99>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
jmp    11c5 <main+0xa5>
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x39>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11c9 <main+0xa9>
mov    $0x1,%ebp
mov    $0x2,%r15d
mov    $0x2a,%r14d
jmp    117b <main+0x5b>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%ecx
mov    0x4(%rsp),%eax
add    $0x1,%r15d
cmp    %eax,%ebp
mov    %ecx,%ebp
jge    11c9 <main+0xa9>
test   %eax,%eax
jle    1160 <main+0x40>
xor    %ebx,%ebx
jmp    119d <main+0x7d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
jge    1160 <main+0x40>
mov    %ebx,%ecx
lea    0x1(%rcx),%ebx
mov    $0x2a,%edi
cmp    %eax,%ebp
je     1190 <main+0x70>
test   %ecx,%ecx
je     1190 <main+0x70>
cmp    %eax,%ebx
je     1190 <main+0x70>
cmp    $0x1,%ebp
je     1190 <main+0x70>
add    %r15d,%ecx
test   $0x1,%cl
mov    $0x20,%edi
cmove  %r14d,%edi
jmp    1190 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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