#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main() {
  int j, n;
  char ch[80], tran[80];
  printf("input cipher code:");
  gets(ch);
  printf("\ncipher code:%s", ch);
  j = 0;
  while (ch[j] != '\0') {
    if ((ch[j] >= 'A') && (ch[j] <= 'Z'))
      tran[j] = 155 - ch[j];
    else if ((ch[j] >= 'a') && (ch[j] <= 'z'))
      tran[j] = 219 - ch[j];
    else
      tran[j] = ch[j];
    j++;
  }
  n = j;
  printf("\noriginal text :");
  for (j = 0; j < n; j++)
    putchar(tran[j]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x60(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1236 <main+0x106>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jl     11ca <main+0x9a>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jg     11ca <main+0x9a>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%ecx
mov    $0x9b,%eax
sub    %ecx,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
jmp    1228 <main+0xf8>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     1210 <main+0xe0>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     1210 <main+0xe0>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%ecx
mov    $0xdb,%eax
sub    %ecx,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
jmp    1223 <main+0xf3>
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
jmp    1228 <main+0xf8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127c <main+0x14c>
movslq -0x8(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1251 <main+0x121>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%al
test   %al,%al
je     11d5 <main+0xa5>
xor    %ebx,%ebx
jmp    1194 <main+0x64>
nop
lea    -0x61(%rax),%ecx
mov    $0xdb,%dl
sub    %al,%dl
cmp    $0x1a,%cl
movzbl %dl,%edx
movzbl %al,%ecx
cmovb  %edx,%ecx
mov    %cl,0x50(%rsp,%rbx,1)
movzbl 0x1(%rsp,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     11a2 <main+0x72>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1170 <main+0x40>
mov    $0x9b,%cl
sub    %al,%cl
jmp    1183 <main+0x53>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     11e3 <main+0xb3>
mov    %ebx,%r14d
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl 0x50(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11c0 <main+0x90>
jmp    11e3 <main+0xb3>
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"input cipher code:\00"
@.str.1 = [16 x i8] c"\0Acipher code:%s\00"
@.str.2 = [17 x i8] c"\0Aoriginal text :\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %2
br label %11
11: ; preds = %77, %0
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %80
18: ; preds = %11
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %43
25: ; preds = %18
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp sle i32 %30, 90
br i1 %31, label %32, label %43
32: ; preds = %25
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = sub nsw i32 155, %37
%39 = trunc i32 %38 to i8
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %41
store i8 %39, i8* %42
br label %77
43: ; preds = %25, %18
%44 = load i32, i32* %2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp sge i32 %48, 97
br i1 %49, label %50, label %68
50: ; preds = %43
%51 = load i32, i32* %2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp sle i32 %55, 122
br i1 %56, label %57, label %68
57: ; preds = %50
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = sub nsw i32 219, %62
%64 = trunc i32 %63 to i8
%65 = load i32, i32* %2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %66
store i8 %64, i8* %67
br label %76
68: ; preds = %50, %43
%69 = load i32, i32* %2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %74
store i8 %72, i8* %75
br label %76
76: ; preds = %68, %57
br label %77
77: ; preds = %76, %32
%78 = load i32, i32* %2
%79 = add nsw i32 %78, 1
store i32 %79, i32* %2
br label %11
80: ; preds = %11
%81 = load i32, i32* %2
store i32 %81, i32* %3
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %83
83: ; preds = %93, %80
%84 = load i32, i32* %2
%85 = load i32, i32* %3
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %96
87: ; preds = %83
%88 = load i32, i32* %2
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = call i32 @putchar(i8 signext %91)
br label %93
93: ; preds = %87
%94 = load i32, i32* %2
%95 = add nsw i32 %94, 1
store i32 %95, i32* %2
br label %83
96: ; preds = %83
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"input cipher code:\00"
@.str.1 = [16 x i8] c"\0Acipher code:%s\00"
@.str.2 = [17 x i8] c"\0Aoriginal text :\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %44
12: ; preds = %0, %24
%13 = phi i64 [ %27, %24 ], [ 0, %0 ]
%14 = phi i8 [ %29, %24 ], [ %8, %0 ]
%15 = add i8 %14, -65
%16 = icmp ult i8 %15, 26
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = sub nuw i8 -101, %14
br label %24
19: ; preds = %12
%20 = add i8 %14, -97
%21 = icmp ult i8 %20, 26
%22 = sub nuw i8 -37, %14
%23 = select i1 %21, i8 %22, i8 %14
br label %24
24: ; preds = %19, %17
%25 = phi i8 [ %18, %17 ], [ %23, %19 ]
%26 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %13
store i8 %25, i8* %26
%27 = add nuw i64 %13, 1
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %12
31: ; preds = %24
%32 = trunc i64 %27 to i32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 %32, 0
br i1 %34, label %44, label %35
35: ; preds = %31
%36 = and i64 %27, 4294967295
br label %37
37: ; preds = %35, %37
%38 = phi i64 [ 0, %35 ], [ %42, %37 ]
%39 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = call i32 @putchar(i8 signext %40)
%42 = add nuw nsw i64 %38, 1
%43 = icmp eq i64 %42, %36
br i1 %43, label %44, label %37
44: ; preds = %37, %10, %31
%45 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret i32 0
}