#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, x, y;
  printf("Enter X:");
  scanf_s("%d", &x);
  printf("Enter Y:");
  scanf_s("%d", &y);
  for (i = 0; i < y; i++) {
    for (j = 0; j < x; j++) {
      if ((i > 0 && i < y - 1) && (j > 0 && j < x - 1)) {
        printf(" ");
      } else
        printf("*");
    }
    printf("\n");
  }
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf_s@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf_s@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121d <main+0xed>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1203 <main+0xd3>
cmpl   $0x0,-0x8(%rbp)
jle    11e4 <main+0xb4>
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11e4 <main+0xb4>
cmpl   $0x0,-0xc(%rbp)
jle    11e4 <main+0xb4>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11e4 <main+0xb4>
lea    0xe3b(%rip),%rdi
call   1040 <printf@plt>
jmp    11f0 <main+0xc0>
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
jmp    11f5 <main+0xc5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <main+0x61>
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x4e>
lea    0xdf7(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb3(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf_s@plt>
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf_s@plt>
cmpl   $0x0,(%rsp)
jle    11e5 <main+0xa5>
xor    %ebx,%ebx
jmp    11a2 <main+0x62>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jge    11e5 <main+0xa5>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1190 <main+0x50>
xor    %ebp,%ebp
jmp    11c5 <main+0x85>
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jge    1190 <main+0x50>
test   %ebx,%ebx
je     11b0 <main+0x70>
mov    (%rsp),%ecx
add    $0xffffffff,%ecx
cmp    %ecx,%ebx
jge    11b0 <main+0x70>
test   %ebp,%ebp
je     11b0 <main+0x70>
add    $0xffffffff,%eax
mov    $0x20,%edi
cmp    %eax,%ebp
jl     11b5 <main+0x75>
jmp    11b0 <main+0x70>
lea    0xe29(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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