// File: /workspace/github_cpp_makefile_star2_O3/dannye[P]jed/src/decoder.cpp
// Function: readStartOfScan(BitReader&, JPGImage*)
void readStartOfScan(BitReader& bitReader, JPGImage* const image) {
    std::cout << "Reading SOS Marker\n";
    if (image->numComponents == 0) {
        std::cout << "Error - SOS detected before SOF\n";
        image->valid = false;
        return;
    }

    uint length = bitReader.readWord();

    for (uint i = 0; i < image->numComponents; ++i) {
        image->colorComponents[i].usedInScan = false;
    }

    // the number of components in the next scan might not be all
    //   components in the image
    image->componentsInScan = bitReader.readByte();
    if (image->componentsInScan == 0) {
        std::cout << "Error - Scan must include at least 1 component\n";
        image->valid = false;
        return;
    }
    for (uint i = 0; i < image->componentsInScan; ++i) {
        byte componentID = bitReader.readByte();
        // component IDs are usually 1, 2, 3 but rarely can be seen as 0, 1, 2
        if (image->zeroBased) {
            componentID += 1;
        }
        if (componentID == 0 || componentID > image->numComponents) {
            std::cout << "Error - Invalid color component ID: " << (uint)componentID << '\n';
            image->valid = false;
            return;
        }
        ColorComponent& component = image->colorComponents[componentID - 1];
        if (!component.usedInFrame) {
            std::cout << "Error - Invalid color component ID: " << (uint)componentID << '\n';
            image->valid = false;
            return;
        }
        if (component.usedInScan) {
            std::cout << "Error - Duplicate color component ID: " << (uint)componentID << '\n';
            image->valid = false;
            return;
        }
        component.usedInScan = true;

        byte huffmanTableIDs = bitReader.readByte();
        component.huffmanDCTableID = huffmanTableIDs >> 4;
        component.huffmanACTableID = huffmanTableIDs & 0x0F;
        if (component.huffmanDCTableID > 3) {
            std::cout << "Error - Invalid Huffman DC table ID: " << (uint)component.huffmanDCTableID << '\n';
            image->valid = false;
            return;
        }
        if (component.huffmanACTableID > 3) {
            std::cout << "Error - Invalid Huffman AC table ID: " << (uint)component.huffmanACTableID << '\n';
            image->valid = false;
            return;
        }
    }

    image->startOfSelection = bitReader.readByte();
    image->endOfSelection = bitReader.readByte();
    byte successiveApproximation = bitReader.readByte();
    image->successiveApproximationHigh = successiveApproximation >> 4;
    image->successiveApproximationLow = successiveApproximation & 0x0F;

    if (image->frameType == SOF0) {
        // Baseline JPGs don't use spectral selection or successive approximtion
        if (image->startOfSelection != 0 || image->endOfSelection != 63) {
            std::cout << "Error - Invalid spectral selection\n";
            image->valid = false;
            return;
        }
        if (image->successiveApproximationHigh != 0 || image->successiveApproximationLow != 0) {
            std::cout << "Error - Invalid successive approximation\n";
            image->valid = false;
            return;
        }
    }
    else if (image->frameType == SOF2) {
        if (image->startOfSelection > image->endOfSelection) {
            std::cout << "Error - Invalid spectral selection (start greater than end)\n";
            image->valid = false;
            return;
        }
        if (image->endOfSelection > 63) {
            std::cout << "Error - Invalid spectral selection (end greater than 63)\n";
            image->valid = false;
            return;
        }
        if (image->startOfSelection == 0 && image->endOfSelection != 0) {
            std::cout << "Error - Invalid spectral selection (contains DC and AC)\n";
            image->valid = false;
            return;
        }
        if (image->startOfSelection != 0 && image->componentsInScan != 1) {
            std::cout << "Error - Invalid spectral selection (AC scan contains multiple components)\n";
            image->valid = false;
            return;
        }
        if (image->successiveApproximationHigh != 0 &&
            image->successiveApproximationLow != image->successiveApproximationHigh - 1) {
            std::cout << "Error - Invalid successive approximation\n";
            image->valid = false;
            return;
        }
    }

    for (uint i = 0; i < image->numComponents; ++i) {
        const ColorComponent& component = image->colorComponents[i];
        if (image->colorComponents[i].usedInScan) {
            if (image->quantizationTables[component.quantizationTableID].set == false) {
                std::cout << "Error - Color component using uninitialized quantization table\n";
                image->valid = false;
                return;
            }
            if (image->startOfSelection == 0) {
                if (image->huffmanDCTables[component.huffmanDCTableID].set == false) {
                    std::cout << "Error - Color component using uninitialized Huffman DC table\n";
                    image->valid = false;
                    return;
                }
            }
            if (image->endOfSelection > 0) {
                if (image->huffmanACTables[component.huffmanACTableID].set == false) {
                    std::cout << "Error - Color component using uninitialized Huffman AC table\n";
                    image->valid = false;
                    return;
                }
            }
        }
    }

    if (length - 6 - (2 * image->componentsInScan) != 0) {
        std::cout << "Error - SOS invalid\n";
        image->valid = false;
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r12
movq 0x743c(%rip), %rdi      # 0x9fd8
leaq 0x47b4(%rip), %rsi      # 0x7357
movl $0x13, %edx
callq 0x2130
cmpb $0x0, 0x2070(%rbx)
je 0x32f2
movb $0x0, 0x1(%r12)
leaq 0x8(%r12), %rbp
movq %rbp, %rdi
callq 0x2140
movl %eax, %r14d
movq %rbp, %rdi
callq 0x2140
movl %eax, %r15d
movzbl 0x2070(%rbx), %eax
testq %rax, %rax
je 0x3162
leal 0xf(%rax), %ecx
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x10(%rsp)
shrl $0x4, %ecx
imulq $0x70, %rcx, %rax
movdqa 0x4410(%rip), %xmm1     # 0x7020
movdqa 0x4418(%rip), %xmm2     # 0x7030
movdqa 0x4420(%rip), %xmm3     # 0x7040
movdqa 0x4428(%rip), %xmm4     # 0x7050
movdqa 0x4430(%rip), %xmm5     # 0x7060
movdqa 0x4438(%rip), %xmm6     # 0x7070
movdqa 0x4440(%rip), %xmm7     # 0x7080
movdqa 0x4447(%rip), %xmm8     # 0x7090
xorl %ecx, %ecx
movdqa 0x444c(%rip), %xmm9     # 0x70a0
pcmpeqd %xmm10, %xmm10
movdqa 0x10(%rsp), %xmm12
pxor %xmm9, %xmm12
movdqa %xmm8, %xmm13
pxor %xmm9, %xmm13
movdqa %xmm13, %xmm15
pcmpgtd %xmm12, %xmm15
pshufd $0xa0, %xmm15, %xmm14   # xmm14 = xmm15[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm0    # xmm0 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm13
pshufd $0xf5, %xmm13, %xmm13   # xmm13 = xmm13[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm11   # xmm11 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm0, %xmm11
pshufd $0xf5, %xmm15, %xmm15   # xmm15 = xmm15[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm0    # xmm0 = xmm15[0,2,2,3,4,5,6,7]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
movd %xmm0, %edx
testb $0x1, %dl
je 0x2cc6
movb $0x0, 0x2056(%rbx,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm13
packsswb %xmm13, %xmm13
movd %xmm13, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x2cf9
movb $0x0, 0x205d(%rbx,%rcx)
movdqa %xmm7, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movd %xmm0, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x2d57
movb $0x0, 0x2064(%rbx,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movd %xmm0, %edx
shrl $0x18, %edx
testb $0x1, %dl
je 0x2d94
movb $0x0, 0x206b(%rbx,%rcx)
movdqa %xmm6, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x2, %xmm0, %edx
testb $0x1, %dl
je 0x2dfa
movb $0x0, 0x2072(%rbx,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x2, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x2e2c
movb $0x0, 0x2079(%rbx,%rcx)
movdqa %xmm5, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x3, %xmm0, %edx
testb $0x1, %dl
je 0x2e88
movb $0x0, 0x2080(%rbx,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x3, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x2ec6
movb $0x0, 0x2087(%rbx,%rcx)
movdqa %xmm4, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm11
packsswb %xmm11, %xmm0
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x2f2d
movb $0x0, 0x208e(%rbx,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm13
packsswb %xmm13, %xmm0
pextrw $0x4, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x2f60
movb $0x0, 0x2095(%rbx,%rcx)
movdqa %xmm3, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x5, %xmm0, %edx
testb $0x1, %dl
je 0x2fbc
movb $0x0, 0x209c(%rbx,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x5, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x2ffa
movb $0x0, 0x20a3(%rbx,%rcx)
movdqa %xmm2, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x6, %xmm0, %edx
testb $0x1, %dl
je 0x3060
movb $0x0, 0x20aa(%rbx,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x6, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x3092
movb $0x0, 0x20b1(%rbx,%rcx)
movdqa %xmm1, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm12    # xmm12 = xmm0[1,1,3,3]
movdqa %xmm12, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm14   # xmm14 = xmm11[1,1,3,3]
por %xmm14, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
testb $0x1, %dl
je 0x30ee
movb $0x0, 0x20b8(%rbx,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm12, %xmm11   # xmm11 = xmm12[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm14, %xmm0    # xmm0 = xmm14[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x312c
movb $0x0, 0x20bf(%rbx,%rcx)
movdqa 0x3f7c(%rip), %xmm0     # 0x70b0
paddq %xmm0, %xmm8
paddq %xmm0, %xmm7
paddq %xmm0, %xmm6
paddq %xmm0, %xmm5
paddq %xmm0, %xmm4
paddq %xmm0, %xmm3
paddq %xmm0, %xmm2
paddq %xmm0, %xmm1
addq $0x70, %rcx
cmpq %rcx, %rax
jne 0x2c59
movb $0x0, 0x1(%r12)
movq %rbp, %rdi
callq 0x2140
movb %al, 0x2072(%rbx)
testb %al, %al
je 0x330a
movq %r15, 0x8(%rsp)
shll $0x8, %r14d
movq %r14, 0x10(%rsp)
leaq 0x2050(%rbx), %r15
xorl %r14d, %r14d
movb $0x0, 0x1(%r12)
movq %rbp, %rdi
callq 0x2140
addb 0x2071(%rbx), %al
je 0x3322
movq %rbp, %rcx
movzbl %al, %ebp
cmpb 0x2070(%rbx), %bpl
ja 0x3324
leal -0x1(%rbp), %eax
leaq (,%rax,8), %r13
subq %rax, %r13
cmpb $0x0, 0x5(%r15,%r13)
je 0x3354
addq %r15, %r13
cmpb $0x1, 0x6(%r13)
je 0x3384
movb $0x1, 0x6(%r13)
movb $0x0, 0x1(%r12)
movq %rcx, %rbp
movq %rcx, %rdi
callq 0x2140
movl %eax, %ecx
shrb $0x4, %cl
movb %cl, 0x3(%r13)
movl %eax, %ecx
andb $0xf, %cl
movb %cl, 0x4(%r13)
cmpb $0x40, %al
jae 0x33b1
cmpb $0x4, %cl
jae 0x33e0
incl %r14d
movzbl 0x2072(%rbx), %eax
cmpl %eax, %r14d
jb 0x3196
movq %rbp, %r14
xorl %ebp, %ebp
movb %bpl, 0x1(%r12)
movq %r14, %rdi
callq 0x2140
movb %al, 0x2073(%rbx)
movb %bpl, 0x1(%r12)
movq %r14, %rdi
callq 0x2140
movb %al, 0x2074(%rbx)
movb %bpl, 0x1(%r12)
movq %r14, %rdi
callq 0x2140
movl %eax, %ecx
shrb $0x4, %cl
movb %cl, 0x2075(%rbx)
movl %eax, %edx
andb $0xf, %dl
movb %dl, 0x2076(%rbx)
movzbl 0x2065(%rbx), %esi
cmpl $0xc2, %esi
je 0x3433
cmpl $0xc0, %esi
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
jne 0x34cf
cmpb $0x0, 0x2073(%rbx)
jne 0x3464
cmpb $0x3f, 0x2074(%rbx)
jne 0x3464
cmpb $0x10, %al
setb %al
testb %dl, %dl
sete %cl
testb %cl, %al
jne 0x34cf
movq 0x6cf7(%rip), %rdi      # 0x9fd8
leaq 0x4169(%rip), %rsi      # 0x7451
movl $0x29, %edx
jmp 0x3418
movq 0x6cdf(%rip), %rdi      # 0x9fd8
leaq 0x406b(%rip), %rsi      # 0x736b
movl $0x20, %edx
jmp 0x3418
movq 0x6cc7(%rip), %rdi      # 0x9fd8
leaq 0x4074(%rip), %rsi      # 0x738c
movl $0x2f, %edx
jmp 0x3418
xorl %ebp, %ebp
movq 0x6cad(%rip), %r14      # 0x9fd8
leaq 0x408a(%rip), %rsi      # 0x73bc
movl $0x24, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0x3(%rsp), %rsi
jmp 0x340d
movq 0x6c7d(%rip), %r14      # 0x9fd8
leaq 0x405a(%rip), %rsi      # 0x73bc
movl $0x24, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0x4(%rsp), %rsi
jmp 0x340d
movq 0x6c4d(%rip), %r14      # 0x9fd8
leaq 0x3e98(%rip), %rsi      # 0x722a
movl $0x26, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0x5(%rsp), %rsi
jmp 0x340d
movq 0x6c20(%rip), %r14      # 0x9fd8
leaq 0x4022(%rip), %rsi      # 0x73e1
movl $0x25, %edx
movq %r14, %rdi
callq 0x2130
movzbl 0x3(%r13), %esi
movq %r14, %rdi
callq 0x20a0
leaq 0x6(%rsp), %rsi
jmp 0x340d
movq 0x6bf1(%rip), %r14      # 0x9fd8
leaq 0x4019(%rip), %rsi      # 0x7407
movl $0x25, %edx
movq %r14, %rdi
callq 0x2130
movzbl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x20a0
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movb $0x0, 0x2088(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x2073(%rbx), %dl
movb 0x2074(%rbx), %sil
cmpb %sil, %dl
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
jbe 0x3479
movq 0x6b82(%rip), %rdi      # 0x9fd8
leaq 0x401e(%rip), %rsi      # 0x747b
movl $0x3c, %edx
jmp 0x3418
movq 0x6b6d(%rip), %rdi      # 0x9fd8
leaq 0x3fbb(%rip), %rsi      # 0x742d
movl $0x23, %edx
jmp 0x3418
cmpb $0x40, %sil
jb 0x3494
movq 0x6b52(%rip), %rdi      # 0x9fd8
leaq 0x402b(%rip), %rsi      # 0x74b8
movl $0x39, %edx
jmp 0x3418
testb %dl, %dl
setne %dil
testb %sil, %sil
sete %sil
orb %dil, %sil
je 0x35be
testb %dl, %dl
je 0x34bb
cmpb $0x1, 0x2072(%rbx)
jne 0x35fe
cmpb $0x10, %al
jb 0x34cf
movzbl %cl, %ecx
andl $0xf, %eax
decl %ecx
cmpl %eax, %ecx
jne 0x32da
movzbl 0x2070(%rbx), %esi
testq %rsi, %rsi
je 0x3576
leaq 0x410(%rbx), %rax
leaq 0x1230(%rbx), %rcx
leaq (,%rsi,8), %rdx
subq %rsi, %rdx
xorl %esi, %esi
cmpb $0x1, 0x2056(%rbx,%rsi)
jne 0x356d
movzbl 0x2052(%rbx,%rsi), %edi
movl %edi, %r8d
shll $0x8, %r8d
leaq (%r8,%rdi,4), %rdi
cmpb $0x0, 0x100(%rbx,%rdi)
je 0x35a6
cmpb $0x0, 0x2073(%rbx)
jne 0x354b
movzbl 0x2053(%rbx,%rsi), %edi
imulq $0x388, %rdi, %rdi      # imm = 0x388
cmpb $0x0, 0x384(%rax,%rdi)
je 0x35e6
cmpb $0x0, 0x2074(%rbx)
je 0x356d
movzbl 0x2054(%rbx,%rsi), %edi
imulq $0x388, %rdi, %rdi      # imm = 0x388
cmpb $0x0, 0x384(%rcx,%rdi)
je 0x35d6
addq $0x7, %rsi
cmpq %rsi, %rdx
jne 0x34fa
leal (%r10,%r9), %eax
addl $-0x6, %eax
movzbl 0x2072(%rbx), %ecx
addl %ecx, %ecx
cmpl %ecx, %eax
je 0x3424
movq 0x6a43(%rip), %rdi      # 0x9fd8
leaq 0x4096(%rip), %rsi      # 0x7632
movl $0x14, %edx
jmp 0x3418
movq 0x6a2b(%rip), %rdi      # 0x9fd8
leaq 0x3fc2(%rip), %rsi      # 0x7576
movl $0x3f, %edx
jmp 0x3418
movq 0x6a13(%rip), %rdi      # 0x9fd8
leaq 0x3f26(%rip), %rsi      # 0x74f2
movl $0x38, %edx
jmp 0x3418
movq 0x69fb(%rip), %rdi      # 0x9fd8
leaq 0x4010(%rip), %rsi      # 0x75f4
jmp 0x35f4
movq 0x69eb(%rip), %rdi      # 0x9fd8
leaq 0x3fc2(%rip), %rsi      # 0x75b6
movl $0x3d, %edx
jmp 0x3418
movq 0x69d3(%rip), %rdi      # 0x9fd8
leaq 0x3f1f(%rip), %rsi      # 0x752b
movl $0x4a, %edx
jmp 0x3418