LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp32-fast.c
// Function: print_close_open
void print_close_open(mtgp32_fast_t *mtgp32, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%.8f ", mtgp32_genrand_close_open(mtgp32));
	if (i % 5 == 4) {
	    printf("\n");
	}
    }
    if (i % 5 != 0) {
	printf("\n");
    }
}

// Assembly:
testl %esi, %esi
jle 0x1da0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x4, %r12d
movl %esi, (%rsp)
movl %esi, 0x4(%rsp)
movl %ebp, %edx
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
imulq %rax, %rdx
shrq $0x22, %rdx
movq 0xf0(%r14), %rsi
movl 0x4(%rsi), %edi
movl 0x8(%rsi), %eax
movslq 0xc(%rsi), %r8
movslq (%rsi), %r10
incq %r10
andq %r8, %r10
movl 0x4(%r14), %r9d
addl %eax, %r9d
movl %r10d, (%rsi)
movl %r10d, %ecx
subl %edi, %ecx
leal (%rcx,%rax), %r11d
andl %r8d, %r11d
leal (%rcx,%rax), %r13d
incl %r13d
andl %r8d, %r13d
movl %r9d, %eax
subl %edi, %eax
addl %r10d, %eax
andl %r8d, %eax
movl 0x10(%rsi,%rax,4), %r15d
movb 0x8(%r14), %cl
movl 0xd0(%r14), %ebx
andl 0x10(%rsi,%r11,4), %ebx
movb 0xc(%r14), %al
xorl 0x10(%rsi,%r13,4), %ebx
movl %ebx, %r11d
shll %cl, %r11d
movl %eax, %ecx
shrl %cl, %r15d
xorl %ebx, %r15d
xorl %r11d, %r15d
movl %r15d, %eax
andl $0xf, %eax
xorl 0x10(%r14,%rax,4), %r15d
movl %r15d, 0x10(%rsi,%r10,4)
movslq (%rsi), %rax
movl 0x10(%rsi,%rax,4), %ecx
notl %edi
addl %r9d, %edi
addl %eax, %edi
andl %r8d, %edi
movl 0x10(%rsi,%rdi,4), %eax
movl %eax, %esi
shrl $0x10, %esi
xorl %eax, %esi
movl %esi, %eax
shrl $0x8, %eax
xorl %esi, %eax
shrl $0x9, %ecx
andl $0xf, %eax
xorl 0x90(%r14,%rax,4), %ecx
leal (%rdx,%rdx,4), %ebx
movd %ecx, %xmm0
addss 0x12bf(%rip), %xmm0     # 0x3004
cvtss2sd %xmm0, %xmm0
leaq 0x12d2(%rip), %rdi      # 0x3022
movb $0x1, %al
callq 0x1080
addl %r12d, %ebx
jne 0x1d66
movl $0xa, %edi
callq 0x1040
incl %ebp
decl %r12d
movl 0x4(%rsp), %eax
decl %eax
movl %eax, %esi
jne 0x1c6e
imull $0xcccccccd, (%rsp), %eax # imm = 0xCCCCCCCD
cmpl $0x33333334, %eax       # imm = 0x33333334
leaq 0x8(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jb 0x1da0
movl $0xa, %edi
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O3/keiranrowan[P]tiny-core/./src/hostname.c
// Function: main
int main(int argc, char **argv) {
	if (argc > 1) {
		if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) {
			printf("hostname [-s] <hostname>\n");
			printf("No arguments prints hostname\n");
		} else if (strcmp(argv[1], "-s") == 0) {
			const char *hostname = argv[2];
			int err = sethostname(hostname, strlen(hostname)); 
			if (err != 0) {
				printf("Error setting hostname\n");
				return 1;
			} else {
				printf("Hostname set.\n");
				return 0;
			}
		}
	} else {
		char hostname[HOST_NAME_MAX + 1];
		int err = gethostname(hostname, HOST_NAME_MAX + 1);
		if (err != 0) {
			printf("Error getting hostname.\n");
			return 1;
		} else {
			printf("%s\n", hostname);
			return 0;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
cmpl $0x2, %edi
jl 0x120e
movq %rsi, %r14
movq 0x8(%rsi), %r15
cmpb $0x2d, (%r15)
jne 0x1237
cmpb $0x68, 0x1(%r15)
jne 0x11b1
cmpb $0x0, 0x2(%r15)
je 0x124c
leaq 0xe4c(%rip), %rsi       # 0x2004
movq %r15, %rdi
callq 0x1050
testl %eax, %eax
je 0x124c
xorl %ebx, %ebx
cmpb $0x73, 0x1(%r15)
jne 0x1266
cmpb $0x0, 0x2(%r15)
jne 0x1266
movq 0x10(%r14), %r14
movq %r14, %rdi
callq 0x1040
movq %r14, %rdi
movq %rax, %rsi
callq 0x1060
testl %eax, %eax
je 0x1272
leaq 0xe2f(%rip), %rdi       # 0x2031
callq 0x1030
movl $0x1, %ebx
jmp 0x1266
movq %rsp, %r14
movl $0x41, %esi
movq %r14, %rdi
callq 0x1070
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
leaq 0xddf(%rip), %rdi       # 0x200b
cmoveq %r14, %rdi
callq 0x1030
jmp 0x1266
leaq 0xdc6(%rip), %rsi       # 0x2004
movq %r15, %rdi
callq 0x1050
xorl %ebx, %ebx
testl %eax, %eax
jne 0x1266
leaq 0xdf5(%rip), %rdi       # 0x2048
callq 0x1030
leaq 0xe02(%rip), %rdi       # 0x2061
callq 0x1030
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xdaa(%rip), %rdi       # 0x2023
jmp 0x1230
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-zoe/subtitle-convert.c
// Function: processLine
char *processLine( char *line ) {
	char *retline = malloc( strlen(line)+1 );
	int i, e = 0, modifier, letter;
	for( i = 0; i < strlen(line) + 1; i++ ) {
		if( line[i] != 0x26 ) { // &
			retline[e] = line[i];
			e++;
		}
		else {
			i++;
			modifier = line[i];
			i++;
			letter = line[i];
			retline[e] = getModdedLetter( modifier, letter );
			e++;
		}
	}
	return retline;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x1080
movq %rax, %r14
leaq 0x1(%rax), %rdi
callq 0x10c0
movq %rax, %r15
incq %r14
je 0x130d
xorl %eax, %eax
movq %r15, %r12
xorl %r13d, %r13d
movb (%rbx,%rax), %al
cmpb $0x26, %al
jne 0x12fb
movslq %r13d, %r13
movsbl 0x1(%rbx,%r13), %edi
movsbl 0x2(%rbx,%r13), %esi
addq $0x2, %r13
callq 0x122c
movb %al, (%r12)
incl %r13d
movslq %r13d, %rax
incq %r12
cmpq %rax, %r14
ja 0x12dc
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/ch2/eatyguy2.c
// Function: getkey
int getkey() {

  // Make reading from stdin non-blocking.
  int flags = fcntl(STDIN_FILENO, F_GETFL);
  fcntl(STDIN_FILENO, F_SETFL, flags | O_NONBLOCK);

  int ch = getchar();

  // Turn off non-blocking I/O. On some systems, leaving stdin
  // non-blocking will also leave stdout non-blocking, which
  // can cause printing errors.
  fcntl(STDIN_FILENO, F_SETFL, flags);
  return ch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %edi, %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x4100
movl %eax, %ebx
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
xorl %edi, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x4100
callq 0x4280
movl %eax, %r14d
xorl %edi, %edi
movl $0x4, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x4100
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/ch2/eatyguy2.c
// Function: main
int main() {

  start();

  // Create a Lua state and load the module.
  lua_State *L = luaL_newstate();
  luaL_openlibs(L);

  // Make our Lua-callable functions visible to Lua.
  lua_register(L, "set_color", set_color);
  lua_register(L, "set_pos",   set_pos);
  lua_register(L, "timestamp", timestamp);

  // Load eatyguy2.lua and run the init() function.
  luaL_dofile(L, "eatyguy2.lua");
  lua_setglobal(L, "eatyguy");
  lua_settop(L, 0);

  lua_getglobal(L, "eatyguy");
  lua_getfield(L, -1, "init");  // -1 means stack top.
  lua_call(L, 0, 0);            // 0, 0 = #args, #retvals

  lua_getglobal(L, "eatyguy");
  while (1) {
    // Call eatyguy.loop().
    lua_getfield(L, -1, "loop");
    lua_call(L, 0, 0);

    int c = getkey();
    if (c == ESC_KEY || c == 'q' || c == 'Q') done();
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x483e
callq 0x14d8d
movq %rax, %rbx
movq %rax, %rdi
callq 0x14f90
leaq -0x141(%rip), %rsi      # 0x4896
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5584
leaq 0x1c694(%rip), %rsi     # 0x2107c
movq %rbx, %rdi
callq 0x59c8
leaq -0xf7(%rip), %rsi       # 0x4900
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5584
leaq 0x1c67e(%rip), %rsi     # 0x21086
movq %rbx, %rdi
callq 0x59c8
leaq -0xac(%rip), %rsi       # 0x496b
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5584
leaq 0x1c666(%rip), %rsi     # 0x2108e
movq %rbx, %rdi
callq 0x59c8
leaq 0x1c661(%rip), %rsi     # 0x21098
movq %rbx, %rdi
xorl %edx, %edx
callq 0x144e6
testl %eax, %eax
jne 0x4a5c
movq %rbx, %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5eab
leaq 0x1c642(%rip), %r14     # 0x210a5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59c8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4c29
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5653
leaq 0x1c623(%rip), %rdx     # 0x210ad
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5771
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5e43
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5653
leaq 0x1d0aa(%rip), %r14     # 0x21b64
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0x5771
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5e43
callq 0x47f1
cmpl $0x1b, %eax
je 0x4aef
cmpl $0x71, %eax
je 0x4aef
cmpl $0x51, %eax
jne 0x4aba
callq 0x4873
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/jfdb.c
// Function: print_meta
static void print_meta(JFDB *db) {
  JFDB_CheckPoint *cp = &db->tip.cp;
  printf("-----\n");
  printf("magic: %x:%x\n", db->tip.magic, db->tip.version);
  printf("level: %"PRIu64" / %llu\n", cp->levels, 1LLU << db->tip.level);
  printf("-----\n");
  printf("gaps:\n");
  for (int i = 0; i < JFDB_NUM_GAPS; i++)
    printf(" %8u @ %-8u\n", cp->gaps[i].size, cp->gaps[i].block);
  printf("keys: %12zu / %-12"PRIu64"\n", db->kmap.size, cp->lengthKeys);
  printf("vals: %12zu / %-12"PRIu64"\n", db->vmap.size, cp->lengthVals);
  printf("-----\n");
  printf("roots:\n");
  JFT *trie;
  for (JFT_Offset pos = cp->offset; pos; pos = JFT_parent_offset(trie)) {
    trie = JFDB_get_trie(db, pos);
    printf("      %12"PRIu64" = ", pos);
    print_bits((JFT_Head *)trie, 1);
    printf("\n");
  }
  printf("-----\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5f3a(%rip), %r14      # 0x75de
movq %r14, %rdi
callq 0x1080
movl 0xc0(%rbx), %esi
movl 0xc4(%rbx), %edx
leaq 0x5c48(%rip), %rdi      # 0x7307
xorl %eax, %eax
callq 0x10f0
movq 0x120(%rbx), %rsi
movb 0xc8(%rbx), %cl
movl $0x1, %edx
shlq %cl, %rdx
leaq 0x5c33(%rip), %rdi      # 0x7315
xorl %eax, %eax
callq 0x10f0
movq %r14, %rdi
callq 0x1080
leaq 0x5ed9(%rip), %rdi      # 0x75d1
callq 0x1080
movl $0x1a, %r15d
leaq 0x5c1e(%rip), %r14      # 0x7328
movl (%rbx,%r15,8), %edx
movl 0x4(%rbx,%r15,8), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10f0
incq %r15
cmpq $0x22, %r15
jne 0x170a
movq 0xa0(%rbx), %rsi
movq 0x110(%rbx), %rdx
leaq 0x5bfa(%rip), %rdi      # 0x7335
xorl %eax, %eax
callq 0x10f0
movq 0xb8(%rbx), %rsi
movq 0x118(%rbx), %rdx
leaq 0x5bf4(%rip), %rdi      # 0x734b
xorl %eax, %eax
callq 0x10f0
leaq 0x5e79(%rip), %rdi      # 0x75de
callq 0x1080
leaq 0x5e66(%rip), %rdi      # 0x75d7
callq 0x1080
movq 0x128(%rbx), %r12
testq %r12, %r12
je 0x17f6
leaq 0x5be7(%rip), %r13      # 0x7370
leaq 0x5dd7(%rip), %rbp      # 0x7567
movabsq $0xffffffffff, %r14     # imm = 0xFFFFFFFFFF
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3bff
movq %rax, %r15
leaq 0x5bb2(%rip), %rdi      # 0x7361
movq %r12, %rsi
xorl %eax, %eax
callq 0x10f0
movl $0x3f, %r12d
testb $0x7, %r12b
movq %rbp, %rdi
cmoveq %r13, %rdi
movq (%r15), %rax
xorl %esi, %esi
btq %r12, %rax
setb %sil
xorl %eax, %eax
callq 0x10f0
addq $-0x1, %r12
jb 0x17bf
movl $0xa, %edi
callq 0x1040
movq (%r15), %r12
andq %r14, %r12
jne 0x179a
leaq 0x5de1(%rip), %rdi      # 0x75de
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/jfdb.c
// Function: load_input
static void load_input(JFDB *db, FILE *input) {
  int c, s = 0, n = 2;
  JFT_Stem *stems = malloc(n * sizeof(JFT_Stem));
  JFT_Boolean escaped = False;
  char *buf = malloc(1 << 20); // NB: static buffer
  size_t bufSize = 0;
  stems[0] = (JFT_Stem) {
    .size = 0,
    .data = (uint8_t *)buf
  };
  while ((c = getc(input)) != EOF) {
    if (escaped) {
      // copy byte no matter what
      buf[bufSize++] = c;
      stems[s].size++;
      escaped = False;
    } else if (c == '\\') {
      // escape the next byte
      escaped = True;
    } else if (c == '\t') {
      // close out current stem, start next one
      if (++s >= n)
        stems = realloc(stems, (n *= 2) * sizeof(JFT_Stem));
      stems[s] = (JFT_Stem) {
        .size = 0,
        .data = (uint8_t *)&buf[bufSize]
      };
    } else if (c == '\n') {
      // close out current stem, write db, reset
      if (s)
        JFDB_store(db, &stems[0], &stems[1], &stems[2], s > 1 ? s - 1 : 0, 0);
      else
        JFDB_annul(db, &stems[0], 0);
      bufSize = s = 0;
      stems[s].size = 0;
    } else {
      // copy byte
      buf[bufSize++] = c;
      stems[s].size++;
    }
  }
  free(stems);
  free(buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
movl $0x30, %edi
callq 0x1180
movq %rax, %r12
movl $0x100000, %edi         # imm = 0x100000
callq 0x1180
movq %rax, %r15
movq $0x0, (%r12)
movw $0x0, 0x8(%r12)
movq %rax, 0x10(%r12)
movq %rbx, %rdi
callq 0x1230
cmpl $-0x1, %eax
je 0x2649
movl $0x2, 0xc(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
testl %ebp, %ebp
jne 0x25c6
cmpl $0x5c, %eax
je 0x2621
cmpl $0xa, %eax
je 0x25ef
cmpl $0x9, %eax
jne 0x25c6
incl %r13d
movl 0xc(%rsp), %eax
cmpl %eax, %r13d
jl 0x25a4
addl %eax, %eax
movl %eax, 0xc(%rsp)
cltq
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
movq %r12, %rdi
callq 0x1190
movq %rax, %r12
movslq %r13d, %rax
leaq (%rax,%rax,2), %rax
leaq (%r15,%r14), %rcx
movq $0x0, (%r12,%rax,8)
movw $0x0, 0x8(%r12,%rax,8)
movq %rcx, 0x10(%r12,%rax,8)
jmp 0x25da
movb %al, (%r15,%r14)
incq %r14
movslq %r13d, %rax
leaq (%rax,%rax,2), %rax
incw 0x8(%r12,%rax,8)
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1230
cmpl $-0x1, %eax
jne 0x2566
jmp 0x2649
testl %r13d, %r13d
je 0x2628
leaq 0x18(%r12), %rdx
leaq 0x30(%r12), %rcx
leal -0x1(%r13), %r8d
cmpl $0x2, %r13d
movl $0x0, %eax
cmovll %eax, %r8d
movq 0x10(%rsp), %rdi
movq %r12, %rsi
xorl %r9d, %r9d
callq 0x3ed6
jmp 0x2637
movl $0x1, %ebp
jmp 0x25dc
movq 0x10(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3e71
movw $0x0, 0x8(%r12)
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x25dc
movq %r12, %rdi
callq 0x1030
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_new_with_capacity
obmap * obmap_new_with_capacity(uint32_t capacity){

  obmap *m = obmap_create_default();

  uint32_t i = 0;
  while(MAP_CAPACITIES[i] < capacity && i < NUM_CAPACITIES - 1) i++;

  m->hash_table = obvector_new(MAP_CAPACITIES[i]);
  m->pairs = obdeque_new();
  m->cap_idx = i;

  return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
leaq 0x3816(%rip), %r15      # 0x53f0
xorl %r14d, %r14d
callq 0x1c23
movq %rax, %rbx
movq %r14, %rax
movl (%r15), %edi
incq %r14
cmpq $0x18, %rax
ja 0x1bfc
addq $0x4, %r15
cmpl %ebp, %edi
jb 0x1be5
callq 0x2998
movq %rax, 0x10(%rbx)
callq 0x37c0
movq %rax, 0x18(%rbx)
decb %r14b
movb %r14b, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_create_default
obmap * obmap_create_default(void){

  static const char classname[] = "obmap";
  obmap *new_instance = malloc(sizeof(obmap));
  assert(new_instance != NULL);

  /* initialize base class data */
  ob_init_base((obj *)new_instance, &obmap_destroy, &obmap_hash,
           &obmap_compare, &obmap_display, classname);

  new_instance->hash_table = NULL;
  new_instance->pairs = NULL;
  new_instance->cap_idx = 0;
  new_instance->collisions = 0;

  return new_instance;
}

// Assembly:
pushq %rbx
movl $0x28, %edi
callq 0x10b0
testq %rax, %rax
je 0x1c78
movq %rax, %rbx
leaq 0x876(%rip), %rsi       # 0x24b3
leaq 0x8d9(%rip), %rdx       # 0x251d
leaq 0x9cc(%rip), %rcx       # 0x2617
leaq 0xa9f(%rip), %r8        # 0x26f1
leaq 0x381a(%rip), %r9       # 0x5473
movq %rax, %rdi
callq 0x3534
movb $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movl $0x0, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x390c(%rip), %rdi      # 0x558b
leaq 0x37fb(%rip), %rsi      # 0x5481
leaq 0x3aaf(%rip), %rcx      # 0x573c
movl $0x13b, %edx            # imm = 0x13B
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_copy
obmap * obmap_copy(const obmap *to_copy){

  obmap *copy;
  obmap_pair *mp;
  obdeque_iterator *it;

  assert(to_copy);

  copy = obmap_create_default();

  copy->cap_idx = to_copy->cap_idx;
  copy->collisions = to_copy->collisions;
  copy->pairs = obdeque_new();

  /* copy deque manually, internal objects need to be copied as well as Deque
   * itself */
  it = obdeque_head_iterator(to_copy->pairs);
  if(it){
    do{
       mp = obmap_copy_pair((obmap_pair *)obdeque_obj_at_iterator(to_copy->pairs, it));
       obdeque_add_at_tail(copy->pairs, (obj *)mp);
       ob_release((obj *)mp);
    }while(obdeque_iterate_next(to_copy->pairs, it));
  }
  ob_release((obj *)it);

  obmap_rehash(copy); /* cannot grab to_copy->hash_table directly, stored
                         iterators must point to values within copy, not to copy */

  return copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1d35
movq %rdi, %r14
callq 0x1c23
movq %rax, %rbx
movb 0x8(%r14), %al
movb %al, 0x8(%rbx)
movl 0x20(%r14), %eax
movl %eax, 0x20(%rbx)
callq 0x37c0
movq %rax, 0x18(%rbx)
movq 0x18(%r14), %rdi
callq 0x38dc
movq %rax, %r15
testq %rax, %rax
je 0x1d16
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x390a
movq %rax, %rdi
callq 0x1d54
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x398b
movq %r12, %rdi
callq 0x36e2
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x3a03
testb %al, %al
jne 0x1cdb
movq %r15, %rdi
callq 0x36e2
movq %rbx, %rdi
callq 0x1d89
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x373d(%rip), %rdi      # 0x5479
leaq 0x373e(%rip), %rsi      # 0x5481
leaq 0x374b(%rip), %rcx      # 0x5495
movl $0x4d, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_rehash
void obmap_rehash(obmap *m){

  obdeque_iterator *it, *it_copy;

  assert(m);

  ob_release((obj *)m->hash_table);
  m->hash_table = obvector_new(MAP_CAPACITIES[m->cap_idx]);

  it = obdeque_head_iterator(m->pairs);
  if(!it) return;

  do{
    it_copy = obdeque_copy_iterator(it);
    obmap_add_to_table(m, it_copy);
    ob_release((obj *)it_copy);
  }while(obdeque_iterate_next(m->pairs, it));

  ob_release((obj *)it);

  return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1e08
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x36e2
movzbl 0x8(%rbx), %eax
leaq 0x3646(%rip), %rcx      # 0x53f0
movl (%rcx,%rax,4), %edi
callq 0x2998
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0x38dc
testq %rax, %rax
je 0x1e02
movq %rax, %r14
movq %r14, %rdi
callq 0x3baa
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x210b
movq %r15, %rdi
callq 0x36e2
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x3a03
testb %al, %al
jne 0x1dc7
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x36e2
popq %rbx
popq %r14
popq %r15
retq
leaq 0x36a7(%rip), %rdi      # 0x54b6
leaq 0x366b(%rip), %rsi      # 0x5481
leaq 0x3739(%rip), %rcx      # 0x5556
movl $0xb4, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_insert
void obmap_insert(obmap *m, obj *key, obj *value){

  obmap_pair *mp;
  obdeque_iterator *it;
  ob_hash_t hash_value;

  assert(m);

  hash_value = obmap_find_key(m, key);
  it = (obdeque_iterator *)obvector_obj_at_index(m->hash_table, hash_value);

  /* If the key already exists in the map then overwrite the existing
   * value */
  if(it){
    mp = (obmap_pair *)obdeque_obj_at_iterator(m->pairs, it);
    obmap_replace_pair_value(mp, value);
    return;
  }

  /* if add operation will overload the map then resize the map */
  if((obdeque_length(m->pairs)+1)/MAP_CAPACITIES[m->cap_idx] > MAX_LOAD_FACTOR)
    obmap_increase_size(m);

  mp = obmap_new_pair(key, value);
  obdeque_add_at_tail(m->pairs, (obj *)mp);
  ob_release((obj *)mp); /* map deque has only reference to mp */

  assert(it = obdeque_tail_iterator(m->pairs));
  obmap_add_to_table(m, it);
  ob_release((obj *)it); /* map vector hash only reference to it */

  return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1ede
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x1f1c
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x2d97
movq 0x18(%rbx), %rdi
testq %rax, %rax
je 0x1e70
movq %rax, %rsi
callq 0x390a
movq %rax, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1fd2
callq 0x3ad6
incq %rax
movzbl 0x8(%rbx), %ecx
leaq 0x356d(%rip), %rdx      # 0x53f0
movl (%rdx,%rcx,4), %ecx
cmpq %rcx, %rax
jb 0x1e93
movq %rbx, %rdi
callq 0x201d
movq %r15, %rdi
movq %r14, %rsi
callq 0x2088
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x398b
movq %r14, %rdi
callq 0x36e2
movq 0x18(%rbx), %rdi
callq 0x3b7c
testq %rax, %rax
je 0x1efd
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x210b
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x36e2
leaq 0x35d1(%rip), %rdi      # 0x54b6
leaq 0x3595(%rip), %rsi      # 0x5481
leaq 0x35c5(%rip), %rcx      # 0x54b8
movl $0x6e, %edx
callq 0x1050
leaq 0x35dd(%rip), %rdi      # 0x54e1
leaq 0x3576(%rip), %rsi      # 0x5481
leaq 0x35a6(%rip), %rcx      # 0x54b8
movl $0x83, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_find_key
ob_hash_t obmap_find_key(const obmap *m, const obj *key){

  ob_hash_t hash_value, offset;
  obmap_pair *mp;
  obdeque_iterator *it;

  hash_value = ob_hash(key)%MAP_CAPACITIES[m->cap_idx];
  offset = 0;

  while((it = (obdeque_iterator *)obvector_obj_at_index(m->hash_table, hash_value))){
    mp = (obmap_pair *)obdeque_obj_at_iterator(m->pairs, it);
    if(ob_compare(mp->key, key) == OB_EQUAL_TO)
      break;
    offset = obmap_offset_collision(offset);
    hash_value = (hash_value+offset)%MAP_CAPACITIES[m->cap_idx];
  }

  return hash_value; /* the hash value where key is actually found */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3620
movzbl 0x8(%r14), %ecx
leaq 0x34b1(%rip), %r12      # 0x53f0
movl (%r12,%rcx,4), %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
movq 0x10(%r14), %rdi
movq %rdx, %rsi
callq 0x2d97
testq %rax, %rax
je 0x1fc5
xorl %r13d, %r13d
movq 0x18(%r14), %rdi
movq %rax, %rsi
callq 0x390a
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x365f
testb %al, %al
je 0x1fc5
testq %r13, %r13
je 0x1f8e
cmpq $0x1, %r13
jne 0x1f96
movl $0x2, %r13d
jmp 0x1f9d
movl $0x1, %r13d
jmp 0x1f9d
imulq %r13, %r13
decq %r13
addq %r13, %r15
movzbl 0x8(%r14), %eax
movl (%r12,%rax,4), %ecx
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq 0x10(%r14), %rdi
movq %rdx, %r15
movq %rdx, %rsi
callq 0x2d97
testq %rax, %rax
jne 0x1f5f
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_replace_pair_value
void obmap_replace_pair_value(obmap_pair *mp, obj *value){

  assert(mp);

  ob_retain(value);
  ob_release(mp->value);
  mp->value = value;
  return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1ffe
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3717
movq 0x10(%r14), %rdi
callq 0x36e2
movq %rbx, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x35c4(%rip), %rdi      # 0x55c9
leaq 0x3475(%rip), %rsi      # 0x5481
leaq 0x35e3(%rip), %rcx      # 0x55f6
movl $0xf1, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_increase_size
void obmap_increase_size(obmap *to_size){

  assert(to_size);
  assert(to_size->cap_idx < NUM_CAPACITIES-1); /* cannot resize beyond largest
                                                  capacity */

  to_size->cap_idx+=2;
  if(to_size->cap_idx >= NUM_CAPACITIES) to_size->cap_idx = NUM_CAPACITIES-1;
  to_size->collisions = 0; /* before resize reset collisions */

  obmap_rehash(to_size);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x204a
movb 0x8(%rdi), %al
cmpb $0x19, %al
jae 0x2069
leal 0x2(%rax), %ecx
cmpb $0x18, %al
movzbl %cl, %eax
movl $0x19, %ecx
cmovnel %eax, %ecx
movb %cl, 0x8(%rdi)
movl $0x0, 0x20(%rdi)
popq %rax
jmp 0x1d89
leaq 0x3859(%rip), %rdi      # 0x58aa
leaq 0x3429(%rip), %rsi      # 0x5481
leaq 0x3853(%rip), %rcx      # 0x58b2
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x1050
leaq 0x3864(%rip), %rdi      # 0x58d4
leaq 0x340a(%rip), %rsi      # 0x5481
leaq 0x3834(%rip), %rcx      # 0x58b2
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_new_pair
obmap_pair * obmap_new_pair(obj *key, obj *value){

  static const char classname[] = "obmap_pair";
  obmap_pair *new_instance = malloc(sizeof(obmap_pair));
  assert(new_instance != NULL);

  /* initialize base class data */
  ob_init_base((obj *)new_instance, &obmap_destroy_pair, &obmap_hash_pair, NULL,
           &obmap_display_pair, classname);

  ob_retain(key);
  new_instance->key = key;
  ob_retain(value);
  new_instance->value = value;

  return new_instance;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl $0x18, %edi
callq 0x10b0
testq %rax, %rax
je 0x20ec
movq %rax, %r14
leaq 0x26a(%rip), %rsi       # 0x2316
leaq 0x2cd(%rip), %rdx       # 0x2380
leaq 0x398(%rip), %r8        # 0x2452
leaq 0x33a7(%rip), %r9       # 0x5468
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x3534
movq %r15, %rdi
callq 0x3717
movq %r15, 0x8(%r14)
movq %rbx, %rdi
callq 0x3717
movq %rbx, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3498(%rip), %rdi      # 0x558b
leaq 0x3387(%rip), %rsi      # 0x5481
leaq 0x349f(%rip), %rcx      # 0x55a0
movl $0xda, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_add_to_table
void obmap_add_to_table(obmap *m, obdeque_iterator *it){

  ob_hash_t hash_value, offset;
  obmap_pair *pair;

  assert(m);
  assert(it);

  pair = (obmap_pair *)obdeque_obj_at_iterator(m->pairs, it);
  hash_value = ob_hash(pair->key)%MAP_CAPACITIES[m->cap_idx];
  offset = 0;

  while(obvector_obj_at_index(m->hash_table, hash_value)){
    offset = obmap_offset_collision(offset);
    hash_value = (hash_value+offset)%MAP_CAPACITIES[m->cap_idx];
    m->collisions++;
  }

  obvector_store_at_index(m->hash_table, (obj *)it, hash_value);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x21d3
movq %rsi, %rbx
testq %rsi, %rsi
je 0x21f2
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rbx, %rsi
callq 0x390a
movq 0x8(%rax), %rdi
callq 0x3620
movzbl 0x8(%r14), %ecx
leaq 0x32a3(%rip), %r12      # 0x53f0
movl (%r12,%rcx,4), %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
movq 0x10(%r14), %rdi
movq %rdx, %rsi
callq 0x2d97
testq %rax, %rax
je 0x21bb
xorl %r13d, %r13d
testq %r13, %r13
je 0x2180
cmpq $0x1, %r13
jne 0x2188
movl $0x2, %r13d
jmp 0x218f
movl $0x1, %r13d
jmp 0x218f
imulq %r13, %r13
decq %r13
addq %r13, %r15
movzbl 0x8(%r14), %eax
movl (%r12,%rax,4), %ecx
movq %r15, %rax
xorl %edx, %edx
divq %rcx
incl 0x20(%r14)
movq 0x10(%r14), %rdi
movq %rdx, %r15
movq %rdx, %rsi
callq 0x2d97
testq %rax, %rax
jne 0x216d
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2b21
leaq 0x32dc(%rip), %rdi      # 0x54b6
leaq 0x32a0(%rip), %rsi      # 0x5481
leaq 0x3710(%rip), %rcx      # 0x58f8
movl $0x1b7, %edx            # imm = 0x1B7
callq 0x1050
leaq 0x3734(%rip), %rdi      # 0x592d
leaq 0x3281(%rip), %rsi      # 0x5481
leaq 0x36f1(%rip), %rcx      # 0x58f8
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_lookup
obj * obmap_lookup(const obmap *m, const obj *key){

  obdeque_iterator *it;
  obmap_pair *mp;
  ob_hash_t hash_value;

  assert(m);

  hash_value = obmap_find_key(m, key);
  it = (obdeque_iterator *)obvector_obj_at_index(m->hash_table, hash_value);

  if(!it) return NULL;

  mp = (obmap_pair *)obdeque_obj_at_iterator(m->pairs, it);
  return mp->value;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2246
movq %rdi, %rbx
callq 0x1f1c
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x2d97
testq %rax, %rax
je 0x2242
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x390a
movq 0x10(%rax), %rax
jmp 0x2244
xorl %eax, %eax
popq %rbx
retq
leaq 0x3269(%rip), %rdi      # 0x54b6
leaq 0x322d(%rip), %rsi      # 0x5481
leaq 0x32ab(%rip), %rcx      # 0x5506
movl $0x91, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_remove
void obmap_remove(obmap *m, obj *key){

  obdeque_iterator *it;
  ob_hash_t hash_value;

  assert(m);

  hash_value = obmap_find_key(m, key);
  it = (obdeque_iterator *)obvector_obj_at_index(m->hash_table, hash_value);

  if(!it) return;

  obdeque_remove_at_iterator(m->pairs, it);
  obmap_rehash(m);

  return;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x229b
movq %rdi, %rbx
callq 0x1f1c
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x2d97
testq %rax, %rax
je 0x2299
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x4479
movq %rbx, %rdi
popq %rbx
jmp 0x1d89
popq %rbx
retq
leaq 0x3214(%rip), %rdi      # 0x54b6
leaq 0x31d8(%rip), %rsi      # 0x5481
leaq 0x3284(%rip), %rcx      # 0x5534
movl $0xa2, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_clear
void obmap_clear(obmap *m){

  assert(m);

  ob_release((obj *)m->hash_table);
  ob_release((obj *)m->pairs);

  m->hash_table = obvector_new(MAP_CAPACITIES[m->cap_idx]);
  m->pairs = obdeque_new();
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x22f7
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x36e2
movq 0x18(%rbx), %rdi
callq 0x36e2
movzbl 0x8(%rbx), %eax
leaq 0x3110(%rip), %rcx      # 0x53f0
movl (%rcx,%rax,4), %edi
callq 0x2998
movq %rax, 0x10(%rbx)
callq 0x37c0
movq %rax, 0x18(%rbx)
popq %rbx
retq
leaq 0x31b8(%rip), %rdi      # 0x54b6
leaq 0x317c(%rip), %rsi      # 0x5481
leaq 0x3265(%rip), %rcx      # 0x5571
movl $0xca, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_destroy_pair
void obmap_destroy_pair(obj *to_dealloc){

  /* cast generic obj to obmap */
  obmap_pair *instance = (obmap_pair *)to_dealloc;

  assert(to_dealloc);
  assert(ob_has_class(to_dealloc, "obmap_pair"));

  ob_release((obj *)instance->key);
  ob_release((obj *)instance->value);

  return;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2342
movq %rdi, %rbx
leaq 0x3142(%rip), %rsi      # 0x5468
callq 0x375c
testb %al, %al
je 0x2361
movq 0x8(%rbx), %rdi
callq 0x36e2
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0x36e2
leaq 0x33a2(%rip), %rdi      # 0x56eb
leaq 0x3131(%rip), %rsi      # 0x5481
leaq 0x339f(%rip), %rcx      # 0x56f6
movl $0x12a, %edx            # imm = 0x12A
callq 0x1050
leaq 0x33ad(%rip), %rdi      # 0x5715
leaq 0x3112(%rip), %rsi      # 0x5481
leaq 0x3380(%rip), %rcx      # 0x56f6
movl $0x12b, %edx            # imm = 0x12B
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_hash_pair
ob_hash_t obmap_hash_pair(const obj *to_hash){

  static int8_t init = 0;
  static ob_hash_t seed = 0;

  ob_hash_t value;
  obmap_pair *instance = (obmap_pair *)to_hash;

  assert(to_hash);
  assert(ob_has_class(to_hash, "obmap_pair"));

  if(init == 0){
    srand(time(NULL));
    seed = rand();
    init = 1;
  }

  value = seed;

  value += ob_hash(instance->key);
  value += ob_hash(instance->value);

  value += value << 3;
  value ^= value >> 11;
  value += value << 15;

  return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2414
movq %rdi, %rbx
leaq 0x30d0(%rip), %rsi      # 0x5468
callq 0x375c
testb %al, %al
je 0x2433
cmpb $0x1, 0x6cdc(%rip)      # 0x9088
jne 0x23b7
movq 0x6cdb(%rip), %r15      # 0x9090
jmp 0x23db
xorl %edi, %edi
callq 0x10a0
movl %eax, %edi
callq 0x1070
callq 0x10d0
movslq %eax, %r15
movq %r15, 0x6cbc(%rip)      # 0x9090
movb $0x1, 0x6cad(%rip)      # 0x9088
movq 0x8(%rbx), %rdi
callq 0x3620
movq %rax, %r14
addq %r15, %r14
movq 0x10(%rbx), %rdi
callq 0x3620
addq %r14, %rax
leaq (%rax,%rax,8), %rax
movq %rax, %rcx
shrq $0xb, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0xf, %rax
addq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x320e(%rip), %rdi      # 0x5629
leaq 0x305f(%rip), %rsi      # 0x5481
leaq 0x3208(%rip), %rcx      # 0x5631
movl $0x101, %edx            # imm = 0x101
callq 0x1050
leaq 0x321e(%rip), %rdi      # 0x5658
leaq 0x3040(%rip), %rsi      # 0x5481
leaq 0x31e9(%rip), %rcx      # 0x5631
movl $0x102, %edx            # imm = 0x102
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_display_pair
void obmap_display_pair(const obj *to_print){

  obmap_pair *mp = (obmap_pair *)to_print;

  assert(to_print != NULL);
  assert(ob_has_class(to_print, "obmap_pair"));

  fprintf(stderr, "  [key]\n");
  ob_display(mp->key);
  fprintf(stderr, "  [value]\n");
  ob_display(mp->value);
  return;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2475
movq %rdi, %rbx
leaq 0x3006(%rip), %rsi      # 0x5468
callq 0x375c
testb %al, %al
je 0x2494
movq %rbx, %rdi
callq 0x10f0
popq %rbx
retq
leaq 0x3200(%rip), %rdi      # 0x567c
leaq 0x2ffe(%rip), %rsi      # 0x5481
leaq 0x3203(%rip), %rcx      # 0x568d
movl $0x11a, %edx            # imm = 0x11A
callq 0x1050
leaq 0x3217(%rip), %rdi      # 0x56b2
leaq 0x2fdf(%rip), %rsi      # 0x5481
leaq 0x31e4(%rip), %rcx      # 0x568d
movl $0x11b, %edx            # imm = 0x11B
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_destroy
void obmap_destroy(obj *to_dealloc){

  /* cast generic obj to obmap */
  obmap *instance = (obmap *)to_dealloc;

  assert(to_dealloc);
  assert(ob_has_class(to_dealloc, "obmap"));

  ob_release((obj *)instance->hash_table);
  ob_release((obj *)instance->pairs);

  return;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x24df
movq %rdi, %rbx
leaq 0x2fb0(%rip), %rsi      # 0x5473
callq 0x375c
testb %al, %al
je 0x24fe
movq 0x10(%rbx), %rdi
callq 0x36e2
movq 0x18(%rbx), %rdi
popq %rbx
jmp 0x36e2
leaq 0x3205(%rip), %rdi      # 0x56eb
leaq 0x2f94(%rip), %rsi      # 0x5481
leaq 0x337a(%rip), %rcx      # 0x586e
movl $0x19a, %edx            # imm = 0x19A
callq 0x1050
leaq 0x3383(%rip), %rdi      # 0x5888
leaq 0x2f75(%rip), %rsi      # 0x5481
leaq 0x335b(%rip), %rcx      # 0x586e
movl $0x19b, %edx            # imm = 0x19B
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_hash
ob_hash_t obmap_hash(const obj *to_hash){

  static int8_t init = 0;
  static ob_hash_t seed = 0;

  ob_hash_t value;
  obdeque_iterator *it;
  obmap *instance = (obmap *)to_hash;

  assert(to_hash);
  assert(ob_has_class(to_hash, "obmap"));

  if(init == 0){
    srand(time(NULL));
    seed = rand();
    init = 1;
  }

  value = seed;

  it = obdeque_head_iterator(instance->pairs);
  if(!it) return value;

  /* perform commutative hash, so order of addition to table does not matter */
  do{
    value += ob_hash(obdeque_obj_at_iterator(instance->pairs, it));
  }while(obdeque_iterate_next(instance->pairs, it));

  ob_release((obj *)it);

  value += value << 3;
  value ^= value >> 11;
  value += value << 15;

  return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x25d9
movq %rdi, %rbx
leaq 0x2f3e(%rip), %rsi      # 0x5473
callq 0x375c
testb %al, %al
je 0x25f8
cmpb $0x1, 0x6b4f(%rip)      # 0x9098
jne 0x2554
movq 0x6b4e(%rip), %r14      # 0x90a0
jmp 0x2578
xorl %edi, %edi
callq 0x10a0
movl %eax, %edi
callq 0x1070
callq 0x10d0
movslq %eax, %r14
movq %r14, 0x6b2f(%rip)      # 0x90a0
movb $0x1, 0x6b20(%rip)      # 0x9098
movq 0x18(%rbx), %rdi
callq 0x38dc
testq %rax, %rax
je 0x25d0
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x390a
movq %rax, %rdi
callq 0x3620
addq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x3a03
testb %al, %al
jne 0x2589
movq %r15, %rdi
callq 0x36e2
leaq (%r14,%r14,8), %rax
movq %rax, %rcx
shrq $0xb, %rcx
xorq %rax, %rcx
movq %rcx, %r14
shlq $0xf, %r14
addq %rcx, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3049(%rip), %rdi      # 0x5629
leaq 0x2e9a(%rip), %rsi      # 0x5481
leaq 0x3170(%rip), %rcx      # 0x575e
movl $0x153, %edx            # imm = 0x153
callq 0x1050
leaq 0x3181(%rip), %rdi      # 0x5780
leaq 0x2e7b(%rip), %rsi      # 0x5481
leaq 0x3151(%rip), %rcx      # 0x575e
movl $0x154, %edx            # imm = 0x154
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_compare
int8_t obmap_compare(const obj *a, const obj *b){

  assert(a);
  assert(b);
  assert(ob_has_class(a, "obmap"));
  assert(ob_has_class(b, "obmap"));

  if(ob_hash(a) == ob_hash(b)) return OB_EQUAL_TO;
  return OB_NOT_EQUAL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2675
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2694
movq %rdi, %r14
leaq 0x2e41(%rip), %rsi      # 0x5473
callq 0x375c
testb %al, %al
je 0x26b3
leaq 0x2e31(%rip), %rsi      # 0x5473
movq %rbx, %rdi
callq 0x375c
testb %al, %al
je 0x26d2
movq %r14, %rdi
callq 0x3620
movq %rax, %r14
movq %rbx, %rdi
callq 0x3620
cmpq %rax, %r14
setne %al
addb %al, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3123(%rip), %rdi      # 0x579f
leaq 0x2dfe(%rip), %rsi      # 0x5481
leaq 0x3117(%rip), %rcx      # 0x57a1
movl $0x172, %edx            # imm = 0x172
callq 0x1050
leaq 0x3135(%rip), %rdi      # 0x57d0
leaq 0x2ddf(%rip), %rsi      # 0x5481
leaq 0x30f8(%rip), %rcx      # 0x57a1
movl $0x173, %edx            # imm = 0x173
callq 0x1050
leaq 0x3118(%rip), %rdi      # 0x57d2
leaq 0x2dc0(%rip), %rsi      # 0x5481
leaq 0x30d9(%rip), %rcx      # 0x57a1
movl $0x174, %edx            # imm = 0x174
callq 0x1050
leaq 0x3112(%rip), %rdi      # 0x57eb
leaq 0x2da1(%rip), %rsi      # 0x5481
leaq 0x30ba(%rip), %rcx      # 0x57a1
movl $0x175, %edx            # imm = 0x175
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obmap.c
// Function: obmap_display
void obmap_display(const obj *to_print){

  obmap *m = (obmap *)to_print;
  obdeque_iterator *it;

  assert(to_print != NULL);
  assert(ob_has_class(to_print, "obmap"));
  fprintf(stderr, "obmap with key-value pairs:\n");

  it = obdeque_head_iterator(m->pairs);

  if(!it) return;

  do{
    ob_display(obdeque_obj_at_iterator(m->pairs, it));
  }while(obdeque_iterate_next(m->pairs, it));

  fprintf(stderr, "  [map end]\n");

  ob_release((obj *)it);

  return;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2714
movq %rdi, %rbx
leaq 0x2d72(%rip), %rsi      # 0x5473
callq 0x375c
testb %al, %al
je 0x2733
movq %rbx, %rdi
callq 0x1144
popq %rbx
retq
leaq 0x2f61(%rip), %rdi      # 0x567c
leaq 0x2d5f(%rip), %rsi      # 0x5481
leaq 0x30db(%rip), %rcx      # 0x5804
movl $0x181, %edx            # imm = 0x181
callq 0x1050
leaq 0x30ea(%rip), %rdi      # 0x5824
leaq 0x2d40(%rip), %rsi      # 0x5481
leaq 0x30bc(%rip), %rcx      # 0x5804
movl $0x182, %edx            # imm = 0x182
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/codegen.c
// Function: load
static void load(Type *t) {
  printfln("  pop rax"); // スタックにつまれている、変数のアドレスをraxにロード
  // 変数のアドレスにある値をraxにロード
  int sz = t->size;
  if (sz == 1) {
    printfln("  movsx rax, BYTE PTR [rax]");
  } else if (sz == 2) {
    printfln("  movsx rax, WORD PTR [rax]");
  } else if (sz == 4) {
    printfln("  movsxd rax, DWORD PTR [rax]");
  } else if (sz == 8) {
    printfln("  mov rax, [rax]");
  } else {
    assert(false);
  }

  printfln("  push rax"); // 変数の値(rax)をスタックに積む
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7ac8(%rip), %rdi      # 0xb468
xorl %eax, %eax
callq 0x27b5
movl 0x4(%rbx), %eax
decl %eax
cmpl $0x8, %eax
jae 0x39e1
movl $0x8b, %ecx
btl %eax, %ecx
jae 0x39e1
movl %eax, %eax
leaq 0x7790(%rip), %rcx      # 0xb154
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
xorl %eax, %eax
callq 0x27b5
leaq 0x79da(%rip), %rdi      # 0xb3b3
xorl %eax, %eax
popq %rbx
jmp 0x27b5
leaq 0x793a(%rip), %rdi      # 0xb322
leaq 0x790b(%rip), %rsi      # 0xb2fa
leaq 0x8392(%rip), %rcx      # 0xbd88
movl $0x27, %edx
callq 0x20d0
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/codegen.c
// Function: store
static void store(Type *t) {
  printfln("  pop rdi"); // rhsの結果
  printfln("  pop rax"); // 左辺の変数のアドレス

  if (t->kind == TY_BOOL) {
    // booleanの場合はrdiが
    // 0のときは0
    // それ以外は固定で1をrdiに設定する
    printfln("  cmp rdi, 0");
    // cmp の比較で rdi != 0 のときだけ rdiの下位8bit に1をセット
    printfln("  setne dil");
    // rdiの上位56bitはクリアして1を代入
    printfln("  movzb rdi, dil");
  }

  int sz = t->size;
  // 左辺の変数にrhsの結果を代入
  if (sz == 1) {
    printfln("  mov [rax], dil");
  } else if (sz == 2) {
    printfln("  mov [rax], di");
  } else if (sz == 4) {
    printfln("  mov [rax], edi");
  } else if (sz == 8) {
    printfln("  mov [rax], rdi");
  } else {
    assert(false);
  }
  printfln("  push rdi"); // この代入結果自体もスタックに積む(右結合でどんどん左に伝搬していくときの右辺値になる)
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x838f(%rip), %rdi      # 0xbd9a
xorl %eax, %eax
callq 0x27b5
leaq 0x7a4f(%rip), %rdi      # 0xb468
xorl %eax, %eax
callq 0x27b5
cmpl $0x2, (%rbx)
jne 0x3a4f
leaq 0x8378(%rip), %rdi      # 0xbda4
xorl %eax, %eax
callq 0x27b5
leaq 0x8377(%rip), %rdi      # 0xbdb1
xorl %eax, %eax
callq 0x27b5
leaq 0x8375(%rip), %rdi      # 0xbdbd
xorl %eax, %eax
callq 0x27b5
movl 0x4(%rbx), %eax
decl %eax
cmpl $0x8, %eax
jae 0x3a89
movl $0x8b, %ecx
btl %eax, %ecx
jae 0x3a89
movl %eax, %eax
leaq 0x7708(%rip), %rcx      # 0xb174
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
xorl %eax, %eax
callq 0x27b5
leaq 0x83a3(%rip), %rdi      # 0xbe24
xorl %eax, %eax
popq %rbx
jmp 0x27b5
leaq 0x7892(%rip), %rdi      # 0xb322
leaq 0x7863(%rip), %rsi      # 0xb2fa
leaq 0x8373(%rip), %rcx      # 0xbe11
movl $0x48, %edx
callq 0x20d0
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/codegen.c
// Function: inc
static void inc(Type *ty) {
  printfln("  pop rax");
  // ポインタの場合はそのポインタが指す先の型のサイズ分インクリメントする。(int *x; x++ が4バイト先に進むような場合)
  // ポインタでない場合は単に値を1増やす int i = 0; i++; でiが1になる みたいな場合
  printfln("  add rax, %ld\n", ty->ptr_to ? ty->ptr_to->size : 1);
  printfln("  push rax");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x79b5(%rip), %rdi      # 0xb468
xorl %eax, %eax
callq 0x27b5
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x3ac8
movl 0x4(%rax), %esi
jmp 0x3acd
movl $0x1, %esi
leaq 0x8398(%rip), %rdi      # 0xbe6c
xorl %eax, %eax
callq 0x27b5
leaq 0x78d1(%rip), %rdi      # 0xb3b3
xorl %eax, %eax
popq %rbx
jmp 0x27b5
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/debug.c
// Function: node_ast_helper
char *node_ast_helper(Node *body) {
  char *tmp_bufs[1000];// 文の数
  char buf[10000];// ast dumpの文字列バッファ

  int n = 0;
  int i = 0;

  n += sprintf(buf + n, "\n");
  for (Node *nd = body; nd; nd = nd->next) {
    char *tmp = tmp_bufs[i] = node_ast(nd);
    n += sprintf(buf + n, "##   %s\n", tmp);
  }
  char *ret = my_strndup(buf, n);
  for (int j = 0; j < i; j++) {
    free(tmp_bufs[j]);
  }
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2710, %rsp           # imm = 0x2710
movw $0xa, (%rsp)
testq %rdi, %rdi
je 0x4635
movq %rdi, %r14
movl $0x1, %ebx
leaq 0x7f54(%rip), %r15      # 0xc560
movq %r14, %rdi
callq 0x3d28
movslq %ebx, %rbx
leaq (%rsp,%rbx), %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
addl %eax, %ebx
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x460c
jmp 0x463a
movl $0x1, %ebx
movq %rsp, %rdi
movl %ebx, %esi
callq 0x4ae3
addq $0x2710, %rsp           # imm = 0x2710
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/debug.c
// Function: function_body_ast
char *function_body_ast(Function *f) {
  int n = 0;
  char buf[10000];

  char *ti = type_info(f->return_type);
  n = sprintf(buf + n, "(def (%s) %s (", ti, f->name);
  free(ti);

  int i = 0;
  VarList* reverse_params = NULL;
  // f->paramsは最後の引数からのリンクリストになってるのでダンプ用には逆順にする。
  for (VarList *cur = f->params; cur; cur = cur->next) {
    VarList *vl = calloc(1, sizeof(VarList));
    vl->next = reverse_params;
    vl->var = cur->var;
    reverse_params = vl;
  }

  // 逆順にしたリストからastダンプ
  for (VarList *p = reverse_params; p; p = p->next) {
    char *ti = type_info(p->var->type);
    n += sprintf(buf + n, "%s %s", ti, p->var->name);
    free(ti);
    if (p->next) {
      n += sprintf(buf + n, " ");
    }
  }
  // 逆順のリストはもういらないので捨てる。(そこに紐づくLVar は別途freeされるので無視する)
  VarList *rp = reverse_params;
  while (rp) {
    VarList *tmp = rp->next;
    free(rp);
    rp = tmp;
  }

  char *body_ast = node_ast_helper(f->body);
  n += sprintf(buf + n, ") ( %s", body_ast);
  n += sprintf(buf + n, "## ))");
  free(body_ast);

  return my_strndup(buf, n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4e38, %rsp           # imm = 0x4E38
movq %rdi, %r12
movq 0x8(%rdi), %rdx
leaq 0x2720(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x3b4e
movq %r14, %rdi
movl %eax, %esi
callq 0x4ae3
movq %rax, %r15
movq 0x10(%r12), %rcx
leaq 0x7ed5(%rip), %rsi      # 0xc569
leaq 0x10(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
movl %eax, %r14d
movq %r15, %rdi
callq 0x2030
movq 0x28(%r12), %rbx
testq %rbx, %rbx
je 0x477b
movq %r12, 0x8(%rsp)
xorl %r15d, %r15d
movq %r15, %r12
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %rax, %r15
movq %r12, (%rax)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r15)
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x46c4
leaq 0x2720(%rsp), %r12
leaq 0x7e7d(%rip), %r13      # 0xc578
movq %r15, %rbx
movq 0x8(%rbx), %rax
movq (%rax), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x3b4e
movq %r12, %rdi
movl %eax, %esi
callq 0x4ae3
movq %rax, %rbp
movslq %r14d, %r14
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rcx
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x21c0
addl %eax, %r14d
movq %rbp, %rdi
callq 0x2030
cmpq $0x0, (%rbx)
je 0x4763
movslq %r14d, %r14
movw $0x20, 0x10(%rsp,%r14)
incl %r14d
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x46fe
movq 0x8(%rsp), %r12
movq (%r15), %rbx
movq %r15, %rdi
callq 0x2030
movq %rbx, %r15
testq %rbx, %rbx
jne 0x4768
movq 0x18(%r12), %rdi
callq 0x45e6
movq %rax, %rbx
movslq %r14d, %r14
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
leaq 0x7de4(%rip), %rsi      # 0xc57e
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
leal (%rax,%r14), %ecx
movslq %ecx, %rcx
movl $0x29202323, 0x10(%rsp,%rcx) # imm = 0x29202323
movw $0x29, 0x14(%rsp,%rcx)
leal (%rax,%r14), %ebp
addl $0x5, %ebp
movq %rbx, %rdi
callq 0x2030
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x4ae3
addq $0x4e38, %rsp           # imm = 0x4E38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/debug.c
// Function: dump_globals
void dump_globals(VarList *vars) {
  VarList *v = vars;
  while (v) {
    Node *dummy = calloc(1, sizeof(Node));
    dummy->kind = ND_VAR_DECL; // ローカル変数の宣言のダンプを使い回す
    dummy->var = v->var;
    printf("## %s\n", node_ast(dummy));
    v = v->next;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x485e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7d6e(%rip), %r14      # 0xc58b
movl $0x1, %edi
movl $0xc8, %esi
callq 0x2100
movl $0x20, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x78(%rax)
movq %rax, %rdi
callq 0x3d28
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x20c0
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x481d
addq $0x8, %rsp
popq %rbx
popq %r14
retq