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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a0 <main+0x80>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <main+0x5a>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1228 <main+0x108>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1202 <main+0xe2>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <main+0xb7>
lea    0xe04(%rip),%rdi
call   1030 <printf@plt>
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b3 <main+0x93>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1255 <main+0x135>
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    122f <main+0x10f>
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,(%rsp)
jle    1192 <main+0x62>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    $0x78,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
cmp    $0x3,%eax
jge    11d5 <main+0xa5>
test   %eax,%eax
jle    11c2 <main+0x92>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x78,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     11b0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%ebx
jmp    1203 <main+0xd3>
nopl   0x0(%rax)
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    (%rsp),%eax
lea    -0x2(%rax),%edx
cmp    %edx,%ebx
mov    %ecx,%ebx
jge    11a4 <main+0x74>
mov    $0x78,%edi
call   1030 <putchar@plt>
cmpl   $0x3,(%rsp)
jl     11e0 <main+0xb0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
add    $0xfffffffe,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1220 <main+0xf0>
jmp    11e0 <main+0xb0>

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

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