#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 < i; 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     122c <main+0x10c>
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
cmp    -0x10(%rbp),%eax
jge    1212 <main+0xf2>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ec <main+0xcc>
lea    0xdf2(%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   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xea8(%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
test   %eax,%eax
jle    1224 <main+0xf4>
mov    $0x1,%ebx
xor    %r14d,%r14d
jmp    11bb <main+0x8b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x8(%rsp),%eax
add    $0x1,%r14d
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    1224 <main+0xf4>
mov    %ebx,%ebp
cmp    %ebx,%eax
jle    11f0 <main+0xc0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
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    %ebx,%ebp
nopl   0x0(%rax)
mov    $0x78,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11f0 <main+0xc0>
mov    %r14d,%ebp
cmp    $0x2,%ebx
jb     11a0 <main+0x70>
nopw   0x0(%rax,%rax,1)
mov    $0x79,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xe0>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
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 = %49, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %52
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 = %44, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %4
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %47
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %38
47: ; preds = %38
%48 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %11
52: ; 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 %43, label %12
12: ; preds = %0, %37
%13 = phi i32 [ %40, %37 ], [ %10, %0 ]
%14 = phi i32 [ %42, %37 ], [ 2, %0 ]
%15 = phi i32 [ %39, %37 ], [ 1, %0 ]
%16 = icmp sgt i32 %13, %15
br i1 %16, label %18, label %17
17: ; preds = %18, %12
br label %27
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 = %27
%26 = icmp ugt i32 %15, 1
br i1 %26, label %32, label %37
27: ; preds = %17, %27
%28 = phi i32 [ %30, %27 ], [ 1, %17 ]
%29 = call i32 @putchar(i32 120)
%30 = add nuw i32 %28, 1
%31 = icmp eq i32 %30, %14
br i1 %31, label %25, label %27
32: ; preds = %25, %32
%33 = phi i32 [ %35, %32 ], [ 1, %25 ]
%34 = call i32 @putchar(i32 121)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, %15
br i1 %36, label %37, label %32
37: ; preds = %32, %25
%38 = call i32 @putchar(i32 10)
%39 = add nuw nsw i32 %15, 1
%40 = load i32, i32* %1
%41 = icmp slt i32 %15, %40
%42 = add nuw i32 %14, 1
br i1 %41, label %12, label %43
43: ; preds = %37, %0
ret i32 0
}