#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 */
typedef int ssize_t;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ srot13(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int main(int argc, const char *argv[]) {
  if (argc > 1) {
    for (int i = 1; i < argc; i++) {
      int length = strlen(argv[i]);
      char *strclone = calloc(sizeof(char), length);
      strcpy(strclone, argv[i]);
      srot13(strclone);
      printf("%s ", strclone);
      free(strclone);
    }
    puts("");
  } else {
    char *line = NULL;
    size_t len = 255;
    ssize_t read;
    while ((read = getline(&line, &len, stdin)) != -1) {
      srot13(line);
      printf("%s", line);
    }
    free(line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    122e <main+0xae>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121d <main+0x9d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    $0x1,%edi
call   1080 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
call   1090 <srot13@plt>
mov    -0x20(%rbp),%rsi
lea    0xdff(%rip),%rdi
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x27>
lea    0xddf(%rip),%rdi
call   1050 <puts@plt>
jmp    1287 <main+0x107>
movq   $0x0,-0x28(%rbp)
movq   $0xff,-0x30(%rbp)
mov    0x2da3(%rip),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10a0 <getline@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     127e <main+0xfe>
mov    -0x28(%rbp),%rdi
call   1090 <srot13@plt>
mov    -0x28(%rbp),%rsi
lea    0xd90(%rip),%rdi
call   1070 <printf@plt>
jmp    123e <main+0xbe>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     1204 <main+0x84>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xe5c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1080 <calloc@plt>
mov    %rax,%r13
mov    (%r15,%rbx,8),%rsi
mov    %rax,%rdi
call   1050 <strcpy@plt>
mov    %r13,%rdi
call   1090 <srot13@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1070 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11b0 <main+0x30>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1282 <main+0x102>
movq   $0x0,(%rsp)
movq   $0xff,0x8(%rsp)
mov    0x2dcc(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
call   10a0 <getline@plt>
cmp    $0xffffffff,%eax
je     1279 <main+0xf9>
lea    0xdcb(%rip),%r14
mov    %rsp,%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rdi
call   1090 <srot13@plt>
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1070 <printf@plt>
mov    (%r12),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   10a0 <getline@plt>
cmp    $0xffffffff,%eax
jne    1250 <main+0xd0>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [1 x i8] zeroinitializer
@stdin = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %46
14: ; preds = %2
store i32 1, i32* %6
br label %15
15: ; preds = %41, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %44
19: ; preds = %15
%20 = load i8**, i8*** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
store i32 %25, i32* %7
%26 = load i32, i32* %7
%27 = call i8* @calloc(i32 1, i32 %26)
store i8* %27, i8** %8
%28 = load i8*, i8** %8
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcpy(i8* %28, i8* %33)
%35 = load i8*, i8** %8
%36 = call i32 @srot13(i8* %35)
%37 = load i8*, i8** %8
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %8
%40 = call i32 @free(i8* %39)
br label %41
41: ; preds = %19
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %15
44: ; preds = %15
%45 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %59
46: ; preds = %2
store i8* null, i8** %9
store i64 255, i64* %10
br label %47
47: ; preds = %51, %46
%48 = load i32, i32* @stdin
%49 = call i32 @getline(i8** %9, i64* %10, i32 %48)
store i32 %49, i32* %11
%50 = icmp ne i32 %49, -1
br i1 %50, label %51, label %56
51: ; preds = %47
%52 = load i8*, i8** %9
%53 = call i32 @srot13(i8* %52)
%54 = load i8*, i8** %9
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %54)
br label %47
56: ; preds = %47
%57 = load i8*, i8** %9
%58 = call i32 @free(i8* %57)
br label %59
59: ; preds = %56, %44
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %23
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %10
8: ; preds = %10
%9 = tail call i32 @putchar(i32 10)
br label %40
10: ; preds = %6, %10
%11 = phi i64 [ 1, %6 ], [ %21, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @strlen(i8* %13)
%15 = tail call i8* @calloc(i32 1, i32 %14)
%16 = load i8*, i8** %12
%17 = tail call i32 @strcpy(i8* %15, i8* %16)
%18 = tail call i32 @srot13(i8* %15)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%20 = tail call i32 @free(i8* %15)
%21 = add nuw nsw i64 %11, 1
%22 = icmp eq i64 %21, %7
br i1 %22, label %8, label %10
23: ; preds = %2
%24 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%25 = bitcast i64* %4 to i8*
store i64 255, i64* %4
%26 = load i32, i32* @stdin
%27 = call i32 @getline(i8** %3, i64* %4, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %37, label %29
29: ; preds = %23, %29
%30 = load i8*, i8** %3
%31 = call i32 @srot13(i8* %30)
%32 = load i8*, i8** %3
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = load i32, i32* @stdin
%35 = call i32 @getline(i8** %3, i64* %4, i32 %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %29
37: ; preds = %29, %23
%38 = load i8*, i8** %3
%39 = call i32 @free(i8* %38)
br label %40
40: ; preds = %37, %8
ret i32 0
}