#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *, int *, int *, int *, int *,
           int *, int *, int *, char *, char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int qseq2fastq_demultiplex(FILE *input_qseq_file, FILE *demultiplex_reads_file,
                           char **barcodes, int barcodes_num,
                           FILE **barcode_output_files, int all) {
  if (input_qseq_file && demultiplex_reads_file) {
    char line[4096], run[4096], read[4096], quality_string[4096], qfilterc;
    int n, e[12], qfilter;
    int barcode_len[barcodes_num];
    for (int i = 0; i < barcodes_num; i++)
      barcode_len[i] = strlen(barcodes[i]);
    while ((n = fscanf(demultiplex_reads_file,
                       "%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%d", run, &e[1],
                       &e[2], &e[3], &e[4], &e[5], &e[6], &e[7], read,
                       quality_string, &qfilter)) > 0) {
      if (n != 11) {
        fprintf(stderr, "wrong numbers of elements in barcode file line\n");
        return 1;
      }
      if (all || qfilter == 1) {
        qfilterc = 'N';
        if (qfilter == 1)
          qfilterc = 'Y';
      } else {
        n = fscanf(input_qseq_file,
                   "%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%d", run, &e[1],
                   &e[2], &e[3], &e[4], &e[5], &e[6], &e[7], read,
                   quality_string, &qfilter);
        continue;
      }
      FILE *output_file = stdout;
      for (int i = 0; i < barcodes_num; i++)
        if (strncmp(barcodes[i], read, barcode_len[i]) == 0)
          output_file = barcode_output_files[i];
      n = fscanf(input_qseq_file, "%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%d",
                 run, &e[1], &e[2], &e[3], &e[4], &e[5], &e[6], &e[7], read,
                 quality_string, &qfilter);
      if (n != 11) {
        fprintf(stderr, "wrong numbers of elements in qseq file line\n");
        return 1;
      }
      for (int c = 0; quality_string[c] != '\0'; c++)
        quality_string[c] = quality_string[c] - 64 + 33;
      for (int c = 0; read[c] != '\0'; c++)
        if (read[c] == '.')
          read[c] = 'N';
      fprintf(output_file, "@%d:%d:%d:%d:%c\n%s\n+%d:%d:%d:%d:%c\n%s\n", e[2],
              e[3], e[4], e[5], qfilterc, read, e[2], e[3], e[4], e[5],
              qfilterc, quality_string);
    }
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<qseq2fastq_demultiplex>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40b8,%rsp
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9d,-0x5c(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     16c7 <qseq2fastq_demultiplex+0x587>
cmpq   $0x0,-0x40(%rbp)
je     16c7 <qseq2fastq_demultiplex+0x587>
mov    -0x4c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40b0(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40e0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40b8(%rbp)
movl   $0x0,-0x40bc(%rbp)
mov    -0x40bc(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1205 <qseq2fastq_demultiplex+0xc5>
mov    -0x48(%rbp),%rax
movslq -0x40bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    -0x40e0(%rbp),%rax
movslq -0x40bc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x40bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40bc(%rbp)
jmp    11bb <qseq2fastq_demultiplex+0x7b>
jmp    120a <qseq2fastq_demultiplex+0xca>
mov    -0x40(%rbp),%rdi
lea    -0x2060(%rbp),%rdx
lea    -0x40a0(%rbp),%rcx
add    $0x4,%rcx
lea    -0x40a0(%rbp),%r8
add    $0x8,%r8
lea    -0x40a0(%rbp),%r9
add    $0xc,%r9
lea    -0x40a0(%rbp),%r12
add    $0x10,%r12
lea    -0x40a0(%rbp),%r15
add    $0x14,%r15
lea    -0x40a0(%rbp),%r14
add    $0x18,%r14
lea    -0x40a0(%rbp),%rbx
add    $0x1c,%rbx
lea    -0x3060(%rbp),%r11
lea    -0x4060(%rbp),%r10
lea    0xd89(%rip),%rsi
lea    -0x40a4(%rbp),%rax
sub    $0x40,%rsp
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1050 <fscanf@plt>
add    $0x40,%rsp
mov    %eax,-0x4068(%rbp)
cmp    $0x0,%eax
jle    16a7 <qseq2fastq_demultiplex+0x567>
cmpl   $0xb,-0x4068(%rbp)
je     12f7 <qseq2fastq_demultiplex+0x1b7>
mov    0x2d10(%rip),%rax
movslq (%rax),%rdi
lea    0xd47(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x40c0(%rbp)
jmp    16b8 <qseq2fastq_demultiplex+0x578>
cmpl   $0x0,-0x5c(%rbp)
jne    130e <qseq2fastq_demultiplex+0x1ce>
cmpl   $0x1,-0x40a4(%rbp)
jne    132e <qseq2fastq_demultiplex+0x1ee>
movb   $0x4e,-0x4061(%rbp)
cmpl   $0x1,-0x40a4(%rbp)
jne    1329 <qseq2fastq_demultiplex+0x1e9>
movb   $0x59,-0x4061(%rbp)
jmp    13dc <qseq2fastq_demultiplex+0x29c>
mov    -0x38(%rbp),%rdi
lea    -0x2060(%rbp),%rdx
lea    -0x40a0(%rbp),%rcx
add    $0x4,%rcx
lea    -0x40a0(%rbp),%r8
add    $0x8,%r8
lea    -0x40a0(%rbp),%r9
add    $0xc,%r9
lea    -0x40a0(%rbp),%r12
add    $0x10,%r12
lea    -0x40a0(%rbp),%r15
add    $0x14,%r15
lea    -0x40a0(%rbp),%r14
add    $0x18,%r14
lea    -0x40a0(%rbp),%rbx
add    $0x1c,%rbx
lea    -0x3060(%rbp),%r11
lea    -0x4060(%rbp),%r10
lea    0xc65(%rip),%rsi
lea    -0x40a4(%rbp),%rax
sub    $0x40,%rsp
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1050 <fscanf@plt>
add    $0x40,%rsp
mov    %eax,-0x4068(%rbp)
jmp    120a <qseq2fastq_demultiplex+0xca>
mov    0x2bf5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40c8(%rbp)
movl   $0x0,-0x40cc(%rbp)
mov    -0x40cc(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    146b <qseq2fastq_demultiplex+0x32b>
mov    -0x40e0(%rbp),%rax
mov    -0x48(%rbp),%rcx
movslq -0x40cc(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
lea    -0x3060(%rbp),%rsi
movslq -0x40cc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1452 <qseq2fastq_demultiplex+0x312>
mov    -0x58(%rbp),%rax
movslq -0x40cc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40c8(%rbp)
jmp    1457 <qseq2fastq_demultiplex+0x317>
mov    -0x40cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40cc(%rbp)
jmp    13f7 <qseq2fastq_demultiplex+0x2b7>
mov    -0x38(%rbp),%rdi
lea    -0x2060(%rbp),%rdx
lea    -0x40a0(%rbp),%rcx
add    $0x4,%rcx
lea    -0x40a0(%rbp),%r8
add    $0x8,%r8
lea    -0x40a0(%rbp),%r9
add    $0xc,%r9
lea    -0x40a0(%rbp),%r12
add    $0x10,%r12
lea    -0x40a0(%rbp),%r15
add    $0x14,%r15
lea    -0x40a0(%rbp),%r14
add    $0x18,%r14
lea    -0x40a0(%rbp),%rbx
add    $0x1c,%rbx
lea    -0x3060(%rbp),%r11
lea    -0x4060(%rbp),%r10
lea    0xb28(%rip),%rsi
lea    -0x40a4(%rbp),%rax
sub    $0x40,%rsp
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1050 <fscanf@plt>
add    $0x40,%rsp
mov    %eax,-0x4068(%rbp)
cmpl   $0xb,-0x4068(%rbp)
je     154f <qseq2fastq_demultiplex+0x40f>
mov    0x2ab8(%rip),%rax
movslq (%rax),%rdi
lea    0xb1f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x40c0(%rbp)
jmp    16b8 <qseq2fastq_demultiplex+0x578>
movl   $0x0,-0x40d0(%rbp)
movslq -0x40d0(%rbp),%rax
movsbl -0x4060(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     15aa <qseq2fastq_demultiplex+0x46a>
movslq -0x40d0(%rbp),%rax
movsbl -0x4060(%rbp,%rax,1),%eax
ff
sub    $0x40,%eax
add    $0x21,%eax
mov    %al,%cl
movslq -0x40d0(%rbp),%rax
mov    %cl,-0x4060(%rbp,%rax,1)
mov    -0x40d0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40d0(%rbp)
jmp    1559 <qseq2fastq_demultiplex+0x419>
movl   $0x0,-0x40d4(%rbp)
movslq -0x40d4(%rbp),%rax
movsbl -0x3060(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     160c <qseq2fastq_demultiplex+0x4cc>
movslq -0x40d4(%rbp),%rax
movsbl -0x3060(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
jne    15f3 <qseq2fastq_demultiplex+0x4b3>
movslq -0x40d4(%rbp),%rax
movb   $0x4e,-0x3060(%rbp,%rax,1)
4e
jmp    15f8 <qseq2fastq_demultiplex+0x4b8>
mov    -0x40d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40d4(%rbp)
jmp    15b4 <qseq2fastq_demultiplex+0x474>
mov    -0x40c8(%rbp),%rdi
mov    -0x4098(%rbp),%edx
mov    -0x4094(%rbp),%ecx
mov    -0x4090(%rbp),%r8d
mov    -0x408c(%rbp),%r9d
movsbl -0x4061(%rbp),%r13d
ff
lea    -0x3060(%rbp),%r12
mov    -0x4098(%rbp),%r15d
mov    -0x4094(%rbp),%r14d
mov    -0x4090(%rbp),%ebx
mov    -0x408c(%rbp),%r11d
movsbl -0x4061(%rbp),%r10d
ff
lea    -0x4060(%rbp),%rax
lea    0xa11(%rip),%rsi
sub    $0x40,%rsp
mov    %r13d,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11d,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %rax,0x38(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0x40,%rsp
jmp    120a <qseq2fastq_demultiplex+0xca>
movl   $0x0,-0x2c(%rbp)
movl   $0x1,-0x40c0(%rbp)
mov    -0x40b0(%rbp),%rax
mov    %rax,%rsp
jmp    16ce <qseq2fastq_demultiplex+0x58e>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<qseq2fastq_demultiplex>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3088,%rsp
mov    %r8,-0xb0(%rbp)
mov    %ecx,-0x30(%rbp)
mov    $0x1,%eax
mov    %rdi,-0x88(%rbp)
test   %rdi,%rdi
je     1529 <qseq2fastq_demultiplex+0x3d9>
test   %rsi,%rsi
je     1529 <qseq2fastq_demultiplex+0x3d9>
mov    %rdx,%r15
mov    %r9d,-0x80(%rbp)
mov    %rsi,-0x78(%rbp)
mov    %rsp,-0x38(%rbp)
mov    -0x30(%rbp),%ecx
mov    %ecx,%r13d
mov    %rsp,%r12
lea    0xf(,%r13,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
test   %ecx,%ecx
jle    11d6 <qseq2fastq_demultiplex+0x86>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1040 <strlen@plt>
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11c0 <qseq2fastq_demultiplex+0x70>
lea    -0x6c(%rbp),%rcx
lea    -0x68(%rbp),%rbx
lea    -0x64(%rbp),%r14
sub    $0x8,%rsp
lea    -0x2c(%rbp),%r11
lea    -0x10b0(%rbp),%rax
lea    -0x20b0(%rbp),%r10
lea    0xe01(%rip),%rsi
lea    -0x30b0(%rbp),%rdx
mov    -0x78(%rbp),%rdi
mov    %rbx,%r8
mov    %r14,%r9
push   %r11
push   %rax
push   %r10
lea    -0x54(%rbp),%rax
push   %rax
lea    -0x58(%rbp),%rax
push   %rax
lea    -0x5c(%rbp),%rax
push   %rax
lea    -0x60(%rbp),%rax
push   %rax
call   1050 <fscanf@plt>
add    $0x40,%rsp
test   %eax,%eax
jle    14e1 <qseq2fastq_demultiplex+0x391>
mov    %r15,-0xa8(%rbp)
mov    %r13,-0xa0(%rbp)
mov    %r12,-0x98(%rbp)
jmp    132a <qseq2fastq_demultiplex+0x1da>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    $0x8,%rsp
mov    -0x88(%rbp),%rdi
lea    0xd8e(%rip),%rsi
lea    -0x30b0(%rbp),%rdx
mov    %r14,%r15
lea    -0x6c(%rbp),%r14
mov    %r14,%rcx
mov    %rbx,%r8
mov    %r15,%r9
lea    -0x2c(%rbp),%rax
push   %rax
lea    -0x10b0(%rbp),%rax
push   %rax
lea    -0x20b0(%rbp),%rax
push   %rax
lea    -0x54(%rbp),%rax
push   %rax
lea    -0x58(%rbp),%r12
push   %r12
lea    -0x5c(%rbp),%r13
push   %r13
lea    -0x60(%rbp),%rax
push   %rax
call   1050 <fscanf@plt>
lea    -0x30b0(%rbp),%rdx
lea    0xd39(%rip),%rsi
lea    -0x20b0(%rbp),%r11
lea    -0x10b0(%rbp),%r10
lea    -0x2c(%rbp),%rax
add    $0x40,%rsp
mov    -0x78(%rbp),%rdi
sub    $0x8,%rsp
mov    %r14,%rcx
mov    %rbx,%r8
mov    %r15,%r9
push   %rax
push   %r10
push   %r11
lea    -0x54(%rbp),%rax
push   %rax
push   %r12
push   %r13
lea    -0x60(%rbp),%rax
push   %rax
call   1050 <fscanf@plt>
add    $0x40,%rsp
test   %eax,%eax
mov    %r15,%r14
mov    -0xa8(%rbp),%r15
mov    -0xa0(%rbp),%r13
mov    -0x98(%rbp),%r12
jle    14e1 <qseq2fastq_demultiplex+0x391>
cmp    $0xb,%eax
jne    14e5 <qseq2fastq_demultiplex+0x395>
mov    -0x2c(%rbp),%ecx
mov    -0x80(%rbp),%eax
test   %eax,%eax
jne    1346 <qseq2fastq_demultiplex+0x1f6>
cmp    $0x1,%ecx
jne    1260 <qseq2fastq_demultiplex+0x110>
mov    %ecx,-0x7c(%rbp)
mov    0x2c88(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
cmpl   $0x0,-0x30(%rbp)
jle    13a9 <qseq2fastq_demultiplex+0x259>
xor    %r14d,%r14d
lea    -0x20b0(%rbp),%r10
jmp    1380 <qseq2fastq_demultiplex+0x230>
nopl   0x0(%rax)
add    $0x1,%r14
cmp    %r14,%r13
lea    -0x20b0(%rbp),%r10
je     13b0 <qseq2fastq_demultiplex+0x260>
mov    (%r15,%r14,8),%rdi
mov    (%r12,%r14,4),%edx
mov    %r10,%rsi
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1370 <qseq2fastq_demultiplex+0x220>
mov    -0xb0(%rbp),%rax
mov    (%rax,%r14,8),%rax
mov    %rax,-0x90(%rbp)
jmp    1370 <qseq2fastq_demultiplex+0x220>
lea    -0x20b0(%rbp),%r10
sub    $0x8,%rsp
mov    -0x88(%rbp),%rdi
lea    0xc3e(%rip),%rsi
lea    -0x30b0(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
mov    %rbx,%r14
mov    %rbx,%r8
lea    -0x64(%rbp),%r9
lea    -0x2c(%rbp),%rax
push   %rax
lea    -0x10b0(%rbp),%rax
push   %rax
push   %r10
lea    -0x54(%rbp),%rax
push   %rax
lea    -0x58(%rbp),%r13
push   %r13
lea    -0x5c(%rbp),%r15
push   %r15
lea    -0x60(%rbp),%rax
push   %rax
call   1050 <fscanf@plt>
add    $0x40,%rsp
cmp    $0xb,%eax
jne    14fd <qseq2fastq_demultiplex+0x3ad>
mov    -0x10b0(%rbp),%al
test   %al,%al
je     1430 <qseq2fastq_demultiplex+0x2e0>
lea    -0x10af(%rbp),%rcx
nop
add    $0xe1,%al
mov    %al,-0x1(%rcx)
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1420 <qseq2fastq_demultiplex+0x2d0>
lea    -0x20b0(%rbp),%r11
mov    %r11,%rax
lea    -0x10b0(%rbp),%r10
jmp    1457 <qseq2fastq_demultiplex+0x307>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movb   $0x4e,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x2e,%cl
je     1450 <qseq2fastq_demultiplex+0x300>
test   %cl,%cl
jne    1453 <qseq2fastq_demultiplex+0x303>
cmpl   $0x1,-0x7c(%rbp)
mov    -0x68(%rbp),%edx
mov    -0x64(%rbp),%ecx
mov    -0x60(%rbp),%r8d
mov    -0x5c(%rbp),%r9d
mov    $0x4e,%ebx
mov    $0x59,%eax
cmove  %eax,%ebx
mov    -0x90(%rbp),%rdi
lea    0xbee(%rip),%rsi
xor    %eax,%eax
push   %r10
push   %rbx
push   %r9
push   %r8
push   %rcx
push   %rdx
push   %r11
push   %rbx
call   1060 <fprintf@plt>
lea    -0x20b0(%rbp),%r11
lea    -0x10b0(%rbp),%r10
add    $0x40,%rsp
mov    -0x78(%rbp),%rdi
mov    %r14,%rbx
lea    -0x6c(%rbp),%r14
mov    %r13,%r12
mov    %r15,%r13
lea    -0x64(%rbp),%r15
lea    -0x2c(%rbp),%rax
lea    0xb2b(%rip),%rsi
lea    -0x30b0(%rbp),%rdx
jmp    12e1 <qseq2fastq_demultiplex+0x191>
xor    %eax,%eax
jmp    1522 <qseq2fastq_demultiplex+0x3d2>
mov    0x2af4(%rip),%rax
movslq (%rax),%rcx
lea    0xb2b(%rip),%rdi
mov    $0x2f,%esi
jmp    1513 <qseq2fastq_demultiplex+0x3c3>
mov    0x2adc(%rip),%rax
movslq (%rax),%rcx
lea    0xb43(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
mov    $0x1,%eax
mov    -0x38(%rbp),%rcx
mov    %rcx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"%s\09%d\09%d\09%d\09%d\09%d\09%d\09%d\09%s\09%s\09%d\00"
@stderr = global i32 0
@.str.1 = [48 x i8] c"wrong numbers of elements in barcode file line\0A\00"
@stdout = global i32* null
@.str.2 = [45 x i8] c"wrong numbers of elements in qseq file line\0A\00"
@.str.3 = [39 x i8] c"@%d:%d:%d:%d:%c\0A%s\0A+%d:%d:%d:%d:%c\0A%s\0A\00"
define i32 @qseq2fastq_demultiplex(i32* %0, i32* %1, i8** %2, i32 %3, i32** %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8**
%11 = alloca i32
%12 = alloca i32**
%13 = alloca i32
%14 = alloca [4096 x i8]
%15 = alloca [4096 x i8]
%16 = alloca [4096 x i8]
%17 = alloca [4096 x i8]
%18 = alloca i8
%19 = alloca i32
%20 = alloca [12 x i32]
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i64
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store i32* %0, i32** %8
store i32* %1, i32** %9
store i8** %2, i8*** %10
store i32 %3, i32* %11
store i32** %4, i32*** %12
store i32 %5, i32* %13
%30 = load i32*, i32** %8
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %227
32: ; preds = %6
%33 = load i32*, i32** %9
%34 = icmp ne i32* %33, null
br i1 %34, label %35, label %227
35: ; preds = %32
%36 = load i32, i32* %11
%37 = zext i32 %36 to i64
%38 = call i8* @llvm.stacksave()
store i8* %38, i8** %22
%39 = alloca i32, i64 %37
store i64 %37, i64* %23
store i32 0, i32* %24
br label %40
40: ; preds = %54, %35
%41 = load i32, i32* %24
%42 = load i32, i32* %11
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %57
44: ; preds = %40
%45 = load i8**, i8*** %10
%46 = load i32, i32* %24
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
%50 = call i32 @strlen(i8* %49)
%51 = load i32, i32* %24
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %39, i64 %52
store i32 %50, i32* %53
br label %54
54: ; preds = %44
%55 = load i32, i32* %24
%56 = add nsw i32 %55, 1
store i32 %56, i32* %24
br label %40
57: ; preds = %40
br label %58
58: ; preds = %199, %91, %57
%59 = load i32*, i32** %9
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%61 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 1
%62 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 2
%63 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 3
%64 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 4
%65 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 5
%66 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 6
%67 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 7
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%69 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%70 = call i32 @fscanf(i32* %59, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %60, i32* %61, i32* %62, i32* %63, i32* %64, i32* %65, i32* %66, i32* %67, i8* %68, i8* %69, i32* %21)
store i32 %70, i32* %19
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %224
72: ; preds = %58
%73 = load i32, i32* %19
%74 = icmp ne i32 %73, 11
br i1 %74, label %75, label %80
75: ; preds = %72
%76 = load i32, i32* @stderr
%77 = sext i32 %76 to i64
%78 = inttoptr i64 %77 to i32*
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %7
store i32 1, i32* %25
br label %225
80: ; preds = %72
%81 = load i32, i32* %13
%82 = icmp ne i32 %81, 0
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load i32, i32* %21
%85 = icmp eq i32 %84, 1
br i1 %85, label %86, label %91
86: ; preds = %83, %80
store i8 78, i8* %18
%87 = load i32, i32* %21
%88 = icmp eq i32 %87, 1
br i1 %88, label %89, label %90
89: ; preds = %86
store i8 89, i8* %18
br label %90
90: ; preds = %89, %86
br label %104
91: ; preds = %83
%92 = load i32*, i32** %8
%93 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%94 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 1
%95 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 2
%96 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 3
%97 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 4
%98 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 5
%99 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 6
%100 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 7
%101 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%102 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%103 = call i32 @fscanf(i32* %92, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %93, i32* %94, i32* %95, i32* %96, i32* %97, i32* %98, i32* %99, i32* %100, i8* %101, i8* %102, i32* %21)
store i32 %103, i32* %19
br label %58
104: ; preds = %90
%105 = load i32*, i32** @stdout
store i32* %105, i32** %26
store i32 0, i32* %27
br label %106
106: ; preds = %130, %104
%107 = load i32, i32* %27
%108 = load i32, i32* %11
%109 = icmp slt i32 %107, %108
br i1 %109, label %110, label %133
110: ; preds = %106
%111 = load i8**, i8*** %10
%112 = load i32, i32* %27
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %111, i64 %113
%115 = load i8*, i8** %114
%116 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%117 = load i32, i32* %27
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32, i32* %39, i64 %118
%120 = load i32, i32* %119
%121 = call i64 @strncmp(i8* %115, i8* %116, i32 %120)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %110
%124 = load i32**, i32*** %12
%125 = load i32, i32* %27
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i32*, i32** %124, i64 %126
%128 = load i32*, i32** %127
store i32* %128, i32** %26
br label %129
129: ; preds = %123, %110
br label %130
130: ; preds = %129
%131 = load i32, i32* %27
%132 = add nsw i32 %131, 1
store i32 %132, i32* %27
br label %106
133: ; preds = %106
%134 = load i32*, i32** %8
%135 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%136 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 1
%137 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 2
%138 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 3
%139 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 4
%140 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 5
%141 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 6
%142 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 7
%143 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%144 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%145 = call i32 @fscanf(i32* %134, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %135, i32* %136, i32* %137, i32* %138, i32* %139, i32* %140, i32* %141, i32* %142, i8* %143, i8* %144, i32* %21)
store i32 %145, i32* %19
%146 = load i32, i32* %19
%147 = icmp ne i32 %146, 11
br i1 %147, label %148, label %153
148: ; preds = %133
%149 = load i32, i32* @stderr
%150 = sext i32 %149 to i64
%151 = inttoptr i64 %150 to i32*
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %7
store i32 1, i32* %25
br label %225
153: ; preds = %133
store i32 0, i32* %28
br label %154
154: ; preds = %173, %153
%155 = load i32, i32* %28
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 %156
%158 = load i8, i8* %157
%159 = sext i8 %158 to i32
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %176
161: ; preds = %154
%162 = load i32, i32* %28
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 %163
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = sub nsw i32 %166, 64
%168 = add nsw i32 %167, 33
%169 = trunc i32 %168 to i8
%170 = load i32, i32* %28
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 %171
store i8 %169, i8* %172
br label %173
173: ; preds = %161
%174 = load i32, i32* %28
%175 = add nsw i32 %174, 1
store i32 %175, i32* %28
br label %154
176: ; preds = %154
store i32 0, i32* %29
br label %177
177: ; preds = %196, %176
%178 = load i32, i32* %29
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 %179
%181 = load i8, i8* %180
%182 = sext i8 %181 to i32
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %199
184: ; preds = %177
%185 = load i32, i32* %29
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 %186
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp eq i32 %189, 46
br i1 %190, label %191, label %195
191: ; preds = %184
%192 = load i32, i32* %29
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 %193
store i8 78, i8* %194
br label %195
195: ; preds = %191, %184
br label %196
196: ; preds = %195
%197 = load i32, i32* %29
%198 = add nsw i32 %197, 1
store i32 %198, i32* %29
br label %177
199: ; preds = %177
%200 = load i32*, i32** %26
%201 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 2
%202 = load i32, i32* %201
%203 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 3
%204 = load i32, i32* %203
%205 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 4
%206 = load i32, i32* %205
%207 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 5
%208 = load i32, i32* %207
%209 = load i8, i8* %18
%210 = sext i8 %209 to i32
%211 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%212 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 2
%213 = load i32, i32* %212
%214 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 3
%215 = load i32, i32* %214
%216 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 4
%217 = load i32, i32* %216
%218 = getelementptr inbounds [12 x i32], [12 x i32]* %20, i64 0, i64 5
%219 = load i32, i32* %218
%220 = load i8, i8* %18
%221 = sext i8 %220 to i32
%222 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%223 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %202, i32 %204, i32 %206, i32 %208, i32 %210, i8* %211, i32 %213, i32 %215, i32 %217, i32 %219, i32 %221, i8* %222)
br label %58
224: ; preds = %58
store i32 0, i32* %7
store i32 1, i32* %25
br label %225
225: ; preds = %224, %148, %75
%226 = load i8*, i8** %22
br label %228
227: ; preds = %32, %6
store i32 1, i32* %7
br label %228
228: ; preds = %227, %225
%229 = load i32, i32* %7
ret i32 %229
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s\09%d\09%d\09%d\09%d\09%d\09%d\09%d\09%s\09%s\09%d\00"
@stderr = global i32 0
@.str.1 = [48 x i8] c"wrong numbers of elements in barcode file line\0A\00"
@stdout = global i32* null
@.str.2 = [45 x i8] c"wrong numbers of elements in qseq file line\0A\00"
@.str.3 = [39 x i8] c"@%d:%d:%d:%d:%c\0A%s\0A+%d:%d:%d:%d:%c\0A%s\0A\00"
define i32 @qseq2fastq_demultiplex(i32* %0, i32* %1, i8** nocapture %2, i32 %3, i32** nocapture %4, i32 %5) {
%7 = alloca [4096 x i8]
%8 = alloca [4096 x i8]
%9 = alloca [4096 x i8]
%10 = alloca [12 x i32]
%11 = alloca i32
%12 = icmp ne i32* %0, null
%13 = icmp ne i32* %1, null
%14 = and i1 %12, %13
br i1 %14, label %15, label %118
15: ; preds = %6
%16 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%19 = bitcast [12 x i32]* %10 to i8*
%20 = bitcast i32* %11 to i8*
%21 = zext i32 %3 to i64
%22 = tail call i8* @llvm.stacksave()
%23 = alloca i32, i64 %21
%24 = icmp sgt i32 %3, 0
br i1 %24, label %37, label %25
25: ; preds = %37, %15
%26 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 1
%27 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 2
%28 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 3
%29 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 4
%30 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 5
%31 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 6
%32 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 7
%33 = call i32 @fscanf(i32* %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30, i32* %31, i32* %32, i8* %17, i8* %18, i32* %11)
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %116
35: ; preds = %25
%36 = icmp ne i32 %5, 0
br label %45
37: ; preds = %15, %37
%38 = phi i64 [ %43, %37 ], [ 0, %15 ]
%39 = getelementptr inbounds i8*, i8** %2, i64 %38
%40 = load i8*, i8** %39
%41 = tail call i32 @strlen(i8* %40)
%42 = getelementptr inbounds i32, i32* %23, i64 %38
store i32 %41, i32* %42
%43 = add nuw nsw i64 %38, 1
%44 = icmp eq i64 %43, %21
br i1 %44, label %25, label %37
45: ; preds = %35, %61
%46 = phi i32 [ %33, %35 ], [ %62, %61 ]
%47 = icmp eq i32 %46, 11
br i1 %47, label %53, label %48
48: ; preds = %45
%49 = load i32, i32* @stderr
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i32*
%52 = call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i64 47, i64 1, i32* %51)
br label %116
53: ; preds = %45
%54 = load i32, i32* %11
%55 = icmp eq i32 %54, 1
%56 = select i1 %36, i1 true, i1 %55
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = load i32*, i32** @stdout
br i1 %24, label %71, label %64
59: ; preds = %53
%60 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30, i32* %31, i32* %32, i8* %17, i8* %18, i32* %11)
br label %61
61: ; preds = %109, %59
%62 = call i32 @fscanf(i32* %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30, i32* %31, i32* %32, i8* %17, i8* %18, i32* %11)
%63 = icmp sgt i32 %62, 0
br i1 %63, label %45, label %116
64: ; preds = %83, %57
%65 = phi i32* [ %58, %57 ], [ %84, %83 ]
%66 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30, i32* %31, i32* %32, i8* %17, i8* %18, i32* %11)
%67 = icmp eq i32 %66, 11
br i1 %67, label %68, label %87
68: ; preds = %64
%69 = load i8, i8* %18
%70 = icmp eq i8 %69, 0
br i1 %70, label %101, label %92
71: ; preds = %57, %83
%72 = phi i64 [ %85, %83 ], [ 0, %57 ]
%73 = phi i32* [ %84, %83 ], [ %58, %57 ]
%74 = getelementptr inbounds i8*, i8** %2, i64 %72
%75 = load i8*, i8** %74
%76 = getelementptr inbounds i32, i32* %23, i64 %72
%77 = load i32, i32* %76
%78 = call i64 @strncmp(i8* %75, i8* %17, i32 %77)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %71
%81 = getelementptr inbounds i32*, i32** %4, i64 %72
%82 = load i32*, i32** %81
br label %83
83: ; preds = %71, %80
%84 = phi i32* [ %82, %80 ], [ %73, %71 ]
%85 = add nuw nsw i64 %72, 1
%86 = icmp eq i64 %85, %21
br i1 %86, label %64, label %71
87: ; preds = %64
%88 = load i32, i32* @stderr
%89 = sext i32 %88 to i64
%90 = inttoptr i64 %89 to i32*
%91 = call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i64 44, i64 1, i32* %90)
br label %116
92: ; preds = %68, %92
%93 = phi i64 [ %97, %92 ], [ 0, %68 ]
%94 = phi i8 [ %99, %92 ], [ %69, %68 ]
%95 = phi i8* [ %98, %92 ], [ %18, %68 ]
%96 = add i8 %94, -31
store i8 %96, i8* %95
%97 = add nuw nsw i64 %93, 1
%98 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %97
%99 = load i8, i8* %98
%100 = icmp eq i8 %99, 0
br i1 %100, label %101, label %92
101: ; preds = %92, %68
br label %102
102: ; preds = %101, %107
%103 = phi i64 [ %108, %107 ], [ 0, %101 ]
%104 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %103
%105 = load i8, i8* %104
switch i8 %105, label %107 [
i8 0, label %109
i8 46, label %106
]
106: ; preds = %102
store i8 78, i8* %104
br label %107
107: ; preds = %102, %106
%108 = add nuw i64 %103, 1
br label %102
109: ; preds = %102
%110 = load i32, i32* %27
%111 = load i32, i32* %28
%112 = load i32, i32* %29
%113 = load i32, i32* %30
%114 = select i1 %55, i32 89, i32 78
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %110, i32 %111, i32 %112, i32 %113, i32 %114, i8* %17, i32 %110, i32 %111, i32 %112, i32 %113, i32 %114, i8* %18)
br label %61
116: ; preds = %61, %25, %87, %48
%117 = phi i32 [ 1, %48 ], [ 1, %87 ], [ 0, %25 ], [ 0, %61 ]
br label %118
118: ; preds = %6, %116
%119 = phi i32 [ %117, %116 ], [ 1, %6 ]
ret i32 %119
}