#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ processFastq(char *, char *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int *, int *, int *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  FILE *input, *good = NULL;
  int cTrimmed = 0, cUnTrimmed = 0, cLinker = 0;
  char *linker = "TCGTATGCCGTCTTCTGCTTG";
  char *linkhead = "TCG";
  input = fopen(argv[1], "r");
  good = fopen(argv[2], "w");
  processFastq(linker, linkhead, input, good, &cTrimmed, &cUnTrimmed, &cLinker);
  fprintf(stdout, "trimmed=%d  untrimmed=%d  linker=%d\n", cTrimmed, cUnTrimmed,
          cLinker);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xea1(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe92(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe7c(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x28(%rbp),%r9
lea    -0x2c(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <processFastq@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
lea    0xe36(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
mov    0x8(%rsi),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
lea    0xc(%rsp),%rcx
mov    %rcx,(%rsp)
lea    0xe7b(%rip),%rdi
lea    0xe8a(%rip),%rsi
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
mov    %r14,%rdx
mov    %rax,%rcx
call   1040 <processFastq@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%r8d
lea    0xe60(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"TCGTATGCCGTCTTCTGCTTG\00"
@.str.1 = [4 x i8] c"TCG\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [37 x i8] c"trimmed=%d untrimmed=%d linker=%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 i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %16, i32** %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %20, i32** %7
%21 = load i8*, i8** %11
%22 = load i8*, i8** %12
%23 = load i32*, i32** %6
%24 = load i32*, i32** %7
%25 = call i32 @processFastq(i8* %21, i8* %22, i32* %23, i32* %24, i32* %8, i32* %9, i32* %10)
%26 = load i32, i32* @stdout
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = load i32, i32* %10
%30 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"TCGTATGCCGTCTTCTGCTTG\00"
@.str.1 = [4 x i8] c"TCG\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [37 x i8] c"trimmed=%d untrimmed=%d linker=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @processFastq(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %14, i32* %3, i32* %4, i32* %5)
%16 = load i32, i32* @stdout
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
ret i32 0
}