// File: /workspace/github_cpp_makefile_star2_O3/VanAndelInstitute[P]intent/src/seq_tools.cpp
// Function: fix_barcodes(ParsedBarcode&)
void fix_barcodes(ParsedBarcode &bc) {
    if(! v2_bc1_whitelisted(bc.barcode1)){
        bc.barcode1 = v2_corrected_bc(bc.barcode1, V2_BC1, 2);
        if(bc.barcode1 == "") {
            bc.status = BC_ERROR_BAD_BARCODE;
        } else {
            bc.bc_fixed = true;
        }
    }
    if(! v2_bc2_whitelisted(bc.barcode2)){
        bc.barcode2 = v2_corrected_bc(bc.barcode2, V2_BC2, 2);
        if(bc.barcode2 == "") {
            bc.status = BC_ERROR_BAD_BARCODE;
        } else {
            bc.bc_fixed = true;
        }
    }
    if(bc.bc_fixed) {
        fix_quality_lengths(bc);
    }
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x1c190
leaq 0x121de(%rip), %rdi     # 0x408a0
movq %r14, %rsi
callq 0x300d8
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e6ea
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x121b7(%rip), %rax     # 0x408a8
cmpq %rax, %r14
jne 0x2e7bd
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x1c190
leaq 0x12180(%rip), %rsi     # 0x408a0
leaq 0xd8(%rsp), %rdi
callq 0x2fe3c
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movl $0x2, %ecx
callq 0x2e982
leaq 0x8(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x64d0
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2e777
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0xd8(%rsp), %rdi
callq 0x1a8ea
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e79b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x3c97(%rip), %rsi      # 0x32439
movq %r14, %rdi
callq 0x60f0
testl %eax, %eax
je 0x2e7b7
movb $0x1, 0xc8(%rbx)
jmp 0x2e7bd
movl $0x4, (%rbx)
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x1c190
leaq 0x120eb(%rip), %rdi     # 0x408d0
movq %r14, %rsi
callq 0x300d8
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e807
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x120ca(%rip), %rax     # 0x408d8
cmpq %rax, %r14
jne 0x2e8da
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x1c190
leaq 0x12093(%rip), %rsi     # 0x408d0
leaq 0xa8(%rsp), %rdi
callq 0x2fe3c
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movl $0x2, %ecx
callq 0x2e982
leaq 0x48(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x64d0
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2e894
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0xa8(%rsp), %rdi
callq 0x1a8ea
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e8b8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x3b7a(%rip), %rsi      # 0x32439
movq %r14, %rdi
callq 0x60f0
testl %eax, %eax
je 0x2e8d4
movb $0x1, 0xc8(%rbx)
jmp 0x2e8da
movl $0x4, (%rbx)
cmpb $0x1, 0xc8(%rbx)
jne 0x2e8eb
movq %rbx, %rdi
callq 0x2e126
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x1a8ea
jmp 0x2e90f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e97a
movq 0x38(%rsp), %rsi
jmp 0x2e972
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x1a8ea
jmp 0x2e935
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e97a
movq 0x58(%rsp), %rsi
jmp 0x2e972
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e97a
movq 0x78(%rsp), %rsi
jmp 0x2e972
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e97a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
movq %rbx, %rdi
callq 0x6660