// File: /workspace/github_c_makefile_star2_O0/annoroad[P]fqtools_plus/fqtools.c
// Function: quality_base_percent
local void quality_base_percent(struct readclass* readclass){
	readline* read1 = readclass->read1;
    int i=0;
    int curqual;
    read1->highAT_sign=0;
    read1->low = 0;
	read1->N = 0;
    read1->Q30=0;
    read1->A=0;
    read1->T=0;
    read1->GC=0;
	char* seq=(read1->reads)[1];
	char* qual=(read1->reads)[3];
    while(i < g.CUT){
        switch (*(seq + i)){
            case 'A': read1->A++; break;
            case 'a': read1->A++; break;
            case 'T': read1->T++; break;
            case 't': read1->T++; break;
            case 'G': read1->GC++; break;
            case 'g': read1->GC++; break;
            case 'C': read1->GC++; break;
            case 'c': read1->GC++; break;
            case 'N': read1->N++;  break;
            case 'n': read1->N++;  break;
        }
        curqual = (int)*(qual + i) - g.ASCII;
        i++;
        if (curqual <= g.LOWQ){
           	read1->low++;
            continue;
        }

        if (curqual >= g.HIGHQ){
            read1->Q30++;
            continue;
        }
    }
    if (read1->A >= g.highAT || read1->T >= g.highAT){
    	read1->highAT_sign=1;
    }
    if (g.single_or_pair){
    	readline* read2 = readclass->read2;
    	i=0;
	    read2->highAT_sign=0;
	    read2->low = 0;
		read2->N = 0;
	    read2->Q30=0;
	    read2->A=0;
	    read2->T=0;
	    read2->GC=0;
	   	seq=(read2->reads)[1];
		qual=(read2->reads)[3];
	    while(i < g.CUT){
	        switch (*(seq + i)){
	            case 'A': read2->A++; break;
	            case 'a': read2->A++; break;
	            case 'T': read2->T++; break;
	            case 't': read2->T++; break;
	            case 'G': read2->GC++; break;
	            case 'g': read2->GC++; break;
	            case 'C': read2->GC++; break;
	            case 'c': read2->GC++; break;
	            case 'N': read2->N++;  break;
	            case 'n': read2->N++;  break;
	        }
	        curqual = (int)*(qual + i) - g.ASCII;
	        i++;
	        if (curqual <= g.LOWQ){
	            read2->low++;
	            continue;
	        }
	        if (curqual >= g.HIGHQ){
	            read2->Q30++;
	            continue;
	        }
	    }
		if (read2->A >= g.highAT || read2->T >= g.highAT){
		   	read2->highAT_sign=1;
		}
    }
    
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x10(%rsp), %rax
movb $0x0, 0x1c(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x14(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x18(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rsp), %rax
addq $0x1d, %rax
addq $0x400, %rax            # imm = 0x400
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
addq $0x1d, %rax
addq $0xc00, %rax            # imm = 0xC00
movq %rax, -0x28(%rsp)
movl -0x14(%rsp), %eax
cmpl 0x8ddf(%rip), %eax      # 0xd1dc
jge 0x4540
movq -0x20(%rsp), %rax
movslq -0x14(%rsp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rsp)
subl $0x33, %eax
ja 0x44da
movq -0x38(%rsp), %rax
leaq 0x5ca4(%rip), %rcx      # 0xa0d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0x44da
movq -0x10(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x28(%rsp), %rax
movslq -0x14(%rsp), %rcx
movsbl (%rax,%rcx), %eax
subl 0x8d1e(%rip), %eax      # 0xd20c
movl %eax, -0x18(%rsp)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movl -0x18(%rsp), %eax
cmpl 0x8ce9(%rip), %eax      # 0xd1f0
jg 0x451c
movq -0x10(%rsp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x43f3
movl -0x18(%rsp), %eax
cmpl 0x8cce(%rip), %eax      # 0xd1f4
jl 0x453b
movq -0x10(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x43f3
jmp 0x43f3
movq -0x10(%rsp), %rax
cvtsi2ssl 0x8(%rax), %xmm0
ucomiss 0x8caf(%rip), %xmm0     # 0xd200
jae 0x4566
movq -0x10(%rsp), %rax
cvtsi2ssl 0xc(%rax), %xmm0
ucomiss 0x8c9c(%rip), %xmm0     # 0xd200
jb 0x456f
movq -0x10(%rsp), %rax
movb $0x1, 0x1c(%rax)
cmpb $0x0, 0x8c62(%rip)      # 0xd1d8
je 0x4789
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x30(%rsp), %rax
movb $0x0, 0x1c(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0x14(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0x18(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0x4(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0x8(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0xc(%rax)
movq -0x30(%rsp), %rax
movl $0x0, 0x10(%rax)
movq -0x30(%rsp), %rax
addq $0x1d, %rax
addq $0x400, %rax            # imm = 0x400
movq %rax, -0x20(%rsp)
movq -0x30(%rsp), %rax
addq $0x1d, %rax
addq $0xc00, %rax            # imm = 0xC00
movq %rax, -0x28(%rsp)
movl -0x14(%rsp), %eax
cmpl 0x8bc7(%rip), %eax      # 0xd1dc
jge 0x4758
movq -0x20(%rsp), %rax
movslq -0x14(%rsp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rsp)
subl $0x33, %eax
ja 0x46f2
movq -0x40(%rsp), %rax
leaq 0x59bc(%rip), %rcx      # 0xa004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0x46f2
movq -0x30(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x28(%rsp), %rax
movslq -0x14(%rsp), %rcx
movsbl (%rax,%rcx), %eax
subl 0x8b06(%rip), %eax      # 0xd20c
movl %eax, -0x18(%rsp)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movl -0x18(%rsp), %eax
cmpl 0x8ad1(%rip), %eax      # 0xd1f0
jg 0x4734
movq -0x30(%rsp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x460b
movl -0x18(%rsp), %eax
cmpl 0x8ab6(%rip), %eax      # 0xd1f4
jl 0x4753
movq -0x30(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x460b
jmp 0x460b
movq -0x30(%rsp), %rax
cvtsi2ssl 0x8(%rax), %xmm0
ucomiss 0x8a97(%rip), %xmm0     # 0xd200
jae 0x477e
movq -0x30(%rsp), %rax
cvtsi2ssl 0xc(%rax), %xmm0
ucomiss 0x8a84(%rip), %xmm0     # 0xd200
jb 0x4787
movq -0x30(%rsp), %rax
movb $0x1, 0x1c(%rax)
jmp 0x4789
retq
nopw (%rax,%rax)