// File: Aries-orz[P]Ari-RayTracing/src/ObjParser.cpp
// Function: rt::ObjParser::parse(_IO_FILE*)
bool ObjParser::parse(FILE* fp) {
    char buf[256];
    int nVertices = 0, nFaces = 0;
    int lineNum = 0;
    std::vector<Vec3d> vecVertices;
    std::vector<TriArray> vecFaces;
    
    while (fscanf(fp, "%s", buf) != EOF) {
        ++lineNum;
        switch(buf[0]) {
            case '#':
                fgets(buf, sizeof(buf), fp);
                break;
            case 'v':
                switch(buf[1]) {
                    case '\0': {
                        Vec3d point;
                        if (fscanf(fp, "%lf %lf %lf", &point.x, &point.y, &point.z) == 3) {
                            ++nVertices;
                            vecVertices.push_back(point);
                        } else {
                            printf("RTError: Wrong data format at line %d.\n", lineNum);
                            return false;
                        }
                        break;
                    }
                    default:
                        fgets(buf, sizeof(buf), fp);
                        break;
                }
                break;
            case 'f':
                int v, n, t;
                TriArray indice;
                if (fscanf(fp, "%s", buf) != 1) {
                    printf("RTError: Wrong data format at line %d.\n", lineNum);
                    return false;
                }
                
                if (strstr(buf, "//")) {
                    if ( sscanf(buf, "%d//%d", &indice[0], &n) == 2 &&
                         fscanf(fp, "%d//%d", &indice[1], &n) == 2 &&
                         fscanf(fp, "%d//%d", &indice[2], &n) == 2 ) {
                        ++nFaces;
                        vecFaces.push_back(indice);
                    } else {
                        printf("RTError: Wrong data format at line %d.\n", lineNum);
                        return false;
                    }
                }
                
                else if (sscanf(buf, "%d/%d/%d", &v, &t, &n) == 3) {
                    indice[0] = v;
                    if ( fscanf(fp, "%d/%d/%d", &indice[1], &t, &n) == 3 &&
                         fscanf(fp, "%d/%d/%d", &indice[2], &t, &n) == 3 ) {
                        ++nFaces;
                        vecFaces.push_back(indice);
                        }
                    else {
                        printf("RTError: Wrong data format at line %d.\n", lineNum);
                        return false;
                    }
                }
                else if (sscanf(buf, "%d/%d", &v, &t) == 2) {
                    indice[0] = v;
                    if ( fscanf(fp, "%d/%d", &indice[1], &t) == 2 &&
                         fscanf(fp, "%d/%d", &indice[2], &t) == 2 ) {
                        ++nFaces;
                        vecFaces.push_back(indice);
                    }
                    else {
                        printf("RTError: Wrong data format at line %d.\n", lineNum);
                        return false;
                    }
                }
                else {
                    if ( sscanf(buf, "%d", &indice[0]) == 1 &&
                         fscanf(fp, "%d", &indice[1]) == 1 &&
                         fscanf(fp, "%d", &indice[2]) == 1 ) {
                        ++nFaces;
                        vecFaces.push_back(indice);
                    }
                    else {
                        printf("RTError: Wrong data format at line %d.\n", lineNum);
                        return false;
                    }
                }
                break;
            default:
                fgets(buf, sizeof(buf), fp);
                break;
        }
    }
    
    for (int i=0; i<vecFaces.size(); ++i) {
        TriArray tri = vecFaces[i];
        for (int j=0; j<3; ++j) {
            if (tri[j] <=0 || tri[j] > nVertices) {
                printf("RTError: The vertex index of face at line %d is out of range!\n", lineNum);
                return false;
            }
        }
    }
    destroy();
    numOfVertices = nVertices;
    numOfFaces = nFaces;
    verticeList = new Vec3d[numOfVertices];
    faceList = new TriArray[numOfFaces];
    for (int i=0; i<numOfVertices; ++i) {
        verticeList[i] = vecVertices[i];
    }
    for (int i=0; i<numOfFaces; ++i) {
        for (int j=0; j<3; ++j)
            faceList[i][j] = vecFaces[i][j] - 1;
    }
    
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movl $0x0, -0x124(%rbp)
movl $0x0, -0x128(%rbp)
movl $0x0, -0x12c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x5a50
leaq -0x160(%rbp), %rdi
callq 0x5a70
movq -0x18(%rbp), %rdi
leaq 0x63e8(%rip), %rsi      # 0xb2a7
xorl %eax, %eax
leaq -0x120(%rbp), %rdx
callq 0x21c0
movl %eax, -0x1d4(%rbp)
jmp 0x4ed5
movl -0x1d4(%rbp), %eax
cmpl $-0x1, %eax
je 0x564a
movl -0x12c(%rbp), %eax
incl %eax
movl %eax, -0x12c(%rbp)
movsbl -0x120(%rbp), %eax
movl %eax, -0x1d8(%rbp)
subl $0x23, %eax
je 0x4f3e
jmp 0x4f06
movl -0x1d8(%rbp), %eax
subl $0x66, %eax
je 0x5029
jmp 0x4f17
movl -0x1d8(%rbp), %eax
subl $0x76, %eax
je 0x4f5a
jmp 0x562c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x168(%rbp)
movl %eax, -0x16c(%rbp)
jmp 0x5a16
movq -0x18(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2170
jmp 0x4f55
jmp 0x5645
movb -0x11f(%rbp), %al
testb %al, %al
jne 0x500b
jmp 0x4f6a
leaq -0x188(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x3540
jmp 0x4f81
movq -0x18(%rbp), %rdi
leaq -0x180(%rbp), %rcx
leaq -0x178(%rbp), %r8
leaq 0x6310(%rip), %rsi      # 0xb2aa
xorl %eax, %eax
leaq -0x188(%rbp), %rdx
callq 0x21c0
movl %eax, -0x1dc(%rbp)
jmp 0x4fb0
movl -0x1dc(%rbp), %eax
cmpl $0x3, %eax
jne 0x4fe0
movl -0x124(%rbp), %eax
incl %eax
movl %eax, -0x124(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x5a90
jmp 0x4fde
jmp 0x5009
movl -0x12c(%rbp), %esi
leaq 0x62c9(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x4ff6
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x5024
movq -0x18(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2170
jmp 0x5022
jmp 0x5024
jmp 0x5645
movq -0x18(%rbp), %rdi
leaq 0x6273(%rip), %rsi      # 0xb2a7
xorl %eax, %eax
leaq -0x120(%rbp), %rdx
callq 0x21c0
movl %eax, -0x1e0(%rbp)
jmp 0x504a
movl -0x1e0(%rbp), %eax
cmpl $0x1, %eax
je 0x507e
movl -0x12c(%rbp), %esi
leaq 0x6254(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x506b
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
leaq -0x120(%rbp), %rdi
leaq 0x6252(%rip), %rsi      # 0xb2de
callq 0x2060
cmpq $0x0, %rax
je 0x51f9
leaq -0x120(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x1a4(%rbp), %rdi
xorl %esi, %esi
callq 0x35a0
movq %rax, -0x1e8(%rbp)
jmp 0x50c0
movq -0x1e8(%rbp), %rdx
movq -0x1f0(%rbp), %rdi
leaq 0x620c(%rip), %rsi      # 0xb2e1
leaq -0x194(%rbp), %rcx
movb $0x0, %al
callq 0x20e0
cmpl $0x2, %eax
jne 0x51cb
movq -0x18(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x1, %esi
callq 0x35a0
movq %rax, -0x1f8(%rbp)
jmp 0x5111
movq -0x1f8(%rbp), %rdx
movq -0x200(%rbp), %rdi
leaq 0x61bb(%rip), %rsi      # 0xb2e1
xorl %eax, %eax
leaq -0x194(%rbp), %rcx
callq 0x21c0
movl %eax, -0x204(%rbp)
jmp 0x513c
movl -0x204(%rbp), %eax
cmpl $0x2, %eax
jne 0x51cb
movq -0x18(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x2, %esi
callq 0x35a0
movq %rax, -0x210(%rbp)
jmp 0x5170
movq -0x210(%rbp), %rdx
movq -0x218(%rbp), %rdi
leaq 0x615c(%rip), %rsi      # 0xb2e1
xorl %eax, %eax
leaq -0x194(%rbp), %rcx
callq 0x21c0
movl %eax, -0x21c(%rbp)
jmp 0x519b
movl -0x21c(%rbp), %eax
cmpl $0x2, %eax
jne 0x51cb
movl -0x128(%rbp), %eax
incl %eax
movl %eax, -0x128(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x1a4(%rbp), %rsi
callq 0x5b00
jmp 0x51c9
jmp 0x51f4
movl -0x12c(%rbp), %esi
leaq 0x60de(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x51e1
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x562a
leaq -0x120(%rbp), %rdi
leaq 0x60e1(%rip), %rsi      # 0xb2e8
leaq -0x190(%rbp), %rdx
leaq -0x198(%rbp), %rcx
leaq -0x194(%rbp), %r8
movb $0x0, %al
callq 0x20e0
cmpl $0x3, %eax
jne 0x5379
movl -0x190(%rbp), %eax
movl %eax, -0x22c(%rbp)
leaq -0x1a4(%rbp), %rdi
xorl %esi, %esi
callq 0x35a0
movq %rax, -0x228(%rbp)
jmp 0x524f
movq -0x228(%rbp), %rax
movl -0x22c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x240(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x1, %esi
callq 0x35a0
movq %rax, -0x238(%rbp)
jmp 0x5283
movq -0x238(%rbp), %rdx
movq -0x240(%rbp), %rdi
leaq 0x6050(%rip), %rsi      # 0xb2e8
xorl %eax, %eax
leaq -0x198(%rbp), %rcx
leaq -0x194(%rbp), %r8
callq 0x21c0
movl %eax, -0x244(%rbp)
jmp 0x52b5
movl -0x244(%rbp), %eax
cmpl $0x3, %eax
jne 0x534b
movq -0x18(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x2, %esi
callq 0x35a0
movq %rax, -0x250(%rbp)
jmp 0x52e9
movq -0x250(%rbp), %rdx
movq -0x258(%rbp), %rdi
leaq 0x5fea(%rip), %rsi      # 0xb2e8
xorl %eax, %eax
leaq -0x198(%rbp), %rcx
leaq -0x194(%rbp), %r8
callq 0x21c0
movl %eax, -0x25c(%rbp)
jmp 0x531b
movl -0x25c(%rbp), %eax
cmpl $0x3, %eax
jne 0x534b
movl -0x128(%rbp), %eax
incl %eax
movl %eax, -0x128(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x1a4(%rbp), %rsi
callq 0x5b00
jmp 0x5349
jmp 0x5374
movl -0x12c(%rbp), %esi
leaq 0x5f5e(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x5361
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x5628
leaq -0x120(%rbp), %rdi
leaq 0x5f64(%rip), %rsi      # 0xb2eb
leaq -0x190(%rbp), %rdx
leaq -0x198(%rbp), %rcx
movb $0x0, %al
callq 0x20e0
cmpl $0x2, %eax
jne 0x54e4
movl -0x190(%rbp), %eax
movl %eax, -0x26c(%rbp)
leaq -0x1a4(%rbp), %rdi
xorl %esi, %esi
callq 0x35a0
movq %rax, -0x268(%rbp)
jmp 0x53c8
movq -0x268(%rbp), %rax
movl -0x26c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x1, %esi
callq 0x35a0
movq %rax, -0x278(%rbp)
jmp 0x53fc
movq -0x278(%rbp), %rdx
movq -0x280(%rbp), %rdi
leaq 0x5eda(%rip), %rsi      # 0xb2eb
xorl %eax, %eax
leaq -0x198(%rbp), %rcx
callq 0x21c0
movl %eax, -0x284(%rbp)
jmp 0x5427
movl -0x284(%rbp), %eax
cmpl $0x2, %eax
jne 0x54b6
movq -0x18(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x2, %esi
callq 0x35a0
movq %rax, -0x290(%rbp)
jmp 0x545b
movq -0x290(%rbp), %rdx
movq -0x298(%rbp), %rdi
leaq 0x5e7b(%rip), %rsi      # 0xb2eb
xorl %eax, %eax
leaq -0x198(%rbp), %rcx
callq 0x21c0
movl %eax, -0x29c(%rbp)
jmp 0x5486
movl -0x29c(%rbp), %eax
cmpl $0x2, %eax
jne 0x54b6
movl -0x128(%rbp), %eax
incl %eax
movl %eax, -0x128(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x1a4(%rbp), %rsi
callq 0x5b00
jmp 0x54b4
jmp 0x54df
movl -0x12c(%rbp), %esi
leaq 0x5df3(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x54cc
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x5626
leaq -0x120(%rbp), %rax
movq %rax, -0x2b0(%rbp)
leaq -0x1a4(%rbp), %rdi
xorl %esi, %esi
callq 0x35a0
movq %rax, -0x2a8(%rbp)
jmp 0x5509
movq -0x2a8(%rbp), %rdx
movq -0x2b0(%rbp), %rdi
leaq 0x5dc7(%rip), %rsi      # 0xb2e5
movb $0x0, %al
callq 0x20e0
cmpl $0x1, %eax
jne 0x55fb
movq -0x18(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x1, %esi
callq 0x35a0
movq %rax, -0x2b8(%rbp)
jmp 0x5553
movq -0x2b8(%rbp), %rdx
movq -0x2c0(%rbp), %rdi
leaq 0x5d7d(%rip), %rsi      # 0xb2e5
xorl %eax, %eax
callq 0x21c0
movl %eax, -0x2c4(%rbp)
jmp 0x5577
movl -0x2c4(%rbp), %eax
cmpl $0x1, %eax
jne 0x55fb
movq -0x18(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x1a4(%rbp), %rdi
movl $0x2, %esi
callq 0x35a0
movq %rax, -0x2d0(%rbp)
jmp 0x55a7
movq -0x2d0(%rbp), %rdx
movq -0x2d8(%rbp), %rdi
leaq 0x5d29(%rip), %rsi      # 0xb2e5
xorl %eax, %eax
callq 0x21c0
movl %eax, -0x2dc(%rbp)
jmp 0x55cb
movl -0x2dc(%rbp), %eax
cmpl $0x1, %eax
jne 0x55fb
movl -0x128(%rbp), %eax
incl %eax
movl %eax, -0x128(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x1a4(%rbp), %rsi
callq 0x5b00
jmp 0x55f9
jmp 0x5624
movl -0x12c(%rbp), %esi
leaq 0x5cae(%rip), %rdi      # 0xb2b6
xorl %eax, %eax
callq 0x2040
jmp 0x5611
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x5626
jmp 0x5628
jmp 0x562a
jmp 0x5645
movq -0x18(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2170
jmp 0x5643
jmp 0x5645
jmp 0x4eb4
movl $0x0, -0x1a8(%rbp)
movslq -0x1a8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x5b70
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x5766
movslq -0x1a8(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x5ba0
movq (%rax), %rcx
movq %rcx, -0x1b4(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x1ac(%rbp)
movl $0x0, -0x1b8(%rbp)
cmpl $0x3, -0x1b8(%rbp)
jge 0x5750
movl -0x1b8(%rbp), %esi
leaq -0x1b4(%rbp), %rdi
callq 0x35a0
movq %rax, -0x2f0(%rbp)
jmp 0x56d9
movq -0x2f0(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x5711
movl -0x1b8(%rbp), %esi
leaq -0x1b4(%rbp), %rdi
callq 0x35a0
movq %rax, -0x2f8(%rbp)
jmp 0x5700
movq -0x2f8(%rbp), %rax
movl (%rax), %eax
cmpl -0x124(%rbp), %eax
jle 0x573a
movl -0x12c(%rbp), %esi
leaq 0x5bd3(%rip), %rdi      # 0xb2f1
xorl %eax, %eax
callq 0x2040
jmp 0x5727
movb $0x0, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
jmp 0x59f0
jmp 0x573c
movl -0x1b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b8(%rbp)
jmp 0x56b1
jmp 0x5752
movl -0x1a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a8(%rbp)
jmp 0x5654
movq -0x1d0(%rbp), %rdi
callq 0x4cf0
movq -0x1d0(%rbp), %rax
movl -0x124(%rbp), %ecx
movl %ecx, (%rax)
movl -0x128(%rbp), %ecx
movl %ecx, 0x4(%rax)
movslq (%rax), %rax
movq %rax, -0x310(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, -0x308(%rbp)
callq 0x2030
movq %rax, -0x300(%rbp)
jmp 0x57bf
movq -0x310(%rbp), %rax
cmpq $0x0, %rax
je 0x582e
movq -0x300(%rbp), %rax
movq -0x310(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x320(%rbp)
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rdi
movq %rdi, -0x328(%rbp)
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x3540
jmp 0x5810
movq -0x320(%rbp), %rcx
movq -0x328(%rbp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x318(%rbp)
jne 0x57f2
movq -0x1d0(%rbp), %rax
movq -0x300(%rbp), %rcx
movq %rcx, 0x8(%rax)
movslq 0x4(%rax), %rax
movl $0xc, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x2030
movq %rax, -0x330(%rbp)
jmp 0x5868
movq -0x1d0(%rbp), %rax
movq -0x330(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x1bc(%rbp)
movq -0x1d0(%rbp), %rcx
movl -0x1bc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x5909
movslq -0x1bc(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x5bc0
movq %rax, %rsi
movq -0x1d0(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1bc(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0xa130
jmp 0x58cc
jmp 0x58ce
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1bc(%rbp)
jmp 0x5884
movq -0x308(%rbp), %rsi
movq -0x300(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x168(%rbp)
movl %eax, -0x16c(%rbp)
callq 0x21e0
jmp 0x5a16
movl $0x0, -0x1c0(%rbp)
movq -0x1d0(%rbp), %rcx
movl -0x1c0(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x59e2
movl $0x0, -0x1c4(%rbp)
cmpl $0x3, -0x1c4(%rbp)
jge 0x59cc
movslq -0x1c0(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x5ba0
movq %rax, %rdi
movl -0x1c4(%rbp), %esi
callq 0x35a0
movq %rax, -0x338(%rbp)
jmp 0x596a
movq -0x1d0(%rbp), %rax
movq -0x338(%rbp), %rcx
movl (%rcx), %ecx
decl %ecx
movl %ecx, -0x344(%rbp)
movq 0x10(%rax), %rax
movslq -0x1c0(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,4), %rdi
movl -0x1c4(%rbp), %esi
callq 0x35a0
movq %rax, -0x340(%rbp)
jmp 0x59a9
movq -0x340(%rbp), %rax
movl -0x344(%rbp), %ecx
movl %ecx, (%rax)
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x5933
jmp 0x59ce
movl -0x1c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c0(%rbp)
jmp 0x5913
movb $0x1, -0x1(%rbp)
movl $0x1, -0x18c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x5be0
leaq -0x148(%rbp), %rdi
callq 0x5c40
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
leaq -0x160(%rbp), %rdi
callq 0x5be0
leaq -0x148(%rbp), %rdi
callq 0x5c40
movq -0x168(%rbp), %rdi
callq 0x21b0
nopw (%rax,%rax)