#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 tv_sec;
  int tv_usec;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int drop_0xx(unsigned char *, unsigned char *, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
size_t read_data(int /*<<< orphan*/ *, unsigned char *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  FILE *in, *out;
  int i;
  size_t size;
  int outsize, time;
  unsigned char *inbuf, *outbuf, *temp;
  char *outfilename;
  char postfix[] = ".c";
  struct timeval pre, post;
  inbuf = malloc(4000000);
  outbuf = malloc(4000000);
  if (argc > 1) {
    if ((in = fopen(argv[1], "r")) == NULL) {
      perror(argv[1]);
      exit(1);
    }
    outfilename = malloc(strlen(argv[1]) + strlen(postfix) + 1);
    strcpy(outfilename, argv[1]);
    strcat(outfilename, postfix);
    free(outfilename);
    argv++;
    argc--;
  } else
    in = stdin;
  if (argc != 1) {
    printf("Usage: drop_0XX [infile]\n");
    exit(2);
  }
  size = read_data(in, inbuf);
  gettimeofday(&pre, 0);
  for (i = 0; i < 20; i++) {
    temp = inbuf;
    outsize = drop_0xx(temp, outbuf, size * 8);
  }
  gettimeofday(&post, 0);
  time = ((post.tv_sec * 1000000 + post.tv_usec) -
          (pre.tv_sec * 1000000 + pre.tv_usec));
  printf("%d\n", outsize);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe20(%rip),%ax
mov    %ax,-0x5b(%rbp)
mov    0xe18(%rip),%al
mov    %al,-0x59(%rbp)
mov    $0x3d0900,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x3d0900,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    12b7 <main+0xf7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde1(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    124c <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x74(%rbp)
lea    -0x5b(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x74(%rbp),%edi
add    %eax,%edi
add    $0x1,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <strcpy@plt>
mov    -0x58(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
call   10d0 <strcat@plt>
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    12c5 <main+0x105>
mov    0x2d2a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     12e7 <main+0x127>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <read_data@plt>
mov    %rax,-0x30(%rbp)
lea    -0x68(%rbp),%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jge    1342 <main+0x182>
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x30(%rbp),%rdx
shl    $0x3,%rdx
call   1080 <drop_0xx@plt>
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    130a <main+0x14a>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
imul   $0xf4240,-0x70(%rbp),%eax
add    -0x6c(%rbp),%eax
imul   $0xf4240,-0x68(%rbp),%ecx
add    -0x64(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%esi
lea    0xcaf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %edi,%ebx
movb   $0x0,0x6(%rsp)
movw   $0x632e,0x4(%rsp)
mov    $0x3d0900,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
mov    $0x3d0900,%edi
call   10b0 <malloc@plt>
mov    %rax,%r14
cmp    $0x2,%ebx
jl     123a <main+0x6a>
mov    0x8(%r13),%rdi
lea    0xdea(%rip),%rsi
call   10c0 <fopen@plt>
mov    0x8(%r13),%rdi
test   %rax,%rax
jne    13a8 <main+0x1d8>
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%r12
cmp    $0x1,%ebx
jne    13f7 <main+0x227>
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <read_data@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
shl    $0x3,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <drop_0xx@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
lea    0xc6d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    %rax,%r12
call   1070 <strlen@plt>
mov    %eax,%ebp
lea    0x4(%rsp),%rdi
call   1070 <strlen@plt>
lea    (%rax,%rbp,1),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    0x8(%r13),%rsi
mov    %rax,%rdi
call   1050 <strcpy@plt>
mov    %rbp,%rdi
lea    0x4(%rsp),%rsi
call   10e0 <strcat@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
je     124d <main+0x7d>
lea    0xc0b(%rip),%rdi
call   1060 <puts@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@__const.main.postfix = [3 x i8] c".c\00"
@.str = [2 x i8] c"r\00"
@stdin = global i32* null
@.str.1 = [26 x i8] c"Usage: drop_0XX [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 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 4000000)
store i8* %20, i8** %12
%21 = call i8* @malloc(i32 4000000)
store i8* %21, i8** %13
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 1
br i1 %23, label %24, label %60
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, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @strlen(i8* %39)
%41 = getelementptr inbounds [3 x i8], [3 x i8]* %16, i64 0, i64 0
%42 = call i32 @strlen(i8* %41)
%43 = add nsw i32 %40, %42
%44 = add nsw i32 %43, 1
%45 = call i8* @malloc(i32 %44)
store i8* %45, i8** %15
%46 = load i8*, i8** %15
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 @strcpy(i8* %46, i8* %49)
%51 = load i8*, i8** %15
%52 = getelementptr inbounds [3 x i8], [3 x i8]* %16, i64 0, i64 0
%53 = call i32 @strcat(i8* %51, i8* %52)
%54 = load i8*, i8** %15
%55 = call i32 @free(i8* %54)
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i32 1
store i8** %57, i8*** %5
%58 = load i32, i32* %4
%59 = add nsw i32 %58, -1
store i32 %59, i32* %4
br label %62
60: ; preds = %2
%61 = load i32*, i32** @stdin
store i32* %61, i32** %6
br label %62
62: ; preds = %60, %36
%63 = load i32, i32* %4
%64 = icmp ne i32 %63, 1
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%67 = call i32 @exit(i32 2)
unreachable
68: ; preds = %62
%69 = load i32*, i32** %6
%70 = load i8*, i8** %12
%71 = call i64 @read_data(i32* %69, i8* %70)
store i64 %71, i64* %9
%72 = call i32 @gettimeofday(%struct.timeval* %17, i32 0)
store i32 0, i32* %8
br label %73
73: ; preds = %83, %68
%74 = load i32, i32* %8
%75 = icmp slt i32 %74, 20
br i1 %75, label %76, label %86
76: ; preds = %73
%77 = load i8*, i8** %12
store i8* %77, i8** %14
%78 = load i8*, i8** %14
%79 = load i8*, i8** %13
%80 = load i64, i64* %9
%81 = mul i64 %80, 8
%82 = call i32 @drop_0xx(i8* %78, i8* %79, i64 %81)
store i32 %82, i32* %10
br label %83
83: ; preds = %76
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %73
86: ; preds = %73
%87 = call i32 @gettimeofday(%struct.timeval* %18, i32 0)
%88 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 0
%89 = load i32, i32* %88
%90 = mul nsw i32 %89, 1000000
%91 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
%92 = load i32, i32* %91
%93 = add nsw i32 %90, %92
%94 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 0
%95 = load i32, i32* %94
%96 = mul nsw i32 %95, 1000000
%97 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%98 = load i32, i32* %97
%99 = add nsw i32 %96, %98
%100 = sub nsw i32 %93, %99
store i32 %100, i32* %11
%101 = load i32, i32* %10
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %101)
%103 = call i32 @exit(i32 0)
unreachable
}

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