// File: /workspace/github_c_makefile_star2_O0/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_word
af_byte_t* af_word(af_global_t* global, af_task_t* task, af_byte_t delimiter) {
  af_cell_t current_index;
  af_cell_t count;
  af_byte_t* buffer;
  af_byte_t current_char;
  af_cell_t start_index;
  size_t bytes_copied;
  af_byte_t* here;
  if(!task->current_input) {
    here = (af_byte_t*)af_guarantee(global, task, 1);
    *here = 0;
    return here;
  }
  current_index = task->current_input->index;
  count = task->current_input->count;
  buffer = task->current_input->buffer;
  current_char = *(buffer + current_index);
  while(current_index < count && current_char == delimiter) {
    current_char = *(buffer + ++current_index);
  }
  if(current_index == count) {
    here = (af_byte_t*)af_guarantee(global, task, 1);
    *here = 0;
    return here;
  }
  start_index = current_index;
  while(current_index < count && current_char != delimiter) {
    current_char = *(buffer + ++current_index);
  }
  if(!task->current_input->is_closed && current_index == count) {
    here = (af_byte_t*)af_guarantee(global, task, 1);
    *here = 0;
    return here;
  }
  task->current_input->index = current_index;
  if(current_index - start_index <= 255) {
    bytes_copied = current_index - start_index;
  } else {
    bytes_copied = 255;
  }
  here = (af_byte_t*)af_guarantee(global, task, bytes_copied + 1);
  *here = (af_byte_t)bytes_copied;
  memcpy(here + sizeof(af_byte_t),
	 buffer + (start_index * sizeof(af_byte_t)),
	 sizeof(af_byte_t) * bytes_copied);
  return here;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0xe8(%rax)
jne 0x542d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x46a0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5608
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x39(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x59(%rbp)
jae 0x5493
movzbl -0x39(%rbp), %eax
movzbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x549c
jmp 0x54b8
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb 0x1(%rax,%rcx), %al
movb %al, -0x39(%rbp)
jmp 0x5474
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x54ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x46a0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5608
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x5a(%rbp)
jae 0x5513
movzbl -0x39(%rbp), %eax
movzbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
setne %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0x551c
jmp 0x5538
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb 0x1(%rax,%rcx), %al
movb %al, -0x39(%rbp)
jmp 0x54f4
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x557e
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x557e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x46a0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5608
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
subq -0x48(%rbp), %rax
cmpq $0xff, %rax
ja 0x55af
movq -0x28(%rbp), %rax
subq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x55b7
movq $0xff, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq $0x1, %rdx
callq 0x46a0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movq -0x58(%rbp), %rdi
addq $0x1, %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rax
shlq $0x0, %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
shlq $0x0, %rdx
callq 0x21c0
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)