#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*/ fgets(char *, int, int /*<<< orphan*/ *);
int sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void parseFastq(FILE *fd, char *line, char *machine, char *run, int *lane,
                int *tile, int *xoff, int *yoff, char *index, char *seq,
                char *qual, int *passedpf) {
  int fldcount = 0;
  fldcount = sscanf(line, "@%[^_]_%[^:]:%d:%d:%d:%d", machine, run, lane, tile,
                    xoff, yoff);
  if (fldcount != 7 && fldcount != 6) {
    fldcount = sscanf(line, "@%[^:]:%[^:]:%d:%d:%d:%d", machine, run, lane,
                      tile, xoff, yoff);
  }
  fgets(line, 2048, fd);
  fldcount = sscanf(line, "%s", seq);
  fgets(line, 2048, fd);
  fgets(line, 2048, fd);
  fldcount = sscanf(line, "%s", qual);
  strcpy(index, "zork");
  *passedpf = 1;
}


x86 assembly (clang, -O0):
<parseFastq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xe6e(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
je     11ef <parseFastq+0xbf>
cmpl   $0x6,-0x34(%rbp)
je     11ef <parseFastq+0xbf>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xe3d(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x800,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    0x28(%rbp),%rdx
lea    0xe22(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x800,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x800,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    0x30(%rbp),%rdx
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x34(%rbp)
mov    0x20(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x38(%rbp),%rax
movl   $0x1,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseFastq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
push   0x48(%rsp)
push   0x48(%rsp)
call   1050 <sscanf@plt>
add    $0x10,%rsp
and    $0xfffffffe,%eax
cmp    $0x6,%eax
je     119b <parseFastq+0x6b>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rbp,%r9
xor    %eax,%eax
push   0x48(%rsp)
push   0x48(%rsp)
call   1050 <sscanf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    $0x800,%esi
mov    %r12,%rdx
call   1040 <fgets@plt>
lea    0xe80(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0x58(%rsp),%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x800,%esi
mov    %r12,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    $0x800,%esi
mov    %r12,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0x60(%rsp),%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0xe38(%rip),%rsi
mov    0x50(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x68(%rsp),%rax
movl   $0x1,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"@%[^_]_%[^:]:%d:%d:%d:%d\00"
@.str.1 = [25 x i8] c"@%[^:]:%[^:]:%d:%d:%d:%d\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"zork\00"
define void @parseFastq(i32* %0, i8* %1, i8* %2, i8* %3, i32* %4, i32* %5, i32* %6, i32* %7, i8* %8, i8* %9, i8* %10, i32* %11) {
%13 = alloca i32*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i32*
%25 = alloca i32
store i32* %0, i32** %13
store i8* %1, i8** %14
store i8* %2, i8** %15
store i8* %3, i8** %16
store i32* %4, i32** %17
store i32* %5, i32** %18
store i32* %6, i32** %19
store i32* %7, i32** %20
store i8* %8, i8** %21
store i8* %9, i8** %22
store i8* %10, i8** %23
store i32* %11, i32** %24
store i32 0, i32* %25
%26 = load i8*, i8** %14
%27 = load i8*, i8** %15
%28 = load i8*, i8** %16
%29 = load i32*, i32** %17
%30 = load i32*, i32** %18
%31 = load i32*, i32** %19
%32 = load i32*, i32** %20
%33 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %26, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %27, i8* %28, i32* %29, i32* %30, i32* %31, i32* %32)
store i32 %33, i32* %25
%34 = load i32, i32* %25
%35 = icmp ne i32 %34, 7
br i1 %35, label %36, label %48
36: ; preds = %12
%37 = load i32, i32* %25
%38 = icmp ne i32 %37, 6
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = load i8*, i8** %14
%41 = load i8*, i8** %15
%42 = load i8*, i8** %16
%43 = load i32*, i32** %17
%44 = load i32*, i32** %18
%45 = load i32*, i32** %19
%46 = load i32*, i32** %20
%47 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %41, i8* %42, i32* %43, i32* %44, i32* %45, i32* %46)
store i32 %47, i32* %25
br label %48
48: ; preds = %39, %36, %12
%49 = load i8*, i8** %14
%50 = load i32*, i32** %13
%51 = call i32 @fgets(i8* %49, i32 2048, i32* %50)
%52 = load i8*, i8** %14
%53 = load i8*, i8** %22
%54 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %53)
store i32 %54, i32* %25
%55 = load i8*, i8** %14
%56 = load i32*, i32** %13
%57 = call i32 @fgets(i8* %55, i32 2048, i32* %56)
%58 = load i8*, i8** %14
%59 = load i32*, i32** %13
%60 = call i32 @fgets(i8* %58, i32 2048, i32* %59)
%61 = load i8*, i8** %14
%62 = load i8*, i8** %23
%63 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %62)
store i32 %63, i32* %25
%64 = load i8*, i8** %21
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%66 = load i32*, i32** %24
store i32 1, i32* %66
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"@%[^_]_%[^:]:%d:%d:%d:%d\00"
@.str.1 = [25 x i8] c"@%[^:]:%[^:]:%d:%d:%d:%d\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"zork\00"
define void @parseFastq(i32* nocapture %0, i8* %1, i8* %2, i8* %3, i32* %4, i32* %5, i32* %6, i32* %7, i8* %8, i8* %9, i8* %10, i32* nocapture writeonly %11) {
%13 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%14 = and i32 %13, -2
%15 = icmp eq i32 %14, 6
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3, i32* %4, i32* %5, i32* %6, i32* %7)
br label %18
18: ; preds = %16, %12
%19 = tail call i32 @fgets(i8* %1, i32 2048, i32* %0)
%20 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%21 = tail call i32 @fgets(i8* %1, i32 2048, i32* %0)
%22 = tail call i32 @fgets(i8* %1, i32 2048, i32* %0)
%23 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%24 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %11
ret void
}