#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*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int l, i = 0, j = 0;
  printf("Input your width?");
  scanf("%d", &l);
  while (l > i) {
    i++;
    printf("*");
  }
  i = 0;
  while (i < l - 2) {
    i++;
    printf("\n*");
    while (j < l - 2) {
      printf(" ");
      j++;
    }
    printf("*");
    j = 0;
  }
  i = 0;
  printf("\n");
  while (l > i) {
    i++;
    printf("*");
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    118f <main+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x39>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11ff <main+0xcf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11e7 <main+0xb7>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bc <main+0x8c>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
jmp    1196 <main+0x66>
movl   $0x0,-0xc(%rbp)
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1238 <main+0x108>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xe2>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ea <main+0xaa>
xor    %ebx,%ebx
xchg   %ax,%ax
add    $0x1,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
cmp    %ebx,%eax
jg     1170 <main+0x30>
cmp    $0x3,%eax
jl     11ea <main+0xaa>
xor    %ebp,%ebp
lea    0xe82(%rip),%r14
jmp    11b5 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebp
jge    11ea <main+0xaa>
add    $0x1,%ebp
mov    %r14,%rdi
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     11a0 <main+0x60>
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+0x90>
jmp    11a0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    1213 <main+0xd3>
xor    %ebx,%ebx
nopl   (%rax)
add    $0x1,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    %ebx,0xc(%rsp)
jg     1200 <main+0xc0>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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