// File: /workspace/github_cpp_makefile_star2_O3/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 0x654e(%rip), %rax      # 0xa210
movl (%rax), %eax
cmpl $0x1, %eax
je 0x3db8
testl %eax, %eax
jne 0x3fae
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0x6405(%rip), %r12      # 0xa0f0
movq (%r12), %r13
cmpq 0x8(%r12), %r13
je 0x3d6b
leaq -0x60(%rbp), %rbx
leaq -0x80(%rbp), %r14
leaq -0x40(%rbp), %r15
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x4ac0
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4bb6
movq -0x38(%rbp), %rsi
cmpq -0x30(%rbp), %rsi
je 0x3d55
movq -0x70(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0x80(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x38(%rbp)
jmp 0x3d60
movq %r15, %rdi
movq %r14, %rdx
callq 0x4470
addq $0x18, %r13
cmpq 0x8(%r12), %r13
jne 0x3d02
leaq -0xb0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4240
leaq -0xb0(%rbp), %rdi
callq 0x4e9e
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x3da2
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3fae
movq -0x30(%rbp), %rsi
jmp 0x3fa6
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %edx, %edx
movq %rdx, -0x50(%rbp)
movq %rdx, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
leaq 0x631c(%rip), %r13      # 0xa0f0
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x3f3c
xorl %r15d, %r15d
leaq -0xc8(%rbp), %r14
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
xorl %ebx, %ebx
movq 0x10(%rax,%r15), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax,%r15), %xmm0
movups %xmm0, (%rsp)
leaq -0x40(%rbp), %rdi
callq 0x4ac0
testb $0x1, %bl
jne 0x3e58
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4bb6
movq -0x78(%rbp), %rsi
cmpq -0x70(%rbp), %rsi
je 0x3e97
movq -0xb8(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x78(%rbp)
jmp 0x3eb1
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4bb6
movq -0x58(%rbp), %rsi
cmpq -0x50(%rbp), %rsi
je 0x3ea5
movq -0xb8(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x58(%rbp)
jmp 0x3eb1
leaq -0x80(%rbp), %rdi
movq %r14, %rdx
callq 0x4470
jmp 0x3eb1
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x4470
incq %rbx
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r12, %rcx
addq $0x18, %r15
cmpq %rbx, %rcx
ja 0x3df8
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rax
cmpq %rax, %rdx
setne %cl
addq $-0x18, %rax
cmpq %rdx, %rax
seta %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0x3f3c
addq $0x18, %rdx
movq -0x8(%rdx), %rcx
movq %rcx, -0x30(%rbp)
movups -0x18(%rdx), %xmm0
movaps %xmm0, -0x40(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x8(%rdx)
movups (%rax), %xmm0
movups %xmm0, -0x18(%rdx)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rax)
addq $-0x18, %rax
leaq 0x18(%rdx), %rcx
cmpq %rax, %rdx
movq %rcx, %rdx
jb 0x3efa
movq -0x60(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movq 0x8(%rdi), %rsi
movq -0x58(%rbp), %rcx
callq 0x4606
leaq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4240
leaq -0x98(%rbp), %rdi
callq 0x4e9e
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3f84
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x3f99
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x3fae
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x400d
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x400d
jmp 0x400a
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x4036
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x4036
jmp 0x400a
jmp 0x4033
jmp 0x400a
jmp 0x400a
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4022
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x404b
movq -0x50(%rbp), %rsi
jmp 0x4043
jmp 0x4033
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x404b
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x1160