// File: luizaes[P]post-machine-simulator/post_machine_sim.cpp
// Function: PostMachineSimulator::BuildDiagram()
DiagramState* PostMachineSimulator::BuildDiagram() {
	string state_name, input_entry, transition, error_text;
	int number_states, number_transitions, output, start_index = 0;
	node node_aux;
	state state_aux;
	bool error_found = false, state_found = false;
	char symbol, current_queue_symbol = NONE;

	/* Read the number of states the Post Machine has */
	cin >> number_states;

	/* Read the name of each of these states, storing them in an adjacency list */
	for (int i = 0; i < number_states; i++) {
		cin >> state_name;
		node_aux.name = state_name;
		flow_diagram.push_back(node_aux);
	}

	/* Read the name of the starting state */
	cin >> start_state;

	/* Read the name of the accepting state - we don't have a rejection state, 
	   the machine halts and rejects an input by indefinition */
	cin >> accept_state;

	/* Read the number of transitions present in the diagram */
	cin >> number_transitions;

	/* Read each transition */
	for(int i = 0; i < number_transitions; i++) {
		cin >> transition;
		state_found = false;

		for (int j = 0; j < number_states; j++) {
			/* If the state specified in the transition exists */
			if(flow_diagram[j].name.compare(transition) == 0) {
				state_found = true;

				/* If the transition starts with a READ state */
				if(transition.front() == 'R' || transition.front() == 'r') {
					cin >> symbol;
					ReadInputLine(transition);

					if(transition.compare(start_state) == 0) {
						string message = "[ERROR] Invalid transition: it's not possible to have a transition pointing to the starting state.";
						DiagramState* response = new DiagramState(/*has_error=*/true, message);
						return response;
					} else if(transition.compare(" " + accept_state) != 0 && (transition.at(1) == 'A' || transition.at(1) == 'a')) {
						current_queue_symbol = transition.substr(transition.length()-1, 1).front();
						transition = transition.substr(1, transition.length()-3);
					} else {
						transition = transition.substr(1, transition.length()-1);
					}

					state_aux.name = transition;
					state_aux.read_symbol = symbol;
					state_aux.add_symbol = current_queue_symbol;
					current_queue_symbol = NONE;
					flow_diagram[j].flows.push_back(state_aux);

				/* If the transition starts with a START state */
				} else if(transition.compare(start_state) == 0) {
					ReadInputLine(transition);

					if(transition.at(1) == 'A' || transition.at(1) == 'a') {
						current_queue_symbol = transition.substr(transition.length()-1, 1).front();
						transition = transition.substr(1, transition.length()-3);
					}

					state_aux.name = transition;
					state_aux.read_symbol = NONE;
					state_aux.add_symbol = current_queue_symbol;
					current_queue_symbol = NONE;
					flow_diagram[j].flows.push_back(state_aux);
				}  else if(transition.compare(accept_state) == 0) {
					string message = "[ERROR] Invalid transition: the accepting state cannot have a transition to any other state.";
					DiagramState* response = new DiagramState(/*has_error=*/true, message);
					return response;
				/* If the transition starts with an ADD state */
				} else if(transition.front() == 'A' || transition.front() == 'a') {
					cin >> symbol;
					ReadInputLine(transition);
					if(transition.compare(" " + start_state) == 0) {
						string message = "[ERROR] Invalid transition: it's not possible to have a transition pointing to the starting state.";
						DiagramState* response = new DiagramState(/*has_error=*/true, message);
						return response;
					} else if(transition.at(1) == 'A' || transition.at(1) == 'a') {
						current_queue_symbol = transition.substr(transition.length()-1, 1).front();
						transition = transition.substr(1, transition.length()-3);
					} else {
						transition = transition.substr(1, transition.length()-1);
					}
					state_aux.name = transition;
					state_aux.read_symbol = NONE;
					state_aux.add_symbol = current_queue_symbol;
					current_queue_symbol = NONE;
					flow_diagram[j].flows.push_back(state_aux);
				}
				break;
			}
		}

		if(!state_found) {
			string message = "[ERROR] Invalid transition: the specified state does not exist.";
			DiagramState* response = new DiagramState(/*has_error=*/true, message);
			return response;
		}
	}
	string message = "";
	DiagramState* response = new DiagramState(/*has_error=*/false, message);
	return response;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x22c0
leaq -0x50(%rbp), %rdi
callq 0x22c0
leaq -0x70(%rbp), %rdi
callq 0x22c0
leaq -0x90(%rbp), %rdi
callq 0x22c0
movl $0x0, -0xa0(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4e40
leaq -0x100(%rbp), %rdi
callq 0x4e70
movb $0x0, -0x101(%rbp)
movb $0x0, -0x102(%rbp)
movb $0x24, -0x104(%rbp)
movq 0x82e1(%rip), %rdi      # 0xbfe0
leaq -0x94(%rbp), %rsi
callq 0x2150
jmp 0x3d0d
movl $0x0, -0x118(%rbp)
movl -0x118(%rbp), %eax
cmpl -0x94(%rbp), %eax
jge 0x3d88
movq 0x82b4(%rip), %rdi      # 0xbfe0
leaq -0x30(%rbp), %rsi
callq 0x22a0
jmp 0x3d37
leaq -0xd8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2040
jmp 0x3d49
movq -0x360(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4e90
jmp 0x3d5e
jmp 0x3d60
movl -0x118(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118(%rbp)
jmp 0x3d17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x4ad0
movq -0x360(%rbp), %rsi
addq $0x68, %rsi
movq 0x8246(%rip), %rdi      # 0xbfe0
callq 0x22a0
jmp 0x3da1
movq -0x360(%rbp), %rsi
addq $0x88, %rsi
movq 0x822a(%rip), %rdi      # 0xbfe0
callq 0x22a0
jmp 0x3dbd
movq 0x821c(%rip), %rdi      # 0xbfe0
leaq -0x98(%rbp), %rsi
callq 0x2150
jmp 0x3dd2
movl $0x0, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jge 0x4986
movq 0x81eb(%rip), %rdi      # 0xbfe0
leaq -0x70(%rbp), %rsi
callq 0x22a0
jmp 0x3e00
movb $0x0, -0x102(%rbp)
movl $0x0, -0x120(%rbp)
movl -0x120(%rbp), %eax
cmpl -0x94(%rbp), %eax
jge 0x485c
movq -0x360(%rbp), %rdi
movslq -0x120(%rbp), %rsi
callq 0x4c50
movq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2030
movl %eax, -0x364(%rbp)
jmp 0x3e4a
movl -0x364(%rbp), %eax
cmpl $0x0, %eax
jne 0x4846
movb $0x1, -0x102(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x20a0
movsbl (%rax), %eax
cmpl $0x52, %eax
je 0x3e86
leaq -0x70(%rbp), %rdi
callq 0x20a0
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x4229
movq 0x8153(%rip), %rdi      # 0xbfe0
leaq -0x103(%rbp), %rsi
callq 0x22b0
jmp 0x3e9b
leaq -0x70(%rbp), %rdi
callq 0x3810
jmp 0x3ea6
movq -0x360(%rbp), %rsi
addq $0x68, %rsi
leaq -0x70(%rbp), %rdi
callq 0x2030
movl %eax, -0x368(%rbp)
jmp 0x3ec2
movl -0x368(%rbp), %eax
cmpl $0x0, %eax
jne 0x3fd8
leaq -0x141(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x2380
movq -0x370(%rbp), %rdx
leaq 0x41a6(%rip), %rsi      # 0x8098
leaq -0x140(%rbp), %rdi
callq 0x4f00
jmp 0x3f00
leaq -0x141(%rbp), %rdi
callq 0x2250
movl $0x28, %edi
callq 0x2200
movq %rax, -0x378(%rbp)
jmp 0x3f1f
movq -0x378(%rbp), %rdi
movl $0x1, %esi
leaq -0x140(%rbp), %rdx
callq 0x71a0
jmp 0x3f39
movq -0x378(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x2160
jmp 0x4a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x141(%rbp), %rdi
callq 0x2250
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x3fc7
movq -0x378(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
movl $0x28, %esi
callq 0x2210
leaq -0x140(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
movq -0x360(%rbp), %rdx
addq $0x88, %rdx
leaq 0x410e(%rip), %rsi      # 0x80fb
leaq -0x178(%rbp), %rdi
callq 0x4fb0
jmp 0x3ffb
leaq -0x70(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x2030
movl %eax, -0x37c(%rbp)
jmp 0x4013
movl -0x37c(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x37d(%rbp)
je 0x408d
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x388(%rbp)
jmp 0x403d
movq -0x388(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x41, %ecx
movb %al, -0x389(%rbp)
je 0x4081
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x398(%rbp)
jmp 0x406b
movq -0x398(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
sete %al
movb %al, -0x389(%rbp)
movb -0x389(%rbp), %al
movb %al, -0x37d(%rbp)
movb -0x37d(%rbp), %al
movb %al, -0x399(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x2160
movb -0x399(%rbp), %al
testb $0x1, %al
jne 0x40b4
jmp 0x417d
leaq -0x70(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x22e0
movq -0x3a8(%rbp), %rsi
movq %rax, %rdx
decq %rdx
leaq -0x198(%rbp), %rdi
movl $0x1, %ecx
callq 0x2220
jmp 0x40e4
leaq -0x198(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x20a0
movq -0x3b8(%rbp), %rdi
movb (%rax), %al
movb %al, -0x104(%rbp)
callq 0x2160
leaq -0x70(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x22e0
movq -0x3b0(%rbp), %rsi
movq %rax, %rcx
addq $-0x3, %rcx
leaq -0x1b8(%rbp), %rdi
movl $0x1, %edx
callq 0x2220
jmp 0x413c
leaq -0x70(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x2280
leaq -0x1b8(%rbp), %rdi
callq 0x2160
jmp 0x41c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
leaq -0x70(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x22e0
movq -0x3c0(%rbp), %rsi
movq %rax, %rcx
decq %rcx
leaq -0x1d8(%rbp), %rdi
movl $0x1, %edx
callq 0x2220
jmp 0x41ad
leaq -0x70(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x2280
leaq -0x1d8(%rbp), %rdi
callq 0x2160
jmp 0x41cb
leaq -0x100(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2040
jmp 0x41dd
movq -0x360(%rbp), %rdi
movb -0x103(%rbp), %al
movb %al, -0xe0(%rbp)
movb -0x104(%rbp), %al
movb %al, -0xdf(%rbp)
movb $0x24, -0x104(%rbp)
movslq -0x120(%rbp), %rsi
callq 0x4c50
movq %rax, %rdi
addq $0x20, %rdi
leaq -0x100(%rbp), %rsi
callq 0x50c0
jmp 0x4224
jmp 0x4844
movq -0x360(%rbp), %rsi
addq $0x68, %rsi
leaq -0x70(%rbp), %rdi
callq 0x2030
movl %eax, -0x3c4(%rbp)
jmp 0x4245
movl -0x3c4(%rbp), %eax
cmpl $0x0, %eax
jne 0x43ac
leaq -0x70(%rbp), %rdi
callq 0x3810
jmp 0x425f
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x3d0(%rbp)
jmp 0x4276
movq -0x3d0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x42af
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x3d8(%rbp)
jmp 0x429c
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x4353
leaq -0x70(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0x22e0
movq -0x3e0(%rbp), %rsi
movq %rax, %rdx
decq %rdx
leaq -0x1f8(%rbp), %rdi
movl $0x1, %ecx
callq 0x2220
jmp 0x42df
leaq -0x1f8(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x20a0
movq -0x3f0(%rbp), %rdi
movb (%rax), %al
movb %al, -0x104(%rbp)
callq 0x2160
leaq -0x70(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0x22e0
movq -0x3e8(%rbp), %rsi
movq %rax, %rcx
addq $-0x3, %rcx
leaq -0x218(%rbp), %rdi
movl $0x1, %edx
callq 0x2220
jmp 0x4337
leaq -0x70(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x2280
leaq -0x218(%rbp), %rdi
callq 0x2160
leaq -0x100(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2040
jmp 0x4365
movq -0x360(%rbp), %rdi
movb $0x24, -0xe0(%rbp)
movb -0x104(%rbp), %al
movb %al, -0xdf(%rbp)
movb $0x24, -0x104(%rbp)
movslq -0x120(%rbp), %rsi
callq 0x4c50
movq %rax, %rdi
addq $0x20, %rdi
leaq -0x100(%rbp), %rsi
callq 0x50c0
jmp 0x43a7
jmp 0x4842
movq -0x360(%rbp), %rsi
addq $0x88, %rsi
leaq -0x70(%rbp), %rdi
callq 0x2030
movl %eax, -0x3f4(%rbp)
jmp 0x43cb
movl -0x3f4(%rbp), %eax
cmpl $0x0, %eax
jne 0x44e1
leaq -0x239(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x2380
movq -0x400(%rbp), %rdx
leaq 0x3d02(%rip), %rsi      # 0x80fd
leaq -0x238(%rbp), %rdi
callq 0x4f00
jmp 0x4409
leaq -0x239(%rbp), %rdi
callq 0x2250
movl $0x28, %edi
callq 0x2200
movq %rax, -0x408(%rbp)
jmp 0x4428
movq -0x408(%rbp), %rdi
movl $0x1, %esi
leaq -0x238(%rbp), %rdx
callq 0x71a0
jmp 0x4442
movq -0x408(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x248(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x2160
jmp 0x4a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x239(%rbp), %rdi
callq 0x2250
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x44d0
movq -0x408(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
movl $0x28, %esi
callq 0x2210
leaq -0x238(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
leaq -0x70(%rbp), %rdi
callq 0x20a0
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x4507
leaq -0x70(%rbp), %rdi
callq 0x20a0
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x483e
movq 0x7ad2(%rip), %rdi      # 0xbfe0
leaq -0x103(%rbp), %rsi
callq 0x22b0
jmp 0x451c
leaq -0x70(%rbp), %rdi
callq 0x3810
jmp 0x4527
movq -0x360(%rbp), %rdx
addq $0x68, %rdx
leaq 0x3bc2(%rip), %rsi      # 0x80fb
leaq -0x268(%rbp), %rdi
callq 0x4fb0
jmp 0x4547
leaq -0x70(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x2030
movl %eax, -0x40c(%rbp)
jmp 0x455f
leaq -0x268(%rbp), %rdi
callq 0x2160
movl -0x40c(%rbp), %eax
cmpl $0x0, %eax
jne 0x46a4
leaq -0x289(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x2380
movq -0x418(%rbp), %rdx
leaq 0x3afd(%rip), %rsi      # 0x8098
leaq -0x288(%rbp), %rdi
callq 0x4f00
jmp 0x45a9
leaq -0x289(%rbp), %rdi
callq 0x2250
movl $0x28, %edi
callq 0x2200
movq %rax, -0x420(%rbp)
jmp 0x45c8
movq -0x420(%rbp), %rdi
movl $0x1, %esi
leaq -0x288(%rbp), %rdx
callq 0x71a0
jmp 0x45e2
movq -0x420(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x2160
jmp 0x4a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x289(%rbp), %rdi
callq 0x2250
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x4693
movq -0x420(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
movl $0x28, %esi
callq 0x2210
leaq -0x288(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x428(%rbp)
jmp 0x46bb
movq -0x428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x46f4
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movq %rax, -0x430(%rbp)
jmp 0x46e1
movq -0x430(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x479a
leaq -0x70(%rbp), %rdi
movq %rdi, -0x438(%rbp)
callq 0x22e0
movq -0x438(%rbp), %rsi
movq %rax, %rdx
decq %rdx
leaq -0x2b8(%rbp), %rdi
movl $0x1, %ecx
callq 0x2220
jmp 0x4724
leaq -0x2b8(%rbp), %rdi
movq %rdi, -0x448(%rbp)
callq 0x20a0
movq -0x448(%rbp), %rdi
movb (%rax), %al
movb %al, -0x104(%rbp)
callq 0x2160
leaq -0x70(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x22e0
movq -0x440(%rbp), %rsi
movq %rax, %rcx
addq $-0x3, %rcx
leaq -0x2d8(%rbp), %rdi
movl $0x1, %edx
callq 0x2220
jmp 0x477c
leaq -0x70(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x2280
leaq -0x2d8(%rbp), %rdi
callq 0x2160
jmp 0x47e6
leaq -0x70(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x22e0
movq -0x450(%rbp), %rsi
movq %rax, %rcx
decq %rcx
leaq -0x2f8(%rbp), %rdi
movl $0x1, %edx
callq 0x2220
jmp 0x47ca
leaq -0x70(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x2280
leaq -0x2f8(%rbp), %rdi
callq 0x2160
jmp 0x47e8
leaq -0x100(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2040
jmp 0x47fa
movq -0x360(%rbp), %rdi
movb $0x24, -0xe0(%rbp)
movb -0x104(%rbp), %al
movb %al, -0xdf(%rbp)
movb $0x24, -0x104(%rbp)
movslq -0x120(%rbp), %rsi
callq 0x4c50
movq %rax, %rdi
addq $0x20, %rdi
leaq -0x100(%rbp), %rsi
callq 0x50c0
jmp 0x483c
jmp 0x483e
jmp 0x4840
jmp 0x4842
jmp 0x4844
jmp 0x485c
jmp 0x4848
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x3e11
testb $0x1, -0x102(%rbp)
jne 0x4970
leaq -0x319(%rbp), %rdi
movq %rdi, -0x458(%rbp)
callq 0x2380
movq -0x458(%rbp), %rdx
leaq 0x38d0(%rip), %rsi      # 0x815a
leaq -0x318(%rbp), %rdi
callq 0x4f00
jmp 0x4898
leaq -0x319(%rbp), %rdi
callq 0x2250
movl $0x28, %edi
callq 0x2200
movq %rax, -0x460(%rbp)
jmp 0x48b7
movq -0x460(%rbp), %rdi
movl $0x1, %esi
leaq -0x318(%rbp), %rdx
callq 0x71a0
jmp 0x48d1
movq -0x460(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x2160
jmp 0x4a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x319(%rbp), %rdi
callq 0x2250
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x495f
movq -0x460(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
movl $0x28, %esi
callq 0x2210
leaq -0x318(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
jmp 0x4972
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x3ddc
leaq -0x349(%rbp), %rdi
movq %rdi, -0x468(%rbp)
callq 0x2380
movq -0x468(%rbp), %rdx
leaq 0x3755(%rip), %rsi      # 0x80fc
leaq -0x348(%rbp), %rdi
callq 0x4f00
jmp 0x49b5
leaq -0x349(%rbp), %rdi
callq 0x2250
movl $0x28, %edi
callq 0x2200
movq %rax, -0x470(%rbp)
jmp 0x49d4
movq -0x470(%rbp), %rdi
xorl %esi, %esi
leaq -0x348(%rbp), %rdx
callq 0x71a0
jmp 0x49eb
movq -0x470(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x358(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x2160
jmp 0x4a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x349(%rbp), %rdi
callq 0x2250
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x4a76
movq -0x470(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
movl $0x28, %esi
callq 0x2210
leaq -0x348(%rbp), %rdi
callq 0x2160
jmp 0x4ad0
leaq -0x100(%rbp), %rdi
callq 0x3670
leaq -0xd8(%rbp), %rdi
callq 0x3450
leaq -0x90(%rbp), %rdi
callq 0x2160
leaq -0x70(%rbp), %rdi
callq 0x2160
leaq -0x50(%rbp), %rdi
callq 0x2160
leaq -0x30(%rbp), %rdi
callq 0x2160
movq -0x8(%rbp), %rax
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
leaq -0x100(%rbp), %rdi
callq 0x3670
leaq -0xd8(%rbp), %rdi
callq 0x3450
leaq -0x90(%rbp), %rdi
callq 0x2160
leaq -0x70(%rbp), %rdi
callq 0x2160
leaq -0x50(%rbp), %rdi
callq 0x2160
leaq -0x30(%rbp), %rdi
callq 0x2160
movq -0x110(%rbp), %rdi
callq 0x2370
nopl (%rax,%rax)