// File: /workspace/github_c_makefile_star2_O0/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_spawn
af_task_t* af_spawn(af_global_t* global, af_task_t* parent_task) {
  af_cell_t* data_stack_top;
  af_float_t* float_stack_top;
  af_compiled_t** return_stack_top;
  af_cell_t* data_space_base;
  af_wordlist_t** wordlist_order;
  void* task_local_space_base;
  af_task_t* task;
  
  if(!(data_stack_top = malloc(global->default_data_stack_count *
			       sizeof(af_cell_t)))) {
    return NULL;
  }
  if(!(float_stack_top = malloc(global->default_float_stack_count *
				sizeof(af_float_t)))) {
    free(data_stack_top);
    return NULL;
  }
  if(!(return_stack_top = malloc(global->default_return_stack_count *
				 sizeof(af_compiled_t*)))) {
    free(float_stack_top);
    free(data_stack_top);
    return NULL;
  }
  if(!(data_space_base = malloc(global->default_data_space_size *
				sizeof(af_cell_t)))) {
    free(return_stack_top);
    free(float_stack_top);
    free(data_stack_top);
    return NULL;
  }
  if(!(wordlist_order = malloc(global->default_wordlist_order_max_count *
			       sizeof(af_wordlist_t*)))) {
    free(data_space_base);
    free(return_stack_top);
    free(float_stack_top);
    free(data_stack_top);
    return NULL;
  }
  if(!(task_local_space_base = malloc(global->task_local_space_size *
					sizeof(af_byte_t)))) {
    free(wordlist_order);
    free(data_space_base);
    free(return_stack_top);
    free(float_stack_top);
    free(data_stack_top);
    return NULL;
  }
  if(!(task = malloc(sizeof(af_task_t)))) {
    free(task_local_space_base);
    free(wordlist_order);
    free(data_space_base);
    free(return_stack_top);
    free(float_stack_top);
    free(data_stack_top);
    return NULL;
  }
  memcpy(task_local_space_base, global->default_task_local_space_base,
	 global->task_local_space_size * sizeof(af_byte_t));
  task->global = global;
  task->next_task = global->first_task;
  global->first_task = task;
  task->base_cycles_before_yield = 0;
  task->extra_cycles = 0;
  task->current_cycles_before_yield = 0;
  task->current_cycles_left = 0;
  task->yields = 0;
  task->is_compiling = FALSE;
  task->is_to_be_freed = FALSE;
  task->interpreter_pointer = NULL;
  task->data_stack_current = task->data_stack_base =
    (data_stack_top + global->default_data_stack_count) -
    global->default_data_stack_base_room_count;
  task->float_stack_current = task->float_stack_base =
    (float_stack_top + global->default_float_stack_count) -
    global->default_float_stack_base_room_count;
  task->return_stack_current = task->return_stack_base =
    (return_stack_top + global->default_return_stack_count) -
    global->default_return_stack_base_room_count;
  task->data_stack_top = data_stack_top;
  task->float_stack_top = float_stack_top;
  task->return_stack_top = return_stack_top;
  task->data_space_current = task->data_space_base =
    data_space_base;
  task->data_space_top =
    data_space_base + global->default_data_space_size;
  task->task_local_space_base = task_local_space_base;
  task->wordlist_order_max_count = global->default_wordlist_order_max_count;
  task->wordlist_order = wordlist_order;
  if(parent_task) {
    memcpy(task->wordlist_order, parent_task->wordlist_order,
	  parent_task->wordlist_order_count);
    task->wordlist_order_count = parent_task->wordlist_order_count;
    task->current_wordlist = parent_task->current_wordlist;
  } else {
    *task->wordlist_order = global->forth_wordlist;
    task->wordlist_order_count = 1;
    task->current_wordlist = global->forth_wordlist;
  }
  task->most_recent_word = NULL;
  task->current_input = NULL;
  task->base = 10;
  task->init_word = NULL;
  task->current_word = NULL;
  task->abort = global->default_abort;
  task->terminate = NULL;
  task->free_data_on_exit = FALSE;
  task->do_trace = FALSE;
  task->nesting_level = -1;
  global->task_count++;
  af_handle_spawn(global, task);
  return task;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x296b
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x10(%rbp), %rax
movq 0x130(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x299f
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x10(%rbp), %rax
movq 0x138(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x29dc
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x10(%rbp), %rax
movq 0x160(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x2a22
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x10(%rbp), %rax
movq 0x1d0(%rax), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x2a71
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x10(%rbp), %rax
movq 0x1d8(%rax), %rdi
shlq $0x0, %rdi
callq 0x21f0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0x2ac9
movq -0x40(%rbp), %rdi
callq 0x2040
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movl $0x140, %edi            # imm = 0x140
callq 0x21f0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x2b20
movq -0x48(%rbp), %rdi
callq 0x2040
movq -0x40(%rbp), %rdi
callq 0x2040
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x2e70
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x1d8(%rax), %rdx
movq 0x1e8(%rax), %rsi
callq 0x21c0
movq -0x10(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x38(%rax)
movq $0x0, 0x30(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
subq 0x140(%rdx), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x50(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x130(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
subq 0x148(%rdx), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x50(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x138(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
subq 0x150(%rdx), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x50(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x20(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x30(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x38(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x50(%rbp), %rax
movq %rcx, 0xc8(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x160(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x120(%rax)
movq -0x10(%rbp), %rax
movq 0x1d0(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xb0(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x2d73
movq -0x50(%rbp), %rax
movq 0xb0(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rdx
callq 0x21c0
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xa8(%rax)
jmp 0x2db1
movq -0x10(%rbp), %rax
movq 0x1b8(%rax), %rcx
movq -0x50(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movq $0x1, 0xb8(%rax)
movq -0x10(%rbp), %rax
movq 0x1b8(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0xe0(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0xe8(%rax)
movq -0x50(%rbp), %rax
movq $0xa, 0xf0(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0xf8(%rax)
movq -0x10(%rbp), %rax
movq 0x1a8(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x100(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x108(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x118(%rax)
movq -0x50(%rbp), %rax
movq $0x0, 0x128(%rax)
movq -0x50(%rbp), %rax
movq $-0x1, 0x130(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3640
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)