// File: /workspace/github_cpp_makefile_star2_O1/eliebe-5[P]Catmull-clark-subdivision/halfedge.cc
// Function: Mesh::generateHalfEdge(char*)
void Mesh::generateHalfEdge(char* path)
{
    std::ifstream infile(path);
    
    if(!infile.is_open())
        printf("ERROR: File not open\n");
    
    std::string line;


    std::vector<v3> tempV;
    std::vector<v2> tempUV;
    std::vector<v3> tempN;
    std::vector<std::string> tempF;

    int step = 0;
    
    while(std::getline(infile, line))
    {
        if(line.size() < 1);
        else
        {

            std::stringstream sst(line.c_str());

            std::string split;
        
            std::vector<std::string> splits;
                    
            if(line.at(0) == 'v' && line.at(1) == ' ')
            {
            
                while(std::getline(sst, split, ' '))
                {
                    splits.push_back(split);
                }

                v3 p(std::stof(splits[1]), std::stof(splits[2]), std::stof(splits[3]));

                tempV.push_back(p);
            }
            if(line.at(0) == 'v' && line.at(1) == 't')
            {
            
                while(std::getline(sst, split, ' '))
                {
                    splits.push_back(split);
                }

                v2 p(std::stof(splits[1]), std::stof(splits[2]));

                tempUV.push_back(p);
            }
            if(line.at(0) == 'v' && line.at(1) == 'n')
            {
            
                while(std::getline(sst, split, ' '))
                {
                    splits.push_back(split);
                }

                v3 p(std::stof(splits[1]), std::stof(splits[2]), std::stof(splits[3]));

                tempN.push_back(p);
            }
            else if(line.at(0) == 'f')
            {

                step = 0;
                while(std::getline(sst, split, ' '))
                {
                    if(split.at(0) != 'f')
                    {
                        tempF.push_back(split);

                        step++;
                    }
                }    
            }
        }
    }
    


    int vNm = tempV.size();
    vertPool.pre_allocate_elements(vNm);

    for(int i = 0; i < vNm; i++)
    {
        *(vertPool.new_element()) = tempV[i];
    }
  
    int edgeCount = tempF.size();
    int faceCount = edgeCount/step;
  
    //Interpret vertices, uvs, normals and faces as Half-edges.

    facePool.pre_allocate_elements(faceCount);

    for(int i = 0; i < faceCount; i++)
        facePool.new_element();
    
    edgePool.pre_allocate_elements(edgeCount);
    
    for(int i = 0; i < edgeCount; i++)
        edgePool.new_element();
    
    for(int i = 0; i < faceCount*step; i+=step)
    {
        for(int j = 0; j < step - 1; j++)
        {
            edgePool[i + j]->next = edgePool[i + j + 1];
        }
        edgePool[i + step - 1]->next = edgePool[i];
    }
           
    for(int i = 0; i < faceCount; i++)
    {
        int attr = 0;

        int *vIndex = new int[step];
        int *uvIndex = new int[step];
        int *nIndex = new int[step];

        for(int j = 0; j < step; j++)
        {
            attr = 0;
            std::stringstream f(tempF[i*step+j]);
            std::string split;

	  
            std::vector<std::string> splits;

            while(std::getline(f, split, '/'))
            {
                splits.push_back(split);
            }

            switch(splits.size())
            {
            case(3):
                nIndex[j] = std::stoi(splits[2]) - 1;
                attr++;
            case(2):
                uvIndex[j] = std::stoi(splits[1]) - 1;
                attr++;
            case(1):
                vIndex[j] = std::stoi(splits[0]) - 1;
                break;
            default:
                break;
            }
            
        }

        facePool[i]->edge = edgePool[step*i];
        
        if(attr == 2)
        {
            facePool[i]->edge->uv = tempUV[uvIndex[0]];
            facePool[i]->edge->norm = tempN[nIndex[0]];
        }
        
        HEEdge* temp = facePool[i]->edge;
        temp->vert = vertPool[vIndex[0]];

        for(int j = 1; j < step; j++)
        {
            temp = temp->next;
            temp->vert = vertPool[vIndex[j]];
            if(attr == 2)
            {
                temp->uv = tempUV[uvIndex[j]];
                temp->norm = tempN[nIndex[j]];
            }
        }

        delete[] vIndex;
        delete[] uvIndex;
        delete[] nIndex;

    }
    
    for(int i = 0; i < faceCount*step; i++)
    {

        edgePool[i]->vert->edge = edgePool[i];

        for(int j = 0; j < faceCount*step; j++)
        {
            if(edgePool[i]->vert == edgePool[j]->next->vert && edgePool[j]->vert == edgePool[i]->next->vert)
                edgePool[i]->pair = edgePool[j];
        }
    }

    for(int i = 0; i < faceCount; i++)
    {
        HEEdge *temp = facePool[i]->edge->next;

        while(true)
        {
            temp->face = facePool[i];

            if(temp == facePool[i]->edge)
                break;
            temp = temp->next;
        }
    }
    
    fCount = faceCount;
    eStep = step;
    vCount = vNm;
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movq %rdi, 0x128(%rsp)
leaq 0x2f0(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x22b0
leaq 0x368(%rsp), %rdi
callq 0x2080
testb %al, %al
jne 0x2691
leaq 0x3aa0(%rip), %rdi      # 0x612c
callq 0x2230
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ebx, %ebx
movq %rbx, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xc0(%rsp), %rax
movq %rbx, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x100(%rsp), %rax
movq %rbx, 0x10(%rax)
movaps %xmm0, (%rax)
leaq 0xe0(%rsp), %rax
movq %rbx, 0x10(%rax)
movaps %xmm0, (%rax)
leaq 0x130(%rsp), %rax
movq %rbx, 0x10(%rax)
movaps %xmm0, (%rax)
leaq 0xa0(%rsp), %rbp
leaq 0x60(%rsp), %r13
leaq 0x168(%rsp), %r14
xorl %r12d, %r12d
movq 0x2f0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %edx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2ce3
cmpq $0x0, 0xa8(%rsp)
je 0x26fd
movq 0xa0(%rsp), %rsi
movq %r13, %rdi
leaq 0x40(%rsp), %rdx
callq 0x20d0
movq %r14, %rdi
movq %r13, %rsi
movl $0x18, %edx
callq 0x2250
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x277a
callq 0x2190
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
movb $0x0, 0x70(%rsp)
movq %rbx, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0xa8(%rsp), %rdx
testq %rdx, %rdx
je 0x3910
movq 0xa0(%rsp), %rax
cmpb $0x76, (%rax)
jne 0x2948
cmpq $0x1, %rdx
je 0x3952
cmpb $0x20, 0x1(%rax)
jne 0x2948
leaq 0x40(%rsp), %rbx
movq %r14, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2801
movq %rbx, %rdi
movq %r13, %rsi
callq 0x48ac
jmp 0x27d6
movq %r12, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %r12
callq 0x2040
movq %rax, %rbx
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x3959
movl (%rbx), %eax
testl %eax, %eax
movss %xmm0, 0x38(%rsp)
je 0x2851
cmpl $0x22, %eax
jne 0x2857
jmp 0x39b9
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %r12
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x3965
movl (%rbx), %eax
testl %eax, %eax
movss %xmm0, 0x10(%rsp)
je 0x289a
cmpl $0x22, %eax
jne 0x28a0
jmp 0x39c5
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq 0x40(%rsp), %rax
movq 0x60(%rax), %r12
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x3971
movl (%rbx), %eax
testl %eax, %eax
movq 0x30(%rsp), %r12
je 0x28e2
cmpl $0x22, %eax
jne 0x28e8
jmp 0x39d1
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movss 0x38(%rsp), %xmm1
movss %xmm1, 0x20(%rsp)
movss 0x10(%rsp), %xmm1
movss %xmm1, 0x24(%rsp)
movss %xmm0, 0x28(%rsp)
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0x2934
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0xc8(%rsp)
xorl %ebx, %ebx
jmp 0x2948
leaq 0xc0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4e5a
xorl %ebx, %ebx
movq 0xa8(%rsp), %rdx
testq %rdx, %rdx
je 0x3910
movq 0xa0(%rsp), %rax
cmpb $0x76, (%rax)
jne 0x2a99
cmpq $0x1, %rdx
je 0x3952
cmpb $0x74, 0x1(%rax)
jne 0x2a99
leaq 0x40(%rsp), %rbx
movq %r14, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x29ae
movq %rbx, %rdi
movq %r13, %rsi
callq 0x48ac
jmp 0x2983
movq %r12, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %r12
callq 0x2040
movq %rax, %rbx
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x20(%rsp)
je 0x397d
movl (%rbx), %eax
testl %eax, %eax
movss %xmm0, 0x38(%rsp)
je 0x29fe
cmpl $0x22, %eax
jne 0x2a04
jmp 0x39dd
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %r12
movl (%rbx), %eax
movl %eax, 0x10(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x20(%rsp)
je 0x3989
movl (%rbx), %eax
testl %eax, %eax
movq 0x30(%rsp), %r12
je 0x2a46
cmpl $0x22, %eax
jne 0x2a4c
jmp 0x39e9
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
movss 0x38(%rsp), %xmm1
movss %xmm1, 0x18(%rsp)
movss %xmm0, 0x1c(%rsp)
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x2a85
movq 0x18(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x108(%rsp)
xorl %ebx, %ebx
jmp 0x2a99
leaq 0x100(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x4fe2
xorl %ebx, %ebx
movq 0xa8(%rsp), %rdx
testq %rdx, %rdx
je 0x3910
movq 0xa0(%rsp), %rcx
movzbl (%rcx), %eax
cmpl $0x66, %eax
je 0x2b0b
cmpl $0x76, %eax
jne 0x2ca4
cmpq $0x1, %rdx
je 0x3952
cmpb $0x6e, 0x1(%rcx)
jne 0x2b03
leaq 0x40(%rsp), %rbx
movq %r14, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2b5d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x48ac
jmp 0x2ad8
cmpb $0x66, %al
jne 0x2ca4
xorl %r12d, %r12d
movq %r14, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2ca4
movq 0x68(%rsp), %rdx
testq %rdx, %rdx
je 0x3910
movq 0x60(%rsp), %rax
cmpb $0x66, (%rax)
je 0x2b0e
leaq 0x130(%rsp), %rdi
movq %r13, %rsi
callq 0x48ac
incl %r12d
jmp 0x2b0e
movq %r12, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %r12
callq 0x2040
movq %rax, %rbx
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x3995
movl (%rbx), %eax
testl %eax, %eax
movss %xmm0, 0x38(%rsp)
je 0x2bad
cmpl $0x22, %eax
jne 0x2bb3
jmp 0x39f5
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %r12
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x39a1
movl (%rbx), %eax
testl %eax, %eax
movss %xmm0, 0x10(%rsp)
je 0x2bf6
cmpl $0x22, %eax
jne 0x2bfc
jmp 0x3a01
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq 0x40(%rsp), %rax
movq 0x60(%rax), %r12
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21d0
cmpq %r12, 0x18(%rsp)
je 0x39ad
movl (%rbx), %eax
testl %eax, %eax
movq 0x30(%rsp), %r12
je 0x2c3e
cmpl $0x22, %eax
jne 0x2c44
jmp 0x3a0d
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movss 0x38(%rsp), %xmm1
movss %xmm1, 0x20(%rsp)
movss 0x10(%rsp), %xmm1
movss %xmm1, 0x24(%rsp)
movss %xmm0, 0x28(%rsp)
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x2c90
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0xe8(%rsp)
xorl %ebx, %ebx
jmp 0x2ca4
leaq 0xe0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4e5a
xorl %ebx, %ebx
leaq 0x40(%rsp), %rdi
callq 0x48ea
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2cc2
callq 0x2190
movq %r14, %rdi
movq 0x62ec(%rip), %rsi      # 0x8fb8
callq 0x2150
leaq 0x1e8(%rsp), %rdi
callq 0x20b0
jmp 0x26fd
movq 0xc8(%rsp), %rax
subq 0xc0(%rsp), %rax
sarq $0x2, %rax
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r14
movq 0x128(%rsp), %r13
leaq 0x20(%r13), %rax
movq %rax, 0x88(%rsp)
movl 0x3c(%r13), %eax
leal (%rax,%r14), %ebp
decl %ebp
shrl $0x9, %ebp
cmpl 0x38(%r13), %ebp
jb 0x2d91
leaq 0x168(%rsp), %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x2030
movl $0x10, %ecx
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rcx)
addq $0x20, %rcx
cmpq $0x4010, %rcx           # imm = 0x4010
jne 0x2d46
movq %rax, 0x168(%rsp)
movq 0x28(%r13), %rsi
cmpq 0x30(%r13), %rsi
je 0x2d73
movq %rax, (%rsi)
addq $0x8, 0x28(%r13)
jmp 0x2d83
movq 0x88(%rsp), %rdi
movq %rbx, %rdx
callq 0x5120
movl 0x38(%r13), %eax
incl %eax
movl %eax, 0x38(%r13)
cmpl %eax, %ebp
jae 0x2d34
movq %r14, 0x118(%rsp)
testl %r14d, %r14d
jle 0x2e0b
movq 0x118(%rsp), %rbx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
leaq 0x178(%rsp), %r14
xorl %r15d, %r15d
movq 0xc0(%rsp), %rax
movq (%rax,%r15), %rcx
movq %rcx, 0x168(%rsp)
movl 0x8(%rax,%r15), %eax
movl %eax, 0x170(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq 0x88(%rsp), %rdi
callq 0x492e
movups 0x168(%rsp), %xmm0
movups 0x178(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0xc, %r15
decq %rbx
jne 0x2db7
movq 0x138(%rsp), %rbx
subq 0x130(%rsp), %rbx
shrq $0x5, %rbx
movl %ebx, %eax
cltd
idivl %r12d
leaq 0x40(%r13), %rcx
movq %rcx, 0x80(%rsp)
movl 0x5c(%r13), %edx
movq %rax, 0x58(%rsp)
leal (%rax,%rdx), %ebp
decl %ebp
shrl $0xa, %ebp
cmpl 0x58(%r13), %ebp
jb 0x2ea6
leaq 0x168(%rsp), %r14
movl $0x4000, %edi           # imm = 0x4000
callq 0x2030
movq %rax, %r15
movl $0x4000, %edx           # imm = 0x4000
movq %rax, %rdi
xorl %esi, %esi
callq 0x2110
movq %r15, 0x168(%rsp)
movq 0x48(%r13), %rsi
cmpq 0x50(%r13), %rsi
je 0x2e88
movq %r15, (%rsi)
addq $0x8, 0x48(%r13)
jmp 0x2e98
movq 0x80(%rsp), %rdi
movq %r14, %rdx
callq 0x5256
movl 0x58(%r13), %eax
incl %eax
movl %eax, 0x58(%r13)
cmpl %eax, %ebp
jae 0x2e50
cmpl $0x0, 0x58(%rsp)
jle 0x2ec5
movq 0x58(%rsp), %rax
movl %eax, %ebp
movq 0x80(%rsp), %rdi
callq 0x49f6
decl %ebp
jne 0x2eb4
movl 0x1c(%r13), %eax
leal (%rbx,%rax), %ebp
decl %ebp
shrl $0x8, %ebp
cmpl 0x18(%r13), %ebp
jb 0x2f47
leaq 0x168(%rsp), %r14
movl $0x4000, %edi           # imm = 0x4000
callq 0x2030
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movb $0x0, 0x3c(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movups %xmm0, 0x10(%rax,%rcx)
movq $0x0, 0x20(%rax,%rcx)
addq $0x40, %rcx
cmpq $0x4000, %rcx           # imm = 0x4000
jne 0x2eee
movq %rax, 0x168(%rsp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x2f2e
movq %rax, (%rsi)
addq $0x8, 0x8(%r13)
jmp 0x2f39
movq %r13, %rdi
movq %r14, %rdx
callq 0x538c
movl 0x18(%r13), %eax
incl %eax
movl %eax, 0x18(%r13)
cmpl %eax, %ebp
jae 0x2edf
testl %ebx, %ebx
jle 0x2f57
movq %r13, %rdi
callq 0x4ab8
decl %ebx
jne 0x2f4b
movq 0x58(%rsp), %rax
movl %eax, %ebp
imull %r12d, %ebp
testl %ebp, %ebp
jle 0x3024
movl 0x1c(%r13), %eax
movq (%r13), %rcx
leal -0x1(%r12), %edx
xorl %edi, %edi
movl $0xff, %esi
cmpl $0x2, %r12d
jl 0x2fd5
movq (%r13), %r8
movl %edi, %r10d
movl %edx, %r9d
leal 0x1(%r10), %r11d
cmpl %r11d, %eax
jbe 0x3703
cmpl %r10d, %eax
jbe 0x3721
movl %r11d, %ebx
shrl $0x8, %ebx
movl %r11d, %r14d
andl %esi, %r14d
shll $0x6, %r14d
addq (%r8,%rbx,8), %r14
movl %r10d, %ebx
andl %esi, %ebx
shrl $0x8, %r10d
movq (%r8,%r10,8), %r10
shll $0x6, %ebx
movq %r14, 0x18(%r10,%rbx)
movl %r11d, %r10d
decl %r9d
jne 0x2f8e
cmpl %edi, %eax
jbe 0x37cd
leal (%rdi,%r12), %r8d
decl %r8d
cmpl %r8d, %eax
jbe 0x37eb
leal (%rdi,%r12), %r9d
movl %edi, %r10d
shrl $0x8, %r10d
andl %esi, %edi
shll $0x6, %edi
addq (%rcx,%r10,8), %rdi
movl %r8d, %r10d
andl %esi, %r10d
shrl $0x8, %r8d
movq (%rcx,%r8,8), %r8
shll $0x6, %r10d
movq %rdi, 0x18(%r8,%r10)
movl %r9d, %edi
cmpl %ebp, %r9d
jl 0x2f7e
movq %r12, 0x30(%rsp)
cmpl $0x0, 0x58(%rsp)
jle 0x3551
movq 0x30(%rsp), %rcx
movslq %ecx, %rax
shlq $0x2, %rax
testl %ecx, %ecx
movq $-0x1, %rbx
cmovnsq %rax, %rbx
movl %ecx, %eax
movq %rax, 0x38(%rsp)
movl 0x58(%rsp), %eax
movq %rax, 0x148(%rsp)
leaq 0x168(%rsp), %r14
leaq 0x60(%rsp), %r12
xorl %r15d, %r15d
movl %ebp, 0x9c(%rsp)
movq %rbx, 0x150(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x90(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x120(%rsp)
cmpl $0x0, 0x30(%rsp)
movq %r15, 0x158(%rsp)
jle 0x3348
imulq 0x38(%rsp), %r15
shlq $0x5, %r15
movq %r15, 0x160(%rsp)
xorl %r15d, %r15d
leaq 0x40(%rsp), %rbx
movq %r15, %rsi
shlq $0x5, %rsi
addq 0x130(%rsp), %rsi
addq 0x160(%rsp), %rsi
movq %r14, %rdi
movl $0x18, %edx
callq 0x2250
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x68(%rsp)
movb $0x0, 0x70(%rsp)
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movl $0x2f, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x314b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x48ac
jmp 0x3120
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq $0x1, %rcx
je 0x3275
cmpq $0x2, %rcx
je 0x31f8
movl $0x0, 0xc(%rsp)
cmpq $0x3, %rcx
jne 0x3300
movq 0x40(%rax), %rbx
callq 0x2040
movq %rax, %rbp
movl (%rax), %r13d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movl $0xa, %edx
callq 0x21e0
cmpq %rbx, 0x20(%rsp)
je 0x37b5
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
movq 0x120(%rsp), %rdx
jb 0x37c1
movl (%rbp), %ecx
cmpl $0x22, %ecx
je 0x37c1
testl %ecx, %ecx
jne 0x31ea
movl %r13d, (%rbp)
decl %eax
movl %eax, (%rdx,%r15,4)
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x3200
movl $0x0, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rbx
callq 0x2040
movq %rax, %rbp
movl (%rax), %r13d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movl $0xa, %edx
callq 0x21e0
cmpq %rbx, 0x20(%rsp)
je 0x37a9
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x379d
movl (%rbp), %ecx
cmpl $0x22, %ecx
je 0x379d
testl %ecx, %ecx
jne 0x3265
movl %r13d, (%rbp)
decl %eax
movq 0x90(%rsp), %rcx
movl %eax, (%rcx,%r15,4)
jmp 0x327d
movl $0x0, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rbx
callq 0x2040
movq %rax, %rbp
movl (%rax), %r13d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movl $0xa, %edx
callq 0x21e0
cmpq %rbx, 0x20(%rsp)
je 0x3785
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
leaq 0x40(%rsp), %rbx
jb 0x3791
movl (%rbp), %ecx
cmpl $0x22, %ecx
je 0x3791
testl %ecx, %ecx
jne 0x32e6
movl %r13d, (%rbp)
decl %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx,%r15,4)
movq 0x128(%rsp), %r13
movl 0x9c(%rsp), %ebp
movq %rbx, %rdi
callq 0x48ea
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x331c
callq 0x2190
movq %r14, %rdi
movq 0x5c92(%rip), %rsi      # 0x8fb8
callq 0x2150
leaq 0x1e8(%rsp), %rdi
callq 0x20b0
incq %r15
cmpq 0x38(%rsp), %r15
jne 0x30d9
jmp 0x3350
movl $0x0, 0xc(%rsp)
movq 0x158(%rsp), %r15
movq %r15, %rax
imulq 0x38(%rsp), %rax
cmpl %eax, 0x1c(%r13)
jbe 0x3881
movl 0x5c(%r13), %ecx
cmpq %rcx, %r15
movq 0x120(%rsp), %rbx
movl 0xc(%rsp), %r10d
jae 0x38f2
movl %eax, %ecx
shrl $0x8, %ecx
movzbl %al, %esi
shll $0x6, %esi
movq (%r13), %rax
movq 0x40(%r13), %rdx
addq (%rax,%rcx,8), %rsi
movl %r15d, %eax
shrl $0xa, %eax
movl %r15d, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
movq (%rdx,%rax,8), %rdi
movl %ecx, %r8d
shll $0x4, %r8d
movq %rsi, (%rdi,%r8)
testb %r10b, %r10b
je 0x3430
movq 0x90(%rsp), %rsi
movslq (%rsi), %rsi
movq 0x100(%rsp), %rdi
movq (%rdx,%rax,8), %rdx
movl %ecx, %r8d
shll $0x4, %r8d
movq (%rdx,%r8), %rdx
movq (%rdi,%rsi,8), %rsi
movq %rsi, 0x28(%rdx)
movl 0x5c(%r13), %edx
cmpq %rdx, %r15
jae 0x3920
movq 0xe0(%rsp), %rdx
movslq (%rbx), %rsi
leaq (%rsi,%rsi,2), %rsi
movq 0x80(%rsp), %rdi
movq (%rdi), %rdi
movq (%rdi,%rax,8), %rdi
movl %ecx, %r8d
shll $0x4, %r8d
movq (%rdi,%r8), %rdi
movl 0x8(%rdx,%rsi,4), %r8d
movl %r8d, 0x38(%rdi)
movq (%rdx,%rsi,4), %rdx
movq %rdx, 0x30(%rdi)
movl 0x5c(%r13), %edx
cmpq %rdx, %r15
jae 0x38c0
movq 0x10(%rsp), %rdx
movl (%rdx), %edx
cmpl %edx, 0x3c(%r13)
jbe 0x38a2
shll $0x4, %ecx
movl %edx, %esi
andl $0x1ff, %esi            # imm = 0x1FF
movq 0x88(%rsp), %rdi
movq (%rdi), %rdi
shrl $0x9, %edx
shll $0x5, %esi
addq (%rdi,%rdx,8), %rsi
movq 0x80(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%rax,8), %rax
movq (%rax,%rcx), %rax
movq %rsi, (%rax)
cmpl $0x2, 0x30(%rsp)
jl 0x3519
movq 0x100(%rsp), %rcx
movl $0x1, %edx
movq 0xe0(%rsp), %rsi
movq 0x10(%rsp), %rdi
movl (%rdi,%rdx,4), %edi
cmpl %edi, 0x3c(%r13)
jbe 0x3753
movq 0x18(%rax), %rax
movl %edi, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
movq 0x88(%rsp), %r9
movq (%r9), %r9
shrl $0x9, %edi
shll $0x5, %r8d
addq (%r9,%rdi,8), %r8
movq %r8, (%rax)
testb %r10b, %r10b
je 0x350f
movq 0x90(%rsp), %rdi
movslq (%rdi,%rdx,4), %rdi
movq (%rcx,%rdi,8), %rdi
movq %rdi, 0x28(%rax)
movslq (%rbx,%rdx,4), %rdi
leaq (%rdi,%rdi,2), %rdi
movl 0x8(%rsi,%rdi,4), %r8d
movl %r8d, 0x38(%rax)
movq (%rsi,%rdi,4), %rdi
movq %rdi, 0x30(%rax)
incq %rdx
cmpq %rdx, 0x38(%rsp)
jne 0x34a4
movq 0x10(%rsp), %rdi
callq 0x21c0
movq 0x90(%rsp), %rdi
callq 0x21c0
movq %rbx, %rdi
callq 0x21c0
incq %r15
cmpq 0x148(%rsp), %r15
movq 0x150(%rsp), %rbx
jne 0x307f
testl %ebp, %ebp
movq 0x30(%rsp), %r15
movq 0x58(%rsp), %r12
jle 0x35eb
movl 0x1c(%r13), %eax
movq (%r13), %rcx
xorl %edx, %edx
cmpl %eax, %edx
je 0x384f
movl %edx, %esi
shrl $0x8, %esi
movzbl %dl, %edi
movq (%rcx,%rsi,8), %r8
movl %edi, %r9d
shll $0x6, %r9d
leaq (%r8,%r9), %r10
movq (%r8,%r9), %r8
movq %r10, 0x10(%r8)
xorl %r8d, %r8d
shll $0x6, %edi
cmpl %r8d, %eax
je 0x36d1
movq (%rcx,%rsi,8), %r9
addq %rdi, %r9
movq (%r9), %rbx
movzbl %r8b, %r11d
movl %r8d, %r10d
shrl $0x8, %r10d
movq (%rcx,%r10,8), %r10
shll $0x6, %r11d
movq 0x18(%r10,%r11), %r14
cmpq (%r14), %rbx
jne 0x35dd
addq %r11, %r10
movq (%r10), %r11
movq 0x18(%r9), %rbx
cmpq (%rbx), %r11
jne 0x35dd
movq %r10, 0x8(%r9)
incl %r8d
cmpl %r8d, %ebp
jne 0x359a
incl %edx
cmpl %ebp, %edx
jne 0x356d
testl %r12d, %r12d
jle 0x3641
movl 0x5c(%r13), %eax
movq 0x40(%r13), %rcx
xorl %edx, %edx
cmpl %eax, %edx
je 0x381d
movl %edx, %esi
shrl $0xa, %esi
movl %edx, %edi
andl $0x3ff, %edi            # imm = 0x3FF
movq (%rcx,%rsi,8), %r8
movl %edi, %r9d
shll $0x4, %r9d
movq (%r8,%r9), %r8
shll $0x4, %edi
movq 0x18(%r8), %r8
movq (%rcx,%rsi,8), %r9
addq %rdi, %r9
movq %r9, 0x10(%r8)
movq (%rcx,%rsi,8), %r9
cmpq (%r9,%rdi), %r8
jne 0x3621
incl %edx
cmpl %r12d, %edx
jne 0x35fa
movl %r12d, 0x60(%r13)
movl %r15d, 0x64(%r13)
movq 0x118(%rsp), %rax
movl %eax, 0x68(%r13)
leaq 0x130(%rsp), %rdi
callq 0x48ea
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x3674
callq 0x2190
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x3686
callq 0x2190
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x3698
callq 0x2190
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x36b2
callq 0x2190
leaq 0x2f0(%rsp), %rdi
callq 0x2090
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x2a39(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x58e4(%rip), %rsi      # 0x8fd8
movq 0x58d5(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x2a07(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
jmp 0x373d
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x29e9(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x5894(%rip), %rsi      # 0x8fd8
movq 0x5885(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x29b7(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x5862(%rip), %rsi      # 0x8fd8
movq 0x5853(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
leaq 0x2905(%rip), %rdi      # 0x6091
callq 0x2120
leaq 0x28f9(%rip), %rdi      # 0x6091
callq 0x21f0
leaq 0x28ed(%rip), %rdi      # 0x6091
callq 0x21f0
leaq 0x28e1(%rip), %rdi      # 0x6091
callq 0x2120
leaq 0x28d5(%rip), %rdi      # 0x6091
callq 0x2120
leaq 0x28c9(%rip), %rdi      # 0x6091
callq 0x21f0
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x293d(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
jmp 0x3807
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x291f(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x57ca(%rip), %rsi      # 0x8fd8
movq 0x57bb(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x28ed(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x5798(%rip), %rsi      # 0x8fd8
movq 0x5789(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x28bb(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x5766(%rip), %rsi      # 0x8fd8
movq 0x5757(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x2889(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
jmp 0x393c
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x2868(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
jmp 0x38dc
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x284a(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x56f5(%rip), %rsi      # 0x8fd8
movq 0x56e6(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x2818(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
jmp 0x393c
xorl %esi, %esi
leaq 0x27a7(%rip), %rdi      # 0x60c0
xorl %eax, %eax
callq 0x2210
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x27ea(%rip), %rsi      # 0x611e
movq %rax, %rdi
callq 0x2070
movq 0x5695(%rip), %rsi      # 0x8fd8
movq 0x5686(%rip), %rdx      # 0x8fd0
movq %rbx, %rdi
callq 0x2280
movl $0x1, %esi
jmp 0x3912
leaq 0x272c(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x2720(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x2714(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x2708(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x26fc(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x26f0(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x26e4(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x26d8(%rip), %rdi      # 0x608c
callq 0x2120
leaq 0x26cc(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x26c0(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x26b4(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x26a8(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x269c(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x2690(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x2684(%rip), %rdi      # 0x608c
callq 0x21f0
leaq 0x2678(%rip), %rdi      # 0x608c
callq 0x21f0
jmp 0x3aef
jmp 0x3aef
jmp 0x3aef
jmp 0x3a34
jmp 0x3a34
jmp 0x3a46
jmp 0x3a46
jmp 0x3a46
jmp 0x3a34
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3af2
movl 0xc(%rsp), %eax
jmp 0x3a56
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3af2
movl 0x10(%rsp), %eax
movl %eax, (%rbx)
jmp 0x3af2
jmp 0x3aef
movq %rax, %r14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3b31
callq 0x2190
jmp 0x3b31
jmp 0x3adb
jmp 0x3aca
jmp 0x3aca
jmp 0x3aca
jmp 0x3aca
jmp 0x3aca
jmp 0x3adb
jmp 0x3aca
jmp 0x3adb
jmp 0x3aca
jmp 0x3aca
jmp 0x3aca
jmp 0x3aef
jmp 0x3aef
jmp 0x3aef
jmp 0x3aef
jmp 0x3aef
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3adb
jmp 0x3aca
jmp 0x3aca
jmp 0x3aca
jmp 0x3ae0
jmp 0x3adb
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
jmp 0x3b31
jmp 0x3adb
jmp 0x3ae0
movq %rax, %r14
jmp 0x3b31
movq %rax, %r14
cmpl $0x0, (%rbp)
jne 0x3af2
movl %r13d, (%rbp)
jmp 0x3af2
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x48ea
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3b10
callq 0x2190
movq 0x54a1(%rip), %rsi      # 0x8fb8
leaq 0x168(%rsp), %rdi
callq 0x2150
leaq 0x1e8(%rsp), %rdi
callq 0x20b0
leaq 0x130(%rsp), %rdi
callq 0x48ea
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x3b50
callq 0x2190
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x3b62
callq 0x2190
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x3b74
callq 0x2190
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x3b8e
callq 0x2190
leaq 0x2f0(%rsp), %rdi
callq 0x2090
movq %r14, %rdi
callq 0x2290
nop