#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 */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int do_decode(unsigned char *, unsigned char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned char *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
size_t read_data(int /*<<< orphan*/ *, unsigned char *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int main(int argc, char *argv[]) {
  FILE *in, *out;
  int i;
  size_t size;
  int outsize, time;
  unsigned char *inbuf, *outbuf, *temp;
  char outfilename[100];
  char postfix[] = ".c";
  struct timeval pre, post;
  inbuf = malloc(10000000);
  outbuf = malloc(10000000);
  if (argc > 1) {
    if ((in = fopen(argv[1], "r")) == NULL) {
      perror(argv[1]);
      exit(1);
    }
    argv++;
    argc--;
  } else {
    in = stdin;
    out = stdout;
  }
  if (argc != 1) {
    printf("Usage: uudecode [infile]\n");
    exit(2);
  }
  size = read_data(in, inbuf);
  gettimeofday(&pre, 0);
  for (i = 0; i < 100; i++) {
    outsize = do_decode(inbuf, outbuf, outfilename);
  }
  printf("%d\n", outsize);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe60(%rip),%ax
mov    %ax,-0xc3(%rbp)
mov    0xe55(%rip),%al
mov    %al,-0xc1(%rbp)
mov    $0x989680,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x989680,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    122c <main+0xac>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1212 <main+0x92>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <perror@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1248 <main+0xc8>
mov    0x2db5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d97(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     126a <main+0xea>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <read_data@plt>
mov    %rax,-0x30(%rbp)
lea    -0xc8(%rbp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    12bf <main+0x13f>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
call   1070 <do_decode@plt>
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1290 <main+0x110>
mov    -0x34(%rbp),%esi
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x989680,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x989680,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
cmp    $0x2,%ebp
jl     11eb <main+0x5b>
mov    0x8(%r15),%rdi
lea    0xe32(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
jne    124a <main+0xba>
mov    0x8(%r15),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%rax
cmp    $0x1,%ebp
jne    1252 <main+0xc2>
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <read_data@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0x64,%ebx
lea    0x10(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1080 <do_decode@plt>
add    $0xffffffff,%ebx
jne    1220 <main+0x90>
lea    0xdc8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
je     11fa <main+0x6a>
lea    0xdad(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@__const.main.postfix = [3 x i8] c".c\00"
@.str = [2 x i8] c"r\00"
@stdin = global i32* null
@stdout = global i32* null
@.str.1 = [26 x i8] c"Usage: uudecode [infile]\0A\00"
@.str.2 = [4 x i8] c"%d\0A\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 i32
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [100 x i8]
%16 = alloca [3 x i8]
%17 = alloca %struct.timeval
%18 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = bitcast [3 x i8]* %16 to i8*
%20 = call i8* @malloc(i32 10000000)
store i8* %20, i8** %12
%21 = call i8* @malloc(i32 10000000)
store i8* %21, i8** %13
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 1
br i1 %23, label %24, label %41
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %28, i32** %6
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %36
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 @perror(i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %24
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i32 1
store i8** %38, i8*** %5
%39 = load i32, i32* %4
%40 = add nsw i32 %39, -1
store i32 %40, i32* %4
br label %44
41: ; preds = %2
%42 = load i32*, i32** @stdin
store i32* %42, i32** %6
%43 = load i32*, i32** @stdout
store i32* %43, i32** %7
br label %44
44: ; preds = %41, %36
%45 = load i32, i32* %4
%46 = icmp ne i32 %45, 1
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%49 = call i32 @exit(i32 2)
unreachable
50: ; preds = %44
%51 = load i32*, i32** %6
%52 = load i8*, i8** %12
%53 = call i64 @read_data(i32* %51, i8* %52)
store i64 %53, i64* %9
%54 = call i32 @gettimeofday(%struct.timeval* %17, i32 0)
store i32 0, i32* %8
br label %55
55: ; preds = %63, %50
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 100
br i1 %57, label %58, label %66
58: ; preds = %55
%59 = load i8*, i8** %12
%60 = load i8*, i8** %13
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%62 = call i32 @do_decode(i8* %59, i8* %60, i8* %61)
store i32 %62, i32* %10
br label %63
63: ; preds = %58
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 1
store i32 %65, i32* %8
br label %55
66: ; preds = %55
%67 = load i32, i32* %10
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %67)
%69 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [2 x i8] c"r\00"
@stdin = global i32* null
@stdout = global i32* null
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [25 x i8] c"Usage: uudecode [infile]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca %struct.timeval
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = bitcast %struct.timeval* %4 to i8*
%7 = tail call dereferenceable_or_null(10000000) i8* @malloc(i32 10000000)
%8 = tail call dereferenceable_or_null(10000000) i8* @malloc(i32 10000000)
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i8*, i8** %11
%17 = tail call i32 @perror(i8* %16)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %10
%20 = add nsw i32 %0, -1
br label %23
21: ; preds = %2
%22 = load i32*, i32** @stdin
br label %23
23: ; preds = %21, %19
%24 = phi i32* [ %13, %19 ], [ %22, %21 ]
%25 = phi i32 [ %20, %19 ], [ %0, %21 ]
%26 = icmp eq i32 %25, 1
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%29 = tail call i32 @exit(i32 2)
unreachable
30: ; preds = %23
%31 = tail call i64 @read_data(i32* %24, i8* %7)
%32 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
br label %33
33: ; preds = %30, %33
%34 = phi i32 [ 0, %30 ], [ %36, %33 ]
%35 = call i32 @do_decode(i8* %7, i8* %8, i8* %5)
%36 = add nuw nsw i32 %34, 1
%37 = icmp eq i32 %36, 100
br i1 %37, label %38, label %33
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%40 = call i32 @exit(i32 0)
unreachable
}