// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movq 0x73e1(%rip), %rdi      # 0x9fd8
leaq 0x4759(%rip), %rsi      # 0x7357
movl $0x13, %edx
callq 0x2130
cmpb $0x0, 0x2070(%rbx)
je 0x3361
movb $0x0, 0x1(%r13)
leaq 0x8(%r13), %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 0x31bb
leal 0xf(%rax), %ecx
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x20(%rsp)
shrl $0x4, %ecx
imulq $0x70, %rcx, %rax
movdqa 0x43b7(%rip), %xmm1     # 0x7020
movdqa 0x43bf(%rip), %xmm2     # 0x7030
movdqa 0x43c7(%rip), %xmm3     # 0x7040
movdqa 0x43cf(%rip), %xmm4     # 0x7050
movdqa 0x43d7(%rip), %xmm5     # 0x7060
movdqa 0x43df(%rip), %xmm6     # 0x7070
movdqa 0x43e7(%rip), %xmm7     # 0x7080
movdqa 0x43ee(%rip), %xmm8     # 0x7090
xorl %ecx, %ecx
movdqa 0x43f3(%rip), %xmm9     # 0x70a0
pcmpeqd %xmm10, %xmm10
movdqa 0x20(%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 0x2d1f
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 0x2d52
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 0x2db0
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 0x2ded
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 0x2e53
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 0x2e85
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 0x2ee1
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 0x2f1f
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 0x2f86
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 0x2fb9
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 0x3015
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 0x3053
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 0x30b9
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 0x30eb
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 0x3147
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 0x3185
movb $0x0, 0x20bf(%rbx,%rcx)
movdqa 0x3f23(%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 0x2cb2
movb $0x0, 0x1(%r13)
movq %rbp, %rdi
callq 0x2140
movb %al, 0x2072(%rbx)
testb %al, %al
je 0x3379
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
cmpb $0x0, 0x2072(%rbx)
je 0x32a9
leaq 0x2050(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %r14d, %r14d
movb $0x0, 0x1(%r13)
movq %rbp, %r12
movq %rbp, %rdi
callq 0x2140
addb 0x2071(%rbx), %al
movzbl %al, %ebp
testb %bpl, %bpl
je 0x3391
cmpb 0x2070(%rbx), %bpl
ja 0x3391
movq %r13, %r15
leal -0x1(%rbp), %eax
leaq (,%rax,8), %r13
subq %rax, %r13
movq 0x20(%rsp), %rax
cmpb $0x0, 0x5(%rax,%r13)
je 0x3411
addq %rax, %r13
cmpb $0x1, 0x6(%r13)
je 0x3441
movb $0x1, 0x6(%r13)
movb $0x0, 0x1(%r15)
movq %r12, %rbp
movq %r12, %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 0x346e
cmpb $0x4, %cl
jae 0x349d
incl %r14d
movzbl 0x2072(%rbx), %eax
cmpl %eax, %r14d
movq %r15, %r13
jb 0x31fc
movq %rbp, %r14
xorl %ebp, %ebp
movb %bpl, 0x1(%r13)
movq %r14, %rdi
callq 0x2140
movb %al, 0x2073(%rbx)
movb %bpl, 0x1(%r13)
movq %r14, %rdi
callq 0x2140
movb %al, 0x2074(%rbx)
movb %bpl, 0x1(%r13)
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 0x33c1
cmpl $0xc0, %esi
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r10
jne 0x3546
cmpb $0x0, 0x2073(%rbx)
jne 0x33f9
cmpb $0x3f, 0x2074(%rbx)
jne 0x33f9
cmpb $0x10, %al
setb %al
testb %dl, %dl
sete %cl
testb %cl, %al
jne 0x3546
movq 0x6c88(%rip), %rdi      # 0x9fd8
leaq 0x40fa(%rip), %rsi      # 0x7451
movl $0x29, %edx
jmp 0x34d5
movq 0x6c70(%rip), %rdi      # 0x9fd8
leaq 0x3ffc(%rip), %rsi      # 0x736b
movl $0x20, %edx
jmp 0x34d5
movq 0x6c58(%rip), %rdi      # 0x9fd8
leaq 0x4005(%rip), %rsi      # 0x738c
movl $0x2f, %edx
jmp 0x34d5
movq 0x6c40(%rip), %r14      # 0x9fd8
leaq 0x401d(%rip), %rsi      # 0x73bc
movl $0x24, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0xb(%rsp), %rsi
jmp 0x34ca
movb 0x2073(%rbx), %dl
movb 0x2074(%rbx), %sil
cmpb %sil, %dl
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r10
jbe 0x34f0
movq 0x6bf0(%rip), %rdi      # 0x9fd8
leaq 0x408c(%rip), %rsi      # 0x747b
movl $0x3c, %edx
jmp 0x34d5
movq 0x6bd8(%rip), %rdi      # 0x9fd8
leaq 0x4026(%rip), %rsi      # 0x742d
movl $0x23, %edx
jmp 0x34d5
movq 0x6bc0(%rip), %r14      # 0x9fd8
leaq 0x3f9d(%rip), %rsi      # 0x73bc
movl $0x24, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0xc(%rsp), %rsi
jmp 0x34ca
movq 0x6b90(%rip), %r14      # 0x9fd8
leaq 0x3ddb(%rip), %rsi      # 0x722a
movl $0x26, %edx
movq %r14, %rdi
callq 0x2130
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20a0
leaq 0xd(%rsp), %rsi
jmp 0x34ca
movq 0x6b63(%rip), %r14      # 0x9fd8
leaq 0x3f65(%rip), %rsi      # 0x73e1
movl $0x25, %edx
movq %r14, %rdi
callq 0x2130
movzbl 0x3(%r13), %esi
movq %r14, %rdi
callq 0x20a0
leaq 0xe(%rsp), %rsi
jmp 0x34ca
movq 0x6b34(%rip), %r14      # 0x9fd8
leaq 0x3f5c(%rip), %rsi      # 0x7407
movl $0x25, %edx
movq %r14, %rdi
callq 0x2130
movzbl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x20a0
leaq 0xf(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movb $0x0, 0x2088(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x40, %sil
jb 0x350b
movq 0x6adb(%rip), %rdi      # 0x9fd8
leaq 0x3fb4(%rip), %rsi      # 0x74b8
movl $0x39, %edx
jmp 0x34d5
testb %dl, %dl
setne %dil
testb %sil, %sil
sete %sil
orb %dil, %sil
je 0x3639
testb %dl, %dl
je 0x3532
cmpb $0x1, 0x2072(%rbx)
jne 0x3679
cmpb $0x10, %al
jb 0x3546
movzbl %cl, %ecx
andl $0xf, %eax
decl %ecx
cmpl %eax, %ecx
jne 0x3349
movzbl 0x2070(%rbx), %esi
testq %rsi, %rsi
je 0x35ed
leaq 0x410(%rbx), %rax
leaq 0x1230(%rbx), %rcx
leaq (,%rsi,8), %rdx
subq %rsi, %rdx
xorl %esi, %esi
cmpb $0x1, 0x2056(%rbx,%rsi)
jne 0x35e4
movzbl 0x2052(%rbx,%rsi), %edi
movl %edi, %r8d
shll $0x8, %r8d
leaq (%r8,%rdi,4), %rdi
cmpb $0x0, 0x100(%rbx,%rdi)
je 0x3621
cmpb $0x0, 0x2073(%rbx)
jne 0x35c2
movzbl 0x2053(%rbx,%rsi), %edi
imulq $0x388, %rdi, %rdi      # imm = 0x388
cmpb $0x0, 0x384(%rax,%rdi)
je 0x3661
cmpb $0x0, 0x2074(%rbx)
je 0x35e4
movzbl 0x2054(%rbx,%rsi), %edi
imulq $0x388, %rdi, %rdi      # imm = 0x388
cmpb $0x0, 0x384(%rcx,%rdi)
je 0x3651
addq $0x7, %rsi
cmpq %rsi, %rdx
jne 0x3571
shll $0x8, %r9d
leal (%r10,%r9), %eax
addl $-0x6, %eax
movzbl 0x2072(%rbx), %ecx
addl %ecx, %ecx
cmpl %ecx, %eax
je 0x34e1
movq 0x69c8(%rip), %rdi      # 0x9fd8
leaq 0x401b(%rip), %rsi      # 0x7632
movl $0x14, %edx
jmp 0x34d5
movq 0x69b0(%rip), %rdi      # 0x9fd8
leaq 0x3f47(%rip), %rsi      # 0x7576
movl $0x3f, %edx
jmp 0x34d5
movq 0x6998(%rip), %rdi      # 0x9fd8
leaq 0x3eab(%rip), %rsi      # 0x74f2
movl $0x38, %edx
jmp 0x34d5
movq 0x6980(%rip), %rdi      # 0x9fd8
leaq 0x3f95(%rip), %rsi      # 0x75f4
jmp 0x366f
movq 0x6970(%rip), %rdi      # 0x9fd8
leaq 0x3f47(%rip), %rsi      # 0x75b6
movl $0x3d, %edx
jmp 0x34d5
movq 0x6958(%rip), %rdi      # 0x9fd8
leaq 0x3ea4(%rip), %rsi      # 0x752b
movl $0x4a, %edx
jmp 0x34d5