// File: /workspace/github_c_makefile_star2_O0/tabemann[P]attoforth/src/runtime/io.c
// Function: af_io_main
void* af_io_main(void* arg) {
  af_io_t* io = arg;
  while(!io->to_be_destroyed) {
    af_io_action_t* current_action;
    af_cell_t active_fd_count;
    struct pollfd* fds;
    af_io_action_t** actions;
    af_cell_t current_index = 0;
    pthread_mutex_lock(&io->mutex);
    af_bool_t still_looping;
    struct timespec current_time;
    struct timespec wait_time;
    int used_wait_time = -1;
    af_bool_t wait_time_set = FALSE;
    clock_gettime(CLOCK_MONOTONIC, &current_time);
    do {
      still_looping = FALSE;
      current_action = io->first_active_action;
      while(current_action) {
	if(current_action->type == AF_IO_TYPE_CLOSE) {
	  current_action->is_done = TRUE;
	  close(current_action->fd);
	  still_looping = TRUE;
	} else if(current_action->type == AF_IO_TYPE_READ) {
	  if(!current_action->count) {
	    current_action->is_done = TRUE;
	    still_looping = TRUE;
	  }
	} else if(current_action->type == AF_IO_TYPE_WRITE) {
	  if(!current_action->count) {
	    current_action->is_done = TRUE;
	    still_looping = TRUE;
	  }
	} else if(current_action->type == AF_IO_TYPE_SEEK) {
	  current_action->is_done = TRUE;
	  if((lseek(current_action->fd, current_action->offset,
		  current_action->whence)) == -1) {
	    current_action->has_error = TRUE;
	  }
	  still_looping = TRUE;
	} else if(current_action->type == AF_IO_TYPE_TELL) {
	  current_action->is_done = TRUE;
	  if((current_action->offset =
	      lseek(current_action->fd, 0, SEEK_CUR)) == -1) {
	    current_action->has_error = TRUE;
	  }
	  still_looping = TRUE;
	} else if(current_action->type == AF_IO_TYPE_SLEEP) {
	  if(current_time.tv_sec > current_action->sleep_until.tv_sec ||
	     (current_time.tv_sec == current_action->sleep_until.tv_sec &&
	      current_time.tv_nsec > current_action->sleep_until.tv_nsec)) {
	    current_action->is_done = TRUE;
	    still_looping = TRUE;
	  } else {
	    struct timespec current_wait_time;
	    timespec_diff(&current_time, &current_action->sleep_until,
			  &current_wait_time);
	    if(wait_time_set) {
	      if(current_wait_time.tv_sec < wait_time.tv_sec ||
		 (current_wait_time.tv_sec == wait_time.tv_sec &&
		  current_wait_time.tv_nsec < wait_time.tv_nsec)) {
		wait_time.tv_sec = current_wait_time.tv_sec;
		wait_time.tv_nsec = current_wait_time.tv_nsec;
	      }
	    } else {
	      wait_time.tv_sec = current_wait_time.tv_sec;
	      wait_time.tv_nsec = current_wait_time.tv_nsec;
	      wait_time_set = TRUE;
	    }
	  }
	}
	current_action = current_action->next_action;
      }
      af_io_remove_done(io);
    } while(still_looping);
    if(!(fds = malloc(sizeof(struct pollfd) * (io->active_action_count + 1)))) {
      close(io->break_fd_out);
      close(io->break_fd_in);
      pthread_mutex_destroy(&io->mutex);
      return NULL;
    }
    if(!(actions = malloc(sizeof(af_io_action_t*) * io->active_action_count))) {
      free(fds);
      close(io->break_fd_out);
      close(io->break_fd_in);
      pthread_mutex_destroy(&io->mutex);
      return NULL;
    }
    current_action = io->first_active_action;
    while(current_action) {
      if(current_action->type != AF_IO_TYPE_CLOSE &&
	 current_action->type != AF_IO_TYPE_SEEK &&
	 current_action->type != AF_IO_TYPE_TELL &&
	 current_action->type != AF_IO_TYPE_SLEEP) {
	fds[current_index].fd = current_action->fd;
	if(current_action->type == AF_IO_TYPE_READ) {
	  fds[current_index].events = POLLIN;
	} else {
	  fds[current_index].events = POLLOUT;
	}
	actions[current_index] = current_action;
	fds[current_index++].revents = 0;
      }
      current_action = current_action->next_action;
    }
    fds[current_index].fd = io->break_fd_out;
    fds[current_index].events = POLLIN;
    fds[current_index].revents = 0;
    pthread_mutex_unlock(&io->mutex);
    if(wait_time_set) {
      used_wait_time =
	(wait_time.tv_sec * 1000) + (wait_time.tv_nsec / 1000000);
    }
    if((active_fd_count = poll(fds, current_index + 1, used_wait_time))
       != -1) {
      af_cell_t current_active_index = 0;
      pthread_mutex_lock(&io->mutex);
      clock_gettime(CLOCK_MONOTONIC, &current_time);
      current_action = io->first_active_action;
      while(current_action) {
	if(current_action->type == AF_IO_TYPE_SLEEP) {
	  if(current_time.tv_sec > current_action->sleep_until.tv_sec ||
	     (current_time.tv_sec == current_action->sleep_until.tv_sec &&
	      current_time.tv_nsec > current_action->sleep_until.tv_nsec)) {
	    current_action->is_done = TRUE;
	  }
	}
	current_action = current_action->next_action;
      }
      while(current_active_index < current_index) {
	if(fds[current_active_index].revents & POLLHUP) {
	  actions[current_active_index]->has_hangup = TRUE;
	}
	if(fds[current_active_index].revents & POLLERR) {
	  actions[current_active_index]->is_done = TRUE;
	  actions[current_active_index]->has_error = TRUE;
	}
	if(fds[current_active_index].revents & POLLIN) {
	  if(actions[current_active_index]->type == AF_IO_TYPE_READ) {
	    if(actions[current_active_index]->fd == STDIN_FILENO) {
	      af_io_prepare_stdin();
	    }
	    ssize_t size = read(actions[current_active_index]->fd,
				actions[current_active_index]->buffer +
				actions[current_active_index]->index,
				actions[current_active_index]->count -
				actions[current_active_index]->index);
	    if(size > 0) {
	      actions[current_active_index]->index += size;
	      if(actions[current_active_index]->index >=
		 actions[current_active_index]->count) {
		actions[current_active_index]->is_done = TRUE;
	      }
	    } else if (!size) {
	      actions[current_active_index]->is_done = TRUE;
	      actions[current_active_index]->is_closed = TRUE;
	    } else if(errno == EAGAIN ||
		      errno == EWOULDBLOCK ||
		      errno == EINTR) {
	      /* Do nothing */
	    } else {
	      actions[current_active_index]->is_done = TRUE;
	      actions[current_active_index]->is_closed = TRUE;
	      actions[current_active_index]->has_error = TRUE;
	    }
	  }
	}
	if(fds[current_active_index].revents & POLLOUT) {
	  if(actions[current_active_index]->type == AF_IO_TYPE_WRITE) {
	    ssize_t size = write(actions[current_active_index]->fd,
				 actions[current_active_index]->buffer +
				 actions[current_active_index]->index,
				 actions[current_active_index]->count -
				 actions[current_active_index]->index);
	    if(size > 0) {
	      actions[current_active_index]->index += size;
	      if(actions[current_active_index]->index >=
		 actions[current_active_index]->count) {
		actions[current_active_index]->is_done = TRUE;
	      }
	    } else if (!size) {
	      actions[current_active_index]->is_done = TRUE;
	      actions[current_active_index]->is_closed = TRUE;
	    } else if(errno == EAGAIN ||
		      errno == EWOULDBLOCK ||
		      errno == EINTR) {
	      /* Do nothing */
	    } else {
	      actions[current_active_index]->is_done = TRUE;
	      actions[current_active_index]->is_closed = TRUE;
	      actions[current_active_index]->has_error = TRUE;
	    }
	  }
	}
	current_active_index++;
      }
      if(fds[current_index].revents & POLLERR ||
	 fds[current_index].revents & POLLHUP) {
	free(actions);
	free(fds);
	close(io->break_fd_out);
	close(io->break_fd_in);
	pthread_mutex_destroy(&io->mutex);
	return NULL;
      }
      if(fds[current_index].revents & POLLIN) {
	af_byte_t buffer;
	ssize_t size = read(io->break_fd_out, &buffer, sizeof(af_byte_t));
	if(size > 0) {
	  /* Do nothing */
	} else if (size == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
	  /* Do nothing */
	} else {
	  free(actions);
	  free(fds);
	  close(io->break_fd_out);
	  close(io->break_fd_in);
	  pthread_mutex_destroy(&io->mutex);
	  return NULL;
	}
      }
      free(actions);
      free(fds);
      af_io_remove_done(io);
      pthread_mutex_unlock(&io->mutex);
    } else {
      free(actions);
      free(fds);
      close(io->break_fd_out);
      close(io->break_fd_in);
      pthread_mutex_destroy(&io->mutex);
      return NULL;
    }
  }
  close(io->break_fd_out);
  close(io->break_fd_in);
  pthread_mutex_destroy(&io->mutex);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x70(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1700e
jmp 0x17ad5
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x22d0
movl $0xffffffff, -0x6c(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x78(%rbp)
movl $0x1, %edi
leaq -0x58(%rbp), %rsi
callq 0x20c0
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1727b
movq -0x20(%rbp), %rax
cmpq $0x2, 0x18(%rax)
jne 0x1708f
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x2160
movq $-0x1, -0x48(%rbp)
jmp 0x1726a
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x170be
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x170b9
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq $-0x1, -0x48(%rbp)
jmp 0x17268
movq -0x20(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jne 0x170ed
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x170e8
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq $-0x1, -0x48(%rbp)
jmp 0x17266
movq -0x20(%rbp), %rax
cmpq $0x3, 0x18(%rax)
jne 0x17144
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movl %eax, %edx
callq 0x2150
cmpq $-0x1, %rax
jne 0x17137
movq -0x20(%rbp), %rax
movq $-0x1, 0x90(%rax)
movq $-0x1, -0x48(%rbp)
jmp 0x17264
movq -0x20(%rbp), %rax
cmpq $0x5, 0x18(%rax)
jne 0x1719a
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x2150
movq -0x20(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $-0x1, %rax
jne 0x1718d
movq -0x20(%rbp), %rax
movq $-0x1, 0x90(%rax)
movq $-0x1, -0x48(%rbp)
jmp 0x17262
movq -0x20(%rbp), %rax
cmpq $0x4, 0x18(%rax)
jne 0x17260
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jg 0x171d3
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jne 0x171e9
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jle 0x171e9
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
movq $-0x1, -0x48(%rbp)
jmp 0x1725e
movq -0x20(%rbp), %rsi
addq $0x58, %rsi
leaq -0x58(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x19320
cmpq $0x0, -0x78(%rbp)
je 0x17241
movq -0x88(%rbp), %rax
cmpq -0x68(%rbp), %rax
jl 0x1722c
movq -0x88(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x1723f
movq -0x80(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0x1723f
movq -0x88(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x1725c
movq -0x88(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $-0x1, -0x78(%rbp)
jmp 0x1725e
jmp 0x17260
jmp 0x17262
jmp 0x17264
jmp 0x17266
jmp 0x17268
jmp 0x1726a
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x17054
movq -0x18(%rbp), %rdi
callq 0x193b0
cmpq $0x0, -0x48(%rbp)
jne 0x17040
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x172e0
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x17b02
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x17336
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x17b02
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x173f5
movq -0x20(%rbp), %rax
cmpq $0x2, 0x18(%rax)
je 0x173e4
movq -0x20(%rbp), %rax
cmpq $0x3, 0x18(%rax)
je 0x173e4
movq -0x20(%rbp), %rax
cmpq $0x5, 0x18(%rax)
je 0x173e4
movq -0x20(%rbp), %rax
cmpq $0x4, 0x18(%rax)
je 0x173e4
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movl %edx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x173ab
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movw $0x1, 0x4(%rax,%rcx,8)
jmp 0x173ba
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movw $0x4, 0x4(%rax,%rcx,8)
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movw $0x0, 0x6(%rax,%rcx,8)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x17342
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edx
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movl %edx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movw $0x1, 0x4(%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movw $0x0, 0x6(%rax,%rcx,8)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x21e0
cmpq $0x0, -0x78(%rbp)
je 0x17466
imulq $0x3e8, -0x68(%rbp), %rax # imm = 0x3E8
movq %rax, -0xb8(%rbp)
movq -0x60(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
movq %rax, %rcx
movq -0xb8(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x6c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
movl -0x6c(%rbp), %edx
callq 0x2210
cltq
movq %rax, -0x28(%rbp)
cmpq $-0x1, %rax
je 0x17a8f
movq $0x0, -0x90(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x22d0
movl $0x1, %edi
leaq -0x58(%rbp), %rsi
callq 0x20c0
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x17514
movq -0x20(%rbp), %rax
cmpq $0x4, 0x18(%rax)
jne 0x17506
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jg 0x174f8
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jne 0x17504
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jle 0x17504
movq -0x20(%rbp), %rax
movq $-0x1, 0x78(%rax)
jmp 0x17506
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x174bc
jmp 0x17516
movq -0x90(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x1794b
movq -0x30(%rbp), %rax
movq -0x90(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x17559
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x88(%rax)
movq -0x30(%rbp), %rax
movq -0x90(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x175a2
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x90(%rax)
movq -0x30(%rbp), %rax
movq -0x90(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x17778
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x18(%rax)
jne 0x17776
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x28(%rax)
jne 0x175f2
callq 0x16f60
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x28(%rax), %edi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rax), %rsi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq 0x40(%rax), %rsi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rdx
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
subq 0x40(%rax), %rdx
callq 0x2190
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
jle 0x176c8
movq -0x98(%rbp), %rcx
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rdx
movq (%rax,%rdx,8), %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x90(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq 0x38(%rcx), %rax
jb 0x176c3
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
jmp 0x17774
cmpq $0x0, -0x98(%rbp)
jne 0x17705
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x80(%rax)
jmp 0x17772
callq 0x2060
cmpl $0xb, (%rax)
je 0x17723
callq 0x2060
cmpl $0xb, (%rax)
je 0x17723
callq 0x2060
cmpl $0x4, (%rax)
jne 0x17725
jmp 0x17770
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x80(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x90(%rax)
jmp 0x17772
jmp 0x17774
jmp 0x17776
jmp 0x17778
movq -0x30(%rbp), %rax
movq -0x90(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x17934
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x1, 0x18(%rax)
jne 0x17932
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x28(%rax), %edi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rax), %rsi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq 0x40(%rax), %rsi
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rdx
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
subq 0x40(%rax), %rdx
callq 0x20e0
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jle 0x17884
movq -0xa0(%rbp), %rcx
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rdx
movq (%rax,%rdx,8), %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x90(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq 0x38(%rcx), %rax
jb 0x1787f
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
jmp 0x17930
cmpq $0x0, -0xa0(%rbp)
jne 0x178c1
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x80(%rax)
jmp 0x1792e
callq 0x2060
cmpl $0xb, (%rax)
je 0x178df
callq 0x2060
cmpl $0xb, (%rax)
je 0x178df
callq 0x2060
cmpl $0x4, (%rax)
jne 0x178e1
jmp 0x1792c
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x78(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x80(%rax)
movq -0x38(%rbp), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $-0x1, 0x90(%rax)
jmp 0x1792e
jmp 0x17930
jmp 0x17932
jmp 0x17934
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x17516
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x17975
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x179b9
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x17b02
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movswl 0x6(%rax,%rcx,8), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x17a65
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
leaq -0xa1(%rbp), %rsi
movl $0x1, %edx
callq 0x2190
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jle 0x179fd
jmp 0x17a63
cmpq $-0x1, -0xb0(%rbp)
jne 0x17a1d
callq 0x2060
cmpl $0xb, (%rax)
je 0x17a1b
callq 0x2060
cmpl $0xb, (%rax)
jne 0x17a1d
jmp 0x17a61
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x17b02
jmp 0x17a63
jmp 0x17a65
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rdi
callq 0x193b0
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x21e0
jmp 0x17ad0
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x17b02
jmp 0x16ff7
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edi
callq 0x2160
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x2130
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nop