// File: /workspace/github_cpp_makefile_star2_O1/nataly-enne[P]pet-fera/pet_fera_cadastrar.cpp
// Function: cadastrar(std::map<int, TRATADOR, std::less<int>, std::allocator<std::pair<int const, TRATADOR>>>&)
void cadastrar(map <int, TRATADOR>  &tratadores){ 
	int id, idade, nivel_seg;
	unsigned int old_size;
	long int cpf;
	string nome, especialidade, tipo_sang, id_string, idade_string, tipo_sang_string, nivel_seg_string, cpf_string, fator_rh_string;
	char fator_rh, continuar, sucesso;
	bool check;
	old_size = tratadores.size();
	ofstream tratador;
	
	do{
		// Recebe o ID e verifica se é valido.
		do{
			cout << "Digite o id:" << endl;
			cin >> id_string;
			if(!verifica_ID(tratadores, id_string, sucesso)){
				cout << "O ID deve conter apenas inteiros ou ID já cadastrado!" << endl << endl;
			}
			else{
				stringstream ss(id_string); // Converte string para int.
				ss >> id;
			}

		}while(sucesso == 'n');

		// Recebe o nome e verifica se é valido.
		do{
			cout << "Digite o nome:" << endl;
			cin.ignore();
			getline(cin, nome);
			if(!verifica_nome(nome, sucesso)){
				cout << "ERRO: só pode ser inserido letra ou espaço!" << endl << endl;
			}
		}while(sucesso == 'n'); 
		
		// Recebe o CPF e verifica se é valido.
		do{
			cout << "Digite o CPF: " << endl;
			getline(cin, cpf_string);
			if(!verifica_CPF(cpf_string, sucesso)){
				cout << "CPF deve conter apenas numeros" << endl << endl;
			}
			else{
				cpf = stoll(cpf_string); //Transforma a string em long int.
				check = check_CPF(tratadores, cpf); // Checa se o CPF existe.
				if(check){
					cout << "CPF já cadastrado!" << endl;
					sucesso = 'n';
				}
			}
		}while(sucesso == 'n');

		
		// Recebe a idade e verifica se é valida.
		do{
			cout << "Digite a idade: " << endl;
			getline(cin, idade_string);
			if(!verifica_idade(idade_string, sucesso)){
				cout << "Idade deve conter apenas inteiros positivos!" << endl << endl;
			}
			else{
				stringstream ss(idade_string);
				ss >> idade;
			}

		}while(sucesso == 'n');

		// Recebe o tipo sanguineo e verifica se é valido.
		do{
			cout << "Insira o tipo sanguineo: " << endl;
			getline(cin, tipo_sang_string);
			if(!verifica_tipo_sang(tipo_sang_string, sucesso)){
				cout << "ERRO: O tipo sanguineo deve ser: A, B, AB ou O!" << endl << endl;
			}
			else{
				tipo_sang = tipo_sang_string;
			}

		}while(sucesso == 'n');

		// Recebe o fator RH e verifica se é valido.
		do{
			cout << "Insira o fator RH: " << endl;
			getline(cin, fator_rh_string);
			if(!verifica_fator(fator_rh_string, sucesso)){
				cout << "ERRO: O fator RH deve ser: + ou -" << endl << endl;
			}
			else{
				fator_rh = (char)fator_rh_string[0];
			}

		}while(sucesso == 'n');

		// Recebe a especialidade e verifica se é valida.
		do{
			cout << "Digite a especialidade: " << endl;
			getline(cin, especialidade);
			if(!verifica_especialidade(especialidade, sucesso)){
				cout << "ERRO: A especialidade deve conter apenas letras!" << endl << endl;
			}
			else{
				transform(especialidade.begin(), especialidade.end(), especialidade.begin(), ::tolower);
				especialidade = especialidade;
			}

		}while(sucesso == 'n');

		// Recebe o nível de segurança e verifica se é valida.
		do{
			cout << "Digite o nivel de seguranca: 0 ou 1 ou 2"<< endl;
			getline(cin, nivel_seg_string);
			if(!verifica_seguranca(nivel_seg_string, sucesso)){
				cout << "ERRO: O nivel de seguranca só pode ser 0, 1 ou 2!" << endl << endl;
			}
			else{
				stringstream ss(nivel_seg_string);
				ss >> nivel_seg;
			}
		}while(sucesso == 'n');

		
		// Armazenando os valores recebidos pelo usuário no map.
		tratadores.insert(pair <int, TRATADOR> (id, TRATADOR(id, nome, cpf, idade, tipo_sang, fator_rh, especialidade, nivel_seg)));
		
		cout << "Deseja cadastrar um novo funcionário? s/n" << endl;
		cin >> continuar;
	}while(continuar == 's');

	if (tratadores.size() == old_size){ 
		cout << "Falha no cadastro do funcionario!" << endl;
	}
	else{
		if(!tratadores.empty()){
			tratador.open("tratadores.txt");
			for(auto it = tratadores.begin(); it != tratadores.end(); it++){
				tratador << (*it).second;
			}
			tratador.close();
		}
		cout << "Cadastro efetuado com sucesso!!" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x698, %rsp            # imm = 0x698
leaq -0x120(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x278(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x100(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x258(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xa0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq %rdi, -0x38(%rbp)
movl 0x28(%rdi), %eax
movq %rax, -0x138(%rbp)
leaq -0x6c0(%rbp), %rdi
callq 0x3360
leaq -0x238(%rbp), %rbx
leaq -0x4c0(%rbp), %r15
leaq 0x80(%r15), %rax
movq %rax, -0x40(%rbp)
leaq 0x35a58(%rip), %rax     # 0x47ac8
addq $0x10, %rax
movq %rax, -0x140(%rbp)
movq 0x35f4e(%rip), %r12     # 0x47fd0
movq 0x35f57(%rip), %r13     # 0x47fe0
movl $0xc, %edx
movq %r12, %rdi
leaq 0x286a7(%rip), %rsi     # 0x3a73f
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %r13, %rdi
leaq -0x110(%rbp), %rsi
callq 0x3270
movq %rbx, -0x248(%rbp)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
addq %rsi, %rdx
leaq -0x248(%rbp), %rdi
callq 0x4574
movq -0x38(%rbp), %rdi
leaq -0x248(%rbp), %rsi
leaq -0x29(%rbp), %rdx
callq 0x37355
movl %eax, %r14d
movq -0x248(%rbp), %rdi
cmpq %rbx, %rdi
je 0x12120
callq 0x31d0
testb %r14b, %r14b
je 0x1215f
movq %r15, %rdi
leaq -0x110(%rbp), %rsi
movl $0x18, %edx
callq 0x3310
movq %r15, %rdi
leaq -0x44(%rbp), %rsi
callq 0x3120
movq %r15, %rdi
movq 0x35e61(%rip), %rsi     # 0x47fb0
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x30d0
jmp 0x121c5
movl $0x36, %edx
movq %r12, %rdi
leaq 0x285de(%rip), %rsi     # 0x3a74c
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x12089
movl $0xe, %edx
movq %r12, %rdi
leaq 0x285a5(%rip), %rsi     # 0x3a783
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %r13, %rdi
callq 0x33a0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x130(%rbp), %rsi
callq 0x33c0
leaq -0x130(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x3832d
testb %al, %al
jne 0x122b4
movl $0x2d, %edx
movq %r12, %rdi
leaq 0x28535(%rip), %rsi     # 0x3a792
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x121cf
movl $0xe, %edx
movq %r12, %rdi
leaq 0x284f3(%rip), %rsi     # 0x3a7c0
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x33c0
leaq -0x218(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x228(%rbp), %rdi
callq 0x4574
leaq -0x228(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x3859e
movl %eax, %r14d
movq -0x228(%rbp), %rdi
leaq -0x218(%rbp), %rax
cmpq %rax, %rdi
je 0x12377
callq 0x31d0
testb %r14b, %r14b
je 0x123c1
movq -0xb0(%rbp), %r14
callq 0x3040
movq %r15, %rsi
movq %rax, %r15
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %edx
callq 0x3060
cmpq %r14, -0x4c0(%rbp)
je 0x13088
movl (%r15), %ecx
testl %ecx, %ecx
je 0x12429
cmpl $0x22, %ecx
jne 0x1242c
jmp 0x13094
movl $0x1e, %edx
movq %r12, %rdi
leaq 0x283ff(%rip), %rsi     # 0x3a7cf
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
jmp 0x12491
movl %ebx, (%r15)
movq -0x38(%rbp), %rdi
movq %rax, -0x148(%rbp)
movq %rax, %rsi
callq 0x36d85
leaq -0x238(%rbp), %rbx
leaq -0x4c0(%rbp), %r15
testb %al, %al
je 0x12491
movl $0x13, %edx
movq %r12, %rdi
leaq 0x2838e(%rip), %rsi     # 0x3a7ee
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movb $0x6e, -0x29(%rbp)
cmpb $0x6e, -0x29(%rbp)
je 0x122be
movl $0x10, %edx
movq %r12, %rdi
leaq 0x28358(%rip), %rsi     # 0x3a802
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x33c0
leaq -0x1f8(%rbp), %rax
movq %rax, -0x208(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x208(%rbp), %rdi
callq 0x4574
leaq -0x208(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x3865c
movl %eax, %r14d
movq -0x208(%rbp), %rdi
leaq -0x1f8(%rbp), %rax
cmpq %rax, %rdi
je 0x12554
callq 0x31d0
testb %r14b, %r14b
je 0x12593
movq %r15, %rdi
leaq -0xf0(%rbp), %rsi
movl $0x18, %edx
callq 0x3310
movq %r15, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3120
movq %r15, %rdi
movq 0x35a2d(%rip), %rsi     # 0x47fb0
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x30d0
jmp 0x125f9
movl $0x2c, %edx
movq %r12, %rdi
leaq 0x28271(%rip), %rsi     # 0x3a813
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x1249b
movl $0x19, %edx
movq %r12, %rdi
leaq 0x2822e(%rip), %rsi     # 0x3a840
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x268(%rbp), %rsi
callq 0x33c0
leaq -0x268(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x387d8
testb %al, %al
je 0x1268f
leaq -0x288(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x30f0
jmp 0x126f5
movl $0x2f, %edx
movq %r12, %rdi
leaq 0x281bc(%rip), %rsi     # 0x3a85a
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x12603
movl $0x13, %edx
movq %r12, %rdi
leaq 0x2817c(%rip), %rsi     # 0x3a88a
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x90(%rbp), %rsi
callq 0x33c0
leaq -0x1d8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x4574
leaq -0x1e8(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x38938
movl %eax, %r14d
movq -0x1e8(%rbp), %rdi
leaq -0x1d8(%rbp), %rax
cmpq %rax, %rdi
je 0x127b8
callq 0x31d0
testb %r14b, %r14b
je 0x127cb
movq -0x90(%rbp), %rax
movb (%rax), %al
movb %al, -0x2a(%rbp)
jmp 0x12831
movl $0x21, %edx
movq %r12, %rdi
leaq 0x280c4(%rip), %rsi     # 0x3a89e
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x126ff
movl $0x18, %edx
movq %r12, %rdi
leaq 0x28076(%rip), %rsi     # 0x3a8c0
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
callq 0x33c0
leaq -0x1b8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x4574
leaq -0x1c8(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x38a27
movl %eax, %r14d
movq -0x1c8(%rbp), %rdi
leaq -0x1b8(%rbp), %rax
cmpq %rax, %rdi
je 0x128eb
callq 0x31d0
testb %r14b, %r14b
je 0x12932
movq -0x68(%rbp), %rbx
testq %rbx, %rbx
je 0x12916
movq -0x70(%rbp), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x32c0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x12900
leaq -0x70(%rbp), %rdi
movq %rdi, %rsi
callq 0x30f0
leaq -0x238(%rbp), %rbx
leaq -0x4c0(%rbp), %r15
jmp 0x12998
movl $0x30, %edx
movq %r12, %rdi
leaq 0x27f98(%rip), %rsi     # 0x3a8d9
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x1283b
movl $0x28, %edx
movq %r12, %rdi
leaq 0x28010(%rip), %rsi     # 0x3a9c1
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq %r13, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x33c0
leaq -0x198(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x4574
leaq -0x1a8(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x3819a
movl %eax, %r14d
movq -0x1a8(%rbp), %rdi
leaq -0x198(%rbp), %rax
cmpq %rax, %rdi
je 0x12a5b
callq 0x31d0
testb %r14b, %r14b
je 0x12a9a
movq %r15, %rdi
leaq -0xd0(%rbp), %rsi
movl $0x18, %edx
callq 0x3310
movq %r15, %rdi
leaq -0x4c(%rbp), %rsi
callq 0x3120
movq %r15, %rdi
movq 0x35526(%rip), %rsi     # 0x47fb0
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x30d0
jmp 0x12b00
movl $0x32, %edx
movq %r12, %rdi
leaq 0x27f41(%rip), %rsi     # 0x3a9ea
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpb $0x6e, -0x29(%rbp)
je 0x129a2
movl -0x44(%rbp), %r14d
leaq -0x178(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x4574
movl -0x50(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq -0x158(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
addq %rsi, %rdx
leaq -0x168(%rbp), %rdi
callq 0x4574
leaq -0x328(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x338(%rbp), %r15
movq %r15, %rdi
callq 0x4574
movl -0x4c(%rbp), %eax
subq $0x8, %rsp
movsbl -0x2a(%rbp), %r10d
leaq -0x318(%rbp), %rdi
movl %r14d, %esi
leaq -0x188(%rbp), %rdx
movq -0x148(%rbp), %rcx
movl -0x48(%rbp), %r8d
leaq -0x168(%rbp), %r9
pushq %rax
pushq %r15
pushq %r10
callq 0xfb00
addq $0x20, %rsp
movl -0x44(%rbp), %eax
movl %eax, -0x4c0(%rbp)
leaq 0x34c59(%rip), %rax     # 0x47838
movq %rax, -0x4b8(%rbp)
movl -0x310(%rbp), %eax
movl %eax, -0x4b0(%rbp)
leaq -0x498(%rbp), %rcx
movq %rcx, -0x4a8(%rbp)
movq -0x308(%rbp), %rax
leaq -0x2f8(%rbp), %rdx
cmpq %rdx, %rax
leaq -0x4c0(%rbp), %r15
je 0x12c31
movq %rax, -0x4a8(%rbp)
movq -0x2f8(%rbp), %rax
movq %rax, -0x498(%rbp)
jmp 0x12c37
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq -0x300(%rbp), %rax
movq %rax, -0x4a0(%rbp)
movq %rdx, -0x308(%rbp)
movq $0x0, -0x300(%rbp)
movb $0x0, -0x2f8(%rbp)
movl 0x18(%rdx), %eax
movl %eax, 0x40(%r15)
movq 0x10(%rdx), %rax
movq %rax, 0x38(%r15)
leaq -0x468(%rbp), %rcx
movq %rcx, -0x478(%rbp)
movq -0x2d8(%rbp), %rax
leaq -0x2c8(%rbp), %rdx
cmpq %rdx, %rax
je 0x12ca5
movq %rax, -0x478(%rbp)
movq -0x2c8(%rbp), %rax
movq %rax, -0x468(%rbp)
jmp 0x12cab
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq -0x2d0(%rbp), %rax
movq %rax, -0x470(%rbp)
movq %rdx, -0x2d8(%rbp)
movq $0x0, -0x2d0(%rbp)
movb $0x0, -0x2c8(%rbp)
movb -0x2b8(%rbp), %al
movb %al, -0x458(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x450(%rbp)
movq -0x2b0(%rbp), %rax
leaq -0x2a0(%rbp), %rdx
cmpq %rdx, %rax
je 0x12d13
movq %rax, -0x450(%rbp)
movq -0x2a0(%rbp), %rax
movq %rax, -0x440(%rbp)
jmp 0x12d19
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq -0x2a8(%rbp), %rax
movq %rax, -0x448(%rbp)
movq %rdx, -0x2b0(%rbp)
movq $0x0, -0x2a8(%rbp)
movb $0x0, -0x2a0(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movl -0x290(%rbp), %eax
movl %eax, -0x430(%rbp)
movq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x1d80a
leaq 0x34acb(%rip), %rax     # 0x47838
movq %rax, -0x4b8(%rbp)
movq -0x450(%rbp), %rdi
cmpq -0x40(%rbp), %rdi
je 0x12d86
callq 0x31d0
movq -0x478(%rbp), %rdi
leaq -0x468(%rbp), %rax
cmpq %rax, %rdi
je 0x12d9e
callq 0x31d0
movq -0x4a8(%rbp), %rdi
leaq -0x498(%rbp), %rax
cmpq %rax, %rdi
je 0x12db6
callq 0x31d0
leaq 0x34a7b(%rip), %rax     # 0x47838
movq %rax, -0x318(%rbp)
movq -0x2b0(%rbp), %rdi
leaq -0x2a0(%rbp), %rax
cmpq %rax, %rdi
je 0x12ddc
callq 0x31d0
movq -0x2d8(%rbp), %rdi
leaq -0x2c8(%rbp), %rax
cmpq %rax, %rdi
je 0x12df4
callq 0x31d0
movq -0x308(%rbp), %rdi
leaq -0x2f8(%rbp), %rax
cmpq %rax, %rdi
je 0x12e0c
callq 0x31d0
movq -0x338(%rbp), %rdi
leaq -0x328(%rbp), %rax
cmpq %rax, %rdi
je 0x12e24
callq 0x31d0
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x12e3c
callq 0x31d0
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0x12e54
callq 0x31d0
movl $0x2a, %edx
movq %r12, %rdi
leaq 0x27bba(%rip), %rsi     # 0x3aa1d
callq 0x3250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %r13, %rdi
leaq -0x2b(%rbp), %rsi
callq 0x3280
cmpb $0x73, -0x2b(%rbp)
je 0x12089
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
cmpq -0x138(%rbp), %rax
jne 0x12ec5
movl $0x21, %ebx
leaq 0x27aab(%rip), %r14     # 0x3a96e
jmp 0x12f31
movl $0x1f, %ebx
leaq 0x27ad0(%rip), %r14     # 0x3a9a1
testq %rax, %rax
je 0x12f31
leaq 0x27b6b(%rip), %rsi     # 0x3aa48
leaq -0x6c0(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
movq -0x38(%rbp), %rax
movq 0x18(%rax), %r15
addq $0x8, %rax
cmpq %rax, %r15
je 0x12f25
movq %rax, %r13
leaq -0x6c0(%rbp), %r12
leaq 0x28(%r15), %rsi
movq %r12, %rdi
callq 0xffb4
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r13, %rax
jne 0x12f09
leaq -0x6c0(%rbp), %rdi
callq 0x32a0
movq 0x35098(%rip), %r15     # 0x47fd0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3250
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x3506c(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x35050(%rip), %rax     # 0x47fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x6b8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x6c0(%rbp,%rcx)
callq 0x3190
leaq -0x5c8(%rbp), %rdi
callq 0x30d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x12fbc
callq 0x31d0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x12fd4
callq 0x31d0
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x12fec
callq 0x31d0
movq -0x268(%rbp), %rdi
leaq -0x258(%rbp), %rax
cmpq %rax, %rdi
je 0x13004
callq 0x31d0
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x1301c
callq 0x31d0
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x13034
callq 0x31d0
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x1304c
callq 0x31d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1305e
callq 0x31d0
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x13076
callq 0x31d0
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2811d(%rip), %rdi     # 0x3b1ac
callq 0x3110
leaq 0x28111(%rip), %rdi     # 0x3b1ac
callq 0x32b0
movq %rax, %r14
jmp 0x1325a
jmp 0x13221
jmp 0x13221
jmp 0x13221
movq %rax, %r14
jmp 0x13111
movq %rax, %r14
jmp 0x130f9
movq %rax, %r14
jmp 0x130e1
movq %rax, %r14
leaq -0x4c0(%rbp), %rdi
callq 0x1cd90
leaq -0x318(%rbp), %rdi
callq 0x4a34
movq -0x338(%rbp), %rdi
leaq -0x328(%rbp), %rax
cmpq %rax, %rdi
je 0x130f9
callq 0x31d0
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x13111
callq 0x31d0
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
jmp 0x13221
jmp 0x13221
jmp 0x13140
jmp 0x13221
jmp 0x13140
movq %rax, %r14
movq 0x34e66(%rip), %rsi     # 0x47fb0
leaq -0x4c0(%rbp), %rdi
callq 0x3160
leaq -0x440(%rbp), %rdi
callq 0x30d0
jmp 0x13224
jmp 0x13221
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x13224
movl %ebx, (%r15)
jmp 0x13224
movq %rax, %r14
movq -0x1a8(%rbp), %rdi
leaq -0x198(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
movq %rax, %r14
movq -0x1c8(%rbp), %rdi
leaq -0x1b8(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
movq %rax, %r14
movq -0x1e8(%rbp), %rdi
leaq -0x1d8(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
movq %rax, %r14
movq -0x208(%rbp), %rdi
leaq -0x1f8(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
movq %rax, %r14
movq -0x228(%rbp), %rdi
leaq -0x218(%rbp), %rax
cmpq %rax, %rdi
je 0x13224
jmp 0x1320c
movq %rax, %r14
movq -0x248(%rbp), %rdi
cmpq %rbx, %rdi
je 0x13224
callq 0x31d0
jmp 0x13224
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
movq %rax, %r14
movq 0x34d9d(%rip), %rax     # 0x47fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x6b8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x6c0(%rbp,%rcx)
callq 0x3190
leaq -0x5c8(%rbp), %rdi
callq 0x30d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x1326f
callq 0x31d0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x13287
callq 0x31d0
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x1329f
callq 0x31d0
movq -0x268(%rbp), %rdi
leaq -0x258(%rbp), %rax
cmpq %rax, %rdi
je 0x132b7
callq 0x31d0
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x132cf
callq 0x31d0
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x132e7
callq 0x31d0
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x132ff
callq 0x31d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x13311
callq 0x31d0
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x13329
callq 0x31d0
movq %r14, %rdi
callq 0x3380