LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-multicore.c
// Function: init_core
void init_core(NgaState *vm, CELL x) {
  int y;
  vm->cpu[x].sp = 0;
  vm->cpu[x].rp = 0;
  vm->cpu[x].ip = 0;
  vm->cpu[x].active = 0;
  vm->cpu[x].u = 0;
  for (y = 0; y < STACK_DEPTH; y++) { vm->cpu[x].data[y] = 0; };
  for (y = 0; y < ADDRESSES; y++) { vm->cpu[x].address[y] = 0; };
  for (y = 0; y < 24; y++) { vm->cpu[x].registers[y] = 0; };
}

// Assembly:
movslq %esi, %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rdi, %rax
addq $0x200004, %rax         # imm = 0x200004
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andl $0x0, 0x10(%rax)
xorl %ecx, %ecx
cmpq $0x100, %rcx            # imm = 0x100
je 0x487f
andl $0x0, 0x14(%rax,%rcx,4)
incq %rcx
jmp 0x486c
xorl %ecx, %ecx
cmpq $0x100, %rcx            # imm = 0x100
je 0x4897
andl $0x0, 0x414(%rax,%rcx,4)
incq %rcx
jmp 0x4881
xorl %ecx, %ecx
cmpq $0x18, %rcx
je 0x48ac
andl $0x0, 0x814(%rax,%rcx,4)
incq %rcx
jmp 0x4899
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_guard
void float_guard(NgaState *vm) {
  if (vm->fsp < 0 || vm->fsp > 255) {
    printf("\nERROR (nga/float_guard): Float Stack Limits Exceeded!\n");
    printf("At %lld, fsp = %lld\n", (long long)vm->cpu[vm->active].ip, (long long)vm->fsp);
    exit(1);
  }
  if (vm->afsp < 0 || vm->afsp > 255) {
    printf("\nERROR (nga/float_guard): Alternate Float Stack Limits Exceeded!\n");
    printf("At %lld, afsp = %lld\n", (long long)vm->cpu[vm->active].ip, (long long)vm->afsp);
    exit(1);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x100, 0x2075b8(%rdi)  # imm = 0x100
jae 0x4a94
cmpl $0x100, 0x2075bc(%rbx)  # imm = 0x100
jae 0x4ac6
popq %rbx
retq
leaq 0x49d7(%rip), %rdi      # 0x9472
callq 0x30a0
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
movslq 0x20000c(%rbx,%rax), %rsi
movslq 0x2075b8(%rbx), %rdx
leaq 0x45ee(%rip), %rdi      # 0x90b2
jmp 0x4af6
leaq 0x4964(%rip), %rdi      # 0x9431
callq 0x30a0
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
movslq 0x20000c(%rbx,%rax), %rsi
movslq 0x2075bc(%rbx), %rdx
leaq 0x45d1(%rip), %rdi      # 0x90c7
xorl %eax, %eax
callq 0x3150
pushq $0x1
popq %rdi
callq 0x33b0
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: string_inject
CELL string_inject(NgaState *vm, char *str, CELL buffer) {
  if (!str) {
    vm->memory[buffer] = 0;
    return 0;
  }

  CELL pos = 0;
  int i = 0;

  while (str[i] != '\0') {
    unsigned char *utf8_str = (unsigned char *)&str[i];
    int utf32_char = 0;
    int bytes_consumed = 0;

    // Convert UTF-8 to UTF-32
    if ((utf8_str[0] & 0x80) == 0x00) {
      // 1-byte UTF-8 sequence
      utf32_char = utf8_str[0];
      bytes_consumed = 1;
    } else if ((utf8_str[0] & 0xE0) == 0xC0) {
      // 2-byte UTF-8 sequence
      utf32_char = ((uint32_t)(utf8_str[0] & 0x1F) << 6) |
                              (utf8_str[1] & 0x3F);
      bytes_consumed = 2;
    } else if ((utf8_str[0] & 0xF0) == 0xE0) {
      // 3-byte UTF-8 sequence
      utf32_char = ((uint32_t)(utf8_str[0] & 0x0F) << 12) |
                   ((uint32_t)(utf8_str[1] & 0x3F) << 6) |
                              (utf8_str[2] & 0x3F);
      bytes_consumed = 3;
    } else if ((utf8_str[0] & 0xF8) == 0xF0) {
      // 4-byte UTF-8 sequence
      utf32_char = ((uint32_t)(utf8_str[0] & 0x07) << 18) |
                   ((uint32_t)(utf8_str[1] & 0x3F) << 12) |
                   ((uint32_t)(utf8_str[2] & 0x3F) << 6) |
                              (utf8_str[3] & 0x3F);
      bytes_consumed = 4;
    } else {
      // Invalid UTF-8, skip byte
      utf32_char = utf8_str[0];
      bytes_consumed = 1;
    }

    vm->memory[buffer + pos] = (CELL)utf32_char;
    vm->memory[buffer + pos + 1] = 0;
    pos++;
    i += bytes_consumed;
  }

  return buffer;
}

// Assembly:
movslq %edx, %rcx
testq %rsi, %rsi
je 0x4db1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %eax
leaq (%rdi,%rcx,4), %rcx
addq $0x4, %rcx
xorl %edx, %edx
movl $0x1, %edi
movl $0x2, %r8d
movabsq $0x1, %rbx
movl $0x3, %r10d
movabsq $0x2, %r11
movabsq $0x3, %r14
movl %edx, %r15d
movzbl (%rsi,%r15), %ebp
testl %ebp, %ebp
je 0x4da6
testb %bpl, %bpl
js 0x4cf7
movl %edi, %r13d
jmp 0x4d94
addq %rsi, %r15
movl %ebp, %r9d
andl $-0x20, %r9d
cmpl $0xc0, %r9d
jne 0x4d1b
andl $0x1f, %ebp
shll $0x6, %ebp
movq %rbx, %r9
movl %ebp, %r12d
movl %r8d, %r13d
jmp 0x4d89
movl %ebp, %r9d
andl $-0x10, %r9d
cmpl $0xe0, %r9d
jne 0x4d4a
shll $0xc, %ebp
movzwl %bp, %r9d
movzbl 0x1(%r15), %r12d
andl $0x3f, %r12d
shll $0x6, %r12d
orl %r9d, %r12d
movq %r11, %r9
movl %r10d, %r13d
jmp 0x4d89
movl %ebp, %r9d
andl $-0x8, %r9d
cmpl $0xf0, %r9d
jne 0x4cef
andl $0x7, %ebp
shll $0x12, %ebp
movzbl 0x1(%r15), %r9d
andl $0x3f, %r9d
shll $0xc, %r9d
orl %ebp, %r9d
movzbl 0x2(%r15), %r12d
andl $0x3f, %r12d
shll $0x6, %r12d
orl %r9d, %r12d
movq %r14, %r9
movl $0x4, %r13d
movzbl (%r15,%r9), %ebp
andl $0x3f, %ebp
orl %r12d, %ebp
movl %ebp, -0x4(%rcx)
andl $0x0, (%rcx)
addl %r13d, %edx
addq $0x4, %rcx
jmp 0x4cda
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, (%rdi,%rcx,4)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_to_number
void float_to_number(NgaState *vm) {
  double a = float_pop(vm);
  if (a > 2147483647)
    a = 2147483647;
  if (a < -2147483648)
    a = -2147483648;
  stack_push(vm, (CELL)round(a));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4b3a
movsd 0x428f(%rip), %xmm1     # 0x9058
minsd %xmm0, %xmm1
movsd 0x428b(%rip), %xmm0     # 0x9060
maxsd %xmm1, %xmm0
callq 0x3090
cvttsd2si %xmm0, %eax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
leaq (%rbx,%rcx), %rdx
movslq 0x200004(%rbx,%rcx), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x200004(%rbx,%rcx)
movl %eax, 0x20001c(%rdx,%rsi,4)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_eq
void float_eq(NgaState *vm) {
  double a = float_pop(vm);
  double b = float_pop(vm);
  if (a == b)
    stack_push(vm, -1);
  else
    stack_push(vm, 0);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4b3a
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x4b3a
cmpeqsd 0x8(%rsp), %xmm0
movq %xmm0, %rax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
leaq (%rbx,%rcx), %rdx
movslq 0x200004(%rbx,%rcx), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x200004(%rbx,%rcx)
movl %eax, 0x20001c(%rdx,%rsi,4)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_lt
void float_lt(NgaState *vm) {
  double a = float_pop(vm);
  double b = float_pop(vm);
  if (b < a)
    stack_push(vm, -1);
  else
    stack_push(vm, 0);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4b3a
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x4b3a
xorl %eax, %eax
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %al
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
leaq (%rbx,%rcx), %rdx
movslq 0x200004(%rbx,%rcx), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x200004(%rbx,%rcx)
negl %eax
movl %eax, 0x20001c(%rdx,%rsi,4)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_gt
void float_gt(NgaState *vm) {
  double a = float_pop(vm);
  double b = float_pop(vm);
  if (b > a)
    stack_push(vm, -1);
  else
    stack_push(vm, 0);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4b3a
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x4b3a
xorl %eax, %eax
ucomisd 0x8(%rsp), %xmm0
seta %al
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
leaq (%rbx,%rcx), %rdx
movslq 0x200004(%rbx,%rcx), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x200004(%rbx,%rcx)
negl %eax
movl %eax, 0x20001c(%rdx,%rsi,4)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-float.c
// Function: float_swap
void float_swap(NgaState *vm) {
  double a = float_pop(vm);
  double b = float_pop(vm);
  float_push(vm, a);
  float_push(vm, b);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4b3a
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x4b3a
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x4b05
movq %rbx, %rdi
movsd (%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
jmp 0x4b05
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-rng.c
// Function: io_rng
V io_rng(NgaState *vm) {
  int64_t r = 0;
  char buffer[8];
  int i;
  ssize_t ignore;
  int fd = open("/dev/urandom", O_RDONLY);
  ignore = read(fd, buffer, 8);
  close(fd);
  for(i = 0; i < 8; ++i) {
    r = r << 8;
    r += ((int64_t)buffer[i] & 0xFF);
  }
#ifndef BIT64
  stack_push(vm, (CELL)abs((CELL)r));
#else
  stack_push(vm, (CELL)llabs((CELL)r));
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x39f3(%rip), %rdi      # 0x90e0
xorl %r14d, %r14d
xorl %esi, %esi
xorl %eax, %eax
callq 0x3320
movl %eax, %ebp
leaq 0x8(%rsp), %rsi
pushq $0x8
popq %rdx
movl %eax, %edi
callq 0x3210
movl %ebp, %edi
callq 0x31c0
xorl %eax, %eax
cmpq $0x8, %r14
je 0x5729
shll $0x8, %eax
movzbl 0x8(%rsp,%r14), %ecx
orl %ecx, %eax
incq %r14
jmp 0x5713
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rdx
movslq 0x200004(%rbx,%rax), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x200004(%rbx,%rax)
movl %ecx, 0x20001c(%rdx,%rsi,4)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_open_pipe
V unix_open_pipe(NgaState *vm) {
  CELL slot, mode, name;
  char *request;
  const char *modes[] = {"r", "w", "", "r+"};
  slot = files_get_handle(vm);
  mode = stack_pop(vm);
  name = stack_pop(vm);
  request = string_extract(vm, name);
  if (slot > 0) {
    vm->OpenFileHandles[slot] = popen(request, modes[mode]);
  }
  if (vm->OpenFileHandles[slot] == NULL) {
    vm->OpenFileHandles[slot] = 0;
    slot = 0;
  }
  stack_push(vm, slot);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x3d7c
movl %eax, %ebp
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leaq -0x1(%rcx), %rdx
movl %edx, (%rax)
movslq 0x14(%rax,%rcx,4), %r14
leal -0x2(%rcx), %edx
movl %edx, (%rax)
movl 0x10(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
testl %ebp, %ebp
jle 0x581d
leaq 0x3842(%rip), %rcx      # 0x9044
movslq (%rcx,%r14,4), %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x3330
movl %ebp, %ecx
movq %rax, 0x288ef0(%rbx,%rcx,8)
jmp 0x5828
movslq %ebp, %rcx
movq 0x288ef0(%rbx,%rcx,8), %rax
leaq 0x200004(%rbx), %rdx
testq %rax, %rax
jne 0x583f
andq $0x0, 0x288ef0(%rbx,%rcx,8)
xorl %ebp, %ebp
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rdx,%rax), %rcx
movslq (%rdx,%rax), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, (%rdx,%rax)
movl %ebp, 0x18(%rcx,%rsi,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_run_external
V unix_run_external(NgaState *vm) {
  char *line, *args[128];
  int i, status;
  pid_t pid;

  char **argv = args;
  line = string_extract(vm, stack_pop(vm));

  for(i = 0; i < 128; i++)
    args[i] = 0;

  while (*line != '\0') {
    while (*line == ' ' || *line == '\t' || *line == '\n')
      *line++ = '\0';
    *argv++ = line;
    while (*line != '\0' && *line != ' ' && *line != '\t' && *line != '\n')
      line++;
  }

  if ((pid = fork()) < 0) {
    printf("*** ERROR: forking child process failed\n");
    exit(1);
  }
  else if (pid == 0) {
    int e = execvp(*args, args);
    if (e < 0) {
      printf("*** ERROR: exec failed with %d\n", e);
      exit(1);
    }
  } else {
  while (wait(&status) != pid)
    ;
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rdi,%rax), %rcx
movslq 0x200004(%rdi,%rax), %rdx
leal -0x1(%rdx), %esi
movl %esi, 0x200004(%rdi,%rax)
movl 0x200018(%rcx,%rdx,4), %esi
callq 0x3cb8
xorl %ecx, %ecx
cmpq $0x80, %rcx
je 0x5984
andq $0x0, 0x10(%rsp,%rcx,8)
incq %rcx
jmp 0x5970
movb (%rax), %dil
leaq 0x10(%rsp), %rcx
movabsq $0x100000601, %rdx      # imm = 0x100000601
movabsq $0x100000600, %rsi      # imm = 0x100000600
testb %dil, %dil
je 0x59dc
cmpb $0x20, %dil
ja 0x59c1
movzbl %dil, %edi
btq %rdi, %rsi
jae 0x59c1
movb $0x0, (%rax)
movb 0x1(%rax), %dil
incq %rax
jmp 0x59a5
movq %rax, (%rcx)
addq $0x8, %rcx
movzbl (%rax), %edi
cmpq $0x20, %rdi
ja 0x59d7
btq %rdi, %rdx
jb 0x59a0
incq %rax
jmp 0x59c8
callq 0x3440
testl %eax, %eax
js 0x5a18
je 0x59fc
movl %eax, %ebx
leaq 0xc(%rsp), %r14
movq %r14, %rdi
callq 0x3420
cmpl %ebx, %eax
jne 0x59ee
jmp 0x5a0d
leaq 0x10(%rsp), %rsi
movq (%rsi), %rdi
callq 0x3390
testl %eax, %eax
js 0x5a26
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
leaq 0x3a8a(%rip), %rdi      # 0x94a9
callq 0x30a0
jmp 0x5a36
leaq 0x36c5(%rip), %rdi      # 0x90f2
movl %eax, %esi
xorl %eax, %eax
callq 0x3150
pushq $0x1
popq %rdi
callq 0x33b0
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_exec0
V unix_exec0(NgaState *vm) {
  char path[1025];
  strlcpy(path, string_extract(vm, stack_pop(vm)), 1024);
  execl(path, path, (char *)0);
  stack_push(vm, errno);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rdi, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
callq 0x3cb8
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c71
movq %r14, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x33e0
callq 0x3070
movl (%rax), %eax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
addq %rbx, %rcx
addq $0x200004, %rcx         # imm = 0x200004
movslq (%rcx), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, (%rcx)
movl %eax, 0x18(%rcx,%rdx,4)
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_exec1
V unix_exec1(NgaState *vm) {
  char path[1025];
  char arg0[1025];
  strlcpy(arg0, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(path, string_extract(vm, stack_pop(vm)), 1024);
  execl(path, path, arg0, (char *)0);
  stack_push(vm, errno);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x820, %rsp            # imm = 0x820
movq %rdi, %rbx
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rdi, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
callq 0x3cb8
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0x410(%rsp), %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %rax, %rsi
callq 0x3c71
movq %r15, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x33e0
callq 0x3070
movl (%rax), %eax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
addq %rbx, %rcx
addq $0x200004, %rcx         # imm = 0x200004
movslq (%rcx), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, (%rcx)
movl %eax, 0x18(%rcx,%rdx,4)
addq $0x820, %rsp            # imm = 0x820
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_exec2
V unix_exec2(NgaState *vm) {
  char path[1025];
  char arg0[1025], arg1[1025];
  strlcpy(arg1, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(arg0, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(path, string_extract(vm, stack_pop(vm)), 1024);
  execl(path, path, arg0, arg1, (char *)0);
  stack_push(vm, errno);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc28, %rsp            # imm = 0xC28
movq %rdi, %rbx
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rdi, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
callq 0x3cb8
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0x410(%rsp), %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0x820(%rsp), %r12
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
movq %rax, %rsi
callq 0x3c71
movq %r12, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x33e0
callq 0x3070
movl (%rax), %eax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
addq %rbx, %rcx
addq $0x200004, %rcx         # imm = 0x200004
movslq (%rcx), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, (%rcx)
movl %eax, 0x18(%rcx,%rdx,4)
addq $0xc28, %rsp            # imm = 0xC28
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_exec3
V unix_exec3(NgaState *vm) {
  char path[1025];
  char arg0[1025], arg1[1025], arg2[1025];
  strlcpy(arg2, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(arg1, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(arg0, string_extract(vm, stack_pop(vm)), 1024);
  strlcpy(path, string_extract(vm, stack_pop(vm)), 1024);
  execl(path, path, arg0, arg1, arg2, (char *)0);
  stack_push(vm, errno);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1040, %rsp           # imm = 0x1040
movq %rdi, %rbx
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rdi, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
callq 0x3cb8
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0x410(%rsp), %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0x820(%rsp), %r12
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
movq %rax, %rsi
callq 0x3c71
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leal -0x1(%rcx), %edx
movl %edx, (%rax)
movl 0x14(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x3cb8
leaq 0xc30(%rsp), %r13
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
movq %rax, %rsi
callq 0x3c71
movq %r13, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x33e0
callq 0x3070
movl (%rax), %eax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
addq %rbx, %rcx
addq $0x200004, %rcx         # imm = 0x200004
movslq (%rcx), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, (%rcx)
movl %eax, 0x18(%rcx,%rdx,4)
addq $0x1040, %rsp           # imm = 0x1040
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/./dev-unix.c
// Function: unix_write
V unix_write(NgaState *vm) {
  ssize_t ignore;
  CELL c = stack_pop(vm);
  CELL b = stack_pop(vm);
  CELL a = stack_pop(vm);
  ignore = write(fileno(vm->OpenFileHandles[c]), string_extract(vm, a), b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x2043a4(%rdi), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rdi,%rax), %rcx
movslq 0x200004(%rdi,%rax), %rdx
leaq -0x1(%rdx), %rsi
movl %esi, 0x200004(%rdi,%rax)
movslq 0x200018(%rcx,%rdx,4), %rsi
leaq -0x2(%rdx), %rdi
movl %edi, 0x200004(%rbx,%rax)
movslq 0x200014(%rcx,%rdx,4), %r14
leal -0x3(%rdx), %edi
movl %edi, 0x200004(%rbx,%rax)
movl 0x200010(%rcx,%rdx,4), %ebp
movq 0x288ef0(%rbx,%rsi,8), %rdi
callq 0x32b0
movl %eax, %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3cb8
movl %r15d, %edi
movq %rax, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x30d0
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: validate_opcode_bundle
V validate_opcode_bundle(NgaState *vm, CELL opcode) {
  CELL remainingOpcode = opcode;
  for (int i = 0; i < 4; i++) {
    CELL current = remainingOpcode & 0xFF;
    if (current < 0 || current > 29) {
      invalid_opcode(vm, opcode);
    }
    remainingOpcode >>= 8;
  }
}

// Assembly:
pushq $0x4
popq %rax
movl %esi, %ecx
subl $0x1, %eax
jb 0x6f2a
movl %ecx, %edx
andl $0xfe, %edx
cmpl $0x1e, %edx
jae 0x6f2b
sarl $0x8, %ecx
jmp 0x6f13
retq
pushq %rax
callq 0x6e93
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: process_opcode_bundle
V process_opcode_bundle(NgaState *vm, CELL opcode) {
#ifndef BRANCH_PREDICTION
  if (INST(0))  instructions[opcode & 0xFF](vm);
  if (INST(8))  instructions[(opcode >> 8) & 0xFF](vm);
  if (INST(16)) instructions[(opcode >> 16) & 0xFF](vm);
  if (INST(24)) instructions[(opcode >> 24) & 0xFF](vm);
#else
  for (size_t i = 0; i < 4; ++i) {
    uint8_t current = ((uint8_t*)&opcode)[i];
    if (unlikely(current > 29)) {
      invalid_opcode(vm, opcode);
    }
    instructions[current](vm);
  }
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %eax
andl $0xff, %eax
movq %rsi, %r14
je 0x6f56
movl %eax, %eax
leaq 0x4d1f3(%rip), %rcx     # 0x54140
movq %rbx, %rdi
callq *(%rcx,%rax,8)
movq %r14, %rsi
movl %esi, %eax
shrl $0x8, %eax
andl $0xff, %eax
je 0x6f74
movl %eax, %eax
leaq 0x4d1d5(%rip), %rcx     # 0x54140
movq %rbx, %rdi
callq *(%rcx,%rax,8)
movq %r14, %rsi
movl %esi, %eax
shrl $0x10, %eax
andl $0xff, %eax
je 0x6f92
movl %eax, %eax
leaq 0x4d1b7(%rip), %rcx     # 0x54140
movq %rbx, %rdi
callq *(%rcx,%rax,8)
movq %r14, %rsi
cmpl $0x1000000, %esi        # imm = 0x1000000
jae 0x6fa2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
shrl $0x18, %esi
leaq 0x4d194(%rip), %rax     # 0x54140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax,%rsi,8)
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: prepare_vm
V prepare_vm(NgaState *vm) {
  vm->active = 0;
  ACTIVE.ip = ACTIVE.sp = ACTIVE.rp = ACTIVE.u = 0;
  ACTIVE.active = -1;
  for (ACTIVE.ip = 0; ACTIVE.ip < IMAGE_SIZE; ACTIVE.ip++)
    vm->memory[ACTIVE.ip] = 0; /* NO - nop instruction */
  for (ACTIVE.ip = 0; ACTIVE.ip < STACK_DEPTH; ACTIVE.ip++)
    ACTIVE.data[ACTIVE.ip] = 0;
  for (ACTIVE.ip = 0; ACTIVE.ip < ADDRESSES; ACTIVE.ip++)
    ACTIVE.address[ACTIVE.ip] = 0;
}

// Assembly:
andl $0x0, 0x2043a4(%rdi)
leaq 0x200004(%rdi), %rax
andl $0x0, 0x200014(%rdi)
movaps 0x1c21(%rip), %xmm0     # 0x9070
movups %xmm0, 0x200004(%rdi)
xorl %edx, %edx
xorl %ecx, %ecx
cmpl $0x7ffff, %edx          # imm = 0x7FFFF
jg 0x7483
movslq %edx, %rcx
andl $0x0, (%rdi,%rcx,4)
movslq 0x2043a4(%rdi), %rcx
imulq $0x874, %rcx, %rsi      # imm = 0x874
movl 0x8(%rax,%rsi), %edx
incl %edx
movl %edx, 0x8(%rax,%rsi)
jmp 0x745a
movslq %ecx, %rdx
imulq $0x874, %rdx, %rdx      # imm = 0x874
andl $0x0, 0x8(%rax,%rdx)
movslq %ecx, %rdx
imulq $0x874, %rdx, %rsi      # imm = 0x874
leaq (%rax,%rsi), %rdx
movslq 0x8(%rax,%rsi), %rsi
cmpq $0xff, %rsi
jg 0x74c7
andl $0x0, 0x14(%rdx,%rsi,4)
movslq 0x2043a4(%rdi), %rcx
imulq $0x874, %rcx, %rdx      # imm = 0x874
incl 0x8(%rax,%rdx)
jmp 0x7492
andl $0x0, 0x8(%rdx)
xorl %edx, %edx
cmpl $0xff, %edx
jg 0x7507
movslq %ecx, %rcx
movslq %edx, %rdx
imulq $0x874, %rcx, %rcx      # imm = 0x874
addq %rax, %rcx
andl $0x0, 0x414(%rcx,%rdx,4)
movslq 0x2043a4(%rdi), %rcx
imulq $0x874, %rcx, %rsi      # imm = 0x874
movl 0x8(%rax,%rsi), %edx
incl %edx
movl %edx, 0x8(%rax,%rsi)
jmp 0x74cd
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: register_signal_handlers
V register_signal_handlers() {
#ifdef ENABLE_SIGNALS
  signal(SIGHUP, sig_handler);
  signal(SIGINT, sig_handler);
  signal(SIGILL, sig_handler);
  signal(SIGBUS, sig_handler);
  signal(SIGFPE, sig_handler);
#endif
}

// Assembly:
pushq %rbx
leaq 0x38(%rip), %rbx        # 0x7834
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x3250
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x3250
pushq $0x4
popq %rdi
movq %rbx, %rsi
callq 0x3250
pushq $0x7
popq %rdi
movq %rbx, %rsi
callq 0x3250
pushq $0x8
popq %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x3250
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: load_image
CELL load_image(NgaState *vm, char *imageFile) {
  FILE *fp;
  CELL imageSize = 0;
  long fileLen;
  if ((fp = fopen(imageFile, "rb")) != NULL) {
    /* Determine length (in cells) */
    fseek(fp, 0, SEEK_END);
    fileLen = ftell(fp) / sizeof(CELL);
    if (fileLen > IMAGE_SIZE) {
      fclose(fp);
      printf("\nERROR (nga/ngaLoadImage): Image is larger than alloted space!\n");
      exit(1);
    }
    rewind(fp);

    /* Erase old image in memory: 0 = nop instruction */
    for (int i = 0; i < IMAGE_SIZE; i++) { vm->memory[i] = 0; }

    /* Read the file into memory */
    imageSize = fread(vm->memory, sizeof(CELL), fileLen, fp);
    fclose(fp);
  }
  return imageSize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %r14
leaq 0x1467(%rip), %rsi      # 0x90a7
movq %rax, %rdi
callq 0x3340
testq %rax, %rax
je 0x7cae
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x32f0
movq %rbx, %rdi
callq 0x3270
cmpq $0x200004, %rax         # imm = 0x200004
jae 0x7cba
movq %rax, %r15
shrq $0x2, %r15
movq %rbx, %rdi
callq 0x3160
xorl %eax, %eax
cmpq $0x80000, %rax          # imm = 0x80000
je 0x7c90
andl $0x0, (%r14,%rax,4)
incq %rax
jmp 0x7c7e
pushq $0x4
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x30b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x3110
jmp 0x7cb1
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x3110
leaq 0x1aea(%rip), %rdi      # 0x97b3
callq 0x30a0
pushq $0x1
popq %rdi
callq 0x33b0
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_li
V i_li(NgaState *vm) {
  guard(vm, 0, 1, 0);
  ACTIVE.sp++;
  ACTIVE.ip++;
  TOS = vm->memory[ACTIVE.ip];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rcx
movslq 0x200004(%rbx,%rax), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, 0x200004(%rbx,%rax)
movslq 0x20000c(%rbx,%rax), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x20000c(%rbx,%rax)
movl 0x4(%rbx,%rsi,4), %eax
movl %eax, 0x20001c(%rcx,%rdx,4)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_sw
V i_sw(NgaState *vm) {
  guard(vm, 2, 2, 0);
  CELL a;
  a = TOS;
  TOS = NOS;
  NOS = a;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rdx
movl %edx, %esi
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl 0x10(%rax,%rcx,4), %edx
movl 0x14(%rax,%rcx,4), %esi
movl %edx, 0x14(%rax,%rcx,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl %esi, 0x10(%rax,%rcx,4)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_pu
V i_pu(NgaState *vm) {
  guard(vm, 1, 0, 1);
  ACTIVE.rp++;
  TORS = TOS;
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rcx
movl %ecx, %esi
xorl %edx, %edx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rcx
movslq 0x200008(%rbx,%rax), %rdx
leaq 0x1(%rdx), %rsi
movl %esi, 0x200008(%rbx,%rax)
movslq 0x200004(%rbx,%rax), %rax
movl 0x200018(%rcx,%rax,4), %eax
movl %eax, 0x20041c(%rcx,%rdx,4)
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_po
V i_po(NgaState *vm) {
  guard(vm, 0, 1, -1);
  ACTIVE.sp++;
  TOS = TORS;
  ACTIVE.rp--;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
xorl %esi, %esi
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, (%rax)
movslq 0x4(%rax), %rdx
movl 0x414(%rax,%rdx,4), %edx
movl %edx, 0x18(%rax,%rcx,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
decl 0x200008(%rbx,%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_ca
V i_ca(NgaState *vm) {
  guard(vm, 1, 0, 1);
  ACTIVE.rp++;
  TORS = ACTIVE.ip;
  ACTIVE.ip = TOS - 1;
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rcx
movl %ecx, %esi
xorl %edx, %edx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq 0x4(%rax), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x4(%rax)
movl 0x8(%rax), %edx
movl %edx, 0x418(%rax,%rcx,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl 0x14(%rax,%rcx,4), %ecx
decl %ecx
movl %ecx, 0x8(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_cc
V i_cc(NgaState *vm) {
  guard(vm, 2, 0, 1);
  CELL a, b;
  a = TOS; i_dr(vm);  /* Target */
  b = TOS; i_dr(vm);  /* Flag   */
  if (b != 0) {
    ACTIVE.rp++;
    TORS = ACTIVE.ip;
    ACTIVE.ip = a - 1;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl 0x14(%rax,%rcx,4), %ebp
movq %rbx, %rdi
callq 0x7d7c
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl 0x14(%rax,%rcx,4), %r14d
movq %rbx, %rdi
callq 0x7d7c
testl %r14d, %r14d
je 0x8019
leaq 0x200004(%rbx), %rax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
leaq (%rax,%rcx), %rdx
movslq 0x4(%rax,%rcx), %rsi
leaq 0x1(%rsi), %rdi
movl %edi, 0x4(%rax,%rcx)
movl 0x8(%rax,%rcx), %ecx
movl %ecx, 0x418(%rdx,%rsi,4)
decl %ebp
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
movl %ebp, 0x8(%rax,%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_eq
V i_eq(NgaState *vm) {
  guard(vm, 2, 1, 0);
  if (ACTIVE.u != 0) {
    NOS = ((unsigned)NOS == (unsigned)TOS) ? -1 : 0;
    ACTIVE.u = 0;
  } else {
    NOS = (NOS == TOS) ? -1 : 0;
  }
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movl 0x10(%rax,%rcx,4), %edx
xorl %esi, %esi
cmpl 0x14(%rax,%rcx,4), %edx
sete %sil
negl %esi
cmpl $0x0, 0x10(%rax)
movl %esi, 0x10(%rax,%rcx,4)
je 0x80c1
leaq 0x200004(%rbx), %rax
movslq 0x2043a4(%rbx), %rcx
imulq $0x874, %rcx, %rcx      # imm = 0x874
andl $0x0, 0x10(%rax,%rcx)
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_fe
V i_fe(NgaState *vm) {
  guard(vm, 1, 1, 0);
  switch (TOS) {
    case -1: TOS = ACTIVE.sp - 1; break;
    case -2: TOS = ACTIVE.rp; break;
    case -3: TOS = IMAGE_SIZE; break;
    case -4: TOS = CELL_MIN; break;
    case -5: TOS = CELL_MAX; break;
    default: TOS = vm->memory[TOS]; break;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdx
movl %edx, %esi
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rdx
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
movslq 0x200018(%rdx,%rcx,4), %rdx
leal 0x5(%rdx), %esi
cmpl $0x4, %esi
ja 0x8299
leaq 0xdaf(%rip), %rdx       # 0x9020
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl $0x7ffffffe, %edx       # imm = 0x7FFFFFFE
jmp 0x829c
leal -0x1(%rcx), %edx
jmp 0x829c
movl $0x80000, %edx          # imm = 0x80000
jmp 0x829c
movl 0x4(%rax), %edx
jmp 0x829c
movl $0x80000001, %edx       # imm = 0x80000001
jmp 0x829c
movl (%rbx,%rdx,4), %edx
movl %edx, 0x14(%rax,%rcx,4)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_st
V i_st(NgaState *vm) {
  guard(vm, 2, 0, 0);
  vm->memory[TOS] = NOS;
  i_dr(vm);
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rcx
movslq 0x200004(%rbx,%rax), %rax
movl 0x200014(%rcx,%rax,4), %edx
movslq 0x200018(%rcx,%rax,4), %rax
movl %edx, (%rbx,%rax,4)
movq %rbx, %rdi
callq 0x7d7c
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_ad
V i_ad(NgaState *vm) {
  guard(vm, 2, 1, 0);
  if (ACTIVE.u != 0) {
    NOS = (unsigned)NOS + (unsigned)TOS;
    ACTIVE.u = 0;
  } else {
    NOS += TOS;
  }
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
cmpl $0x0, 0x10(%rax)
movslq (%rax), %rcx
je 0x8344
leaq 0x200004(%rbx), %rdx
movl 0x14(%rax,%rcx,4), %esi
addl %esi, 0x10(%rax,%rcx,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
andl $0x0, 0x10(%rdx,%rax)
jmp 0x834c
movl 0x14(%rax,%rcx,4), %edx
addl %edx, 0x10(%rax,%rcx,4)
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_di
V i_di(NgaState *vm) {
  guard(vm, 2, 2, 0);
  CELL a, b;
  a = TOS;
  b = NOS;
  if (b == 0) {
#ifdef ENABLE_ERROR
    if (vm->ErrorHandlers[6] != 0) {
    }
#endif
  }
  if (ACTIVE.u != 0) {
    TOS = (unsigned)b / (unsigned)a;
    NOS = (unsigned)b % (unsigned)a;
    ACTIVE.u = 0;
  } else {
    TOS = b / a;
    NOS = b % a;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rdx
movl %edx, %esi
xorl %ecx, %ecx
callq 0x35e7
leaq 0x200004(%rbx), %rcx
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rbx,%rax), %rsi
addq $0x200004, %rsi         # imm = 0x200004
movslq (%rsi), %rdi
movl 0x10(%rsi,%rdi,4), %eax
movl 0x14(%rsi,%rdi,4), %r8d
cmpl $0x0, 0x10(%rsi)
je 0x84a5
xorl %edx, %edx
divl %r8d
movl %eax, 0x14(%rsi,%rdi,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rcx,%rax), %rsi
movslq (%rcx,%rax), %rax
movl %edx, 0x10(%rsi,%rax,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
andl $0x0, 0x10(%rcx,%rax)
jmp 0x84c7
cltd
idivl %r8d
movl %eax, 0x14(%rsi,%rdi,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%rcx,%rax), %rsi
movslq (%rcx,%rax), %rax
movl %edx, 0x10(%rsi,%rax,4)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_sh
V i_sh(NgaState *vm) {
  guard(vm, 2, 1, 0);
  CELL y = TOS;
  CELL x = NOS;
  if (TOS < 0)
    NOS = NOS << (0 - TOS);
  else {
    if (ACTIVE.u != 0) {
      NOS = (unsigned)x >> (unsigned)y;
      ACTIVE.u = 0;
    } else {
      if (x < 0 && y > 0)
        NOS = x >> y | ~(~0U >> y);
      else
        NOS = x >> y;
    }
  }
  i_dr(vm);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rdx
movl 0x10(%rax,%rdx,4), %esi
movl 0x14(%rax,%rdx,4), %ecx
testl %ecx, %ecx
js 0x85ee
cmpl $0x0, 0x10(%rax)
je 0x85f8
shrl %cl, %esi
leaq 0x200004(%rbx), %rcx
movl %esi, 0x10(%rax,%rdx,4)
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
andl $0x0, 0x10(%rcx,%rax)
jmp 0x8611
negb %cl
shll %cl, %esi
movl %esi, 0x10(%rax,%rdx,4)
jmp 0x8611
movl %esi, %edi
sarl %cl, %edi
testl %ecx, %ecx
je 0x860d
testl %esi, %esi
jns 0x860d
pushq $-0x1
popq %rsi
shrl %cl, %esi
notl %esi
orl %esi, %edi
movl %edi, 0x10(%rax,%rdx,4)
movq %rbx, %rdi
popq %rbx
jmp 0x7d7c
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: i_zr
V i_zr(NgaState *vm) {
  guard(vm, 1, 0, 0);
  if (TOS == 0) {
    i_dr(vm);
    ACTIVE.ip = TORS;
    ACTIVE.rp--;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x35e7
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
addq %rbx, %rax
addq $0x200004, %rax         # imm = 0x200004
movslq (%rax), %rcx
cmpl $0x0, 0x14(%rax,%rcx,4)
jne 0x8688
leaq 0x200004(%rbx), %r14
movq %rbx, %rdi
callq 0x7d7c
movslq 0x2043a4(%rbx), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
leaq (%r14,%rax), %rcx
movslq 0x4(%r14,%rax), %rdx
movl 0x414(%rcx,%rdx,4), %ecx
movl %ecx, 0x8(%r14,%rax)
leal -0x1(%rdx), %ecx
movl %ecx, 0x4(%r14,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: verbose_details
V verbose_details(NgaState *vm, CELL opcode) {
  fprintf(stderr, "ip: %lld ", (long long)ACTIVE.ip);
  fprintf(stderr, "sp: %lld ", (long long)ACTIVE.sp);
  fprintf(stderr, "rp: %lld ", (long long)ACTIVE.rp);
  fprintf(stderr, "core: %lld ", (long long)vm->active);
  fprintf(stderr, "opcode: %lld\n", (long long)opcode);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x483d(%rip), %r15      # 0xcff8
movq (%r15), %rdi
movslq 0x2043a4(%r14), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
movslq 0x20000c(%r14,%rax), %rdx
leaq 0xac6(%rip), %rsi       # 0x92a1
xorl %eax, %eax
callq 0x3260
movq (%r15), %rdi
movslq 0x2043a4(%r14), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
movslq 0x200004(%r14,%rax), %rdx
leaq 0xaa9(%rip), %rsi       # 0x92ab
xorl %eax, %eax
callq 0x3260
movq (%r15), %rdi
movslq 0x2043a4(%r14), %rax
imulq $0x874, %rax, %rax      # imm = 0x874
movslq 0x200008(%r14,%rax), %rdx
leaq 0xa8c(%rip), %rsi       # 0x92b5
xorl %eax, %eax
callq 0x3260
movq (%r15), %rdi
movslq 0x2043a4(%r14), %rdx
leaq 0xa7e(%rip), %rsi       # 0x92bf
xorl %eax, %eax
callq 0x3260
movq (%r15), %rdi
movslq %ebx, %rdx
leaq 0xa76(%rip), %rsi       # 0x92cb
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x3260
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/vm/nga-c/retro.c
// Function: strlcat
size_t strlcat(char *dst, const char *src, size_t dsize) {
  const char *odst = dst;
  const char *osrc = src;
  size_t n = dsize;
  size_t dlen;

  /* Find the end of dst and adjust bytes left but don't go past end. */
  while (n-- != 0 && *dst != '\0')
    dst++;
  dlen = dst - odst;
  n = dsize - dlen;

  if (n-- == 0)
    return(dlen + strlen(src));
  while (*src != '\0') {
    if (n != 0) {
      *dst++ = *src;
      n--;
    }
    src++;
  }
  *dst = '\0';
  return(dlen + (src - osrc));  /* count does not include NUL */
}

// Assembly:
leaq (%rdi,%rdx), %rcx
xorl %eax, %eax
cmpq %rax, %rdx
je 0x887d
cmpb $0x0, (%rdi,%rax)
je 0x8877
incq %rax
jmp 0x8867
addq %rdi, %rax
movq %rax, %rcx
pushq %rbx
movq %rcx, %rbx
subq %rdi, %rbx
cmpq %rdx, %rbx
jne 0x8893
movq %rsi, %rdi
callq 0x3120
jmp 0x88be
movq %rbx, %rdi
notq %rdi
addq %rdx, %rdi
xorl %eax, %eax
movb (%rsi,%rax), %dl
testb %dl, %dl
je 0x88bb
testq %rdi, %rdi
je 0x88b4
movb %dl, (%rcx)
incq %rcx
decq %rdi
jmp 0x88b6
xorl %edi, %edi
incq %rax
jmp 0x889e
movb $0x0, (%rcx)
addq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTPriorityQueue_test.c
// Function: shuffle
void shuffle(int* array[], int size) {
	for (int i = 0; i < size; i++) {
		int new_pos = i + rand() / (RAND_MAX / (size - i) + 1);
		int* temp = array[new_pos];
		array[new_pos] = array[i];
		array[i] = temp;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
movl $0x0, %r12d
cmovgl %esi, %r12d
cmpq %r15, %r12
je 0x3ad7
callq 0x2290
movl %eax, %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
idivl %ebx
movl %eax, %esi
incl %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
addq %r15, %rax
movq (%r14,%rax,8), %rcx
movq (%r14,%r15,8), %rdx
movq %rdx, (%r14,%rax,8)
movq %rcx, (%r14,%r15,8)
incq %r15
decl %ebx
jmp 0x3a9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTPriorityQueue_test.c
// Function: test_insert
void test_insert(void) {
	PriorityQueue pqueue = pqueue_create(compare_ints, NULL, NULL);
	int N = 1000;
	int* array = malloc(N * sizeof(*array));					// Στο pqueue θα προσθέσουμε pointers προς τα στοιχεία αυτού του πίνακα

	// insert N στοιχεία
	for (int i = 0; i < N; i++) {
		array[i] = i;
		pqueue_insert(pqueue, &array[i]);
		TEST_ASSERT(pqueue_size(pqueue) == i+1);			// Το size ενημερώθηκε;
		TEST_ASSERT(pqueue_max(pqueue) == &array[i]);	// Εισαγωγή σε αύξουσα σειρά, το στοιχείο που μόλις βάλαμε πρέπει να είναι στην κορυφή
	}

	pqueue_destroy(pqueue);
	free(array);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0x20b(%rip), %rdi      # 0x3af2
xorl %esi, %esi
xorl %edx, %edx
callq 0x447c
movq %rax, %rbx
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21a0
movq %rax, %rbp
pushq $0x1
popq %r14
leaq 0x15f7(%rip), %r15      # 0x5318
leaq 0x179a(%rip), %r12      # 0x54c2
pushq $0x47
popq %r13
movq %rax, (%rsp)
cmpq $0x3e9, %r14            # imm = 0x3E9
je 0x3db1
leal -0x1(%r14), %eax
movl %eax, (%rbp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4529
movq %rbx, %rdi
callq 0x4512
movl %eax, %eax
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
movq %r15, %rsi
pushq $0x46
popq %rdx
movq %r12, %rcx
leaq 0x1641(%rip), %r8       # 0x53af
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3dac
movq %rbx, %rdi
callq 0x451a
xorl %edi, %edi
cmpq %rax, %rbp
sete %dil
movq %r15, %rsi
movl %r13d, %edx
movq %r12, %rcx
leaq 0x1630(%rip), %r8       # 0x53ca
xorl %eax, %eax
callq 0x23ac
incq %r14
addq $0x4, %rbp
testl %eax, %eax
jne 0x3d30
callq 0x2bd0
movq %rbx, %rdi
callq 0x46f7
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTPriorityQueue_test.c
// Function: test_remove
void test_remove(void) {
	PriorityQueue pqueue = pqueue_create(compare_ints, free, NULL);

	// προσθήκη δεδομένων, τυχαία σειρά
	int N = 10;
	int** array = malloc(N * sizeof(*array));
	for (int i = 0; i < N; i++)
		array[i] = create_int(i);
	shuffle(array, N);

	for (int i = 0; i < N; i++)
		pqueue_insert(pqueue, array[i]);

	// Διαδοχικά remove ώστε να συμβούν και resizes
	for (int i = N-1; i >= 0; i--) {
		int* value = pqueue_max(pqueue);
		TEST_ASSERT(*value == i);
		pqueue_remove_max(pqueue);
		TEST_ASSERT(pqueue_size(pqueue) == i);
	}

	pqueue_destroy(pqueue);

	// remove από ουρά χωρίς συνάρτηση destroy
	pqueue = pqueue_create(compare_ints, NULL, NULL);
	pqueue_insert(pqueue, &N);
	TEST_ASSERT(pqueue_max(pqueue) == &N);
	pqueue_remove_max(pqueue);
	pqueue_destroy(pqueue);
	free(array);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0x2f0(%rip), %rdi      # 0x3af2
movq 0x51d7(%rip), %rsi      # 0x8fc0
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x447c
movq %rax, %r14
movl $0xa, 0x4(%rsp)
pushq $0x50
popq %rdi
callq 0x21a0
movq %rax, %rbx
cmpq $0xa, %r15
je 0x3e20
movl %r15d, %edi
callq 0x3ae3
movq %rax, (%rbx,%r15,8)
incq %r15
jmp 0x3e09
pushq $0xa
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3a81
xorl %r15d, %r15d
cmpq $0xa, %r15
je 0x3e47
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x4529
incq %r15
jmp 0x3e30
leaq 0x14ca(%rip), %r15      # 0x5318
leaq 0x166d(%rip), %r12      # 0x54c2
pushq $0x60
popq %r13
testl %ebp, %ebp
jle 0x3ec2
decl %ebp
movq %r14, %rdi
callq 0x451a
xorl %edi, %edi
cmpl (%rax), %ebp
sete %dil
movq %r15, %rsi
pushq $0x5e
popq %rdx
movq %r12, %rcx
leaq 0x156b(%rip), %r8       # 0x53ea
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ebd
movq %r14, %rdi
callq 0x45a4
movq %r14, %rdi
callq 0x4512
xorl %edi, %edi
cmpl %eax, %ebp
sete %dil
movq %r15, %rsi
movl %r13d, %edx
movq %r12, %rcx
leaq 0x1544(%rip), %r8       # 0x53f6
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
jne 0x3e59
callq 0x2bd0
movq %r14, %rdi
callq 0x46f7
leaq -0x3df(%rip), %rdi      # 0x3af2
xorl %esi, %esi
xorl %edx, %edx
callq 0x447c
movq %rax, %r14
leaq 0x4(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x4529
movq %r14, %rdi
callq 0x451a
xorl %edi, %edi
cmpq %r15, %rax
sete %dil
leaq 0x1413(%rip), %rsi      # 0x5318
leaq 0x15b6(%rip), %rcx      # 0x54c2
leaq 0x14fc(%rip), %r8       # 0x540f
pushq $0x68
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ebd
movq %r14, %rdi
callq 0x45a4
movq %r14, %rdi
callq 0x46f7
movq %rbx, %rdi
callq 0x22b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq