#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 */
char getch();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char key;
  key = getch();
  while (key != 'q') {
    switch (key) {
    case 'w':
      printf("ÉÏ");
      break;
    case 's':
      printf("ÏÂ");
      break;
    case 'a':
      printf("×ó");
      break;
    case 'd':
      printf("ÓÒ");
      break;
    default:
      break;
    }
    key = getch();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x71,%eax
je     11cf <main+0xaf>
movsbl -0x11(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x16,%eax
ja     11bb <main+0x9b>
mov    -0x20(%rbp),%rax
lea    0xe92(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
jmp    11c0 <main+0xa0>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x11(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x71,%al
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xf15(%rip),%r14
lea    0xeb2(%rip),%rbx
lea    0xf11(%rip),%r15
lea    0xf0f(%rip),%r12
lea    0xefe(%rip),%r13
jmp    1183 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x71,%al
je     1134 <main+0x14>
movsbl %al,%eax
add    $0xffffff9f,%eax
cmp    $0x16,%eax
ja     1178 <main+0x58>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
mov    %r14,%rdi
jmp    *%rax
mov    %r15,%rdi
jmp    1173 <main+0x53>
nop
mov    %r13,%rdi
jmp    1173 <main+0x53>

LLVM IR (-O0):
@.str = [5 x i8] c"\C3\89\C3\8F\00"
@.str.1 = [5 x i8] c"\C3\8F\C3\82\00"
@.str.2 = [5 x i8] c"\C3\97\C3\B3\00"
@.str.3 = [5 x i8] c"\C3\93\C3\92\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call signext i8 (...) @getch()
store i8 %7, i8* %6
br label %8
8: ; preds = %24, %2
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 113
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
switch i32 %14, label %23 [
i32 119, label %15
i32 115, label %17
i32 97, label %19
i32 100, label %21
]
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %24
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %24
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %24
21: ; preds = %12
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %24
23: ; preds = %12
br label %24
24: ; preds = %23, %21, %19, %17, %15
%25 = call signext i8 (...) @getch()
store i8 %25, i8* %6
br label %8
26: ; preds = %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"\C3\89\C3\8F\00"
@.str.1 = [5 x i8] c"\C3\8F\C3\82\00"
@.str.2 = [5 x i8] c"\C3\97\C3\B3\00"
@.str.3 = [5 x i8] c"\C3\93\C3\92\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getch()
%4 = icmp eq i8 %3, 113
br i1 %4, label %17, label %5
5: ; preds = %2, %14
%6 = phi i8 [ %15, %14 ], [ %3, %2 ]
%7 = sext i8 %6 to i32
switch i32 %7, label %14 [
i32 119, label %11
i32 115, label %8
i32 97, label %9
i32 100, label %10
]
8: ; preds = %5
br label %11
9: ; preds = %5
br label %11
10: ; preds = %5
br label %11
11: ; preds = %5, %8, %9, %10
%12 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %5 ]
%13 = tail call i32 @printf(i8* dereferenceable(1) %12)
br label %14
14: ; preds = %11, %5
%15 = tail call signext i8 (...) @getch()
%16 = icmp eq i8 %15, 113
br i1 %16, label %17, label %5
17: ; preds = %14, %2
ret i32 0
}