// File: /workspace/github_c_makefile_star2_O0/MartinDrab[P]netpipe/netpipe.c
// Function: PrepareChannelEnd
static int _PrepareChannelEnd(PCHANNEL_END End, int KeepListening, int ReceiveDomain, int SendDomain)
{
	int ret = 0;
	int af = AF_UNSPEC;
	SOCKET sock = INVALID_SOCKET;
	struct addrinfo hints;
	struct addrinfo *addrs;
	struct sockaddr_storage acceptAddr;
	int acceptAddrLen = sizeof(acceptAddr);
	struct sockaddr *genAddr = NULL;
	socklen_t genAddrLen = 0;
#ifndef _WIN32
	struct sockaddr_un *unixAddress = NULL;

	if (End->AddressFamily != AF_UNIX) {
#endif
		memset(&hints, 0, sizeof(hints));
		hints.ai_family = End->AddressFamily;
		hints.ai_socktype = SOCK_STREAM;
		hints.ai_protocol = 0;
		if (ReceiveDomain || _sourceSuppliedDomain == NULL) {
			LogInfo("Looking for %s:%s", End->Address, End->Service);
			ret = getaddrinfo(End->Address, End->Service, &hints, &addrs);
		} else {
			char *service = _sourceSuppliedDomain + strlen(_sourceSuppliedDomain);

			LogInfo("Looking for %s", _sourceSuppliedDomain);
			while (service != _sourceSuppliedDomain && *service != ':')
				--service;

			if (*service == ':') {
				*service = '\0';
				++service;
			} else service = NULL;

			ret = getaddrinfo(_sourceSuppliedDomain, service, &hints, &addrs);
			if (service != NULL) {
				--service;
				*service = ':';
			}
		}

		if (ret == 0) {
			af = addrs->ai_family;
			if (af == AF_UNSPEC)
				af = End->AddressFamily;

			genAddr = addrs->ai_addr;
			genAddrLen = (socklen_t)addrs->ai_addrlen;
		} else LogError("getaddrinfo: %i", ret);

#ifndef _WIN32
	} else {
		af = AF_UNIX;
		unixAddress = (struct sockaddr_un *)malloc(sizeof(struct sockaddr_un));
		if (unixAddress != NULL) {
			memset(unixAddress, 0, sizeof(struct sockaddr_un));
			unixAddress->sun_family = AF_UNIX;
			memcpy(unixAddress->sun_path, End->Address, strlen(End->Address));
			genAddr = (struct sockaddr *)unixAddress;
			genAddrLen = SUN_LEN(unixAddress);
		} else ret = ENOMEM;
	}
#endif

	if (ret == 0) {
		LogInfo("Creating a socket");
		sock = socket(af, SOCK_STREAM, 0);
		if (sock != INVALID_SOCKET) {
			switch (End->Type) {
				case cetAccept:
					if (End->ListenSocket == INVALID_SOCKET) {
#ifndef _WIN32
						int reuse = 1;

						LogInfo("Allowing to reuse the socket address...");
						ret = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse));
						if (ret == SOCKET_ERROR) {
							LogError("Error %u", errno);
							ret = 0;
						}

						if (ret == 0) {
							LogInfo("Allowing to reuse the socket port...");
							ret = setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (char *)&reuse, sizeof(reuse));
							if (ret == SOCKET_ERROR) {
								LogError("Error %u", errno);
								ret = 0;
							}
						}
#endif
						if (ret == 0) {
							LogInfo("Binding the socket");
							ret = bind(sock, genAddr, genAddrLen);
							if (ret == 0) {
								LogInfo("Listening");
								ret = listen(sock, SOMAXCONN);
								if (ret == -1)
									LogError("Error %u", errno);
							} else LogError("Error %u", errno);
						}
					}

					if (ret == 0) {
#ifndef _WIN32
						struct pollfd fds;
#else
						pollfd fds;
#endif
						LogInfo("Accepting");
						memset(&fds, 0, sizeof(fds));
						fds.fd = End->ListenSocket != INVALID_SOCKET ? End->ListenSocket : sock;
						fds.events = POLLIN;
						do {
							fds.revents = 0;
							ret = poll(&fds, 1, 1000);
							if (ret > 0) {
								if (fds.revents & POLLERR) {
									ret = -1;
									break;
								}

								if (fds.revents & POLLIN) {
									End->EndSocket = accept(fds.fd, (struct sockaddr *)&acceptAddr, &acceptAddrLen);
									if (End->EndSocket != INVALID_SOCKET) {
										End->AcceptAddress = sockaddrstr((struct sockaddr *)&acceptAddr);
										if (End->AcceptAddress != NULL) {
											ret = 0;
											LogInfo("Accepted a connection from %s", End->AcceptAddress);
											if (KeepListening && End->ListenSocket == INVALID_SOCKET) {
												End->ListenSocket = sock;
												sock = INVALID_SOCKET;
											}
										} else ret = ENOMEM;

										if (End->AcceptAddress == NULL) {
											LogError("Out of memory");
											closesocket(End->EndSocket);
											End->EndSocket = INVALID_SOCKET;
										}
									} else ret = errno;

									if (ret == 0)
										break;
								}

								if (fds.revents & POLLHUP)
									break;
							} else if (ret == SOCKET_ERROR && errno == EINTR)
								ret = 0;
						} while (!_terminated && ret == 0);

						if (End->EndSocket == INVALID_SOCKET)
							ret = -1;
					}
					break;
				case cetConnect:
					End->AcceptAddress = sockaddrstr(genAddr);
					if (End->AcceptAddress != NULL) {
						LogInfo("Connesting to %s (%s)", End->Address, End->AcceptAddress);
						if (genAddr != NULL) {
							ret = connect(sock, genAddr, genAddrLen);
							if (ret == 0) {
								End->EndSocket = sock;
								sock = INVALID_SOCKET;
							}
						} else ret = EINVAL;
					} else {
						ret = ENOMEM;
						LogError("Out of memory");
					}
					break;
			}

			if (sock != INVALID_SOCKET)
				closesocket(sock);
		} else ret = errno;

#ifndef _WIN32
		if (End->AddressFamily == AF_UNIX)
			free(unixAddress);
		else
#endif
			freeaddrinfo(addrs);
	}

	if (ret == 0 && _keepAlive) {
		ret = UtilsSetKeepAlive(End->EndSocket, _keepAlive);
		if (ret != 0)
			LogWarning("UtilsSetKeepAlive: %u", ret);

		ret = 0;
	}

	if (ret == 0) {
		ret = UtilsSetTimeouts(End->EndSocket, 5000);
		if (ret != 0)
			LogError("UtilsSetTimeouts: %u", ret);
	}

	if (ret == 0 && End->Password != NULL) {
		int success = 0;

		ret = AuthSocket(End->EndSocket, End->Password, &success);
		if (ret == 0 && !success)
			ret = -1;
	}

	if (ret == 0 && ReceiveDomain) {
		uint32_t domainLen = 0;
		char *domain = NULL;

		LogInfo("Receiving domain");
		ret = _recv_fixed(End->EndSocket, (char *)&domainLen, sizeof(domainLen), 0);
		if (ret != 0)
			LogError("Unable to get source domain length: %u", ret);

		if (ret == 0) {
			LogInfo("The domain len has %u characters", domainLen);
			domain = (char *)malloc(domainLen + 1);
			if (domain == NULL) {
				ret = ENOMEM;
				LogError("Unable to allocate space for the domain");
			}

			if (ret == 0) {
				domain[domainLen] = '\0';
				ret = _recv_fixed(End->EndSocket, domain, domainLen, 0);
				if (ret != 0)
					LogError("Failed to receive domain name: %u", ret);

				if (ret == 0) {
					LogInfo("Received domain %s", domain);
					if (_sourceSuppliedDomain != NULL)
						free(_sourceSuppliedDomain);

					_sourceSuppliedDomain = domain;
				}

				if (ret != 0)
					free(domain);
			}
		}
	}

	if (ret == 0 && SendDomain) {
		uint32_t domainLen = 0;

		domainLen = (uint32_t)strlen(_targetSendDomain);
		LogInfo("Sending domain %s (%u)", _targetSendDomain, domainLen);
		if (send(End->EndSocket, (char *)&domainLen, sizeof(domainLen), 0) != sizeof(domainLen)) {
			ret = errno;
			LogError("Failed to send domain length: %u", ret);
		}

		if (ret == 0 &&
			send(End->EndSocket, _targetSendDomain, domainLen, 0) != domainLen) {
			ret = errno;
			LogError("Failed to send domain: %u", ret);
		}
	}

	if (ret != 0) {
		if (End->AcceptAddress != NULL) {
			free(End->AcceptAddress);
			End->AcceptAddress = NULL;
		}

		if (End->EndSocket != INVALID_SOCKET &&
			End->EndSocket) {
			closesocket(End->EndSocket);
			End->EndSocket = INVALID_SOCKET;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
movl $0x80, -0xdc(%rbp)
movq $0x0, -0xe8(%rbp)
movl $0x0, -0xec(%rbp)
movq $0x0, -0xf8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x20(%rax)
je 0x820a
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2100
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x4c(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x803d
cmpq $0x0, 0xbaed(%rip)      # 0x13b28
jne 0x808c
callq 0x2090
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %r8
movl $0x4, %edi
leaq 0x8ba9(%rip), %rsi      # 0x10c09
movb $0x0, %al
callq 0x7070
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x2220
movl %eax, -0x18(%rbp)
jmp 0x81a7
movq 0xba95(%rip), %rax      # 0x13b28
movq %rax, -0x130(%rbp)
movq 0xba87(%rip), %rdi      # 0x13b28
callq 0x20c0
movq %rax, %rcx
movq -0x130(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x100(%rbp)
callq 0x2090
movl %eax, %edx
movq 0xba60(%rip), %rcx      # 0x13b28
movl $0x4, %edi
leaq 0x8b4e(%rip), %rsi      # 0x10c22
movb $0x0, %al
callq 0x7070
movq -0x100(%rbp), %rcx
xorl %eax, %eax
cmpq 0xba3d(%rip), %rcx      # 0x13b28
movb %al, -0x131(%rbp)
je 0x8109
movq -0x100(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
setne %al
movb %al, -0x131(%rbp)
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x8115
jmp 0x8129
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x80db
movq -0x100(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x8156
movq -0x100(%rbp), %rax
movb $0x0, (%rax)
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x8161
movq $0x0, -0x100(%rbp)
movq 0xb9c0(%rip), %rdi      # 0x13b28
movq -0x100(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x2220
movl %eax, -0x18(%rbp)
cmpq $0x0, -0x100(%rbp)
je 0x81a5
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movb $0x3a, (%rax)
jmp 0x81a7
cmpl $0x0, -0x18(%rbp)
jne 0x81e5
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x81c7
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x58(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xec(%rbp)
jmp 0x8205
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x8a3a(%rip), %rsi      # 0x10c38
movb $0x0, %al
callq 0x7070
jmp 0x82ce
movl $0x1, -0x1c(%rbp)
movl $0x6e, %edi
callq 0x2180
movq %rax, -0xf8(%rbp)
cmpq $0x0, -0xf8(%rbp)
je 0x82c5
movq -0xf8(%rbp), %rdi
xorl %esi, %esi
movl $0x6e, %edx
callq 0x2100
movq -0xf8(%rbp), %rax
movw $0x1, (%rax)
movq -0xf8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x148(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20c0
movq -0x148(%rbp), %rdi
movq -0x140(%rbp), %rsi
movq %rax, %rdx
callq 0x2170
movq -0xf8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xf8(%rbp), %rdi
addq $0x2, %rdi
callq 0x20c0
movq %rax, %rcx
xorl %eax, %eax
addq $0x2, %rax
addq %rcx, %rax
movl %eax, -0xec(%rbp)
jmp 0x82cc
movl $0xc, -0x18(%rbp)
jmp 0x82ce
cmpl $0x0, -0x18(%rbp)
jne 0x884a
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x8964(%rip), %rsi      # 0x10c4f
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movl -0x1c(%rbp), %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2260
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
je 0x881d
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14c(%rbp)
testl %eax, %eax
je 0x8758
jmp 0x8326
movl -0x14c(%rbp), %eax
subl $0x1, %eax
jne 0x880d
jmp 0x8337
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
jne 0x8521
movl $0x1, -0x104(%rbp)
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x8906(%rip), %rsi      # 0x10c68
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movl -0x20(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x104(%rbp), %rcx
movl $0x4, %r8d
callq 0x2080
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
jne 0x83c8
callq 0x2090
movl %eax, -0x150(%rbp)
callq 0x2050
movl -0x150(%rbp), %edx
movl (%rax), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x88dd(%rip), %rsi      # 0x10c97
movb $0x0, %al
callq 0x7070
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x8449
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x88c6(%rip), %rsi      # 0x10ca7
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movl -0x20(%rbp), %edi
movl $0x1, %esi
movl $0xf, %edx
leaq -0x104(%rbp), %rcx
movl $0x4, %r8d
callq 0x2080
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
jne 0x8447
callq 0x2090
movl %eax, -0x154(%rbp)
callq 0x2050
movl -0x154(%rbp), %edx
movl (%rax), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x885e(%rip), %rsi      # 0x10c97
movb $0x0, %al
callq 0x7070
movl $0x0, -0x18(%rbp)
jmp 0x8449
cmpl $0x0, -0x18(%rbp)
jne 0x851f
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x886d(%rip), %rsi      # 0x10cd3
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movl -0x20(%rbp), %edi
movq -0xe8(%rbp), %rsi
movl -0xec(%rbp), %edx
callq 0x21d0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x84ef
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x884d(%rip), %rsi      # 0x10ced
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movl -0x20(%rbp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
jne 0x84ed
callq 0x2090
movl %eax, -0x158(%rbp)
callq 0x2050
movl -0x158(%rbp), %edx
movl (%rax), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x87b1(%rip), %rsi      # 0x10c97
movb $0x0, %al
callq 0x7070
jmp 0x851d
callq 0x2090
movl %eax, -0x15c(%rbp)
callq 0x2050
movl -0x15c(%rbp), %edx
movl (%rax), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x8781(%rip), %rsi      # 0x10c97
movb $0x0, %al
callq 0x7070
jmp 0x851f
jmp 0x8521
cmpl $0x0, -0x18(%rbp)
jne 0x8753
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x87c0(%rip), %rsi      # 0x10cfe
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
leaq -0x10c(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x2100
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
je 0x8573
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x160(%rbp)
jmp 0x857c
movl -0x20(%rbp), %eax
movl %eax, -0x160(%rbp)
movl -0x160(%rbp), %eax
movl %eax, -0x10c(%rbp)
movw $0x1, -0x108(%rbp)
movw $0x0, -0x106(%rbp)
leaq -0x10c(%rbp), %rdi
movl $0x1, %esi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x21c0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x86f7
movswl -0x106(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x85d8
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
jmp 0x8740
movswl -0x106(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x86e4
movl -0x10c(%rbp), %edi
leaq -0xd8(%rbp), %rsi
leaq -0xdc(%rbp), %rdx
callq 0x2200
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x24(%rax)
je 0x86d0
leaq -0xd8(%rbp), %rdi
callq 0x71e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8689
movl $0x0, -0x18(%rbp)
callq 0x2090
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x4, %edi
leaq 0x86b0(%rip), %rsi      # 0x10d0f
movb $0x0, %al
callq 0x7070
cmpl $0x0, -0xc(%rbp)
je 0x8687
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
jne 0x8687
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
jmp 0x8690
movl $0xc, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x86ce
callq 0x2090
movl %eax, %edx
movl $0x1, %edi
leaq 0x8686(%rip), %rsi      # 0x10d34
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x2110
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
jmp 0x86da
callq 0x2050
movl (%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x86e2
jmp 0x8740
jmp 0x86e4
movswl -0x106(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x86f5
jmp 0x8740
jmp 0x8710
cmpl $-0x1, -0x18(%rbp)
jne 0x870e
callq 0x2050
cmpl $0x4, (%rax)
jne 0x870e
movl $0x0, -0x18(%rbp)
jmp 0x8710
jmp 0x8712
movl 0xb3a8(%rip), %ecx      # 0x13ac0
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x161(%rbp)
jne 0x8732
cmpl $0x0, -0x18(%rbp)
sete %al
movb %al, -0x161(%rbp)
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0x8591
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x24(%rax)
jne 0x8751
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
jmp 0x8753
jmp 0x880d
movq -0xe8(%rbp), %rdi
callq 0x71e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x87e8
callq 0x2090
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %r8
movl $0x4, %edi
leaq 0x85ac(%rip), %rsi      # 0x10d49
movb $0x0, %al
callq 0x7070
cmpq $0x0, -0xe8(%rbp)
je 0x87df
movl -0x20(%rbp), %edi
movq -0xe8(%rbp), %rsi
movl -0xec(%rbp), %edx
callq 0x2210
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x87dd
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
jmp 0x87e6
movl $0x16, -0x18(%rbp)
jmp 0x880b
movl $0xc, -0x18(%rbp)
callq 0x2090
movl %eax, %edx
movl $0x1, %edi
leaq 0x8532(%rip), %rsi      # 0x10d34
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
jmp 0x880d
cmpl $-0x1, -0x20(%rbp)
je 0x881b
movl -0x20(%rbp), %edi
callq 0x2110
jmp 0x8827
callq 0x2050
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x883f
movq -0xf8(%rbp), %rdi
callq 0x2030
jmp 0x8848
movq -0x58(%rbp), %rdi
callq 0x2250
jmp 0x884a
cmpl $0x0, -0x18(%rbp)
jne 0x889b
cmpl $0x0, 0xb2a5(%rip)      # 0x13afc
je 0x889b
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
movl 0xb296(%rip), %esi      # 0x13afc
callq 0xaa60
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x8894
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x2, %edi
leaq 0x84d9(%rip), %rsi      # 0x10d66
movb $0x0, %al
callq 0x7070
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x88dd
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
movl $0x1388, %esi           # imm = 0x1388
callq 0xa9a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x88db
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x84af(%rip), %rsi      # 0x10d83
movb $0x0, %al
callq 0x7070
jmp 0x88dd
cmpl $0x0, -0x18(%rbp)
jne 0x892e
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x892e
movl $0x0, -0x110(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
leaq -0x110(%rbp), %rdx
callq 0x6b10
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x892c
cmpl $0x0, -0x110(%rbp)
jne 0x892c
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
jmp 0x892e
cmpl $0x0, -0x18(%rbp)
jne 0x8aed
cmpl $0x0, -0x10(%rbp)
je 0x8aed
movl $0x0, -0x114(%rbp)
movq $0x0, -0x120(%rbp)
callq 0x2090
movl %eax, %edx
movl $0x4, %edi
leaq 0x8435(%rip), %rsi      # 0x10d9f
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
leaq -0x114(%rbp), %rsi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x8ed0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x89b6
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x8408(%rip), %rsi      # 0x10db7
movb $0x0, %al
callq 0x7070
cmpl $0x0, -0x18(%rbp)
jne 0x8aeb
callq 0x2090
movl %eax, %edx
movl -0x114(%rbp), %ecx
addl $0x0, %ecx
movl $0x4, %edi
leaq 0x8409(%rip), %rsi      # 0x10de5
movb $0x0, %al
callq 0x7070
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2180
movq %rax, -0x120(%rbp)
cmpq $0x0, -0x120(%rbp)
jne 0x8a29
movl $0xc, -0x18(%rbp)
callq 0x2090
movl %eax, %edx
movl $0x1, %edi
leaq 0x83ed(%rip), %rsi      # 0x10e0d
xorl %ecx, %ecx
movb $0x0, %al
callq 0x7070
cmpl $0x0, -0x18(%rbp)
jne 0x8ae9
movq -0x120(%rbp), %rax
movl -0x114(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
movq -0x120(%rbp), %rsi
movl -0x114(%rbp), %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x8ed0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x8a8a
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x83b9(%rip), %rsi      # 0x10e3c
movb $0x0, %al
callq 0x7070
cmpl $0x0, -0x18(%rbp)
jne 0x8ad5
callq 0x2090
movl %eax, %edx
movq -0x120(%rbp), %rcx
movl $0x4, %edi
leaq 0x83bb(%rip), %rsi      # 0x10e65
movb $0x0, %al
callq 0x7070
cmpq $0x0, 0xb06f(%rip)      # 0x13b28
je 0x8ac7
movq 0xb066(%rip), %rdi      # 0x13b28
callq 0x2030
movq -0x120(%rbp), %rax
movq %rax, 0xb053(%rip)      # 0x13b28
cmpl $0x0, -0x18(%rbp)
je 0x8ae7
movq -0x120(%rbp), %rdi
callq 0x2030
jmp 0x8ae9
jmp 0x8aeb
jmp 0x8aed
cmpl $0x0, -0x18(%rbp)
jne 0x8bed
cmpl $0x0, -0x14(%rbp)
je 0x8bed
movl $0x0, -0x124(%rbp)
movq 0xb00e(%rip), %rdi      # 0x13b20
callq 0x20c0
movl %eax, -0x124(%rbp)
callq 0x2090
movl %eax, %edx
movq 0xaff5(%rip), %rcx      # 0x13b20
movl -0x124(%rbp), %r8d
addl $0x0, %r8d
movl $0x4, %edi
leaq 0x833d(%rip), %rsi      # 0x10e7f
movb $0x0, %al
callq 0x7070
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
leaq -0x124(%rbp), %rsi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x20d0
cmpq $0x4, %rax
je 0x8b93
callq 0x2050
movl (%rax), %eax
movl %eax, -0x18(%rbp)
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x8311(%rip), %rsi      # 0x10e9d
movb $0x0, %al
callq 0x7070
cmpl $0x0, -0x18(%rbp)
jne 0x8beb
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
movq 0xaf79(%rip), %rsi      # 0x13b20
movl -0x124(%rbp), %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x20d0
movl -0x124(%rbp), %ecx
cmpq %rcx, %rax
je 0x8beb
callq 0x2050
movl (%rax), %eax
movl %eax, -0x18(%rbp)
callq 0x2090
movl %eax, %edx
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movl $0x1, %edi
leaq 0x82e1(%rip), %rsi      # 0x10ec5
movb $0x0, %al
callq 0x7070
jmp 0x8bed
cmpl $0x0, -0x18(%rbp)
je 0x8c44
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8c17
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2030
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x24(%rax)
je 0x8c42
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x8c42
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x2110
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
jmp 0x8c44
movl -0x18(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq