#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*/ putint(int);
int /*<<< orphan*/ putstring(char *);
int main(void) {
  int i;
  char space[2];
  char X[2];
  char Y[2];
  char W[2];
  char nl[2];
  space[0] = ' ';
  space[1] = 0;
  X[0] = 'X';
  X[1] = 0;
  Y[0] = 'Y';
  Y[1] = 0;
  W[0] = 'W';
  W[1] = 0;
  nl[0] = '\n';
  nl[1] = 0;
  i = 0;
  while (i != 21) {
    putint(i);
    putstring(space);
    if (i / 2 * 2 == i)
      putstring(X);
    if (i / 3 * 3 == i) {
      putstring(Y);
    } else if (i > 10)
      putstring(W);
    putstring(nl);
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
movb   $0x58,-0xc(%rbp)
movb   $0x0,-0xb(%rbp)
movb   $0x59,-0xe(%rbp)
movb   $0x0,-0xd(%rbp)
movb   $0x57,-0x10(%rbp)
movb   $0x0,-0xf(%rbp)
movb   $0xa,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x15,-0x8(%rbp)
je     11ed <main+0xcd>
mov    -0x8(%rbp),%edi
call   1030 <putint@plt>
lea    -0xa(%rbp),%rdi
call   1040 <putstring@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
shl    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1199 <main+0x79>
lea    -0xc(%rbp),%rdi
call   1040 <putstring@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
cmp    -0x8(%rbp),%eax
jne    11be <main+0x9e>
lea    -0xe(%rbp),%rdi
call   1040 <putstring@plt>
jmp    11d6 <main+0xb6>
cmpl   $0xa,-0x8(%rbp)
jle    11d1 <main+0xb1>
lea    -0x10(%rbp),%rdi
call   1040 <putstring@plt>
jmp    11d6 <main+0xb6>
lea    -0x12(%rbp),%rdi
call   1040 <putstring@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x20,0x16(%rsp)
movw   $0x58,0x14(%rsp)
movw   $0x59,0x12(%rsp)
movw   $0x57,0x10(%rsp)
movw   $0xa,0xe(%rsp)
xor    %ebx,%ebx
mov    $0xaaaaaaab,%r13d
lea    0x16(%rsp),%r14
lea    0x12(%rsp),%rbp
lea    0xe(%rsp),%r12
jmp    1185 <main+0x65>
nopw   0x0(%rax,%rax,1)
call   1040 <putstring@plt>
mov    %r12,%rdi
call   1040 <putstring@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
je     11c8 <main+0xa8>
mov    %ebx,%r15d
imul   %r13,%r15
shr    $0x21,%r15
mov    %ebx,%edi
call   1030 <putint@plt>
mov    %r14,%rdi
call   1040 <putstring@plt>
test   $0x80000001,%ebx
jne    11b1 <main+0x91>
lea    0x14(%rsp),%rdi
call   1040 <putstring@plt>
lea    (%r15,%r15,2),%eax
mov    %rbp,%rdi
cmp    %ebx,%eax
je     1170 <main+0x50>
lea    0x10(%rsp),%rdi
cmp    $0xb,%ebx
jae    1170 <main+0x50>
jmp    1175 <main+0x55>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = alloca [2 x i8]
%5 = alloca [2 x i8]
%6 = alloca [2 x i8]
%7 = alloca [2 x i8]
store i32 0, i32* %1
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 32, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %9
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 88, i8* %10
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %11
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 89, i8* %12
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 87, i8* %14
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 0, i8* %15
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 10, i8* %16
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 0, i8* %17
store i32 0, i32* %2
br label %18
18: ; preds = %50, %0
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 21
br i1 %20, label %21, label %55
21: ; preds = %18
%22 = load i32, i32* %2
%23 = call i32 @putint(i32 %22)
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%25 = call i32 @putstring(i8* %24)
%26 = load i32, i32* %2
%27 = sdiv i32 %26, 2
%28 = mul nsw i32 %27, 2
%29 = load i32, i32* %2
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %21
%32 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%33 = call i32 @putstring(i8* %32)
br label %34
34: ; preds = %31, %21
%35 = load i32, i32* %2
%36 = sdiv i32 %35, 3
%37 = mul nsw i32 %36, 3
%38 = load i32, i32* %2
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%42 = call i32 @putstring(i8* %41)
br label %50
43: ; preds = %34
%44 = load i32, i32* %2
%45 = icmp sgt i32 %44, 10
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%48 = call i32 @putstring(i8* %47)
br label %49
49: ; preds = %46, %43
br label %50
50: ; preds = %49, %40
%51 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%52 = call i32 @putstring(i8* %51)
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %18
55: ; preds = %18
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i8]
%2 = alloca [2 x i8]
%3 = alloca [2 x i8]
%4 = alloca [2 x i8]
%5 = alloca [2 x i8]
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 32, i8* %6
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %11
store i8 88, i8* %7
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %12
store i8 89, i8* %8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %13
store i8 87, i8* %9
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %14
store i8 10, i8* %10
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %15
br label %16
16: ; preds = %0, %32
%17 = phi i32 [ 0, %0 ], [ %34, %32 ]
%18 = call i32 @putint(i32 %17)
%19 = call i32 @putstring(i8* %6)
%20 = and i32 %17, 2147483646
%21 = icmp eq i32 %20, %17
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 @putstring(i8* %7)
br label %24
24: ; preds = %22, %16
%25 = urem i32 %17, 3
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = icmp ugt i32 %17, 10
br i1 %28, label %29, label %32
29: ; preds = %27, %24
%30 = phi i8* [ %8, %24 ], [ %9, %27 ]
%31 = call i32 @putstring(i8* %30)
br label %32
32: ; preds = %29, %27
%33 = call i32 @putstring(i8* %10)
%34 = add nuw nsw i32 %17, 1
%35 = icmp eq i32 %34, 21
br i1 %35, label %36, label %16
36: ; preds = %32
ret i32 0
}