#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++) {
    for (j = 1; j <= x - i; j++) {
      printf(" ");
    }
    for (j = 1; j <= i; j++) {
      printf("x");
    }
    for (j = 1; j < x - i + 1; j++) {
      printf("y");
    }
    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     1234 <main+0x114>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jg     11b8 <main+0x98>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x6d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11e5 <main+0xc5>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bf <main+0x9f>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    121a <main+0xfa>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ec <main+0xcc>
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <main+0x5a>
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>
mov    (%rsp),%eax
test   %eax,%eax
jle    1208 <main+0xd8>
mov    $0x1,%ebx
jmp    11a6 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    (%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    1208 <main+0xd8>
mov    %ebx,%ebp
cmp    %ebx,%eax
jle    11d0 <main+0xa0>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11b0 <main+0x80>
mov    %ebx,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x78,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0xa0>
cmp    %ebx,(%rsp)
jle    1190 <main+0x60>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x79,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11f0 <main+0xc0>
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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"
@.str.6 = [2 x i8] c"y\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 = %52, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %55
15: ; preds = %11
store i32 1, i32* %5
br label %16
16: ; preds = %24, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = sub nsw i32 %18, %19
%21 = icmp sle i32 %17, %20
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %24
24: ; preds = %22
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %16
27: ; preds = %16
store i32 1, i32* %5
br label %28
28: ; preds = %34, %27
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %34
34: ; preds = %32
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %28
37: ; preds = %28
store i32 1, i32* %5
br label %38
38: ; preds = %47, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %2
%41 = load i32, i32* %4
%42 = sub nsw i32 %40, %41
%43 = add nsw i32 %42, 1
%44 = icmp slt i32 %39, %43
br i1 %44, label %45, label %50
45: ; preds = %38
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %38
50: ; preds = %38
%51 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, 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 %11
55: ; preds = %11
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 %46, label %12
12: ; preds = %0, %40
%13 = phi i32 [ %43, %40 ], [ %10, %0 ]
%14 = phi i32 [ %45, %40 ], [ 2, %0 ]
%15 = phi i32 [ %42, %40 ], [ 1, %0 ]
%16 = icmp sgt i32 %13, %15
br i1 %16, label %18, label %17
17: ; preds = %18, %12
br label %28
18: ; preds = %12, %18
%19 = phi i32 [ %21, %18 ], [ 1, %12 ]
%20 = call i32 @putchar(i32 32)
%21 = add nuw nsw i32 %19, 1
%22 = load i32, i32* %1
%23 = sub nsw i32 %22, %15
%24 = icmp slt i32 %19, %23
br i1 %24, label %18, label %17
25: ; preds = %28
%26 = load i32, i32* %1
%27 = icmp sgt i32 %26, %15
br i1 %27, label %33, label %40
28: ; preds = %17, %28
%29 = phi i32 [ %31, %28 ], [ 1, %17 ]
%30 = call i32 @putchar(i32 120)
%31 = add nuw i32 %29, 1
%32 = icmp eq i32 %31, %14
br i1 %32, label %25, label %28
33: ; preds = %25, %33
%34 = phi i32 [ %36, %33 ], [ 1, %25 ]
%35 = call i32 @putchar(i32 121)
%36 = add nuw nsw i32 %34, 1
%37 = load i32, i32* %1
%38 = sub nsw i32 %37, %15
%39 = icmp slt i32 %34, %38
br i1 %39, label %33, label %40
40: ; preds = %33, %25
%41 = call i32 @putchar(i32 10)
%42 = add nuw nsw i32 %15, 1
%43 = load i32, i32* %1
%44 = icmp slt i32 %15, %43
%45 = add nuw i32 %14, 1
br i1 %44, label %12, label %46
46: ; preds = %40, %0
ret i32 0
}