#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int rotate(char);
int /*<<< orphan*/ stderr;
int strlen(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    fprintf(
        stderr,
        "%s: program expected at least 1 argument, but instead received %d\n",
        argv[0], argc - 1);
    exit(EXIT_FAILURE);
  } else {
    for (int numArgs = 1; numArgs < argc; numArgs++) {
      int length = strlen(argv[numArgs]);
      for (int i = 0; i < length; i++) {
        printf(
            "Index = %d	Original Char = %c		ROT Char = %c \n", i,
            argv[numArgs][i], rotate(argv[numArgs][i]));
      }
      printf("\n");
    }
  }
  exit(EXIT_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11a0 <main+0x50>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1250 <main+0x100>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1234 <main+0xe4>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <rotate@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ce <main+0x7e>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x57>
jmp    1255 <main+0x105>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
cmp    $0x1,%edi
jne    119b <main+0x3b>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xe7a(%rip),%rsi
xor    %ecx,%ecx
call   1060 <fprintf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jle    121a <main+0xba>
mov    %edi,%eax
mov    %rax,(%rsp)
mov    $0x1,%r13d
lea    0xe93(%rip),%r14
jmp    11d4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    (%rsp),%r13
je     121a <main+0xba>
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11c0 <main+0x60>
mov    %eax,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%r13,8),%rax
movsbl (%rax,%rbx,1),%ebp
mov    %ebp,%edi
call   1070 <rotate@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11f0 <main+0x90>
jmp    11c0 <main+0x60>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"%s: program expected at least 1 argument, but instead received %d\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [47 x i8] c"Index = %d\09Original Char = %c\09\09ROT Char = %c \0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %2
store i32 1, i32* %6
br label %22
22: ; preds = %65, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %68
26: ; preds = %22
%27 = load i8**, i8*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 @strlen(i8* %31)
store i32 %32, i32* %7
store i32 0, i32* %8
br label %33
33: ; preds = %60, %26
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %63
37: ; preds = %33
%38 = load i32, i32* %8
%39 = load i8**, i8*** %5
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = load i32, i32* %8
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = load i8**, i8*** %5
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
%57 = load i8, i8* %56
%58 = call i32 @rotate(i8 signext %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %48, i32 %58)
br label %60
60: ; preds = %37
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %33
63: ; preds = %33
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %63
%66 = load i32, i32* %6
%67 = add nsw i32 %66, 1
store i32 %67, i32* %6
br label %22
68: ; preds = %22
br label %69
69: ; preds = %68
%70 = load i32, i32* @EXIT_SUCCESS
%71 = call i32 @exit(i32 %70)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"%s: program expected at least 1 argument, but instead received %d\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [47 x i8] c"Index = %d\09Original Char = %c\09\09ROT Char = %c \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %17
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %10, i32 0)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %25, %4
%15 = load i32, i32* @EXIT_SUCCESS
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %6, %25
%18 = phi i64 [ 1, %6 ], [ %27, %25 ]
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
%20 = load i8*, i8** %19
%21 = tail call i32 @strlen(i8* %20)
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = zext i32 %21 to i64
br label %29
25: ; preds = %29, %17
%26 = tail call i32 @putchar(i32 10)
%27 = add nuw nsw i64 %18, 1
%28 = icmp eq i64 %27, %7
br i1 %28, label %14, label %17
29: ; preds = %23, %29
%30 = phi i64 [ 0, %23 ], [ %38, %29 ]
%31 = load i8*, i8** %19
%32 = getelementptr inbounds i8, i8* %31, i64 %30
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = tail call i32 @rotate(i8 signext %33)
%36 = trunc i64 %30 to i32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %34, i32 %35)
%38 = add nuw nsw i64 %30, 1
%39 = icmp eq i64 %38, %24
br i1 %39, label %25, label %29
}