// File: /workspace/github_cpp_makefile_star2_O2/RuiDGPires[P]CrimLang/src/preprocessor.cpp
// Function: crl::preprocess(std::vector<crl::Token, std::allocator<crl::Token>>&, crl::preprocessor_lib)
void preprocess(std::vector<Token> &vec, Pproc_lib libs){
		size_t size = vec.size();	
		bool preproc_line = false;
		size_t begin = 0;

		for (size_t i = 0; i < size; i++){
			switch(vec[i].type){
				case Token::Type::PREPROC_START:
					preproc_line = true;
					begin = i;
				break;
				case Token::Type::PREPROC_END:
					preproc_line = false;
					vec.erase(vec.begin() + i--);
				break;
				case Token::Type::IDENT:
					if (!preproc_line) break;
					if (vec[i].str == "include"){
						ASSERT(i < size - 3, "Incomplete preprocessor directive");
						ASSERT(vec[i+2].type == Token::Type::PREPROC_END, "Expected end of preprocessor directive");
						if (vec[i+1].type == Token::Type::STRING){
							ASSERT(file_exists(vec[i+1].str), "File " + vec[i+1].str + " cannot be read");
							include(vec, libs, vec[i+1].str, begin, i);
						}else if (vec[i+1].type == Token::Type::GLOBAL_FOLDER){
							std::string other_full_path;

							for (size_t j = 0; j < libs.libc; j++)
								if (file_exists(std::string(libs.libv[j]) + "/" + vec[i+1].str)){
									other_full_path = std::string(libs.libv[j]) + "/" + vec[i+1].str;
									break;
								}
							ASSERT(other_full_path != "", "File " + vec[i+1].str + " cannot be read");

							include(vec, libs, other_full_path, begin, i);
						}else ASSERT(false, "unkown preprocessor directive");
					}
					break;
				default:
					break;
			}	
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdx, -0x38(%rbp)
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq (%rdi), %rax
pushq $0x30
popq %rcx
cqto
idivq %rcx
movq %rax, %r13
leaq -0x50(%rbp), %rax
andq $0x0, (%rax)
movq %rsi, -0x48(%rbp)
leaq -0x3(%r13), %rax
movq %rax, -0x88(%rbp)
xorl %r12d, %r12d
xorl %ecx, %ecx
movq %r13, -0x78(%rbp)
movq %r12, -0x40(%rbp)
cmpq %r13, %r12
jae 0xecaf
movq (%rbx), %rsi
imulq $0x30, %r12, %r15
movl 0x20(%rsi,%r15), %eax
addq %r15, %rsi
cmpl $0x1, %eax
je 0xea41
cmpl $0x39, %eax
je 0xea2d
cmpl $0x37, %eax
jne 0xeb11
movq %r12, -0x50(%rbp)
movb $0x1, %cl
jmp 0xeb11
decq %r12
movq %r12, -0x40(%rbp)
movq %rbx, %rdi
callq 0xf09a
jmp 0xeb0f
testb $0x1, %cl
je 0xeb0f
movq %rsi, %rdi
leaq 0x6cfb(%rip), %rsi      # 0x1574f
callq 0x410a
movb $0x1, %cl
testb %al, %al
je 0xeb11
cmpq -0x88(%rbp), %r12
jae 0xed18
movq (%rbx), %rsi
cmpl $0x39, 0x80(%rsi,%r15)
jne 0xecc1
incq %r12
imulq $0x30, %r12, %r13
movl 0x20(%rsi,%r13), %eax
cmpl $0x38, %eax
je 0xeb1d
cmpl $0x1c, %eax
jne 0xee4c
addq %r13, %rsi
leaq -0x208(%rbp), %r14
movq %r14, %rdi
callq 0x32f0
movq %r14, %rdi
callq 0xe990
movl %eax, %r15d
movq %r14, %rdi
callq 0x3110
testb %r15b, %r15b
leaq -0x1c8(%rbp), %r14
je 0xed6f
addq (%rbx), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x32f0
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq %r14, %rcx
leaq -0x50(%rbp), %r8
leaq -0x40(%rbp), %r9
callq 0xefa8
movq %r14, %rdi
callq 0x3110
movq -0x78(%rbp), %r13
jmp 0xea26
xorl %ecx, %ecx
movq -0x40(%rbp), %r12
incq %r12
jmp 0xe9f3
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
xorl %r15d, %r15d
leaq -0x70(%rbp), %r12
movq %rbx, -0x80(%rbp)
cmpq %r15, -0x48(%rbp)
je 0xec52
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rsi
leaq -0xc8(%rbp), %r12
movq %r12, %rdi
leaq -0xe8(%rbp), %rdx
callq 0x3be4
leaq -0xa8(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
leaq 0x7286(%rip), %rdx      # 0x15dfb
callq 0x3c2c
movq (%rbx), %rdx
movq %r13, %rbx
addq %r13, %rdx
leaq -0x1e8(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3d3c
movq %r13, %rdi
callq 0xe990
movl %eax, %r12d
movq %r13, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3110
leaq -0xc8(%rbp), %rdi
callq 0x3110
testb %r12b, %r12b
jne 0xebd4
incq %r15
leaq -0x70(%rbp), %r12
movq %rbx, %r13
movq -0x80(%rbp), %rbx
jmp 0xeb39
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rsi
leaq -0xe8(%rbp), %r14
movq %r14, %rdi
leaq -0x29(%rbp), %rdx
callq 0x3be4
leaq -0x70(%rbp), %r12
movq %rbx, %r13
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
leaq 0x71f1(%rip), %rdx      # 0x15dfb
callq 0x3c2c
movq -0x80(%rbp), %rbx
movq (%rbx), %rdx
addq %r13, %rdx
leaq -0xa8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3d3c
movq %r12, %rdi
movq %r14, %rsi
callq 0x32b0
movq %r14, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x3110
leaq -0xe8(%rbp), %rdi
callq 0x3110
movq %r12, %rdi
leaq 0x6888(%rip), %rsi      # 0x154e4
callq 0x3c1f
testb %al, %al
je 0xeddc
leaq -0x1a8(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq %r15, %rcx
leaq -0x50(%rbp), %r8
leaq -0x40(%rbp), %r9
callq 0xefa8
movq -0x78(%rbp), %r13
movq %r15, %rdi
callq 0x3110
movq %r12, %rdi
callq 0x3110
jmp 0xea26
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
leaq 0x6aa6(%rip), %rsi      # 0x15779
leaq -0x168(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x3be4
movb $0x1, %r15b
pushq $-0x1
popq %rdx
leaq -0x168(%rbp), %rcx
movq %r14, %rdi
movl %edx, %esi
callq 0x4e88
xorl %r15d, %r15d
leaq 0xf08c(%rip), %rsi      # 0x1dd90
leaq -0x9dd3(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
jmp 0xee9e
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
leaq 0x6a2d(%rip), %rsi      # 0x15757
leaq -0x188(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x3be4
movb $0x1, %r15b
pushq $-0x1
popq %rdx
leaq -0x188(%rbp), %rcx
movq %r14, %rdi
movl %edx, %esi
callq 0x4e88
xorl %r15d, %r15d
leaq 0xf035(%rip), %rsi      # 0x1dd90
leaq -0x9e2a(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
jmp 0xee9e
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
addq (%rbx), %r13
leaq 0x6a1c(%rip), %rsi      # 0x157a0
leaq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x3c55
leaq 0x6a0f(%rip), %rdx      # 0x157a6
leaq -0x148(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3c2c
movb $0x1, %r15b
pushq $-0x1
popq %rdx
leaq -0x148(%rbp), %rcx
movq %r14, %rdi
movl %edx, %esi
callq 0x4e88
xorl %r15d, %r15d
leaq 0xefc8(%rip), %rsi      # 0x1dd90
leaq -0x9e97(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
jmp 0xee9e
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
addq (%rbx), %r13
leaq 0x69af(%rip), %rsi      # 0x157a0
leaq -0xa8(%rbp), %rdi
movq %r13, %rdx
callq 0x3c55
leaq 0x699f(%rip), %rdx      # 0x157a6
leaq -0x128(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3c2c
movb $0x1, %r15b
pushq $-0x1
popq %rdx
leaq -0x128(%rbp), %rcx
movq %r14, %rdi
movl %edx, %esi
callq 0x4e88
xorl %r15d, %r15d
leaq 0xef55(%rip), %rsi      # 0x1dd90
leaq -0x9f0a(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
jmp 0xee9e
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
leaq 0x6958(%rip), %rsi      # 0x157b6
leaq -0x108(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x3be4
movb $0x1, %r15b
pushq $-0x1
popq %rdx
leaq -0x108(%rbp), %rcx
movq %r14, %rdi
movl %edx, %esi
callq 0x4e88
xorl %r15d, %r15d
leaq 0xef01(%rip), %rsi      # 0x1dd90
leaq -0x9f5e(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x3110
jmp 0xeeb5
movq %rax, %rbx
movb $0x1, %r15b
leaq -0xa8(%rbp), %rdi
callq 0x3110
testb %r15b, %r15b
jne 0xef1b
jmp 0xef97
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x3110
jmp 0xeee2
movq %rax, %rbx
movb $0x1, %r15b
leaq -0x70(%rbp), %rdi
jmp 0xef4d
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x3110
jmp 0xeefc
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0xef92
jmp 0xef72
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
jmp 0xef4d
jmp 0xef59
movq %rax, %rbx
movq %r14, %rdi
callq 0x31b0
jmp 0xef97
jmp 0xef59
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
jmp 0xef4d
jmp 0xef59
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
jmp 0xef92
jmp 0xef72
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
callq 0x3110
testb %r15b, %r15b
jne 0xef5c
jmp 0xefa0
movq %rax, %rbx
movq %r14, %rdi
callq 0x31b0
jmp 0xefa0
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
jmp 0xef9b
movq %rax, %rbx
jmp 0xef97
movq %rax, %rbx
jmp 0xef8b
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x3110
leaq -0xc8(%rbp), %rdi
callq 0x3110
leaq -0x70(%rbp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3410