// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r13d
movq %rdi, %rbx
movl $0x80, 0x24(%rsp)
movl 0x20(%rdi), %eax
cmpl $0x1, %eax
jne 0x5c5f
pushq $0x1
popq %rdi
pushq $0x6e
popq %rsi
callq 0x2140
testq %rax, %rax
je 0x5d21
movq %rax, %r12
movl %r13d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
pushq $0x1
popq %r13
movw $0x1, (%rax)
movq %rax, %r15
addq $0x2, %r15
movq 0x8(%rbx), %rbp
movq %rbp, %rdi
callq 0x20c0
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2170
movq %r15, %rdi
callq 0x20c0
movq %rax, %r15
addl $0x2, %r15d
movq %r12, 0x28(%rsp)
jmp 0x5d99
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl %eax, 0x34(%rsp)
movl $0x1, 0x38(%rsp)
testl %r14d, %r14d
setne %al
movq 0xbea6(%rip), %r15      # 0x11b30
testq %r15, %r15
sete %cl
orb %al, %cl
cmpb $0x1, %cl
movl %ebp, 0x14(%rsp)
jne 0x5cd9
callq 0x2090
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
leaq 0x7efd(%rip), %rsi      # 0xdbac
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x5054
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0x2220
movl %eax, %ebp
jmp 0x5d5c
movq %r15, %rdi
callq 0x20c0
movq %rax, %r12
addq %r15, %r12
callq 0x2090
movq 0xbe3d(%rip), %rcx      # 0x11b30
leaq 0x7ecb(%rip), %rsi      # 0xdbc5
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x5054
movq 0xbe23(%rip), %r15      # 0x11b30
movq %r15, %rdi
cmpq %r15, %r12
je 0x5d29
cmpb $0x3a, (%r12)
je 0x5d34
decq %r12
jmp 0x5d10
pushq $0xc
popq %rbp
jmp 0x619a
cmpb $0x3a, (%r15)
je 0x5d37
xorl %r15d, %r15d
jmp 0x5d3e
movq %r12, %r15
movb $0x0, (%r15)
incq %r15
leaq 0x30(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r15, %rsi
callq 0x2220
movl %eax, %ebp
testq %r15, %r15
je 0x5d5c
movb $0x3a, -0x1(%r15)
testl %ebp, %ebp
je 0x5d71
callq 0x2090
leaq 0x7e6f(%rip), %rsi      # 0xdbdb
jmp 0x618c
movl %r13d, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl 0x4(%rax), %r13d
testl %r13d, %r13d
jne 0x5d88
movl 0x20(%rbx), %r13d
movq 0x18(%rax), %r12
movl 0x10(%rax), %r15d
movq $0x0, 0x28(%rsp)
callq 0x2090
leaq 0x7e4d(%rip), %rsi      # 0xdbf2
xorl %ebp, %ebp
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
pushq $0x1
popq %rsi
movl %r13d, %edi
xorl %edx, %edx
callq 0x2260
cmpl $-0x1, %eax
je 0x5f3f
movl %eax, %r13d
movl (%rbx), %eax
testl %eax, %eax
je 0x5f4b
cmpl $0x1, %eax
jne 0x610b
cmpl $-0x1, 0x28(%rbx)
je 0x5fa9
callq 0x2090
leaq 0x7eaa(%rip), %rsi      # 0xdca1
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
movl 0x28(%rbx), %eax
cmpl $-0x1, %eax
movl %r13d, %ecx
cmovnel %eax, %ecx
leaq 0x8(%rsp), %r12
movl %ecx, (%r12)
movw $0x1, 0x4(%r12)
pushq $0x1
popq %r15
andw $0x0, 0xe(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x21b0
movl %eax, %ebp
testl %eax, %eax
jle 0x5ece
movzwl 0xe(%rsp), %eax
movzwl %ax, %ecx
testb $0x8, %cl
jne 0x60ed
testb $0x1, %cl
je 0x5f24
movl 0x8(%rsp), %edi
leaq 0x68(%rsp), %rbp
movq %rbp, %rsi
leaq 0x24(%rsp), %rdx
callq 0x21f0
movl %eax, 0x24(%rbx)
cmpl $-0x1, %eax
je 0x5ee5
movq %rbp, %rdi
callq 0x5170
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x5eee
callq 0x2090
movq 0x18(%rbx), %rcx
pushq $0x4
popq %rdi
leaq 0x7e10(%rip), %rsi      # 0xdcb2
movl %eax, %edx
xorl %eax, %eax
callq 0x5054
cmpl $0x0, 0x10(%rsp)
je 0x5ec0
cmpl $-0x1, 0x28(%rbx)
jne 0x5ec0
movl %r13d, 0x28(%rbx)
pushq $-0x1
popq %r13
xorl %ebp, %ebp
cmpq $0x0, 0x18(%rbx)
je 0x5ef1
jmp 0x60fc
cmpl $-0x1, %ebp
jne 0x5f2c
callq 0x2050
xorl %ebp, %ebp
cmpl $0x4, (%rax)
setne %bpl
negl %ebp
jmp 0x5f2c
callq 0x2050
movl (%rax), %ebp
jmp 0x5f17
pushq $0xc
popq %rbp
callq 0x2090
pushq $0x1
popq %rdi
leaq 0x7dd7(%rip), %rsi      # 0xdcd7
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
movl 0x24(%rbx), %edi
callq 0x2110
orl $-0x1, 0x24(%rbx)
testl %ebp, %ebp
je 0x60fa
movzwl 0xe(%rsp), %eax
testb $0x10, %al
jne 0x60fc
movl 0xbb8e(%rip), %eax      # 0x11ac0
orl %ebp, %eax
je 0x5e26
jmp 0x60fc
callq 0x2050
movl (%rax), %ebp
jmp 0x6113
movq %r12, %rdi
callq 0x5170
movq %rax, %rbp
movq %rax, 0x18(%rbx)
callq 0x2090
testq %rbp, %rbp
je 0x60cf
movq 0x8(%rbx), %rcx
movq 0x18(%rbx), %r8
leaq 0x7d75(%rip), %rsi      # 0xdcec
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x5054
testq %r12, %r12
je 0x60e8
movl %r13d, %edi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2200
testl %eax, %eax
je 0x60f2
movl %eax, %ebp
jmp 0x610b
leaq 0x68(%rsp), %rax
movl $0x1, (%rax)
callq 0x2090
leaq 0x7c4b(%rip), %rsi      # 0xdc0b
pushq $0x4
popq %rbp
movl %ebp, %edi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movl %r13d, %edi
leaq 0x68(%rsp), %rcx
movl %ebp, %r8d
callq 0x2080
testl %eax, %eax
je 0x6016
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x610b
callq 0x2090
movl %eax, %ebp
callq 0x2050
movl (%rax), %ecx
leaq 0x7c30(%rip), %rsi      # 0xdc3a
pushq $0x1
popq %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x5054
callq 0x2090
leaq 0x7c28(%rip), %rsi      # 0xdc4a
pushq $0x4
popq %rbp
movl %ebp, %edi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
pushq $0x1
popq %rsi
pushq $0xf
popq %rdx
leaq 0x68(%rsp), %rcx
movl %r13d, %edi
movl %ebp, %r8d
callq 0x2080
testl %eax, %eax
je 0x6078
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x610b
callq 0x2090
movl %eax, %ebp
callq 0x2050
movl (%rax), %ecx
leaq 0x7bce(%rip), %rsi      # 0xdc3a
pushq $0x1
popq %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x5054
callq 0x2090
leaq 0x7bf2(%rip), %rsi      # 0xdc76
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
movl %r13d, %edi
movq %r12, %rsi
movl %r15d, %edx
callq 0x21c0
movl %eax, %ebp
callq 0x2090
movl %eax, %r15d
testl %ebp, %ebp
je 0x63c8
callq 0x2050
movl (%rax), %ecx
leaq 0x7b7a(%rip), %rsi      # 0xdc3a
pushq $0x1
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x5054
jmp 0x610b
leaq 0x7c01(%rip), %rsi      # 0xdcd7
pushq $0x1
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
pushq $0xc
jmp 0x60ea
pushq $0x16
popq %rbp
jmp 0x610b
pushq $-0x1
popq %rbp
jmp 0x60fc
movl %r13d, 0x24(%rbx)
xorl %ebp, %ebp
jmp 0x6113
xorl %ebp, %ebp
movl 0x24(%rbx), %eax
cmpl $-0x1, %eax
cmovel %eax, %ebp
cmpl $-0x1, %r13d
je 0x6113
movl %r13d, %edi
callq 0x2110
cmpl $0x1, 0x20(%rbx)
jne 0x6125
movq 0x28(%rsp), %rdi
callq 0x2030
jmp 0x612f
movq 0x18(%rsp), %rdi
callq 0x2250
testl %ebp, %ebp
jne 0x6169
testb $0x1, 0xb9ca(%rip)      # 0x11b04
je 0x6169
movl 0x24(%rbx), %edi
pushq $0x1
popq %rsi
callq 0x7255
testl %eax, %eax
je 0x616d
movl %eax, %ebp
callq 0x2090
leaq 0x7bb0(%rip), %rsi      # 0xdd09
pushq $0x2
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
jmp 0x616d
testl %ebp, %ebp
jne 0x619a
movl 0x24(%rbx), %edi
movl $0x1388, %esi           # imm = 0x1388
callq 0x71e8
testl %eax, %eax
je 0x61d5
movl %eax, %ebp
callq 0x2090
leaq 0x7b9a(%rip), %rsi      # 0xdd26
pushq $0x1
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x61ad
callq 0x2030
andq $0x0, 0x18(%rbx)
movl 0x24(%rbx), %edi
leal 0x1(%rdi), %eax
cmpl $0x2, %eax
jb 0x61c1
callq 0x2110
orl $-0x1, 0x24(%rbx)
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x61ff
leaq 0x8(%rsp), %r15
andl $0x0, (%r15)
movl 0x24(%rbx), %edi
movq %r15, %rdx
callq 0x4c9f
movl (%r15), %ecx
orl %eax, %ecx
pushq $-0x1
popq %rbp
cmovnel %eax, %ebp
jmp 0x6201
xorl %ebp, %ebp
testl %r14d, %r14d
je 0x625f
testl %ebp, %ebp
jne 0x625f
leaq 0x8(%rsp), %r14
andl $0x0, (%r14)
callq 0x2090
leaq 0x7b23(%rip), %rsi      # 0xdd42
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
movl 0x24(%rbx), %edi
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x643f
movl %eax, %ebp
callq 0x2090
testl %ebp, %ebp
je 0x6339
leaq 0x7b09(%rip), %rsi      # 0xdd5a
pushq $0x1
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
cmpl $0x0, 0x14(%rsp)
je 0x632a
testl %ebp, %ebp
jne 0x632a
movq 0xb8af(%rip), %rdi      # 0x11b28
callq 0x20c0
movq %rax, %r14
leaq 0x8(%rsp), %r15
movl %r14d, (%r15)
callq 0x2090
movq 0xb893(%rip), %rcx      # 0x11b28
leaq 0x7b86(%rip), %rsi      # 0xde22
pushq $0x4
popq %rdi
movl %eax, %edx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x5054
movl 0x24(%rbx), %edi
pushq $0x4
popq %rdx
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x20d0
cmpq $0x4, %rax
je 0x62e6
callq 0x2050
movl (%rax), %ebp
callq 0x2090
leaq 0x7b6c(%rip), %rsi      # 0xde40
pushq $0x1
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
testl %ebp, %ebp
jne 0x632a
movl 0x24(%rbx), %edi
movq 0xb838(%rip), %rsi      # 0x11b28
movl 0x8(%rsp), %edx
xorl %ecx, %ecx
callq 0x20d0
movl 0x8(%rsp), %ecx
movl $0x0, %ebp
cmpq %rcx, %rax
je 0x632a
callq 0x2050
movl (%rax), %ebp
callq 0x2090
leaq 0x7b4c(%rip), %rsi      # 0xde68
pushq $0x1
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
testl %ebp, %ebp
jne 0x619a
xorl %ebp, %ebp
jmp 0x61c1
movl 0x8(%rsp), %ecx
leaq 0x7a44(%rip), %rsi      # 0xdd88
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x5054
movl 0x8(%rsp), %r15d
leal 0x1(%r15), %edi
callq 0x2180
testq %rax, %rax
je 0x63a6
movq %rax, %r14
movb $0x0, (%rax,%r15)
movl 0x24(%rbx), %edi
movq %rax, %rsi
movq %r15, %rdx
callq 0x643f
movl %eax, %ebp
callq 0x2090
testl %ebp, %ebp
je 0x63ff
leaq 0x7a54(%rip), %rsi      # 0xdddf
pushq $0x1
popq %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x5054
movq %r14, %rdi
callq 0x2030
jmp 0x625f
callq 0x2090
leaq 0x79fe(%rip), %rsi      # 0xddb0
pushq $0x1
popq %rdi
movl %eax, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
pushq $0xc
popq %rbp
jmp 0x625f
leaq 0x78c1(%rip), %rsi      # 0xdc90
pushq $0x4
popq %rdi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5054
movl %r13d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
cmpl $-0x1, %eax
je 0x642f
movl %eax, %ebp
testl %eax, %eax
jne 0x610b
jmp 0x5deb
leaq 0x7a02(%rip), %rsi      # 0xde08
xorl %ebp, %ebp
pushq $0x4
popq %rdi
movl %eax, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x5054
movq 0xb712(%rip), %rdi      # 0x11b30
callq 0x2030
movq %r14, 0xb706(%rip)      # 0x11b30
jmp 0x625f
pushq $-0x1
popq %rbp
callq 0x2090
movl %eax, %r15d
jmp 0x60b2