LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lutf8lib.c
// Function: iter_codes
static int iter_codes (lua_State *L) {
  luaL_checkstring(L, 1);
  lua_pushcfunction(L, iter_aux);
  lua_pushvalue(L, 1);
  lua_pushinteger(L, 0);
  return 3;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
leaq 0x112(%rip), %rsi       # 0x1fc19
movq %rbx, %rdi
xorl %edx, %edx
callq 0x6591
movq %rbx, %rdi
movl $0x1, %esi
callq 0x5f5b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x63e6
movl $0x3, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lutf8lib.c
// Function: utf8_decode
static const char *utf8_decode (const char *o, int *val) {
  static const unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF};
  const unsigned char *s = (const unsigned char *)o;
  unsigned int c = s[0];
  unsigned int res = 0;  /* final result */
  if (c < 0x80)  /* ascii? */
    res = c;
  else {
    int count = 0;  /* to count number of continuation bytes */
    while (c & 0x40) {  /* still have continuation bytes? */
      int cc = s[++count];  /* read next byte */
      if ((cc & 0xC0) != 0x80)  /* not a continuation byte? */
        return NULL;  /* invalid byte sequence */
      res = (res << 6) | (cc & 0x3F);  /* add lower 6 bits from cont. byte */
      c <<= 1;  /* to test next bit */
    }
    res |= ((c & 0x7F) << (count * 5));  /* add first byte */
    if (count > 3 || res > MAXUNICODE || res <= limits[count])
      return NULL;  /* invalid byte sequence */
    s += count;  /* skip continuation bytes read */
  }
  if (val) *val = res;
  return (const char *)s + 1;  /* +1 to include first byte */
}

