// File: /workspace/github_c_makefile_star2_O0/alexgirao[P]aimant/subprocess.c
// Function: loop_child_pipes
static int loop_child_pipes(struct subprocess *sp, struct subprocess_callbacks *cb)
{
	fd_set rfds[1], wfds[1];
	struct timeval tv;
	int r, max_fds;

	if (cb->ctimeout == 0) {
		cb->ctimeout = 5000; /* 5 seconds */
	}
	if (cb->ptimeout == 0) {
		cb->ptimeout = 5000; /* 5 seconds */
	}

	assert(cb->ctimeout > 0);
	assert(cb->ptimeout > 0);

	FD_ZERO(rfds);
	FD_ZERO(wfds);

	if (cb->produce_immediately) {
		DEBUG_INFO("producing immediately");
		goto BURST;
	}

	for (;;) {
		max_fds = -1;
		if (selfpipe[0] != -1) {
			FD_SET(selfpipe[0], rfds);
			max_fds = MAX2(selfpipe[0], max_fds);
		}
		if (sp->child_fdout != -1) {
			FD_SET(sp->child_fdout, rfds);
			max_fds = MAX2(sp->child_fdout, max_fds);
		}
		if (sp->child_fderr != -1) {
			FD_SET(sp->child_fderr, rfds);
			max_fds = MAX2(sp->child_fderr, max_fds);
		}

		assert(max_fds >= 0);

		tv.tv_sec = 0;
		tv.tv_usec = cb->ctimeout * 1000;

		r = select(max_fds+1, rfds, NULL, NULL, &tv);
		if (r < 0) {
			int save_errno = errno;
			assert(r == -1);
			if (errno == EINTR) {
				DEBUG_INFO("select() received an EINTR, retrying, r=%i, pid=%i", r, sp->pid);
				continue;
			}
			DEBUG("select(), errno=%i, pid=%i", save_errno, sp->pid);
			DEBUG_INFO("sp->child_fdin=%i", sp->child_fdin);
			DEBUG_INFO("sp->child_fdout=%i", sp->child_fdout);
			DEBUG_INFO("sp->child_fderr=%i", sp->child_fderr);
			errno = save_errno;
			perror("select()");
			return __LINE__;
		} else if (r) {
			int n;

			if (sp->child_fdout != -1) {
				/* rfds/sp->child_fdout
				 */

				n = FD_ISSET(sp->child_fdout, rfds);
				if (n) {
					/* read from child's STDOUT
					 */
					char buf_out[0x7fff];
					DEBUG_INFO("FD_ISSET(sp->child_fdout, rfds): %i", n);
					n = read(sp->child_fdout, buf_out, sizeof(buf_out)-1);
					if (n < 0) {
						int save_errno = errno;
						assert(n == -1);
						if (errno == EINTR) {
							DEBUG_INFO("read() received an EINTR, retrying");
							continue;
						}
						DEBUG("read(), errno=%i", save_errno);
						errno = save_errno;
						perror("reading child's stdout");
						exit(1);
					}
					if (n) {
						assert(n < sizeof(buf_out) && n > 0);
						buf_out[n] = 0;
						DEBUG_INFO("received [%s] in child's stdout", buf_out);
						if (cb->consume_stdout) {
							cb->consume_stdout(sp, buf_out, n);
						} else {
							DEBUG_INFO("received data is going nowhere");
						}
					} else {
						DEBUG_INFO("child's fdout got EOF");
						FD_CLR(sp->child_fdout, rfds);
						subprocess_close_child_fdout(sp);
						assert(sp->child_fdout == -1);
					}
				}
			}

			if (sp->child_fderr != -1) {
				/* rfds/sp->child_fderr
				 */

				n = FD_ISSET(sp->child_fderr, rfds);
				if (n) {
					/* read from child's STDERR
					 */
					char buf_err[0x7fff];
					DEBUG_INFO("FD_ISSET(sp->child_fderr, rfds): %i", n);
					n = read(sp->child_fderr, buf_err, sizeof(buf_err)-1);
					if (n < 0) {
						int save_errno = errno;
						assert(n == -1);
						if (errno == EINTR) {
							DEBUG_INFO("read() received an EINTR, retrying");
							continue;
						}
						DEBUG("read(), errno=%i", save_errno);
						errno = save_errno;
						perror("reading child's stderr");
						exit(1);
					}
					if (n) {
						assert(n < sizeof(buf_err) && n > 0);
						buf_err[n] = 0;
						DEBUG_INFO("received [%s] in child's stderr", buf_err);
						if (cb->consume_stderr) {
							cb->consume_stderr(sp, buf_err, n);
						} else {
							DEBUG_INFO("received data is going nowhere");
						}
					} else {
						DEBUG_INFO("child's fderr got EOF");
						FD_CLR(sp->child_fderr, rfds);
						subprocess_close_child_fderr(sp);
						assert(sp->child_fderr == -1);
					}
				}
			}

			/* sometimes stdout and stderr get closed by
			 * child process (subprocess) before
			 * selfpipe[0] gets ready
			 */

			if (sp->child_fdout == -1 && sp->child_fderr == -1) {
				/* both pipes got EOF.. humm.. maybe
				 * child is not alive anymore
				 */
				DEBUG_INFO("got EOF from fdout and fderr, has child process %i gone?", sp->pid);
				if (subprocess_wait(sp, 15)) {
					break;
				}
			}

			/* rfds/selfpipe[0]
			 */

			if (selfpipe[0] != -1 && (n = FD_ISSET(selfpipe[0], rfds))) {
				DEBUG_INFO("FD_ISSET(selfpipe[0], rfds): %i", n);
				assert(subprocess_read_selfpipe() == 0);
				if (sp->is_gone) break;
			}

			/* wfds/sp->child_fdin, can we feed child's stdin? flow control
			 */

		BURST:
			if (sp->child_fdin != -1 && cb->produce_stdin) {
				FD_SET(sp->child_fdin, wfds);
				tv.tv_sec = 0;
				tv.tv_usec = cb->ptimeout;
				r = select(sp->child_fdin+1, NULL, wfds, NULL, &tv);
				if (r == -1) {
					int save_errno = errno;
					if (errno == EINTR) {
						DEBUG_INFO("select() received an EINTR, resuming main loop");
						continue;
					}
					DEBUG("select(), errno=%i", save_errno);
					errno = save_errno;
					perror("select()");
					exit(1);
				} else if (r == 0) {
					DEBUG_INFO("produce timeout happend after %i milliseconds (or buffer filled)", cb->ptimeout);
					if (cb->produce_timeout) {
						int rc;
						if ((rc = cb->produce_timeout(sp))) {
							if (rc == SIGTERM || rc == SIGKILL) {
								DEBUG_INFO("send signal %i to pid %i after sp->produce_timeout()", rc, sp->pid);
								kill(sp->pid, rc);
							} else {
								DEBUG_INFO("exiting loop due produce timeout");
							}
							break;
						}
					}
				} else {
					assert(r == 1);
					assert(FD_ISSET(sp->child_fdin, wfds));
					if (cb->produce_stdin(sp, sp->child_fdin)) {
						goto BURST;
					}
				}
			}
		} else {
			/* consume timeout happend (for both child's stdout and stderr)
			 */
			DEBUG_INFO("consume timeout happend after %i milliseconds", cb->ctimeout);
			if (cb->consume_timeout) {
				int rc;
				FD_SET(sp->child_fdin, wfds);
				tv.tv_sec = 0;
				tv.tv_usec = 0;
				r = select(sp->child_fdin+1, NULL, wfds, NULL, &tv);
				if (r == -1) {
					int save_errno = errno;
					if (errno == EINTR) {
						DEBUG_INFO("select() received an EINTR, resuming main loop");
						continue;
					}
					DEBUG("select(), errno=%i", save_errno);
					errno = save_errno;
					perror("select()");
					exit(1);
				}
				assert(r == 0 || (r == 1 && FD_ISSET(sp->child_fdin, wfds)));
				if ((rc = cb->consume_timeout(sp, sp->child_fdin, r))) {
					if (rc == SIGTERM || rc == SIGKILL) {
						DEBUG_INFO("send signal %i to pid %i after sp->consume_timeout()", rc, sp->pid);
						kill(sp->pid, rc);
					} else {
						DEBUG_INFO("exiting loop due consume timeout");
					}
					break;
				}
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x101e0, %rsp          # imm = 0x101E0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xa346
movq -0x18(%rbp), %rax
movl $0x1388, (%rax)         # imm = 0x1388
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0xa35b
movq -0x18(%rbp), %rax
movl $0x1388, 0x4(%rax)      # imm = 0x1388
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jle 0xa366
jmp 0xa385
leaq 0x76f6(%rip), %rdi      # 0x11a63
leaq 0x6c24(%rip), %rsi      # 0x10f98
movl $0x264, %edx            # imm = 0x264
leaq 0x76f4(%rip), %rcx      # 0x11a74
callq 0x21a0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0xa391
jmp 0xa3b0
leaq 0x7725(%rip), %rdi      # 0x11abd
leaq 0x6bf9(%rip), %rsi      # 0x10f98
movl $0x265, %edx            # imm = 0x265
leaq 0x76c9(%rip), %rcx      # 0x11a74
callq 0x21a0
jmp 0xa3b2
leaq -0xa0(%rbp), %rax
movq %rax, -0x148(%rbp)
movl $0x0, -0x13c(%rbp)
movl -0x13c(%rbp), %eax
cmpq $0x10, %rax
jae 0xa3fc
movq -0x148(%rbp), %rax
movl -0x13c(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0xa3ca
jmp 0xa3fe
jmp 0xa400
leaq -0x120(%rbp), %rax
movq %rax, -0x158(%rbp)
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
cmpq $0x10, %rax
jae 0xa44a
movq -0x158(%rbp), %rax
movl -0x14c(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0xa418
jmp 0xa44c
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0xa45b
jmp 0xac41
jmp 0xa45d
movl $0xffffffff, -0x138(%rbp) # imm = 0xFFFFFFFF
cmpl $-0x1, 0xc2aa(%rip)     # 0x16718
je 0xa4e1
movl 0xc2a2(%rip), %eax      # 0x16718
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl 0xc285(%rip), %eax      # 0x16718
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movl 0xc265(%rip), %eax      # 0x16718
cmpl -0x138(%rbp), %eax
jl 0xa4c9
movl 0xc257(%rip), %eax      # 0x16718
movl %eax, -0x10188(%rbp)
jmp 0xa4d5
movl -0x138(%rbp), %eax
movl %eax, -0x10188(%rbp)
movl -0x10188(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
je 0xa560
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x138(%rbp), %eax
jl 0xa548
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x1018c(%rbp)
jmp 0xa554
movl -0x138(%rbp), %eax
movl %eax, -0x1018c(%rbp)
movl -0x1018c(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0xa5df
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
cmpl -0x138(%rbp), %eax
jl 0xa5c7
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x10190(%rbp)
jmp 0xa5d3
movl -0x138(%rbp), %eax
movl %eax, -0x10190(%rbp)
movl -0x10190(%rbp), %eax
movl %eax, -0x138(%rbp)
cmpl $0x0, -0x138(%rbp)
jl 0xa5ea
jmp 0xa609
leaq 0x6395(%rip), %rdi      # 0x10986
leaq 0x69a0(%rip), %rsi      # 0x10f98
movl $0x27e, %edx            # imm = 0x27E
leaq 0x7470(%rip), %rcx      # 0x11a74
callq 0x21a0
movq $0x0, -0x130(%rbp)
movq -0x18(%rbp), %rax
imull $0x3e8, (%rax), %eax    # imm = 0x3E8
cltq
movq %rax, -0x128(%rbp)
movl -0x138(%rbp), %edi
addl $0x1, %edi
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x130(%rbp), %r8
movq %rcx, %rdx
callq 0x2280
movl %eax, -0x134(%rbp)
cmpl $0x0, -0x134(%rbp)
jge 0xa6fe
callq 0x2070
movl (%rax), %eax
movl %eax, -0x15c(%rbp)
cmpl $-0x1, -0x134(%rbp)
jne 0xa675
jmp 0xa694
leaq 0x74f9(%rip), %rdi      # 0x11b75
leaq 0x6915(%rip), %rsi      # 0x10f98
movl $0x286, %edx            # imm = 0x286
leaq 0x73e5(%rip), %rcx      # 0x11a74
callq 0x21a0
callq 0x2070
cmpl $0x4, (%rax)
jne 0xa6a3
jmp 0xa45d
jmp 0xa6a5
movl -0x15c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r8d
leaq 0x68de(%rip), %rdi      # 0x10f98
movl $0x28b, %esi            # imm = 0x28B
leaq 0x7408(%rip), %rdx      # 0x11ace
movb $0x0, %al
callq 0xdfe0
movl -0x15c(%rbp), %eax
movl %eax, -0x10194(%rbp)
callq 0x2070
movl -0x10194(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x5e2f(%rip), %rdi      # 0x1051c
callq 0x2310
movl $0x291, -0x4(%rbp)      # imm = 0x291
jmp 0xb05e
cmpl $0x0, -0x134(%rbp)
je 0xae79
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
je 0xa93a
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0xa0(%rbp,%rax,8), %rax
movq %rax, -0x101a0(%rbp)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x101a0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x160(%rbp)
cmpl $0x0, -0x160(%rbp)
je 0xa938
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %edi
leaq -0x8160(%rbp), %rsi
movl $0x7ffe, %edx           # imm = 0x7FFE
callq 0x21f0
movl %eax, -0x160(%rbp)
cmpl $0x0, -0x160(%rbp)
jge 0xa840
callq 0x2070
movl (%rax), %eax
movl %eax, -0x8164(%rbp)
cmpl $-0x1, -0x160(%rbp)
jne 0xa7c1
jmp 0xa7e0
leaq 0x5ad8(%rip), %rdi      # 0x102a0
leaq 0x67c9(%rip), %rsi      # 0x10f98
movl $0x2a2, %edx            # imm = 0x2A2
leaq 0x7299(%rip), %rcx      # 0x11a74
callq 0x21a0
callq 0x2070
cmpl $0x4, (%rax)
jne 0xa7ef
jmp 0xa45d
jmp 0xa7f1
movl -0x8164(%rbp), %ecx
leaq 0x679a(%rip), %rdi      # 0x10f98
movl $0x2a7, %esi            # imm = 0x2A7
leaq 0x61cd(%rip), %rdx      # 0x109d7
movb $0x0, %al
callq 0xdfe0
movl -0x8164(%rbp), %eax
movl %eax, -0x101a4(%rbp)
callq 0x2070
movl -0x101a4(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x72b8(%rip), %rdi      # 0x11ae9
callq 0x2310
movl $0x1, %edi
callq 0x2350
cmpl $0x0, -0x160(%rbp)
je 0xa8bd
movslq -0x160(%rbp), %rax
cmpq $0x7fff, %rax           # imm = 0x7FFF
jae 0xa863
cmpl $0x0, -0x160(%rbp)
jle 0xa863
jmp 0xa882
leaq 0x7296(%rip), %rdi      # 0x11b00
leaq 0x6727(%rip), %rsi      # 0x10f98
movl $0x2ad, %edx            # imm = 0x2AD
leaq 0x71f7(%rip), %rcx      # 0x11a74
callq 0x21a0
movslq -0x160(%rbp), %rax
movb $0x0, -0x8160(%rbp,%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa8b9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x8160(%rbp), %rsi
movl -0x160(%rbp), %edx
callq *%rax
jmp 0xa8bb
jmp 0xa8bb
jmp 0xa936
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
xorq $-0x1, %rcx
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
andq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x10(%rbp), %rdi
callq 0x9280
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
jne 0xa915
jmp 0xa934
leaq 0x7201(%rip), %rdi      # 0x11b1d
leaq 0x6675(%rip), %rsi      # 0x10f98
movl $0x2b9, %edx            # imm = 0x2B9
leaq 0x7145(%rip), %rcx      # 0x11a74
callq 0x21a0
jmp 0xa936
jmp 0xa938
jmp 0xa93a
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0xab69
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0xa0(%rbp,%rax,8), %rax
movq %rax, -0x101b0(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x101b0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x160(%rbp)
cmpl $0x0, -0x160(%rbp)
je 0xab67
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
leaq -0x10170(%rbp), %rsi
movl $0x7ffe, %edx           # imm = 0x7FFE
callq 0x21f0
movl %eax, -0x160(%rbp)
cmpl $0x0, -0x160(%rbp)
jge 0xaa6f
callq 0x2070
movl (%rax), %eax
movl %eax, -0x10174(%rbp)
cmpl $-0x1, -0x160(%rbp)
jne 0xa9f0
jmp 0xaa0f
leaq 0x58a9(%rip), %rdi      # 0x102a0
leaq 0x659a(%rip), %rsi      # 0x10f98
movl $0x2cb, %edx            # imm = 0x2CB
leaq 0x706a(%rip), %rcx      # 0x11a74
callq 0x21a0
callq 0x2070
cmpl $0x4, (%rax)
jne 0xaa1e
jmp 0xa45d
jmp 0xaa20
movl -0x10174(%rbp), %ecx
leaq 0x656b(%rip), %rdi      # 0x10f98
movl $0x2d0, %esi            # imm = 0x2D0
leaq 0x5f9e(%rip), %rdx      # 0x109d7
movb $0x0, %al
callq 0xdfe0
movl -0x10174(%rbp), %eax
movl %eax, -0x101b4(%rbp)
callq 0x2070
movl -0x101b4(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x70d3(%rip), %rdi      # 0x11b33
callq 0x2310
movl $0x1, %edi
callq 0x2350
cmpl $0x0, -0x160(%rbp)
je 0xaaec
movslq -0x160(%rbp), %rax
cmpq $0x7fff, %rax           # imm = 0x7FFF
jae 0xaa92
cmpl $0x0, -0x160(%rbp)
jle 0xaa92
jmp 0xaab1
leaq 0x70b1(%rip), %rdi      # 0x11b4a
leaq 0x64f8(%rip), %rsi      # 0x10f98
movl $0x2d6, %edx            # imm = 0x2D6
leaq 0x6fc8(%rip), %rcx      # 0x11a74
callq 0x21a0
movslq -0x160(%rbp), %rax
movb $0x0, -0x10170(%rbp,%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xaae8
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x10170(%rbp), %rsi
movl -0x160(%rbp), %edx
callq *%rax
jmp 0xaaea
jmp 0xaaea
jmp 0xab65
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
xorq $-0x1, %rcx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
andq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x10(%rbp), %rdi
callq 0x9310
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
jne 0xab44
jmp 0xab63
leaq 0x701c(%rip), %rdi      # 0x11b67
leaq 0x6446(%rip), %rsi      # 0x10f98
movl $0x2e2, %edx            # imm = 0x2E2
leaq 0x6f16(%rip), %rcx      # 0x11a74
callq 0x21a0
jmp 0xab65
jmp 0xab67
jmp 0xab69
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
jne 0xab97
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
jne 0xab97
movq -0x10(%rbp), %rdi
movl $0xf, %esi
callq 0x9410
cmpl $0x0, %eax
je 0xab95
jmp 0xb057
jmp 0xab97
cmpl $-0x1, 0xbb7a(%rip)     # 0x16718
je 0xac3f
movl 0xbb6e(%rip), %eax      # 0x16718
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0xa0(%rbp,%rax,8), %rax
movq %rax, -0x101c0(%rbp)
movl 0xbb4f(%rip), %eax      # 0x16718
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x101c0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
movb %al, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0x160(%rbp)
testb $0x1, %al
jne 0xac03
jmp 0xac3f
callq 0x93a0
cmpl $0x0, %eax
jne 0xac0f
jmp 0xac2e
leaq 0x5d7d(%rip), %rdi      # 0x10993
leaq 0x637b(%rip), %rsi      # 0x10f98
movl $0x2fb, %edx            # imm = 0x2FB
leaq 0x6e4b(%rip), %rcx      # 0x11a74
callq 0x21a0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0xac3d
jmp 0xb057
jmp 0xac3f
jmp 0xac41
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
je 0xae74
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xae74
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x120(%rbp,%rax,8), %rcx
movq %rcx, -0x120(%rbp,%rax,8)
movq $0x0, -0x130(%rbp)
movq -0x18(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %edi
addl $0x1, %edi
leaq -0x120(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x130(%rbp), %r8
movq %rcx, %rsi
callq 0x2280
movl %eax, -0x134(%rbp)
cmpl $-0x1, -0x134(%rbp)
jne 0xad57
callq 0x2070
movl (%rax), %eax
movl %eax, -0x10178(%rbp)
callq 0x2070
cmpl $0x4, (%rax)
jne 0xad06
jmp 0xa45d
jmp 0xad08
movl -0x10178(%rbp), %ecx
leaq 0x6283(%rip), %rdi      # 0x10f98
movl $0x30e, %esi            # imm = 0x30E
leaq 0x57e8(%rip), %rdx      # 0x10509
movb $0x0, %al
callq 0xdfe0
movl -0x10178(%rbp), %eax
movl %eax, -0x101c4(%rbp)
callq 0x2070
movl -0x101c4(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x57d4(%rip), %rdi      # 0x1051c
callq 0x2310
movl $0x1, %edi
callq 0x2350
cmpl $0x0, -0x134(%rbp)
jne 0xadb8
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xadb3
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movl %eax, -0x1017c(%rbp)
cmpl $0x0, %eax
je 0xadb1
cmpl $0xf, -0x1017c(%rbp)
je 0xad96
cmpl $0x9, -0x1017c(%rbp)
jne 0xadaa
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movl -0x1017c(%rbp), %esi
callq 0x2270
jmp 0xadac
jmp 0xadac
jmp 0xb057
jmp 0xadb3
jmp 0xae70
cmpl $0x1, -0x134(%rbp)
jne 0xadc3
jmp 0xade2
leaq 0x6db3(%rip), %rdi      # 0x11b7d
leaq 0x61c7(%rip), %rsi      # 0x10f98
movl $0x321, %edx            # imm = 0x321
leaq 0x6c97(%rip), %rcx      # 0x11a74
callq 0x21a0
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x120(%rbp,%rax,8), %rax
movq %rax, -0x101d0(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x101d0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xae30
jmp 0xae4f
leaq 0x6d4d(%rip), %rdi      # 0x11b84
leaq 0x615a(%rip), %rsi      # 0x10f98
movl $0x322, %edx            # imm = 0x322
leaq 0x6c2a(%rip), %rcx      # 0x11a74
callq 0x21a0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %esi
callq *%rax
cmpl $0x0, %eax
je 0xae6e
jmp 0xac41
jmp 0xae70
jmp 0xae72
jmp 0xae74
jmp 0xb050
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xb04e
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x120(%rbp,%rax,8), %rcx
movq %rcx, -0x120(%rbp,%rax,8)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x128(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %edi
addl $0x1, %edi
leaq -0x120(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x130(%rbp), %r8
movq %rcx, %rsi
callq 0x2280
movl %eax, -0x134(%rbp)
cmpl $-0x1, -0x134(%rbp)
jne 0xaf7d
callq 0x2070
movl (%rax), %eax
movl %eax, -0x10184(%rbp)
callq 0x2070
cmpl $0x4, (%rax)
jne 0xaf2c
jmp 0xa45d
jmp 0xaf2e
movl -0x10184(%rbp), %ecx
leaq 0x605d(%rip), %rdi      # 0x10f98
movl $0x338, %esi            # imm = 0x338
leaq 0x55c2(%rip), %rdx      # 0x10509
movb $0x0, %al
callq 0xdfe0
movl -0x10184(%rbp), %eax
movl %eax, -0x101d4(%rbp)
callq 0x2070
movl -0x101d4(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x55ae(%rip), %rdi      # 0x1051c
callq 0x2310
movl $0x1, %edi
callq 0x2350
cmpl $0x0, -0x134(%rbp)
je 0xafdb
cmpl $0x1, -0x134(%rbp)
jne 0xafdd
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x120(%rbp,%rax,8), %rax
movq %rax, -0x101e0(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x101e0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xafdd
jmp 0xaffc
leaq 0x6bbf(%rip), %rdi      # 0x11ba3
leaq 0x5fad(%rip), %rsi      # 0x10f98
movl $0x33d, %edx            # imm = 0x33D
leaq 0x6a7d(%rip), %rcx      # 0x11a74
callq 0x21a0
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %esi
movl -0x134(%rbp), %edx
callq *%rax
movl %eax, -0x10180(%rbp)
cmpl $0x0, %eax
je 0xb04c
cmpl $0xf, -0x10180(%rbp)
je 0xb034
cmpl $0x9, -0x10180(%rbp)
jne 0xb048
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movl -0x10180(%rbp), %esi
callq 0x2270
jmp 0xb04a
jmp 0xb04a
jmp 0xb057
jmp 0xb04e
jmp 0xb050
jmp 0xb052
jmp 0xa45d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x101e0, %rsp          # imm = 0x101E0
popq %rbp
retq
nopw (%rax,%rax)