#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 *, ...);
int rot13(char, int, int, int);
int main(int argc, char *argv[]) {
  char *curr;
  argv++;
  while (argc-- > 1) {
    curr = *argv++;
    while (*curr) {
      if ((*curr >= 'a' && *curr <= 'z')) {
        printf("%c", rot13(*curr, 97, 122, 26));
      }
      if ((*curr >= 'A' && *curr <= 'Z')) {
        printf("%c", rot13(*curr, 65, 90, 26));
      }
      curr++;
    }
    printf("\n");
  }
}


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    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jle    1233 <main+0x113>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1220 <main+0x100>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     11c4 <main+0xa4>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     11c4 <main+0xa4>
mov    -0x18(%rbp),%rax
mov    $0x61,%esi
mov    $0x7a,%edx
mov    $0x1a,%ecx
movsbl (%rax),%edi
call   1030 <rot13@plt>
mov    %eax,%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     120f <main+0xef>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     120f <main+0xef>
mov    -0x18(%rbp),%rax
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x1a,%ecx
movsbl (%rax),%edi
call   1030 <rot13@plt>
mov    %eax,%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116c <main+0x4c>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1142 <main+0x22>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     11cd <main+0xad>
mov    %rsi,%r15
mov    %edi,%r14d
jmp    115b <main+0x3b>
cs nopw 0x0(%rax,%rax,1)
add    $0x8,%r15
lea    -0x1(%r14),%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r14d
mov    %ebx,%r14d
jle    11cd <main+0xad>
mov    0x8(%r15),%rbx
mov    (%rbx),%al
test   %al,%al
je     1140 <main+0x20>
add    $0x1,%rbx
jmp    117b <main+0x5b>
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1140 <main+0x20>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11a5 <main+0x85>
movsbl %al,%edi
mov    $0x61,%esi
mov    $0x7a,%edx
mov    $0x1a,%ecx
call   1040 <rot13@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
movzbl -0x1(%rbx),%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1170 <main+0x50>
movsbl %al,%edi
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x1a,%ecx
call   1040 <rot13@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1170 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\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 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
br label %9
9: ; preds = %54, %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp sgt i32 %10, 1
br i1 %12, label %13, label %56
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i32 1
store i8** %15, i8*** %5
%16 = load i8*, i8** %14
store i8* %16, i8** %6
br label %17
17: ; preds = %51, %13
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
br i1 %20, label %21, label %54
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 97
br i1 %25, label %26, label %36
26: ; preds = %21
%27 = load i8*, i8** %6
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 122
br i1 %30, label %31, label %36
31: ; preds = %26
%32 = load i8*, i8** %6
%33 = load i8, i8* %32
%34 = call i32 @rot13(i8 signext %33, i32 97, i32 122, i32 26)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %31, %26, %21
%37 = load i8*, i8** %6
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sge i32 %39, 65
br i1 %40, label %41, label %51
41: ; preds = %36
%42 = load i8*, i8** %6
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 90
br i1 %45, label %46, label %51
46: ; preds = %41
%47 = load i8*, i8** %6
%48 = load i8, i8* %47
%49 = call i32 @rot13(i8 signext %48, i32 65, i32 90, i32 26)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %46, %41, %36
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %6
br label %17
54: ; preds = %17
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %9
56: ; preds = %9
%57 = load i32, i32* %3
ret i32 %57
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %35
4: ; preds = %2, %32
%5 = phi i32 [ %8, %32 ], [ %0, %2 ]
%6 = phi i8** [ %7, %32 ], [ %1, %2 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add nsw i32 %5, -1
%9 = load i8*, i8** %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %32, label %12
12: ; preds = %4, %28
%13 = phi i8 [ %30, %28 ], [ %10, %4 ]
%14 = phi i8* [ %29, %28 ], [ %9, %4 ]
%15 = add i8 %13, -97
%16 = icmp ult i8 %15, 26
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = tail call i32 @rot13(i8 signext %13, i32 97, i32 122, i32 26)
%19 = tail call i32 @putchar(i32 %18)
%20 = load i8, i8* %14
br label %21
21: ; preds = %17, %12
%22 = phi i8 [ %20, %17 ], [ %13, %12 ]
%23 = add i8 %22, -65
%24 = icmp ult i8 %23, 26
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = tail call i32 @rot13(i8 signext %22, i32 65, i32 90, i32 26)
%27 = tail call i32 @putchar(i32 %26)
br label %28
28: ; preds = %25, %21
%29 = getelementptr inbounds i8, i8* %14, i64 1
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %32, label %12
32: ; preds = %28, %4
%33 = tail call i32 @putchar(i32 10)
%34 = icmp sgt i32 %5, 2
br i1 %34, label %4, label %35
35: ; preds = %32, %2
ret i32 0
}