// Assembly:
pushq %rbp
pushq %rbx
movq %rdi, %rax
movzbl (%rdi), %r8d
testb %r8b, %r8b
jns 0x1fbc5
leaq 0x3f28(%rip), %r9       # 0x23a70
xorl %edx, %edx
xorl %r10d, %r10d
xorl %edi, %edi
testb $0x40, %r8b
je 0x1fb93
movzbl 0x1(%rax,%r10), %r11d
incq %r10
movl %r11d, %ebx
andl $-0x40, %ebx
cmpl $0x80, %ebx
sete %cl
movl %edi, %ebp
shll $0x6, %ebp
andl $0x3f, %r11d
orl %ebp, %r11d
shll %cl, %r8d
addq $0x4, %r9
addl $0x5, %edx
cmpl $0x80, %ebx
cmovel %r11d, %edi
je 0x1fb4f
xorl %ecx, %ecx
jmp 0x1fbbe
andl $0x3f, %r8d
movl %edx, %ecx
shll %cl, %r8d
orl %r8d, %edi
xorl %ecx, %ecx
cmpq $0x3, %r10
ja 0x1fbbe
cmpl $0x10ffff, %edi         # imm = 0x10FFFF
ja 0x1fbbe
xorl %edx, %edx
cmpl (%r9), %edi
seta %cl
cmovaq %r10, %rdx
addq %rdx, %rax
movl %edi, %r8d
testb %cl, %cl
je 0x1fbd3
testq %rsi, %rsi
je 0x1fbcd
movl %r8d, (%rsi)
incq %rax
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0x1fbd0
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lutf8lib.c
// Function: iter_aux
static int iter_aux (lua_State *L) {
  size_t len;
  const char *s = luaL_checklstring(L, 1, &len);
  lua_Integer n = lua_tointeger(L, 2) - 1;
  if (n < 0)  /* first iteration? */
    n = 0;  /* start from here */
  else if (n < (lua_Integer)len) {
    n++;  /* skip current byte */
    while (iscont(s + n)) n++;  /* and its continuations */
  }
  if (n >= (lua_Integer)len)
    return 0;  /* no more codepoints */
  else {
    int code;
    const char *next = utf8_decode(s + n, &code);
    if (next == NULL || iscont(next))
      return luaL_error(L, "invalid UTF-8 code");
    lua_pushinteger(L, n + 1);
    lua_pushinteger(L, code);
    return 2;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x14535
movq %rax, %r15
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x61d3
movl $0x0, %r12d
testq %rax, %rax
jle 0x1fc79
cmpq 0x10(%rsp), %rax
jle 0x1fc65
decq %rax
movq %rax, %r12
jmp 0x1fc79
decq %rax
movq %rax, %r12
movb 0x1(%r15,%r12), %al
andb $-0x40, %al
incq %r12
negb %al
jo 0x1fc6b
cmpq 0x10(%rsp), %r12
jge 0x1fcd4
addq %r12, %r15
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0x1fb2f
testq %rax, %rax
je 0x1fc9d
movb (%rax), %al
andb $-0x40, %al
negb %al
jno 0x1fcb3
leaq 0x3d96(%rip), %rsi      # 0x23a3a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13f8e
movl %eax, %r14d
jmp 0x1fcd4
incq %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x63e6
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x63e6
movl $0x2, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: setpath
static void setpath (lua_State *L, const char *fieldname, const char *envname1,
                                   const char *envname2, const char *def) {
  const char *path = getenv(envname1);
  if (path == NULL)  /* no environment variable? */
    path = getenv(envname2);  /* try alternative name */
  if (path == NULL || noenv(L))  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP,
                              LUA_PATH_SEP AUXMARK LUA_PATH_SEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x5040
movq %rax, %r12
testq %rax, %rax
jne 0x1ff21
movq %r13, %rdi
callq 0x5040
movq %rax, %r12
testq %r12, %r12
je 0x1ff5a
leaq 0x3d9c(%rip), %rdx      # 0x23cc9
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x6777
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x6223
movl %eax, %ebp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
testl %ebp, %ebp
je 0x1ff67
movq %r14, %rdi
movq %r15, %rsi
callq 0x645b
jmp 0x1ffb4
leaq 0x3d52(%rip), %rdx      # 0x23cc0
leaq 0x3d4e(%rip), %rcx      # 0x23cc3
movq %r14, %rdi
movq %r12, %rsi
callq 0x152db
leaq 0x3d40(%rip), %rdx      # 0x23cc7
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x152db
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5da2
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b3f
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: gctm
static int gctm (lua_State *L) {
  lua_Integer n = luaL_len(L, 1);
  for (; n >= 1; n--) {  /* for each handle, in reverse order */
    lua_rawgeti(L, 1, n);  /* get handle CLIBS[n] */
    lsys_unloadlib(lua_touserdata(L, -1));
    lua_pop(L, 1);  /* pop handle */
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0x14f6c
testq %rax, %rax
jle 0x20022
movq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x684b
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x633d
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
leaq -0x1(%r14), %rax
cmpq $0x1, %r14
movq %rax, %r14
jg 0x1ffeb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: ll_loadlib
static int ll_loadlib (lua_State *L) {
  const char *path = luaL_checkstring(L, 1);
  const char *init = luaL_checkstring(L, 2);
  int stat = lookforfunc(L, path, init);
  if (stat == 0)  /* no errors? */
    return 1;  /* return the loaded function */
  else {  /* error; error message is on stack top */
    lua_pushnil(L);
    lua_insert(L, -2);
    lua_pushstring(L, (stat == ERRLIB) ?  LIB_FAIL : "init");
    return 3;  /* return nil, error message, and where */
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x14535
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x20152
testl %eax, %eax
je 0x200a8
movl %eax, %r14d
movq %rbx, %rdi
callq 0x63bd
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x5da2
cmpl $0x1, %r14d
leaq 0x3b47(%rip), %rax      # 0x23bd7
leaq 0x1031(%rip), %rsi      # 0x210c8
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x645b
movl $0x3, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: ll_searchpath
static int ll_searchpath (lua_State *L) {
  const char *f = searchpath(L, luaL_checkstring(L, 1),
                                luaL_checkstring(L, 2),
                                luaL_optstring(L, 3, "."),
                                luaL_optstring(L, 4, LUA_DIRSEP));
  if (f != NULL) return 1;
  else {  /* error message is on top of the stack */
    lua_pushnil(L);
    lua_insert(L, -2);
    return 2;  /* return nil + error message */
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r15
leaq 0x20f6(%rip), %rdx      # 0x221dd
movq %rbx, %rdi
movl $0x3, %esi
xorl %ecx, %ecx
callq 0x144dc
movq %rax, %r12
leaq 0x2770(%rip), %rdx      # 0x22870
movq %rbx, %rdi
movl $0x4, %esi
xorl %ecx, %ecx
callq 0x144dc
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x201ea
testq %rax, %rax
jne 0x20147
movq %rbx, %rdi
callq 0x63bd
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x5da2
movl $0x2, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: lookforfunc
static int lookforfunc (lua_State *L, const char *path, const char *sym) {
  void *reg = checkclib(L, path);  /* check loaded C libraries */
  if (reg == NULL) {  /* must load library? */
    reg = lsys_load(L, path, *sym == '*');  /* global symbols if 'sym'=='*' */
    if (reg == NULL) return ERRLIB;  /* unable to load library */
    addtoclib(L, path, reg);
  }
  if (*sym == '*') {  /* loading only library (no function)? */
    lua_pushboolean(L, 1);  /* return 'true' */
    return 0;  /* no errors */
  }
  else {
    lua_CFunction f = lsys_sym(L, reg, sym);
    if (f == NULL)
      return ERRFUNC;  /* unable to find function */
    lua_pushcfunction(L, f);  /* else create new function */
    return 0;  /* no errors */
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x3bb1(%rip), %rdx      # 0x23d18
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x6889
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rdx
callq 0x6777
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x633d
movq %rax, %r15
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x5d51
testq %r15, %r15
je 0x201ba
cmpb $0x2a, (%r14)
jne 0x201d0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x660e
xorl %eax, %eax
jmp 0x201e4
leaq 0x3a1d(%rip), %rsi      # 0x23bde
movq %rbx, %rdi
callq 0x645b
movl $0x1, %eax
jmp 0x201e4
leaq 0x3a07(%rip), %rsi      # 0x23bde
movq %rbx, %rdi
callq 0x645b
movl $0x2, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: searchpath
static const char *searchpath (lua_State *L, const char *name,
                                             const char *path,
                                             const char *sep,
                                             const char *dirsep) {
  luaL_Buffer msg;  /* to build error message */
  luaL_buffinit(L, &msg);
  if (*sep != '\0')  /* non-empty separator? */
    name = luaL_gsub(L, name, sep, dirsep);  /* replace it by 'dirsep' */
  while ((path = pushnexttemplate(L, path)) != NULL) {
    const char *filename = luaL_gsub(L, lua_tostring(L, -1),
                                     LUA_PATH_MARK, name);
    lua_remove(L, -2);  /* remove path template */
    if (readable(filename))  /* does file exist and is readable? */
      return filename;  /* return that file name */
    lua_pushfstring(L, "\n\tno file '%s'", filename);
    lua_remove(L, -2);  /* remove file name */
    luaL_addvalue(&msg);  /* concatenate error msg. entry */
  }
  luaL_pushresult(&msg);  /* create error message */
  return NULL;  /* not found */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0x149f7
cmpb $0x0, (%r13)
je 0x2022f
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x152db
movq %rax, %r14
movq %r15, %rbp
movzbl (%rbp), %eax
cmpl $0x3b, %eax
jne 0x20243
incq %rbp
incq %r15
jmp 0x20232
testl %eax, %eax
jne 0x2024c
xorl %r15d, %r15d
jmp 0x20283
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x5170
movq %rax, %r12
testq %rax, %rax
jne 0x2026f
movq %rbp, %rdi
callq 0x5150
movq %rax, %r12
addq %rbp, %r12
movq %r12, %rdx
subq %r15, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x63fa
movq %r12, %r15
testq %r15, %r15
je 0x20341
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6249
movq %rbx, %rdi
movq %rax, %rsi
leaq 0x10be(%rip), %rdx      # 0x21366
movq %r14, %rcx
callq 0x152db
movq %rax, %rbp
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5da2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
movq %rbp, %rdi
leaq 0xd52(%rip), %rsi       # 0x2102e
callq 0x52f0
movq %rax, %r12
testq %rax, %rax
je 0x202f6
movq %r12, %rdi
callq 0x5140
movq %rbp, %r13
jmp 0x20336
movq %rbx, %rdi
leaq 0x3919(%rip), %rsi      # 0x23c19
movq %rbp, %rdx
xorl %eax, %eax
callq 0x64e8
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5da2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
leaq 0x8(%rsp), %rdi
callq 0x14958
movq %r13, %rbp
testq %r12, %r12
je 0x2022f
jmp 0x2034d
leaq 0x8(%rsp), %rdi
callq 0x148ef
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: searcher_preload
static int searcher_preload (lua_State *L) {
  const char *name = luaL_checkstring(L, 1);
  lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD");
  if (lua_getfield(L, -1, name) == LUA_TNIL)  /* not found? */
    lua_pushfstring(L, "\n\tno field package.preload['%s']", name);
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r14
leaq 0x382a(%rip), %rdx      # 0x23ba9
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x6777
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0x6777
testl %eax, %eax
jne 0x203b4
leaq 0x3881(%rip), %rsi      # 0x23c28
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x64e8
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: searcher_Lua
static int searcher_Lua (lua_State *L) {
  const char *filename;
  const char *name = luaL_checkstring(L, 1);
  filename = findfile(L, name, "path", LUA_LSUBSEP);
  if (filename == NULL) return 1;  /* module not found in this path */
  return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
leaq 0x3753(%rip), %rdx      # 0x23b2e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2054d
testq %rax, %rax
je 0x20415
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x14b39
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x205ba
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: searcher_C
static int searcher_C (lua_State *L) {
  const char *name = luaL_checkstring(L, 1);
  const char *filename = findfile(L, name, "cpath", LUA_CSUBSEP);
  if (filename == NULL) return 1;  /* module not found in this path */
  return checkload(L, (loadfunc(L, filename, name) == 0), filename);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r15
leaq 0x36ed(%rip), %rdx      # 0x23b2d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2054d
testq %rax, %rax
je 0x20479
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2061f
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq %rbx, %rdi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x205ba
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: searcher_Croot
static int searcher_Croot (lua_State *L) {
  const char *filename;
  const char *name = luaL_checkstring(L, 1);
  const char *p = strchr(name, '.');
  int stat;
  if (p == NULL) return 0;  /* is root */
  lua_pushlstring(L, name, p - name);
  filename = findfile(L, lua_tostring(L, -1), "cpath", LUA_CSUBSEP);
  if (filename == NULL) return 1;  /* root not found */
  if ((stat = loadfunc(L, filename, name)) != 0) {
    if (stat != ERRFUNC)
      return checkload(L, 0, filename);  /* real error */
    else {  /* open function not found */
      lua_pushfstring(L, "\n\tno module '%s' in file '%s'", name, filename);
      return 1;
    }
  }
  lua_pushstring(L, filename);  /* will be 2nd argument to module */
  return 2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x1, %esi
xorl %edx, %edx
callq 0x14535
movq %rax, %r14
movq %rax, %rdi
movl $0x2e, %esi
callq 0x5170
testq %rax, %rax
je 0x20535
subq %r14, %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x63fa
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6249
leaq 0x3652(%rip), %rdx      # 0x23b2d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2054d
testq %rax, %rax
je 0x2051c
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2061f
testl %eax, %eax
je 0x20524
cmpl $0x2, %eax
jne 0x2053e
leaq 0x3796(%rip), %rsi      # 0x23ca2
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x64e8
movl $0x1, %r15d
jmp 0x20535
movq %rbx, %rdi
movq %r15, %rsi
callq 0x645b
movl $0x2, %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x205ba
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: findfile
static const char *findfile (lua_State *L, const char *name,
                                           const char *pname,
                                           const char *dirsep) {
  const char *path;
  lua_getfield(L, lua_upvalueindex(1), pname);
  path = lua_tostring(L, -1);
  if (path == NULL)
    luaL_error(L, "'package.%s' must be a string", pname);
  return searchpath(L, name, path, ".", dirsep);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfff0b9d7, %esi       # imm = 0xFFF0B9D7
callq 0x6777
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6249
movq %rax, %r12
testq %rax, %rax
jne 0x20593
leaq 0x36c3(%rip), %rsi      # 0x23c49
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x13f8e
leaq 0x1c43(%rip), %rcx      # 0x221dd
leaq 0x22cf(%rip), %r8       # 0x22870
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x201ea
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: checkload
static int checkload (lua_State *L, int stat, const char *filename) {
  if (stat) {  /* module loaded successfully? */
    lua_pushstring(L, filename);  /* will be 2nd argument to module */
    return 2;  /* return open function and file name */
  }
  else
    return luaL_error(L, "error loading module '%s' from file '%s':\n\t%s",
                          lua_tostring(L, 1), filename, lua_tostring(L, -1));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
testl %esi, %esi
je 0x205df
movq %r14, %rdi
movq %rbx, %rsi
callq 0x645b
movl $0x2, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x6249
movq %rax, %r15
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6249
leaq 0x3660(%rip), %rsi      # 0x23c67
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x13f8e
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/loadlib.c
// Function: loadfunc
static int loadfunc (lua_State *L, const char *filename, const char *modname) {
  const char *openfunc;
  const char *mark;
  modname = luaL_gsub(L, modname, ".", LUA_OFSEP);
  mark = strchr(modname, *LUA_IGMARK);
  if (mark) {
    int stat;
    openfunc = lua_pushlstring(L, modname, mark - modname);
    openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc);
    stat = lookforfunc(L, filename, openfunc);
    if (stat != ERRFUNC) return stat;
    modname = mark + 1;  /* else go ahead and try old-style name */
  }
  openfunc = lua_pushfstring(L, LUA_POF"%s", modname);
  return lookforfunc(L, filename, openfunc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1ba9(%rip), %rax      # 0x221dd
leaq 0x365a(%rip), %rcx      # 0x23c95
movq %rdx, %rsi
movq %rax, %rdx
callq 0x152db
movq %rax, %r15
movq %rax, %rdi
movl $0x2d, %esi
callq 0x5170
testq %rax, %rax
je 0x2069d
movq %rax, %r12
movq %rax, %rdx
subq %r15, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x63fa
leaq 0x3621(%rip), %rsi      # 0x23c97
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x64e8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x20152
incq %r12
cmpl $0x2, %eax
cmoveq %r12, %r15
jne 0x206ca
leaq 0x35f3(%rip), %rsi      # 0x23c97
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x64e8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20152
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: Pair_new
int Pair_new(lua_State *L) {

  // Extract the x, y data from the stack.
  luaL_checktype(L, 2, LUA_TTABLE);
      // stack = [self, p]
  lua_rawgeti(L, 2, 1);  // 2, 1 = idx in stack, idx in table
      // stack = [self, p, p[1]]
  lua_rawgeti(L, 2, 2);
      // stack = [self, p, p[1], p[2]]
  lua_Number x = lua_tonumber(L, -2);  // p[1]
  lua_Number y = lua_tonumber(L, -1);  // p[2]
  lua_settop(L, 0);
      // stack = []

  // Create a Pair instance and set its metatable.
  Pair *pair = (Pair *)lua_newuserdata(L, sizeof(Pair));
      // stack = [pair]
  luaL_getmetatable(L, Pair_metatable);
      // stack = [pair, mt]
  lua_setmetatable(L, 1);
      // stack = [pair]

  // Set up the C data.
  pair->x = x;
  pair->y = y;

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x2, %esi
movl $0x5, %edx
callq 0x1456f
movl $0x1, %edx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x684b
movl $0x2, %edx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x684b
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
xorl %edx, %edx
callq 0x6182
movsd %xmm0, -0x20(%rbp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6182
movsd %xmm0, -0x18(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d51
movl $0x10, %esi
movq %rbx, %rdi
callq 0x727a
movq %rax, %r14
leaq 0x713(%rip), %rdx       # 0x2108d
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x6777
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6d47
movsd -0x20(%rbp), %xmm0
movsd %xmm0, (%r14)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x8(%r14)
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: push_new_pair
void push_new_pair(lua_State *L, lua_Number x, lua_Number y) {

  // Clear the stack.
  lua_settop(L, 0);
    // stack = []

  // Set up the new resulting Pair instance.
  lua_newtable(L);
    // stack = [t (the new table)]
  lua_pushnumber(L, x);
    // stack = [t, x]
  lua_rawseti(L, -2, 1);  // t[1] = x
    // stack = [t]
  lua_pushnumber(L, y);
    // stack = [t, y]
  lua_rawseti(L, -2, 2);  // t[2] = y
    // stack = [t]
  lua_pushvalue(L, -1);
    // stack = [t, t]
  Pair_new(L);
    // stack = [new Pair from t]
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, -0x18(%rbp)
movsd %xmm0, -0x10(%rbp)
movq %rdi, %rbx
xorl %esi, %esi
callq 0x5d51
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x68d6
movq %rbx, %rdi
movsd -0x10(%rbp), %xmm0
callq 0x63d1
movl $0x1, %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6c80
movq %rbx, %rdi
movsd -0x18(%rbp), %xmm0
callq 0x63d1
movl $0x2, %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6c80
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5f5b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x208f0
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: Pair_mt_index
int Pair_mt_index(lua_State *L) {

  // Expected: stack = [self, key]
  Pair *pair = (Pair *)luaL_checkudata(L, 1, Pair_metatable);

  // Find the key value as either 1 (x) or 2 (y).
  int key = 0;
  int t = lua_type(L, 2);
  if (t == LUA_TNUMBER) {
    int ok;
    key = (int)lua_tointegerx(L, 2, &ok);
    if (!ok || (key != 1 && key != 2)) key = 0;
  } else if (t == LUA_TSTRING) {
    const char *str_key = lua_tostring(L, 2);
    if (strcmp(str_key, "x") == 0) key = 1;
    if (strcmp(str_key, "y") == 0) key = 2;
  }

  // Push the value.
  if (key) {
    lua_pushnumber(L, key == 1 ? pair->x : pair->y);
  } else {
    lua_pushnil(L);
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x63c(%rip), %rdx       # 0x2108d
movl $0x1, %esi
callq 0x14393
movq %rax, %r14
movl $0x2, %r12d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5f7f
cmpl $0x4, %eax
je 0x20aaa
xorl %r13d, %r13d
cmpl $0x3, %eax
jne 0x20ae9
leaq -0x2c(%rbp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x61d3
leal -0x3(%rax), %ecx
xorl %r13d, %r13d
cmpl $-0x2, %ecx
cmovael %eax, %r13d
movl (%r15), %eax
testl %eax, %eax
cmovel %eax, %r13d
jmp 0x20ae9
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x6249
movq %rax, %r15
leaq 0x257a(%rip), %rsi      # 0x2303d
movq %rax, %rdi
callq 0x5290
xorl %r13d, %r13d
testl %eax, %eax
sete %r13b
leaq 0x26bf(%rip), %rsi      # 0x2319a
movq %r15, %rdi
callq 0x5290
testl %eax, %eax
cmovel %r12d, %r13d
testl %r13d, %r13d
je 0x20b07
cmpl $0x1, %r13d
je 0x20af8
addq $0x8, %r14
movsd (%r14), %xmm0
movq %rbx, %rdi
callq 0x63d1
jmp 0x20b0f
movq %rbx, %rdi
callq 0x63bd
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: Pair_mt_add
int Pair_mt_add(lua_State *L) {

  // Expected: stack = [self, other]
  // other may be a Pair or a table of the form {x, y}.
  
  // Extract the pairs p, q from the stack.
  Pair *pair = (Pair *)luaL_checkudata(L, 1, Pair_metatable);
  lua_Number p[2] = {pair->x, pair->y};
  lua_Number q[2];
  for (int i = 0; i < 2; ++i) {
    lua_pushnumber(L, i + 1);
      // stack = [self, other, i + 1]
    lua_gettable(L, 2);
      // stack = [self, other, other[i + 1]]
    if (lua_type(L, -1) != LUA_TNUMBER) {
      return luaL_argerror(L, 2, "bad 2nd addend");
    }
    q[i] = lua_tonumber(L, -1);
    lua_pop(L, 1);
      // stack = [self, other]
  }
  lua_settop(L, 0);
    // stack = []

  // Set up a new table with the sum.
  push_new_pair(L, p[0] + q[0], p[1] + q[1]);

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x553(%rip), %rdx       # 0x2108d
movl $0x1, %esi
callq 0x14393
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x1399(%rip), %xmm0     # 0x21ef8
movq %rbx, %rdi
callq 0x63d1
movq %rbx, %rdi
movl $0x2, %esi
callq 0x6710
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5f7f
cmpl $0x3, %eax
jne 0x20bec
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6182
movsd %xmm0, -0x40(%rbp,%r15,8)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
testq %r15, %r15
setne %r14b
jne 0x20c05
leal 0x2(%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq %rbx, %rdi
callq 0x63d1
movq %rbx, %rdi
movl $0x2, %esi
callq 0x6710
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5f7f
incq %r15
cmpl $0x3, %eax
je 0x20b89
jmp 0x20bef
xorl %r14d, %r14d
leaq 0x3126(%rip), %rdx      # 0x23d1c
movq %rbx, %rdi
movl $0x2, %esi
callq 0x13ea8
jmp 0x20c05
testb %r14b, %r14b
je 0x20c35
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d51
movsd -0x28(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
addsd -0x38(%rbp), %xmm1
movq %rbx, %rdi
callq 0x209b7
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: Pair_mt_mul
int Pair_mt_mul(lua_State *L) {

  // Expected: stack = [self, scalar]

  // Extract the needed values.
  Pair *pair = (Pair *)luaL_checkudata(L, 1, Pair_metatable);
  lua_Number scalar = luaL_checknumber(L, 2);

  // Set up the new resulting Pair instance.
  push_new_pair(L, pair->x * scalar, pair->y * scalar);

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x43c(%rip), %rdx       # 0x2108d
movl $0x1, %esi
callq 0x14393
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x145d6
movapd %xmm0, %xmm1
movsd (%r14), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x8(%r14), %xmm1
movq %rbx, %rdi
callq 0x209b7
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch4/Pair.c
// Function: Pair_mt_eq
int Pair_mt_eq(lua_State *L) {

  // Expected: stack = [self (p), other (q)]

  // Extract the pairs p, q from the stack.
  Pair *p = (Pair *)luaL_checkudata(L, 1, Pair_metatable);
  Pair *q = (Pair *)luaL_testudata(L, 2, Pair_metatable);

  // Push true or false onto the stack.
  if (q == NULL) {
    lua_pushboolean(L, 0);  // If q is not a Pair, return false.
  } else {
    lua_pushboolean(L, p->x == q->x && p->y == q->y);
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3e9(%rip), %r15       # 0x2108d
movl $0x1, %esi
movq %r15, %rdx
callq 0x14393
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x14320
xorl %esi, %esi
testq %rax, %rax
je 0x20cec
movsd (%r14), %xmm0
ucomisd (%rax), %xmm0
jne 0x20cec
jp 0x20cec
movsd 0x8(%rax), %xmm0
cmpeqsd 0x8(%r14), %xmm0
movq %xmm0, %rsi
andl $0x1, %esi
movq %rbx, %rdi
callq 0x660e
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/macro11.c
// Function: print_version
static void print_version(
    FILE *strm)
{
    fprintf(strm, "macro11 - portable MACRO11 assembler for DEC PDP-11\n");
    fprintf(strm, "  Version %s\n", VERSIONSTR);
    fprintf(strm, "  Copyright 2001 Richard Krehbiel,\n");
    fprintf(strm, "  modified 2009 by Joerg Hoppe,\n");
    fprintf(strm, "  modified 2015 by Olaf 'Rhialto' Seibert.\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xc176(%rip), %rdi      # 0xf2a8
movl $0x34, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x22d0
leaq 0xc192(%rip), %rsi      # 0xf2dd
leaq 0xc199(%rip), %rdx      # 0xf2eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21e0
leaq 0xc19b(%rip), %rdi      # 0xf2fe
movl $0x23, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x22d0
leaq 0xc1a6(%rip), %rdi      # 0xf322
movl $0x20, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x22d0
leaq 0xc1ae(%rip), %rdi      # 0xf343
movl $0x2b, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
jmp 0x22d0
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/macro11.c
// Function: enable_tf
static void enable_tf(
    char *opt,
    int tf)
{
    if (strcmp(opt, "AMA") == 0)
        enabl_ama = tf;
    else if (strcmp(opt, "GBL") == 0)
        enabl_gbl = tf;
    else if (strcmp(opt, "ME") == 0)
        list_me = tf;
    else if (strcmp(opt, "BEX") == 0)
        list_bex = tf;
    else if (strcmp(opt, "MD") == 0)
        list_md = tf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0xc729(%rip), %rsi      # 0xf8e1
callq 0x21d0
testl %eax, %eax
je 0x3216
leaq 0xc7be(%rip), %rsi      # 0xf986
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
je 0x321f
leaq 0xc194(%rip), %rsi      # 0xf36f
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
je 0x3228
leaq 0xc184(%rip), %rsi      # 0xf372
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
je 0x3231
leaq 0xc175(%rip), %rsi      # 0xf376
movq %r14, %rdi
callq 0x21d0
testl %eax, %eax
jne 0x323a
leaq 0x12860(%rip), %rax     # 0x15a74
jmp 0x3238
leaq 0x1295f(%rip), %rax     # 0x15b7c
jmp 0x3238
leaq 0x11f82(%rip), %rax     # 0x151a8
jmp 0x3238
leaq 0x12849(%rip), %rax     # 0x15a78
jmp 0x3238
leaq 0x12844(%rip), %rax     # 0x15a7c
movl %ebx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/macro11.c
// Function: append_env
static void append_env(
    char *envname,
    char *value)
{
    char           *env = getenv(envname);
    char           *temp;

    if (env == NULL)
        env = "";

    temp = memcheck(malloc(strlen(envname) +
                           1 +
                           strlen(env) +
                           1 +
                           strlen(value) +
                           1));
    strcpy(temp, envname);
    strcat(temp, "=");
    strcat(temp, env);
    strcat(temp, PATHSEP);
    strcat(temp, value);
    putenv(temp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2040
testq %rax, %rax
leaq 0xd8c1(%rip), %r14      # 0x10b21
cmovneq %rax, %r14
movq %r15, %rdi
callq 0x20e0
movq %rax, %r12
movq %r14, %rdi
callq 0x20e0
movq %rax, %r13
movq %rbx, %rdi
callq 0x20e0
addq %r12, %r13
leaq (%rax,%r13), %rdi
addq $0x3, %rdi
callq 0x2230
movq %rax, %rdi
callq 0xe34f
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x2090
movq %r12, %rdi
callq 0x20e0
movw $0x3d, (%r12,%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x22a0
movq %r12, %rdi
callq 0x20e0
movw $0x3a, (%r12,%rax)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x22a0
movq %r12, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21c0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble.c
// Function: get_next_lsb
int get_next_lsb(
    void)
{
    if (lsb_used) {
        lsb_used = 0;
        if (enabl_debug && lstfile) {
            fprintf(lstfile, "get_next_lsb: lsb: %d becomes %d (= next_lsb)\n", lsb, next_lsb);
        }
        return next_lsb++;
    } else {
        if (enabl_debug && lstfile) {
            fprintf(lstfile, "get_next_lsb: lsb: stays %d\n", lsb);
        }
        return lsb;
    }
}

// Assembly:
pushq %rax
leaq 0x12874(%rip), %rax     # 0x15b6c
cmpl $0x0, (%rax)
je 0x3357
leaq 0x12874(%rip), %rcx     # 0x15b78
cmpl $0x0, (%rcx)
movl $0x0, (%rax)
setne %al
leaq 0x14349(%rip), %rcx     # 0x17660
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3347
leaq 0x1283a(%rip), %rax     # 0x15b68
movl (%rax), %edx
leaq 0x12839(%rip), %rax     # 0x15b70
movl (%rax), %ecx
leaq 0xc7e8(%rip), %rsi      # 0xfb28
xorl %eax, %eax
callq 0x21e0
leaq 0x12822(%rip), %rcx     # 0x15b70
movl (%rcx), %eax
leal 0x1(%rax), %edx
movl %edx, (%rcx)
jmp 0x339b
leaq 0x1281a(%rip), %rax     # 0x15b78
cmpl $0x0, (%rax)
setne %al
leaq 0x142f5(%rip), %rcx     # 0x17660
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3392
leaq 0x127e6(%rip), %rax     # 0x15b68
movl (%rax), %edx
leaq 0xc7cc(%rip), %rsi      # 0xfb57
xorl %eax, %eax
callq 0x21e0
leaq 0x127cf(%rip), %rax     # 0x15b68
movl (%rax), %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble.c
// Function: assemble_stack
int assemble_stack(
    STACK *stack,
    TEXT_RLD *tr)
{
    int             res;
    int             errcount = 0;

    while ((res = assemble(stack, tr)) >= 0) {
        list_flush();
        if (res == 0)
            errcount++;                   /* Count an error */
    }

    return errcount;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x33e7
testl %eax, %eax
js 0x33d8
movl %eax, %r15d
xorl %ebp, %ebp
callq 0x78e1
cmpl $0x1, %r15d
adcl $0x0, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33e7
movl %eax, %r15d
testl %eax, %eax
jns 0x33b8
jmp 0x33da
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: change_dot
void change_dot(
    TEXT_RLD *tr,
    int size)
{
    if (size > 0) {
        if (last_dot_section != current_pc->section) {
            text_define_location(tr, current_pc->section->label, &current_pc->value);
            last_dot_section = current_pc->section;
            last_dot_addr = current_pc->value;
        }
        if (last_dot_addr != current_pc->value) {
            text_modify_location(tr, &current_pc->value);
            last_dot_addr = current_pc->value;
        }

        /* Update for next time */
        last_dot_addr += size;
    }

    if (DOT + size > current_pc->section->size)
        current_pc->section->size = DOT + size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
testl %esi, %esi
jle 0x5cc6
movq %rdi, %r14
leaq 0x119f9(%rip), %r12     # 0x17658
leaq 0x119e2(%rip), %r15     # 0x17648
movq (%r15), %rdx
movq 0x18(%rdx), %rax
cmpq %rax, (%r12)
je 0x5c99
movq (%rax), %rsi
addq $0x8, %rdx
movq %r14, %rdi
callq 0xd044
movq (%r15), %rax
movq 0x18(%rax), %rcx
movq %rcx, (%r12)
movl 0x8(%rax), %eax
leaq 0x119b9(%rip), %rcx     # 0x17650
movl %eax, (%rcx)
leaq 0x119b0(%rip), %r12     # 0x17650
movl (%r12), %eax
movq (%r15), %rsi
cmpl 0x8(%rsi), %eax
je 0x5cc2
addq $0x8, %rsi
movq %r14, %rdi
callq 0xd199
movq (%r15), %rax
movl 0x8(%rax), %eax
movl %eax, (%r12)
addl %ebx, (%r12)
leaq 0x1197b(%rip), %rax     # 0x17648
movq (%rax), %rax
addl 0x8(%rax), %ebx
movq 0x18(%rax), %rax
cmpl 0x14(%rax), %ebx
jbe 0x5cdf
movl %ebx, 0x14(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: store_limits
int store_limits(
    STREAM *str,
    TEXT_RLD *tr)
{
    change_dot(tr, 4);
    list_word(str, DOT, 0, 2, "");
    list_word(str, DOT + 2, 0, 2, "");
    return text_limits(tr, &DOT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x4, %esi
callq 0x5c47
leaq 0x118e2(%rip), %r12     # 0x17648
movq (%r12), %rax
movl 0x8(%rax), %esi
leaq 0xadad(%rip), %r15      # 0x10b21
movq %r14, %rdi
xorl %edx, %edx
movl $0x2, %ecx
movq %r15, %r8
callq 0x79dd
movq (%r12), %rax
movl 0x8(%rax), %esi
addl $0x2, %esi
movq %r14, %rdi
xorl %edx, %edx
movl $0x2, %ecx
movq %r15, %r8
callq 0x79dd
movq (%r12), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd266
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: implicit_gbl
void implicit_gbl(
    EX_TREE *value)
{
    if (pass)
        return;                        /* Only do this in first pass */

    if (!enabl_gbl)
        return;                        /* Option not enabled, don't do it. */

    switch (value->type) {
    case EX_UNDEFINED_SYM:
        {
            if (!(value->data.symbol->flags & SYMBOLFLAG_LOCAL)) {      /* Unless it's a
                                                                           local symbol, */
                add_sym(value->data.symbol->label, 0, SYMBOLFLAG_GLOBAL, &absolute_section, &implicit_st);
            }
        }
        break;
    case EX_LIT:
    case EX_SYM:
    case EX_TEMP_SYM: // Impossible on this pass
        return;
    case EX_ADD:
    case EX_SUB:
    case EX_MUL:
    case EX_DIV:
    case EX_AND:
    case EX_OR:
        implicit_gbl(value->data.child.right);
        /* falls into... */
    case EX_COM:
    case EX_NEG:
        implicit_gbl(value->data.child.left);
        break;
    case EX_ERR:
        if (value->data.child.left)
            implicit_gbl(value->data.child.left);
        break;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xfd42(%rip), %r14      # 0x15b60
leaq 0xf383(%rip), %r15      # 0x151a8
cmpl $0x0, (%r14)
jne 0x5e95
cmpl $0x0, (%r15)
je 0x5e95
movl (%rbx), %eax
leal -0x8(%rax), %ecx
cmpl $0x6, %ecx
jae 0x5e46
movq 0x18(%rbx), %rdi
callq 0x5e0f
jmp 0x5e4e
leal -0x5(%rax), %ecx
cmpl $0x2, %ecx
jae 0x5e54
movq 0x10(%rbx), %rbx
jmp 0x5e25
cmpl $0x7, %eax
jne 0x5e64
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x5e25
jmp 0x5e95
cmpl $0x3, %eax
jne 0x5e95
movq 0x10(%rbx), %rax
testb $0x20, 0x10(%rax)
jne 0x5e95
movq (%rax), %rdi
leaq 0xf3b3(%rip), %rcx      # 0x15230
leaq 0x1982c(%rip), %r8      # 0x1f6b0
xorl %esi, %esi
movl $0x2, %edx
popq %rbx
popq %r14
popq %r15
jmp 0xa11f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: migrate_implicit
void migrate_implicit(
    void)
{
    SYMBOL_ITER     iter;
    SYMBOL         *isym,
                   *sym;

    for (isym = first_sym(&implicit_st, &iter); isym != NULL; isym = next_sym(&implicit_st, &iter)) {
        sym = lookup_sym(isym->label, &symbol_st);
        if (sym) {
            continue;                  // It's already in there.  Great.
        }
        isym->flags |= SYMBOLFLAG_IMPLICIT_GLOBAL;
        sym = add_sym(isym->label, isym->value, isym->flags, isym->section, &symbol_st);
        // Just one other thing - migrate the stmtno
        sym->stmtno = isym->stmtno;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x19803(%rip), %rdi     # 0x1f6b0
leaq 0x8(%rsp), %rsi
callq 0xa0bb
testq %rax, %rax
je 0x5f21
movq %rax, %r12
leaq 0x117ca(%rip), %rbx     # 0x17690
leaq 0x197e3(%rip), %r14     # 0x1f6b0
leaq 0x8(%rsp), %r15
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x9ff5
testq %rax, %rax
jne 0x5f0e
movl 0x10(%r12), %edx
orl $0x40, %edx
movl %edx, 0x10(%r12)
movq (%r12), %rdi
movl 0x8(%r12), %esi
movq 0x18(%r12), %rcx
movq %rbx, %r8
callq 0xa11f
movl 0xc(%r12), %ecx
movl %ecx, 0xc(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0xa064
movq %rax, %r12
testq %rax, %rax
jne 0x5ed2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: express_sym_offset
int express_sym_offset(
    EX_TREE *value,
    SYMBOL **sym,
    unsigned *offset)
{
    implicit_gbl(value);               /* Translate tree's undefined syms
                                          into global syms */

    /* Internally relocatable symbols will have been summed down into
       EX_TEMP_SYM's. */

    if (value->type == EX_SYM || value->type == EX_TEMP_SYM) {
        *sym = value->data.symbol;
        *offset = 0;
        return 1;
    }

    /* What remains is external symbols. */

    if (value->type == EX_ADD) {
        EX_TREE        *left = value->data.child.left;
        EX_TREE        *right = value->data.child.right;

        if ((left->type != EX_SYM && left->type != EX_UNDEFINED_SYM) || right->type != EX_LIT)
            return 0;                  /* Failed. */
        *sym = left->data.symbol;
        *offset = right->data.lit;
        return 1;
    }

    if (value->type == EX_SUB) {
        EX_TREE        *left = value->data.child.left;
        EX_TREE        *right = value->data.child.right;

        if ((left->type != EX_SYM && left->type != EX_UNDEFINED_SYM) || right->type != EX_LIT)
            return 0;                  /* Failed. */
        *sym = left->data.symbol;
        *offset = (unsigned) -(int) (right->data.lit);
        return 1;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x5e0f
movl (%r15), %ecx
xorl %eax, %eax
addl $-0x2, %ecx
cmpl $0x7, %ecx
ja 0x5f6d
leaq 0xa260(%rip), %rdx      # 0x101b4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x10(%r15), %rax
movq %rax, (%r14)
xorl %eax, %eax
movl %eax, (%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%r15), %rcx
movl (%rcx), %edx
andl $-0x2, %edx
cmpl $0x2, %edx
jne 0x5f6d
movq 0x18(%r15), %rdx
cmpl $0x1, (%rdx)
jne 0x5f6d
movq 0x10(%rcx), %rax
movq %rax, (%r14)
xorl %eax, %eax
subl 0x10(%rdx), %eax
jmp 0x5f66
movq 0x10(%r15), %rcx
movl (%rcx), %edx
andl $-0x2, %edx
cmpl $0x2, %edx
jne 0x5f6d
movq 0x18(%r15), %rdx
cmpl $0x1, (%rdx)
jne 0x5f6d
movq 0x10(%rcx), %rax
movq %rax, (%r14)
movl 0x10(%rdx), %eax
jmp 0x5f66
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: store_complex
static void store_complex(
    STREAM *refstr,
    TEXT_RLD *tr,
    int size,
    EX_TREE *value)
{
    TEXT_COMPLEX    tx;

    change_dot(tr, size);              /* About to store - update DOT */

    implicit_gbl(value);               /* Turn undefined symbols into globals */

    text_complex_begin(&tx);           /* Open complex expression */

    if (!complex_tree(&tx, value)) {   /* Translate */
        report(refstr, "Invalid expression\n");
        store_word(refstr, tr, size, 0);
    } else {
        list_word(refstr, DOT, 0, size, "C");
        text_complex_commit(tr, &DOT, size, &tx, 0);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl %edx, %esi
callq 0x5c47
movq %r12, %rdi
callq 0x5e0f
leaq 0xc(%rsp), %r13
movq %r13, %rdi
callq 0xd855
movq %r13, %rdi
movq %r12, %rsi
callq 0x5fbb
testl %eax, %eax
je 0x663c
leaq 0x11042(%rip), %r12     # 0x17648
movq (%r12), %rax
movl 0x8(%rax), %esi
leaq 0xa30d(%rip), %r8       # 0x10921
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %ecx
callq 0x79dd
movq (%r12), %rsi
addq $0x8, %rsi
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0xdabd
jmp 0x665c
leaq 0x9c73(%rip), %rsi      # 0x102b6
movq %r15, %rdi
xorl %eax, %eax
callq 0x7b5a
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x5ceb
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq