#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*/ doubledecrypt(char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  int i;
  char *outputfile = NULL;
  for (i = 1; i < argc; ++i) {
    if (strcmp("-o", argv[i]) == 0)
      outputfile = argv[++i];
    else {
      doubledecrypt(outputfile, argv[i]);
    }
  }
  return (0);
}


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)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <main+0x98>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1190 <main+0x70>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    11a5 <main+0x85>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <doubledecrypt@plt>
jmp    11aa <main+0x8a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <main+0x25>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1184 <main+0x64>
mov    %rsi,%r13
mov    %edi,%r15d
mov    $0x1,%ebp
xor    %r12d,%r12d
lea    0xebb(%rip),%r14
jmp    1165 <main+0x45>
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,8),%rsi
mov    %r12,%rdi
call   1030 <doubledecrypt@plt>
add    $0x1,%ebp
cmp    %r15d,%ebp
jge    1184 <main+0x64>
movslq %ebp,%rbx
mov    0x0(%r13,%rbx,8),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <main+0x30>
lea    0x1(%rbx),%ebp
mov    0x8(%r13,%rbx,8),%r12
jmp    115d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-o\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i32 1, i32* %6
br label %8
8: ; preds = %36, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %39
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %12
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %21, i64 %24
%26 = load i8*, i8** %25
store i8* %26, i8** %7
br label %35
27: ; preds = %12
%28 = load i8*, i8** %7
%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 @doubledecrypt(i8* %28, i8* %33)
br label %35
35: ; preds = %27, %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %8
39: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-o\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %25
4: ; preds = %2, %20
%5 = phi i8* [ %22, %20 ], [ null, %2 ]
%6 = phi i32 [ %23, %20 ], [ 1, %2 ]
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = add nsw i32 %6, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
br label %20
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = tail call i32 @doubledecrypt(i8* %5, i8* %18)
br label %20
20: ; preds = %12, %17
%21 = phi i32 [ %13, %12 ], [ %6, %17 ]
%22 = phi i8* [ %16, %12 ], [ %5, %17 ]
%23 = add nsw i32 %21, 1
%24 = icmp slt i32 %23, %0
br i1 %24, label %4, label %25
25: ; preds = %20, %2
ret i32 0
}