#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 */
scalar_t__ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
char *strchr(char *, char);
int strlen(char *);
int main() {
  int i, index;
  char pass[] = "1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
  char line[1000];
  while (gets(line)) {
    for (i = 0; i < strlen(line); i++) {
      if (line[i] == ' ')
        printf(" ");
      else {
        index = strchr(pass, line[i]) - pass;
        printf("%c", pass[index - 1]);
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x2f,%edx
call   1060 <memcpy@plt>
lea    -0x430(%rbp),%rdi
call   1070 <gets@plt>
cmp    $0x0,%rax
je     1241 <main+0xf1>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x434(%rbp)
lea    -0x430(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x434(%rbp),%eax
cmp    %ecx,%eax
jge    122e <main+0xde>
movslq -0x8(%rbp),%rax
movsbl -0x430(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    11e1 <main+0x91>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    121b <main+0xcb>
lea    -0x40(%rbp),%rdi
movslq -0x8(%rbp),%rax
movsbl -0x430(%rbp,%rax,1),%esi
ff
call   1040 <strchr@plt>
lea    -0x40(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x40(%rbp,%rax,1),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1220 <main+0xd0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1194 <main+0x44>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1177 <main+0x27>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x418,%rsp
movups 0xeca(%rip),%xmm0
movups %xmm0,0x1f(%rsp)
movaps 0xeaf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11fc <main+0xbc>
mov    %rsp,%r14
mov    %r14,%r15
not    %r15
lea    0x30(%rsp),%r12
jmp    11a7 <main+0x67>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11fc <main+0xbc>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1190 <main+0x50>
xor    %ebx,%ebx
jmp    11d8 <main+0x98>
nopw   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1190 <main+0x50>
movzbl 0x30(%rsp,%rbx,1),%eax
mov    $0x20,%edi
cmp    $0x20,%al
je     11c0 <main+0x80>
movsbl %al,%esi
mov    %r14,%rdi
call   1050 <strchr@plt>
add    %r15d,%eax
cltq
movsbl (%rsp,%rax,1),%edi
jmp    11c0 <main+0x80>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.pass = [47 x i8] c"1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./\00"
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [47 x i8]
%5 = alloca [1000 x i8]
store i32 0, i32* %1
%6 = bitcast [47 x i8]* %4 to i8*
br label %7
7: ; preds = %49, %0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%9 = call i64 @gets(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %51
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %46, %11
%13 = load i32, i32* %2
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %49
17: ; preds = %12
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 32
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %45
26: ; preds = %17
%27 = getelementptr inbounds [47 x i8], [47 x i8]* %4, i64 0, i64 0
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = call i8* @strchr(i8* %27, i8 signext %31)
%33 = getelementptr inbounds [47 x i8], [47 x i8]* %4, i64 0, i64 0
%34 = ptrtoint i8* %32 to i64
%35 = ptrtoint i8* %33 to i64
%36 = sub i64 %34, %35
%37 = trunc i64 %36 to i32
store i32 %37, i32* %3
%38 = load i32, i32* %3
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [47 x i8], [47 x i8]* %4, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %26, %24
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %12
49: ; preds = %12
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %7
51: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.pass = [47 x i8] c"1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./\00"
define i32 @main() {
%1 = alloca [47 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [47 x i8], [47 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @gets(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %38, label %7
7: ; preds = %0
%8 = ptrtoint [47 x i8]* %1 to i64
%9 = xor i64 %8, -1
br label %10
10: ; preds = %7, %34
%11 = call i32 @strlen(i8* %4)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %10, %27
%14 = phi i64 [ %30, %27 ], [ 0, %10 ]
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 32
br i1 %17, label %27, label %18
18: ; preds = %13
%19 = call i8* @strchr(i8* %3, i8 signext %16)
%20 = ptrtoint i8* %19 to i64
%21 = add i64 %20, %9
%22 = shl i64 %21, 32
%23 = ashr exact i64 %22, 32
%24 = getelementptr inbounds [47 x i8], [47 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
br label %27
27: ; preds = %13, %18
%28 = phi i32 [ %26, %18 ], [ 32, %13 ]
%29 = call i32 @putchar(i32 %28)
%30 = add nuw nsw i64 %14, 1
%31 = call i32 @strlen(i8* %4)
%32 = sext i32 %31 to i64
%33 = icmp slt i64 %30, %32
br i1 %33, label %13, label %34
34: ; preds = %27, %10
%35 = call i32 @putchar(i32 10)
%36 = call i64 @gets(i8* %4)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %10
38: ; preds = %34, %0
ret i32 0
}