// File: 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
subq $0x380, %rsp            # imm = 0x380
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x186c0
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1e8f3
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1bf50
movl 0x20(%rax), %eax
movl %eax, -0x2e8(%rbp)
subl $0x1, %eax
je 0x1df13
jmp 0x1de87
movl -0x2e8(%rbp), %eax
subl $0x37, %eax
je 0x1dea4
jmp 0x1de94
movl -0x2e8(%rbp), %eax
subl $0x39, %eax
je 0x1deb5
jmp 0x1e8de
movb $0x1, -0x21(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1e8e0
movb $0x0, -0x21(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1c820
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rsi
movq %rsi, %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x1cb90
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1ec00
movq -0x2f0(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1eb90
movq %rax, -0x58(%rbp)
jmp 0x1e8e0
testb $0x1, -0x21(%rbp)
jne 0x1df1e
jmp 0x1e8e0
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1bf50
movq %rax, %rdi
leaq 0xd81a(%rip), %rsi      # 0x2b74f
callq 0x66e0
testb $0x1, %al
jne 0x1df43
jmp 0x1e8dc
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x3, %rcx
cmpq %rcx, %rax
jb 0x1e02c
movb $0x1, -0x8d(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x300(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x4590
movq -0x2f8(%rbp), %rdx
leaq 0xd7c9(%rip), %rsi      # 0x2b757
leaq -0x78(%rbp), %rdi
callq 0x52e0
jmp 0x1df99
movq -0x300(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x78(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x1dfb2
movq -0x300(%rbp), %rdi
movb $0x0, -0x8d(%rbp)
leaq 0x1bdb9(%rip), %rsi     # 0x39d80
leaq -0x14cbe(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x1e908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e007
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x41e0
leaq -0x79(%rbp), %rdi
callq 0x4360
testb $0x1, -0x8d(%rbp)
jne 0x1e01b
jmp 0x1e027
movq -0x300(%rbp), %rdi
callq 0x4230
jmp 0x1e8fc
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x2, %rsi
callq 0x1bf50
cmpl $0x39, 0x20(%rax)
je 0x1e12a
movb $0x1, -0xb2(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x310(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x4590
movq -0x308(%rbp), %rdx
leaq 0xd6f9(%rip), %rsi      # 0x2b779
leaq -0xb0(%rbp), %rdi
callq 0x52e0
jmp 0x1e08e
movq -0x310(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0xb0(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x1e0aa
movq -0x310(%rbp), %rdi
movb $0x0, -0xb2(%rbp)
leaq 0x1bcc1(%rip), %rsi     # 0x39d80
leaq -0x14db6(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x1e908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e102
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x41e0
leaq -0xb1(%rbp), %rdi
callq 0x4360
testb $0x1, -0xb2(%rbp)
jne 0x1e119
jmp 0x1e125
movq -0x310(%rbp), %rdi
callq 0x4230
jmp 0x1e8fc
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
callq 0x1bf50
cmpl $0x1c, 0x20(%rax)
jne 0x1e33b
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
callq 0x1bf50
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0x4150
leaq -0xd8(%rbp), %rdi
callq 0x1ddf0
xorb $-0x1, %al
movb %al, -0x311(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x41e0
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x1e194
jmp 0x1e2a0
movb $0x1, -0x119(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x320(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1bf50
movq %rax, %rdx
leaq 0xd5da(%rip), %rsi      # 0x2b7a0
leaq -0x118(%rbp), %rdi
callq 0x5410
jmp 0x1e1d4
leaq 0xd5cb(%rip), %rdx      # 0x2b7a6
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x53c0
jmp 0x1e1f0
movq -0x320(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0xf8(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x1e20c
movq -0x320(%rbp), %rdi
movb $0x0, -0x119(%rbp)
leaq 0x1bb5f(%rip), %rsi     # 0x39d80
leaq -0x14f18(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x1e908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e284
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e278
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x41e0
leaq -0x118(%rbp), %rdi
callq 0x41e0
testb $0x1, -0x119(%rbp)
jne 0x1e28f
jmp 0x1e29b
movq -0x320(%rbp), %rdi
callq 0x4230
jmp 0x1e8fc
movq -0x18(%rbp), %rax
movq %rax, -0x330(%rbp)
movups -0x10(%rbp), %xmm0
movaps %xmm0, -0x130(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1bf50
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x4150
movq -0x330(%rbp), %rdi
movq -0x328(%rbp), %rcx
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
leaq -0x30(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0x1e910
jmp 0x1e307
leaq -0x150(%rbp), %rdi
callq 0x41e0
jmp 0x1e8da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x41e0
jmp 0x1e8fc
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
callq 0x1bf50
cmpl $0x38, 0x20(%rax)
jne 0x1e7f8
leaq -0x170(%rbp), %rdi
callq 0x4450
movq $0x0, -0x178(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x1e608
movq -0x8(%rbp), %rax
movq -0x178(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x340(%rbp)
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x4590
movq -0x340(%rbp), %rsi
movq -0x338(%rbp), %rdx
leaq -0x1d8(%rbp), %rdi
callq 0x52e0
jmp 0x1e3c3
leaq 0xda35(%rip), %rdx      # 0x2bdff
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x53c0
jmp 0x1e3df
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1bf50
movq %rax, %rdx
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x55f0
jmp 0x1e407
leaq -0x198(%rbp), %rdi
callq 0x1ddf0
movb %al, -0x341(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x41e0
leaq -0x1b8(%rbp), %rdi
callq 0x41e0
leaq -0x1d8(%rbp), %rdi
callq 0x41e0
leaq -0x1d9(%rbp), %rdi
callq 0x4360
movb -0x341(%rbp), %al
testb $0x1, %al
jne 0x1e458
jmp 0x1e5ef
movq -0x8(%rbp), %rax
movq -0x178(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x358(%rbp)
leaq -0x241(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x4590
movq -0x358(%rbp), %rsi
movq -0x350(%rbp), %rdx
leaq -0x240(%rbp), %rdi
callq 0x52e0
jmp 0x1e49d
leaq 0xd95b(%rip), %rdx      # 0x2bdff
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x53c0
jmp 0x1e4b9
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1bf50
movq %rax, %rdx
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x55f0
jmp 0x1e4e1
leaq -0x170(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x43c0
leaq -0x200(%rbp), %rdi
callq 0x41e0
leaq -0x220(%rbp), %rdi
callq 0x41e0
leaq -0x240(%rbp), %rdi
callq 0x41e0
leaq -0x241(%rbp), %rdi
callq 0x4360
jmp 0x1e608
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e57b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e56f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x41e0
leaq -0x1d8(%rbp), %rdi
callq 0x41e0
leaq -0x1d9(%rbp), %rdi
callq 0x4360
jmp 0x1e7e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e5de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e5d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x41e0
leaq -0x240(%rbp), %rdi
callq 0x41e0
leaq -0x241(%rbp), %rdi
callq 0x4360
jmp 0x1e7e7
jmp 0x1e5f1
movq -0x178(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x178(%rbp)
jmp 0x1e36d
leaq 0xced5(%rip), %rsi      # 0x2b4e4
leaq -0x170(%rbp), %rdi
callq 0x5390
movb %al, -0x359(%rbp)
jmp 0x1e623
movb -0x359(%rbp), %al
testb $0x1, %al
jne 0x1e756
jmp 0x1e633
movb $0x1, -0x289(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x368(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1bf50
movq %rax, %rdx
leaq 0xd13b(%rip), %rsi      # 0x2b7a0
leaq -0x288(%rbp), %rdi
callq 0x5410
jmp 0x1e673
leaq 0xd12c(%rip), %rdx      # 0x2b7a6
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x53c0
jmp 0x1e68f
movq -0x368(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x268(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x1e6ab
movq -0x368(%rbp), %rdi
movb $0x0, -0x289(%rbp)
leaq 0x1b6c0(%rip), %rsi     # 0x39d80
leaq -0x153b7(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x1e908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e7e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e73a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e72e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x41e0
leaq -0x288(%rbp), %rdi
callq 0x41e0
testb $0x1, -0x289(%rbp)
jne 0x1e745
jmp 0x1e751
movq -0x368(%rbp), %rdi
callq 0x4230
jmp 0x1e7e7
movq -0x18(%rbp), %rax
movq %rax, -0x370(%rbp)
movups -0x10(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x4150
jmp 0x1e781
movq -0x370(%rbp), %rdi
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdx
leaq -0x2c0(%rbp), %rcx
leaq -0x30(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0x1e910
jmp 0x1e7ac
leaq -0x2c0(%rbp), %rdi
callq 0x41e0
leaq -0x170(%rbp), %rdi
callq 0x41e0
jmp 0x1e8d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x41e0
leaq -0x170(%rbp), %rdi
callq 0x41e0
jmp 0x1e8fc
movb $0x1, -0x2e2(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x380(%rbp)
leaq -0x2e1(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x4590
movq -0x378(%rbp), %rdx
leaq 0xcf85(%rip), %rsi      # 0x2b7b6
leaq -0x2e0(%rbp), %rdi
callq 0x52e0
jmp 0x1e83f
movq -0x380(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x2e0(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x1e85b
movq -0x380(%rbp), %rdi
movb $0x0, -0x2e2(%rbp)
leaq 0x1b510(%rip), %rsi     # 0x39d80
leaq -0x15567(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x1e908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1e8b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x41e0
leaq -0x2e1(%rbp), %rdi
callq 0x4360
testb $0x1, -0x2e2(%rbp)
jne 0x1e8ca
jmp 0x1e8d6
movq -0x380(%rbp), %rdi
callq 0x4230
jmp 0x1e8fc
jmp 0x1e8da
jmp 0x1e8dc
jmp 0x1e8e0
jmp 0x1e8e0
jmp 0x1e8e2
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1de58
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x4580
nopl (%rax,%rax)