// File: /workspace/github_cpp_makefile_star2_O2/XuhuiSun95[P]My-OpenGL/myGL.cpp
// Function: myEnd()
void myEnd(){
    switch(shapeType){
        case POLYGON:{
            vector<pixel> points;
            for(vector<vertex>::iterator it = vertices.begin(); it != vertices.end(); it++){
                vertex v = modelTransform(*it);
                points.push_back(projection(v));
            }
            surfaceCheck(points);
            break;
        }
        case QUAD_STRIP:{
            vector<pixel> pointsOdd;
            vector<pixel> pointsEven;
            for(int i = 0; i < vertices.size(); i++){
                vertex v = modelTransform(vertices[i]);
                if(i % 2 == 0)
                    pointsEven.push_back(projection(v));
                else
                    pointsOdd.push_back(projection(v));
            }
            reverse(pointsOdd.begin(), pointsOdd.end());
            pointsEven.insert(pointsEven.end(), pointsOdd.begin(), pointsOdd.end());
            surfaceCheck(pointsEven);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq 0x585c(%rip), %rax      # 0x9210
movl (%rax), %eax
cmpl $0x1, %eax
je 0x3a34
testl %eax, %eax
jne 0x3b7a
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rbx
movaps %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x5717(%rip), %r12      # 0x90f0
movq (%r12), %r13
leaq -0x60(%rbp), %r14
leaq -0x78(%rbp), %r15
cmpq 0x8(%r12), %r13
je 0x3af9
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x47fc
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x48f2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4042
addq $0x18, %r13
jmp 0x39e5
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rax
andq $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rcx
andq $0x0, 0x10(%rcx)
movaps %xmm0, (%rax)
movaps %xmm0, (%rcx)
xorl %r13d, %r13d
leaq 0x5697(%rip), %rbx      # 0x90f0
pushq $0x18
popq %r14
leaq -0xc0(%rbp), %r12
xorl %r15d, %r15d
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
cqto
idivq %r14
cmpq %r15, %rax
jbe 0x3b1e
movq 0x10(%rcx,%r13), %rax
movq %rax, 0x10(%rsp)
movups (%rcx,%r13), %xmm0
movups %xmm0, (%rsp)
leaq -0x78(%rbp), %rdi
callq 0x47fc
testb $0x1, %r15b
jne 0x3ac8
movq -0x68(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x78(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x48f2
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x4042
jmp 0x3aed
movq -0x68(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x78(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x48f2
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x4042
incq %r15
addq $0x18, %r13
jmp 0x3a67
leaq -0xa8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3dca
leaq -0xa8(%rbp), %rdi
callq 0x4bb8
leaq -0xa8(%rbp), %rdi
jmp 0x3b6c
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x423f
leaq -0x60(%rbp), %rdi
movq 0x8(%rdi), %rsi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x3e2a
leaq -0x90(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3dca
leaq -0x90(%rbp), %rdi
callq 0x4bb8
leaq -0x90(%rbp), %rdi
callq 0x3ffe
leaq -0x60(%rbp), %rdi
callq 0x3ffe
leaq -0x40(%rbp), %rdi
callq 0x3ffe
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x3ffe
jmp 0x3bb8
jmp 0x3bb5
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x3bbc
jmp 0x3bc3
jmp 0x3bb5
jmp 0x3bc3
jmp 0x3bb5
jmp 0x3bb5
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3ffe
jmp 0x3bc6
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3ffe
movq %rbx, %rdi
callq 0x1160