// File: /workspace/github_cpp_makefile_star2_O1/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 0x1c224
leaq 0x11596(%rip), %rdi     # 0x3f8a0
movq %r14, %rsi
callq 0x2fd18
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e332
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x1156f(%rip), %rax     # 0x3f8a8
cmpq %rax, %r14
jne 0x2e405
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x1c224
leaq 0x11538(%rip), %rsi     # 0x3f8a0
leaq 0xd8(%rsp), %rdi
callq 0x2fa7c
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movl $0x2, %ecx
callq 0x2e5ca
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 0x2e3bf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0xd8(%rsp), %rdi
callq 0x1a990
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e3e3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x304f(%rip), %rsi      # 0x31439
movq %r14, %rdi
callq 0x60f0
testl %eax, %eax
je 0x2e3ff
movb $0x1, 0xc8(%rbx)
jmp 0x2e405
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 0x1c224
leaq 0x114a3(%rip), %rdi     # 0x3f8d0
movq %r14, %rsi
callq 0x2fd18
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e44f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x11482(%rip), %rax     # 0x3f8d8
cmpq %rax, %r14
jne 0x2e522
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x1c224
leaq 0x1144b(%rip), %rsi     # 0x3f8d0
leaq 0xa8(%rsp), %rdi
callq 0x2fa7c
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movl $0x2, %ecx
callq 0x2e5ca
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 0x2e4dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0xa8(%rsp), %rdi
callq 0x1a990
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e500
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x2f32(%rip), %rsi      # 0x31439
movq %r14, %rdi
callq 0x60f0
testl %eax, %eax
je 0x2e51c
movb $0x1, 0xc8(%rbx)
jmp 0x2e522
movl $0x4, (%rbx)
cmpb $0x1, 0xc8(%rbx)
jne 0x2e533
movq %rbx, %rdi
callq 0x2dd6e
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x1a990
jmp 0x2e557
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e5c2
movq 0x38(%rsp), %rsi
jmp 0x2e5ba
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x1a990
jmp 0x2e57d
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e5c2
movq 0x58(%rsp), %rsi
jmp 0x2e5ba
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e5c2
movq 0x78(%rsp), %rsi
jmp 0x2e5ba
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e5c2
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
movq %rbx, %rdi
callq 0x6660