#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 *, ...);
char *rot13(char *);
int main(void) {
  char s[] =
      "ROT13 (\"rotate by 13 places\", sometimes hyphenated ROT-13) is a "
      "simple letter substitution cipher that replaces a letter with the "
      "letter 13 letters after it in the alphabet. ROT13 is a special case of "
      "the Caesar cipher, developed in ancient Rome.\n\nBecause there are 26 "
      "letters (2×13) in the basic Latin alphabet, ROT13 is its own inverse; "
      "that is, to undo ROT13, the same algorithm is applied, so the same "
      "action can be used for encoding and decoding.\n";
  char *p;
  p = rot13(s);
  printf("%s", p);
  printf("------------------------------------\n");
  printf("%s", s);
  printf("------------------------------------\n");
  p = rot13(s);
  printf("------------------------------------\n");
  printf("%s", p);
  printf("------------------------------------\n");
  printf("%s", s);
  p = rot13(s);
  printf("%s", p);
  printf("------------------------------------\n");
  printf("%s", s);
  printf("------------------------------------\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1d0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x1c6,%edx
call   1050 <memcpy@plt>
lea    -0x1d0(%rbp),%rdi
call   1030 <rot13@plt>
mov    %rax,-0x1d8(%rbp)
mov    -0x1d8(%rbp),%rsi
lea    0x104b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1040(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d0(%rbp),%rsi
lea    0x1028(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x101d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d0(%rbp),%rdi
call   1030 <rot13@plt>
mov    %rax,-0x1d8(%rbp)
lea    0xffc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1d8(%rbp),%rsi
lea    0xfe4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d0(%rbp),%rsi
lea    0xfc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d0(%rbp),%rdi
call   1030 <rot13@plt>
mov    %rax,-0x1d8(%rbp)
mov    -0x1d8(%rbp),%rsi
lea    0xf99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d0(%rbp),%rsi
lea    0xf76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1c8,%rsp
lea    0xeab(%rip),%rsi
mov    %rsp,%r14
mov    $0x1c6,%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
mov    %r14,%rdi
call   1040 <rot13@plt>
lea    0x1052(%rip),%r15
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1041(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <rot13@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <rot13@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x1c8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = [454 x i8] c"ROT13 (\22rotate by 13 places\22, sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is a special case of the Caesar cipher, developed in ancient Rome.\0A\0ABecause there are 26 letters (2\C3\9713) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding.\0A\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [38 x i8] c"------------------------------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [454 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [454 x i8]* %2 to i8*
%5 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%6 = call i8* @rot13(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%14 = call i8* @rot13(i8* %13)
store i8* %14, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%19 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%22 = call i8* @rot13(i8* %21)
store i8* %22, i8** %3
%23 = load i8*, i8** %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%26 = getelementptr inbounds [454 x i8], [454 x i8]* %2, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [454 x i8] c"ROT13 (\22rotate by 13 places\22, sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is a special case of the Caesar cipher, developed in ancient Rome.\0A\0ABecause there are 26 letters (2\C3\9713) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding.\0A\00"
@.str = [3 x i8] c"%s\00"
@str.6 = [37 x i8] c"------------------------------------\00"
define i32 @main() {
%1 = alloca [454 x i8]
%2 = getelementptr inbounds [454 x i8], [454 x i8]* %1, i64 0, i64 0
%3 = call i8* @rot13(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%8 = call i8* @rot13(i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%13 = call i8* @rot13(i8* %2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}