// File: /workspace/github_cpp_makefile_star2_O1/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 0x644a(%rip), %rax      # 0xa210
movl (%rax), %eax
cmpl $0x1, %eax
je 0x3ebc
testl %eax, %eax
jne 0x40b2
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0x6301(%rip), %r12      # 0xa0f0
movq (%r12), %r13
cmpq 0x8(%r12), %r13
je 0x3e6f
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 0x4bcc
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4cc2
movq -0x38(%rbp), %rsi
cmpq -0x30(%rbp), %rsi
je 0x3e59
movq -0x70(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0x80(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x38(%rbp)
jmp 0x3e64
movq %r15, %rdi
movq %r14, %rdx
callq 0x4578
addq $0x18, %r13
cmpq 0x8(%r12), %r13
jne 0x3e06
leaq -0xb0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4348
leaq -0xb0(%rbp), %rdi
callq 0x4fb3
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x3ea6
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x40b2
movq -0x30(%rbp), %rsi
jmp 0x40aa
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %rax, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
leaq 0x6218(%rip), %r13      # 0xa0f0
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x3fd8
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 0x4bcc
testb $0x1, %bl
jne 0x3f5c
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4cc2
movq -0x78(%rbp), %rsi
cmpq -0x70(%rbp), %rsi
je 0x3f9b
movq -0xb8(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x78(%rbp)
jmp 0x3fb5
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4cc2
movq -0x58(%rbp), %rsi
cmpq -0x50(%rbp), %rsi
je 0x3fa9
movq -0xb8(%rbp), %rax
movq %rax, 0x10(%rsi)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, -0x58(%rbp)
jmp 0x3fb5
leaq -0x80(%rbp), %rdi
movq %r14, %rdx
callq 0x4578
jmp 0x3fb5
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x4578
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 0x3efc
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x18, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x403c
addq $0x18, %rax
movq -0x8(%rax), %rdx
movq %rdx, -0x30(%rbp)
movups -0x18(%rax), %xmm0
movaps %xmm0, -0x40(%rbp)
movq 0x10(%rcx), %rdx
movq %rdx, -0x8(%rax)
movups (%rcx), %xmm0
movups %xmm0, -0x18(%rax)
movq -0x30(%rbp), %rdx
movq %rdx, 0x10(%rcx)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rcx)
addq $-0x18, %rcx
leaq 0x18(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x3ffe
leaq -0x80(%rbp), %rdi
movq 0x8(%rdi), %rsi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x470e
leaq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4348
leaq -0x98(%rbp), %rdi
callq 0x4fb3
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x4088
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x409d
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x40b2
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
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 0x4111
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
jmp 0x4111
jmp 0x410e
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x413a
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
jmp 0x413a
jmp 0x410e
jmp 0x4137
jmp 0x410e
jmp 0x410e
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4126
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x414f
movq -0x50(%rbp), %rsi
jmp 0x4147
jmp 0x4137
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x414f
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq %rbx, %rdi
callq 0x1170