// File: /workspace/github_cpp_makefile_star2_O1/ixchow[P]http-tweak/tweak.cpp
// Function: tweak::sync()
void sync() {
	auto &internal = get_internal();
	std::unique_lock< std::mutex > lock(internal.mutex);

	if (!internal.server) internal.server = std::make_unique< http::server >(internal.port);

	//Read adjustments (and poll requests) from the server:
	internal.server->poll([&](http::request const &request, std::unique_ptr< http::response > response){
		if (request.method == "GET" && request.url == "/") {
			//serve UI:
			std::ifstream ui(internal.ui_file, std::ios::binary);
			std::ostringstream ss;
			ss << ui.rdbuf();
			response->body = ss.str();
		} else if (request.method == "GET" && request.url == "/tweaks") {
			//serve current state (...by registering a poll):
			internal.polls.emplace_back(0, std::move(response));
		} else if (request.method == "GET" && request.url.substr(0,8) == "/tweaks?") {
			//long poll:
			uint32_t serial = -1U;
			try {
				serial = std::stoul(request.url.substr(8));
			} catch (...) {
				std::cerr << "[tweak::sync()] got invalid serial in url '" + request.url + "'." << std::endl;
				serial = -1U;
			}
			if (serial != -1U) {
				internal.polls.emplace_back(std::stoul(request.url.substr(8)), std::move(response));
			}
		} else if (request.method == "POST" && request.url == "/tweaks") {
			//adjust current state
			//std::cout << "Got tweaks:\n" << request.body << std::endl; //DEBUG

			//looking at something like: {"name":"value","name2":"value2",...}

			std::string const &json = request.body;
			uint32_t i = 0;
			auto skip_wsp = [&json,&i]() {
				while (i < json.size()
					&& (json[i] == 0x09 || json[i] == 0x0A || json[i] == 0x0D || json[i] == 0x20)
					) ++i;
			};
			auto skip_char = [&json,&i](char c) -> bool {
				if (i >= json.size()) return false;
				if (json[i] != c) return false;
				++i;
				return true;
			};
			auto extract_string = [&json, &i](std::string *into) -> bool {
				if (i >= json.size() || json[i] != '"') return false;
				uint32_t begin = i;
				++i;
				while (i < json.size() && json[i] != '"') {
					if (json[i] == '\\') ++i;
					++i;
				}
				if (i >= json.size()) return false;
				assert(json[i] == '"');
				++i;
				uint32_t end = i;
				std::string data = json.substr(begin, end - begin);
				std::string err = "";
				if (!json_to_utf8(data, into, &err)) {
					std::cerr << "Error decoding json string: " << err << std::endl;
					return false;
				}
				return true;
			};
			skip_wsp();
			if (!skip_char('{')) {
				std::cerr << "Missing opening '{'" << std::endl;
				return;
			}
			skip_wsp();
			bool first = true;
			while (i < json.size()) {
				if (json[i] == '}') break; //closing character
				if (first) {
					first = false;
				} else {
					if (!skip_char(',')) {
						std::cerr << "Missing separating ','" << std::endl;
						return;
					}
					skip_wsp();
				}
				std::string name, value;
				if (!extract_string(&name)) {
					std::cerr << "Missing name string." << std::endl;
					return;
				}
				skip_wsp();
				if (!skip_char(':')) {
					std::cerr << "Missing separating ':'" << std::endl;
					return;
				}
				skip_wsp();
				if (!extract_string(&value)) {
					std::cerr << "Missing value string." << std::endl;
					return;
				}

				//std::cout << "Received: '" << name << "':'" << value << "'" << std::endl; //DEBUG
				internal.received[name] = value;

				skip_wsp();
			}
			if (!skip_char('}')) {
				std::cerr << "Missing closing '{'" << std::endl;
				return;
			}
			skip_wsp();
			if (i < json.size()) {
				std::cerr << "Trailing garbage" << std::endl;
				return;
			}
		} else {
			response->status.code = 404;
			response->status.message = "Not Found";
			response->body = "Not Found";
			response->headers.emplace_back("Content-Type", "text/plain");
		}
	});

	//Read all adjustments from the server, and encode current state and hits:
	std::map< std::string, std::string > state;
	for (auto tweak : internal.tweaks) {
		auto f = internal.received.find(tweak->name);
		if (f != internal.received.end()) {
			try {
				tweak->deserialize(f->second);
			} catch (...) {
				std::cerr << "Failed to deserialize " << f->first << " from '" << f->second << "'" << std::endl;
			}
		}
		state[tweak->name] = "{\"hint\":" + utf8_to_json(tweak->hint) + ",\"value\":" + utf8_to_json(tweak->serialize()) + "}";
	}
	internal.received.clear();

	std::string all_state = "{\n";
	for (auto const &name_value : state) {
		if (&name_value != &(*state.begin())) all_state += ",\n";
		all_state += utf8_to_json(name_value.first) + ":" + name_value.second;
	}
	all_state += "\n}";

	//if state has changed, update serial:
	if (internal.state != all_state) {
		internal.state = all_state;
		++internal.state_serial;
	}

	//respond to polls:
	for (auto poll = internal.polls.begin(); poll != internal.polls.end(); /* later */) {
		auto next = poll;
		++next;
		if (poll->serial != internal.state_serial) {
			poll->response->body = "{\"serial\":" + std::to_string(internal.state_serial) + ",\"state\":" + internal.state + "}";
			poll->response->headers.emplace_back("Content-Type", "application/json");
			internal.polls.erase(poll);
		}
		poll = next;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
callq 0x4380
leaq 0xad46(%rip), %rax      # 0xf338
leaq -0x170(%rbp), %rbx
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x9014
movb $0x1, 0x8(%rbx)
cmpq $0x0, 0xad8c(%rip)      # 0xf3a0
jne 0x4674
movl $0x30, %edi
callq 0x3370
movq %rax, %r14
movzwl 0xad6e(%rip), %esi      # 0xf398
movq %rax, %rdi
callq 0x9450
movq $0x0, -0x120(%rbp)
movq 0xad5c(%rip), %rsi      # 0xf3a0
movq %r14, 0xad55(%rip)      # 0xf3a0
testq %rsi, %rsi
je 0x465c
leaq 0xad49(%rip), %rdi      # 0xf3a0
callq 0x7bb0
movq -0x120(%rbp), %rsi
testq %rsi, %rsi
je 0x4674
leaq -0x120(%rbp), %rdi
callq 0x7bb0
movq 0xad25(%rip), %rdi      # 0xf3a0
leaq 0xac96(%rip), %rax      # 0xf318
xorps %xmm0, %xmm0
leaq -0x120(%rbp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movq %rax, (%rsi)
leaq 0xf85(%rip), %rax       # 0x5622
movq %rax, 0x18(%rsi)
leaq 0x1988(%rip), %rax      # 0x6030
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
callq 0x687e
movq -0x110(%rbp), %rax
testq %rax, %rax
je 0x46d1
leaq -0x120(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0x118(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0xac79(%rip), %rax      # 0xf370
testq %rax, %rax
je 0x4b45
leaq -0x38(%rbp), %r14
leaq -0x58(%rbp), %r12
movq %rax, -0xf0(%rbp)
movq 0x8(%rax), %r13
leaq 0xacce(%rip), %rdi      # 0xf3e8
movq %r13, %rsi
callq 0x9ece
movq %rax, %r15
leaq 0xacc4(%rip), %rax      # 0xf3f0
cmpq %rax, %r15
je 0x4792
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x3f44
cmpq $0x0, 0x70(%r13)
je 0x4a8d
leaq 0x60(%r13), %rdi
leaq -0x140(%rbp), %rsi
callq *0x78(%r13)
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x4792
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x3380
leaq 0x20(%r13), %rsi
leaq -0xe8(%rbp), %r15
movq %r15, %rdi
callq 0x532f
movl $0x8, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x6a47(%rip), %rcx      # 0xb200
callq 0x33d0
leaq -0x78(%rbp), %r15
movq %r15, -0x88(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x47e8
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x47ef
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x80(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x88(%rbp), %rdi
leaq 0x69f5(%rip), %rsi      # 0xb209
callq 0x35b0
movq %r14, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq -0x160(%rbp), %rbx
je 0x4840
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x4847
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
cmpq $0x0, 0x50(%r13)
je 0x509c
leaq 0x40(%r13), %rsi
movq %rbx, %rdi
callq *0x58(%r13)
leaq -0xc8(%rbp), %rdi
movq %rbx, %rsi
callq 0x532f
movq -0x48(%rbp), %rcx
movl $0xf, %esi
cmpq %r14, %rcx
je 0x4895
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %r8
movq -0xc0(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x48ca
movl $0xf, %esi
leaq -0xb8(%rbp), %rdi
cmpq %rdi, -0xc8(%rbp)
je 0x48c5
movq -0xb8(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x48dc
movq -0xc8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3130
jmp 0x48ec
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33d0
movq %r12, -0x68(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x4909
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x4911
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x68(%rbp), %rdi
leaq 0x68e2(%rip), %rsi      # 0xb21a
callq 0x35b0
leaq -0x98(%rbp), %rsi
movq %rsi, -0xa8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x496d
movq %rdx, -0xa8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x98(%rbp)
jmp 0x4973
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0xa0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x120(%rbp), %rdi
movq %r13, %rsi
callq 0x70f6
movq %rax, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3400
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x49cd
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x49e2
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x4a04
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x4a26
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x4a3b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x4a53
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x4a75
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xf0(%rbp), %rax
movq (%rax), %rax
testq %rax, %rax
jne 0x4708
jmp 0x4b45
callq 0x3190
jmp 0x50a1
movq %rax, %rbx
jmp 0x4ac1
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x4ac1
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x3380
movq %rbx, %rdi
callq 0x31b0
movl $0x16, %edx
movq 0xa513(%rip), %rdi      # 0xefe8
leaq 0x6705(%rip), %rsi      # 0xb1e1
callq 0x33e0
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq 0xa4f8(%rip), %rdi      # 0xefe8
callq 0x33e0
movq %rax, %rbx
movl $0x7, %edx
movq %rax, %rdi
leaq 0x66f1(%rip), %rsi      # 0xb1f8
callq 0x33e0
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
movq %rbx, %rdi
callq 0x33e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6ba8(%rip), %rsi      # 0xb6d6
callq 0x33e0
movq %r15, %rdi
callq 0x31d0
callq 0x3530
jmp 0x4792
leaq 0xa89c(%rip), %rdi      # 0xf3e8
callq 0x9f1e
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x66b0(%rip), %rsi      # 0xb213
leaq 0x66ab(%rip), %rdx      # 0xb215
leaq -0xa8(%rbp), %rdi
callq 0x3eaa
movq -0x108(%rbp), %rbx
leaq -0x118(%rbp), %rax
cmpq %rax, %rbx
je 0x4cd5
leaq -0x38(%rbp), %r15
leaq -0x58(%rbp), %r12
leaq -0x88(%rbp), %r14
leaq -0xa8(%rbp), %r13
cmpq -0x108(%rbp), %rbx
je 0x4bbb
movq %r13, %rdi
leaq 0x6660(%rip), %rsi      # 0xb216
callq 0x35b0
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x532f
movq %r14, %rdi
leaq 0x665e(%rip), %rsi      # 0xb22f
callq 0x35b0
movq %r15, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4bf6
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x4bfd
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
leaq -0x48(%rbp), %rdi
callq 0x3130
movq %r12, -0x68(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c45
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x4c4d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r13, %rdi
callq 0x3130
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x4c89
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x4c9e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4cba
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rbx
leaq -0x118(%rbp), %rax
cmpq %rax, %rbx
jne 0x4ba3
leaq 0x653d(%rip), %rsi      # 0xb219
leaq -0xa8(%rbp), %rdi
callq 0x35b0
movq 0xa6e1(%rip), %rdx      # 0xf3d0
cmpq -0xa0(%rbp), %rdx
jne 0x4d14
testq %rdx, %rdx
je 0x4d2d
movq -0xa8(%rbp), %rsi
movq 0xa6bd(%rip), %rdi      # 0xf3c8
callq 0x3390
testl %eax, %eax
je 0x4d2d
leaq 0xa6ad(%rip), %rdi      # 0xf3c8
leaq -0xa8(%rbp), %rsi
callq 0x3220
incl 0xa693(%rip)            # 0xf3c0
movq 0xa674(%rip), %rbx      # 0xf3a8
leaq 0xa66d(%rip), %rax      # 0xf3a8
cmpq %rax, %rbx
je 0x5050
leaq -0x78(%rbp), %r14
leaq -0x38(%rbp), %r13
leaq -0xc8(%rbp), %r12
movl $0xd1b71759, %esi       # imm = 0xD1B71759
movq (%rbx), %rcx
movl 0xa65e(%rip), %r15d     # 0xf3c0
cmpl %r15d, 0x10(%rbx)
je 0x5044
movq %rcx, -0xf0(%rbp)
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x4dbe
movl $0x4, %eax
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x4db7
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4dbc
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4dbe
movl %ecx, %edx
imulq %rsi, %rdx
shrq $0x2d, %rdx
addl $0x4, %eax
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4d86
addl $-0x3, %eax
jmp 0x4dbe
addl $-0x2, %eax
jmp 0x4dbe
decl %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x33f0
movq -0xc8(%rbp), %rdi
movl -0xc0(%rbp), %esi
movl %r15d, %edx
callq 0x7972
movl $0xa, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x641b(%rip), %rcx      # 0xb21c
callq 0x33d0
leaq -0xd8(%rbp), %r12
movq %r12, -0xe8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4e36
movq %rdx, -0xe8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd8(%rbp)
jmp 0x4e3e
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0xe0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xe8(%rbp), %rdi
leaq 0x63c1(%rip), %rsi      # 0xb227
callq 0x35b0
movq %r14, -0x88(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4e91
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x4e98
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x80(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa512(%rip), %rsi      # 0xf3c8
movq 0xa513(%rip), %rdx      # 0xf3d0
leaq -0x88(%rbp), %rdi
callq 0x3130
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4ee9
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x4ef1
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x48(%rbp), %rdi
leaq 0x6307(%rip), %rsi      # 0xb21a
callq 0x35b0
leaq -0x58(%rbp), %r15
movq %r15, -0x68(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4f3c
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x4f43
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x18(%rbx), %rdi
addq $0x40, %rdi
leaq -0x68(%rbp), %rsi
callq 0x3400
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x4f80
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4f95
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4fad
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xe8(%rbp), %rdi
cmpq %r12, %rdi
je 0x4fc8
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
leaq -0xc8(%rbp), %r12
je 0x4ff1
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3380
movq 0x18(%rbx), %rdi
addq $0x28, %rdi
leaq 0x6231(%rip), %rsi      # 0xb231
leaq 0x6237(%rip), %rdx      # 0xb23e
callq 0x7176
decq 0xa3a5(%rip)            # 0xf3b8
movq %rbx, %rdi
callq 0x3520
leaq 0x18(%rbx), %rdi
callq 0x71bc
movl $0x20, %esi
movq %rbx, %rdi
callq 0x3380
leaq 0xa370(%rip), %rax      # 0xf3a8
movl $0xd1b71759, %esi       # imm = 0xD1B71759
movq -0xf0(%rbp), %rcx
movq %rcx, %rbx
cmpq %rax, %rcx
jne 0x4d58
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x5072
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3380
leaq -0x120(%rbp), %rdi
callq 0x8f64
leaq -0x170(%rbp), %rdi
callq 0x6864
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3190
movq %rax, %rbx
callq 0x3530
jmp 0x530f
jmp 0x50fd
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0x3380
jmp 0x531b
movq %rax, %rbx
jmp 0x531b
jmp 0x50fd
jmp 0x520d
movq %rax, %rbx
movq -0x110(%rbp), %rax
testq %rax, %rax
je 0x531b
leaq -0x120(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x531b
movq %rax, %rdi
callq 0x3e9c
jmp 0x5190
jmp 0x5190
movq %rax, %rbx
jmp 0x514e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5136
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
jmp 0x5136
movq %rax, %rbx
jmp 0x5170
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x514e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x5170
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x51e8
movq -0xb8(%rbp), %rsi
jmp 0x51e0
jmp 0x5190
jmp 0x5190
movq %rax, %rbx
jmp 0x51e8
movq %rax, %rbx
jmp 0x51cc
movq %rax, %rbx
jmp 0x51b7
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x51b7
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x51cc
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x51e8
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
leaq -0x98(%rbp), %rax
movq -0xa8(%rbp), %rdi
cmpq %rax, %rdi
je 0x530f
movq -0x98(%rbp), %rsi
jmp 0x5307
jmp 0x520d
movq %rax, %rbx
jmp 0x530f
movq %rax, %rbx
jmp 0x52ed
movq %rax, %rbx
jmp 0x52d5
jmp 0x52b9
movq %rax, %rbx
jmp 0x5295
movq %rax, %rbx
jmp 0x5273
movq %rax, %rbx
jmp 0x525e
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x525e
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x5273
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x5295
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x52bc
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x3380
jmp 0x52bc
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x52d1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3380
leaq -0x78(%rbp), %r15
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x52ed
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3380
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x530f
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x3380
leaq -0x120(%rbp), %rdi
callq 0x8f64
leaq -0x170(%rbp), %rdi
callq 0x6864
movq %rbx, %rdi
callq 0x3570