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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     126d <main+0x14d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jg     11c4 <main+0xa4>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1199 <main+0x79>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11fd <main+0xdd>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <main+0xb7>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    122f <main+0x10f>
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0xe4>
cmpl   $0x0,-0x18(%rbp)
jne    1247 <main+0x127>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1253 <main+0x133>
lea    0xdbf(%rip),%rdi
call   1030 <printf@plt>
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1181 <main+0x61>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12a2 <main+0x182>
lea    0xd7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1274 <main+0x154>
lea    0xd62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jl     1248 <main+0x118>
mov    $0x1,%ebx
mov    $0x1,%r15b
xor    %r12d,%r12d
mov    $0xffffffff,%r14d
jmp    11c4 <main+0x94>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x8(%rsp),%eax
add    $0x1,%r12d
add    $0x1,%r14d
xor    %r15d,%r15d
cmp    %eax,%ebx
jge    1248 <main+0x118>
cmp    %ebx,%eax
jle    11e7 <main+0xb7>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11d0 <main+0xa0>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    %r12d,%ebp
cmp    $0x2,%ebx
jb     122f <main+0xff>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1200 <main+0xd0>
mov    %r14d,%ebp
cmp    $0x3,%ebx
jb     122f <main+0xff>
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1220 <main+0xf0>
test   $0x1,%r15b
jne    11a0 <main+0x70>
mov    $0x78,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x70>
test   %eax,%eax
jle    1277 <main+0x147>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x78,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x8(%rsp),%eax
add    %eax,%eax
cmp    %eax,%ebx
jl     1260 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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" \00"
@.str.5 = [2 x i8] c"x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, 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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = 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 %12
12: ; preds = %61, %0
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1
%16 = icmp sle i32 %13, %15
br i1 %16, label %17, label %64
17: ; preds = %12
store i32 1, i32* %5
br label %18
18: ; preds = %26, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = load i32, i32* %4
%22 = sub nsw i32 %20, %21
%23 = icmp sle i32 %19, %22
br i1 %23, label %24, label %29
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %18
29: ; preds = %18
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %5
br label %31
31: ; preds = %37, %29
%32 = load i32, i32* %5
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %31
40: ; preds = %31
store i32 1, i32* %5
br label %41
41: ; preds = %48, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %4
%44 = sub nsw i32 %43, 1
%45 = icmp slt i32 %42, %44
br i1 %45, label %46, label %51
46: ; preds = %41
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %41
51: ; preds = %41
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %59
57: ; preds = %51
%58 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %59
59: ; preds = %57, %54
%60 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59
%62 = load i32, i32* %4
%63 = add nsw i32 %62, 1
store i32 %63, i32* %4
br label %12
64: ; preds = %12
store i32 1, i32* %4
br label %65
65: ; preds = %73, %64
%66 = load i32, i32* %4
%67 = load i32, i32* %2
%68 = mul nsw i32 %67, 2
%69 = sub nsw i32 %68, 1
%70 = icmp sle i32 %66, %69
br i1 %70, label %71, label %76
71: ; preds = %65
%72 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %73
73: ; preds = %71
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %65
76: ; preds = %65
%77 = 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 sgt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %0, %46
%13 = phi i32 [ %49, %46 ], [ %10, %0 ]
%14 = phi i32 [ %51, %46 ], [ 0, %0 ]
%15 = phi i1 [ false, %46 ], [ true, %0 ]
%16 = phi i32 [ %48, %46 ], [ 1, %0 ]
%17 = icmp sgt i32 %13, %16
br i1 %17, label %21, label %28
18: ; preds = %46, %0
%19 = phi i32 [ %10, %0 ], [ %49, %46 ]
%20 = icmp sgt i32 %19, 0
br i1 %20, label %52, label %59
21: ; preds = %12, %21
%22 = phi i32 [ %24, %21 ], [ 1, %12 ]
%23 = call i32 @putchar(i32 32)
%24 = add nuw nsw i32 %22, 1
%25 = load i32, i32* %1
%26 = sub nsw i32 %25, %16
%27 = icmp slt i32 %22, %26
br i1 %27, label %21, label %28
28: ; preds = %21, %12
%29 = call i32 @putchar(i32 120)
%30 = icmp ugt i32 %16, 1
br i1 %30, label %33, label %43
31: ; preds = %33
%32 = icmp ugt i32 %16, 2
br i1 %32, label %38, label %43
33: ; preds = %28, %33
%34 = phi i32 [ %36, %33 ], [ 1, %28 ]
%35 = call i32 @putchar(i32 32)
%36 = add nuw nsw i32 %34, 1
%37 = icmp eq i32 %36, %16
br i1 %37, label %31, label %33
38: ; preds = %31, %38
%39 = phi i32 [ %41, %38 ], [ 1, %31 ]
%40 = call i32 @putchar(i32 32)
%41 = add nuw nsw i32 %39, 1
%42 = icmp eq i32 %41, %14
br i1 %42, label %43, label %38
43: ; preds = %38, %28, %31
br i1 %15, label %46, label %44
44: ; preds = %43
%45 = call i32 @putchar(i32 120)
br label %46
46: ; preds = %43, %44
%47 = call i32 @putchar(i32 10)
%48 = add nuw nsw i32 %16, 1
%49 = load i32, i32* %1
%50 = icmp slt i32 %48, %49
%51 = add nuw nsw i32 %14, 1
br i1 %50, label %12, label %18
52: ; preds = %18, %52
%53 = phi i32 [ %55, %52 ], [ 1, %18 ]
%54 = call i32 @putchar(i32 120)
%55 = add nuw nsw i32 %53, 1
%56 = load i32, i32* %1
%57 = shl nsw i32 %56, 1
%58 = icmp slt i32 %55, %57
br i1 %58, label %52, label %59
59: ; preds = %52, %18
%60 = call i32 @putchar(i32 10)
ret i32 0
}