LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: read_data
static void read_data(
  struct pdb_dir_t *pdb_dir,
  int index,
  int block_size,
  FILE *in)
{
  long marker = ftell(in);
  uint32_t *blocks = get_blocks(pdb_dir, index);
  int block_count = calc_block_count(pdb_dir->stream_sizes[index]);
  int n, offset = 0, length;

  for (n = 0; n < block_count; n++)
  {
    fseek(in, *blocks * block_size, SEEK_SET);
    length = fread(pdb_dir->heap + offset, 4096, 1, in);

    if (length == 0) { printf("Error: fread() 0 bytes.\n"); }

    offset += 4096;
    blocks++;
  }

  fseek(in, marker, SEEK_SET);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, 0xc(%rsp)
movl %esi, %r12d
movq %rdi, %r14
movq %rcx, %rdi
callq 0x10c0
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
testl %r12d, %r12d
jle 0x2b17
movq 0x8(%r14), %rax
movl %r12d, %ecx
movl $0xfff, %edx            # imm = 0xFFF
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
addl %edx, %edi
shrl $0xc, %edi
addl %edi, %r13d
incq %rsi
cmpq %rsi, %rcx
jne 0x2b01
movl %r13d, %r13d
movq 0x8(%r14), %rax
movslq %r12d, %rcx
movl $0xfff, %r15d           # imm = 0xFFF
addl (%rax,%rcx,4), %r15d
cmpl $0x1000, %r15d          # imm = 0x1000
jb 0x2b8e
shlq $0x2, %r13
addq 0x10(%r14), %r13
shrl $0xc, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
movl (%r13,%r12,4), %esi
imull 0xc(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
movq 0x18(%r14), %rdi
addq %rbp, %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1070
testl %eax, %eax
jne 0x2b7f
leaq 0x3d09(%rip), %rdi      # 0x6883
callq 0x1060
addq $0x1000, %rbp           # imm = 0x1000
incq %r12
cmpl %r12d, %r15d
jne 0x2b42
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O1/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: print_pdb_header
void print_pdb_header(struct pdb_header_t *pdb_header)
{
  printf(" -------- PDB header -------\n");
  printf("              magic: %s\n", pdb_header->magic);
  printf("             magic2: %02x %02x %02x %02x %02x %02x\n",
    pdb_header->magic_2[0],
    pdb_header->magic_2[1],
    pdb_header->magic_2[2],
    pdb_header->magic_2[3],
    pdb_header->magic_2[4],
    pdb_header->magic_2[5]);
  printf("         block_size: %d\n", pdb_header->block_size);
  printf("     free_block_map: %d\n", pdb_header->free_block_map);
  printf("         num_blocks: %d\n", pdb_header->number_of_blocks);
  printf("      num_dir_bytes: %d\n", pdb_header->number_of_dir_bytes);
  printf("           reserved: %d\n", pdb_header->reserved);
  printf("  block_map_address: %d\n", pdb_header->block_map_address);
  printf("\n");
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x3ce1(%rip), %rdi      # 0x689b
callq 0x1060
leaq 0x2c68(%rip), %rdi      # 0x582e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
movsbl 0x50(%rbx), %esi
movsbl 0x51(%rbx), %edx
movsbl 0x52(%rbx), %ecx
movsbl 0x53(%rbx), %r8d
movsbl 0x54(%rbx), %r9d
movsbl 0x55(%rbx), %eax
movl %eax, (%rsp)
leaq 0x2c53(%rip), %rdi      # 0x5847
xorl %eax, %eax
callq 0x1090
movl 0x58(%rbx), %esi
leaq 0x2c76(%rip), %rdi      # 0x587b
xorl %eax, %eax
callq 0x1090
movl 0x5c(%rbx), %esi
leaq 0x2c7e(%rip), %rdi      # 0x5894
xorl %eax, %eax
callq 0x1090
movl 0x60(%rbx), %esi
leaq 0x2c86(%rip), %rdi      # 0x58ad
xorl %eax, %eax
callq 0x1090
movl 0x64(%rbx), %esi
leaq 0x2c8e(%rip), %rdi      # 0x58c6
xorl %eax, %eax
callq 0x1090
movl 0x68(%rbx), %esi
leaq 0x2c96(%rip), %rdi      # 0x58df
xorl %eax, %eax
callq 0x1090
movl 0x6c(%rbx), %esi
leaq 0x2c9e(%rip), %rdi      # 0x58f8
xorl %eax, %eax
callq 0x1090
movl $0xa, %edi
addq $0x10, %rsp
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: print_pdb_dir
void print_pdb_dir(struct pdb_dir_t *pdb_dir)
{
  int ptr = 0;
  int n, i;

  printf(" -- PDB Directory --\n");
  printf("   stream_count: %d\n", pdb_dir->stream_count);
  printf("  stream_blocks:\n");

  for (n = 0; n < pdb_dir->stream_count; n++)
  {
    int count = calc_block_count(pdb_dir->stream_sizes[n]);

    printf("    %d: %6d {", n, pdb_dir->stream_sizes[n]);

    for (i = 0; i < count; i++)
    {
      printf(" %d", pdb_dir->stream_blocks[ptr++]);
    }

    printf(" }\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3c33(%rip), %rdi      # 0x68b8
callq 0x1060
movl (%rbx), %esi
leaq 0x2c7e(%rip), %rdi      # 0x5911
xorl %eax, %eax
callq 0x1090
leaq 0x3c2c(%rip), %rdi      # 0x68cd
callq 0x1060
cmpl $0x0, (%rbx)
je 0x2d42
leaq 0x2c70(%rip), %r15      # 0x5926
leaq 0x3ced(%rip), %rbp      # 0x69aa
leaq 0x2c70(%rip), %r12      # 0x5934
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movq 0x8(%rbx), %rax
movl (%rax,%r13,4), %edx
leal 0xfff(%rdx), %r14d
movq %r15, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x1090
cmpl $0x1000, %r14d          # imm = 0x1000
jb 0x2d30
shrl $0xc, %r14d
movslq 0x4(%rsp), %r15
negl %r14d
xorl %ebp, %ebp
movq 0x10(%rbx), %rax
movl (%rax,%r15,4), %esi
incq %r15
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
decl %ebp
cmpl %ebp, %r14d
jne 0x2d02
subl %ebp, 0x4(%rsp)
leaq 0x2bfd(%rip), %r15      # 0x5926
leaq 0x3c7a(%rip), %rbp      # 0x69aa
movq %rbp, %rdi
callq 0x1060
incq %r13
movl (%rbx), %eax
cmpq %rax, %r13
jb 0x2ccf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: read_pdb_dbi_stream
void read_pdb_dbi_stream(
  struct pdb_dir_t *pdb_dir,
  struct pdb_header_t *pdb_header,
  struct pdb_dbi_t *pdb_dbi,
  FILE *in)
{
  read_data(pdb_dir, 3, pdb_header->block_size, in);

  uint8_t *data = pdb_dir->heap;

  pdb_dbi->version_signature = get_int32(data + 0);
  pdb_dbi->version_header = get_uint32(data + 4);
  pdb_dbi->age = get_uint32(data + 8);
  pdb_dbi->global_stream_index = get_int16(data + 12);
  pdb_dbi->build_number = get_int16(data + 14);
  pdb_dbi->public_stream_index = get_int16(data + 16);
  pdb_dbi->pdb_dll_version = get_int16(data + 18);
  pdb_dbi->symbol_record_stream = get_int16(data + 20);
  pdb_dbi->pdb_dll_rbld = get_int16(data + 22);
  pdb_dbi->mod_info_size = get_int32(data + 24);
  pdb_dbi->section_contribution_size = get_int32(data + 28);
  pdb_dbi->section_map_size = get_int32(data + 32);
  pdb_dbi->source_info_size = get_int32(data + 36);
  pdb_dbi->type_server_size = get_int32(data + 40);
  pdb_dbi->mfc_type_server_index = get_uint32(data + 44);
  pdb_dbi->optional_debug_header_size = get_int32(data + 48);
  pdb_dbi->ec_substream_size = get_int32(data + 52);
  pdb_dbi->flags = get_int16(data + 56);
  pdb_dbi->machine = get_uint16(data + 58);
  pdb_dbi->padding = get_uint32(data + 60);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl 0x58(%rsi), %edx
movl $0x3, %esi
callq 0x2ac3
movq 0x18(%r14), %rax
movl (%rax), %ecx
movl %ecx, (%rbx)
movl 0x4(%rax), %ecx
movl %ecx, 0x4(%rbx)
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rbx)
movzwl 0xc(%rax), %ecx
movw %cx, 0xc(%rbx)
movzwl 0xe(%rax), %ecx
movw %cx, 0xe(%rbx)
movzwl 0x10(%rax), %ecx
movw %cx, 0x10(%rbx)
movzwl 0x12(%rax), %ecx
movw %cx, 0x12(%rbx)
movzwl 0x14(%rax), %ecx
movw %cx, 0x14(%rbx)
movzwl 0x16(%rax), %ecx
movw %cx, 0x16(%rbx)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rbx)
movl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rbx)
movl 0x20(%rax), %ecx
movl %ecx, 0x20(%rbx)
movl 0x24(%rax), %ecx
movl %ecx, 0x24(%rbx)
movl 0x28(%rax), %ecx
movl %ecx, 0x28(%rbx)
movl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rbx)
movl 0x30(%rax), %ecx
movl %ecx, 0x30(%rbx)
movl 0x34(%rax), %ecx
movl %ecx, 0x34(%rbx)
movzwl 0x38(%rax), %ecx
movw %cx, 0x38(%rbx)
movzwl 0x3a(%rax), %ecx
movw %cx, 0x3a(%rbx)
movl 0x3c(%rax), %eax
movl %eax, 0x3c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: dump_pdb_stream
void dump_pdb_stream(
  struct pdb_dir_t *pdb_dir,
  struct pdb_header_t *pdb_header,
  FILE *in,
  int index,
  const char *filename)
{
  read_data(pdb_dir, index, pdb_header->block_size, in);

  uint8_t *data = pdb_dir->heap;

  FILE *fp = fopen(filename, "wb");
  fwrite(data, pdb_dir->stream_sizes[index], 1, fp);
  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %rcx
movq %rdi, %r14
movl 0x58(%rsi), %edx
movl %ebp, %esi
callq 0x2ac3
movq 0x18(%r14), %r15
leaq 0x2684(%rip), %rsi      # 0x6861
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movq 0x8(%r14), %rax
movslq %ebp, %rcx
movl (%rax,%rcx,4), %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1080
// File: /workspace/github_c_makefile_star2_O1/cirocosta[P]stress/src/file-watcher.c
// Function: main
int
main(int argc, char** argv)
{
	stress_args_t args = { 0 };
	int fd;

	setbuf(stdout, NULL);
	stress_parse_args(argc, argv, &args);

	_STRESS_MUST_P((fd = inotify_init()) >= 0,
	               "inotify_init",
	               "couldn't initialize inotify");

	create_files_and_watch(args.n, fd);
	stress_wait_until_signalized();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x2010, %rsp           # imm = 0x2010
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %r14
movl $0x2008, %edx           # imm = 0x2008
movq %r14, %rdi
xorl %esi, %esi
callq 0x10e0
movq 0x20f4(%rip), %rax      # 0x3fc8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x10c0
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1bf9
callq 0x1130
testl %eax, %eax
js 0x1f12
movl 0x8(%rsp), %edi
movl %eax, %esi
callq 0x11f0
callq 0x1d22
xorl %eax, %eax
addq $0x2010, %rsp           # imm = 0x2010
popq %rbx
popq %r14
popq %rbp
retq
callq 0x19a4
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/1105.c
// Function: main
int
xmain(int argc, char *argv[])
{
	memset(&cpu, 0, sizeof(KD11B));
	memset(&bus, 0, sizeof(Bus));
	cpu.bus = &bus;
	busadddev(&bus, &membusdev);
	busadddev(&bus, &kebusdev);

	ARGBEGIN{
	}ARGEND;

	if(argc < 0)
		usage();

	loadmem("mem.txt");

	reset(&cpu);

	ttyopen(&cpu.tty);

#ifdef AUTODIAG
	if(rundiag(&cpu, "maindec/ZKAAA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKABA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKACA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKADA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAEA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAFA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAGA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAHA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAIA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAJA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAKA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKALA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAMA0.BIN")) return 0;
//	if(rundiag(&cpu, "maindec/maindec-11-d0nc.pb.bin")) return 0;
	printf("passed all diagnostics\n");
		return 0;
#endif

	cpu.r[7] = 0200;
//	cpu.sw = 0104000;
	run(&cpu);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leaq 0xc8f4(%rip), %rdi      # 0xe1e0
movl $0xe8, %edx
xorl %esi, %esi
callq 0x10e0
xorps %xmm0, %xmm0
movups %xmm0, 0xc9c6(%rip)     # 0xe2c8
movq $0x0, 0xc9cb(%rip) # 0xe2d8
leaq 0xc9b4(%rip), %rax      # 0xe2c8
movq %rax, 0xc8ed(%rip)      # 0xe208
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x191b
leaq 0x680b(%rip), %rax      # 0x8138
movq %rax, (%rcx)
movq $0x0, 0x67fd(%rip) # 0x8138
leaq 0xc986(%rip), %rcx      # 0xe2c8
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x1942
leaq 0x6824(%rip), %rcx      # 0x8178
movq %rcx, (%rax)
movq $0x0, 0x6816(%rip) # 0x8178
cmpq $0x0, 0xc86e(%rip)      # 0xe1d8
jne 0x1976
movq (%rbx), %rax
movq %rax, 0xc862(%rip)      # 0xe1d8
leal -0x1(%r14), %eax
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x19cb
cmpb $0x2d, (%rsi)
jne 0x19cb
leaq 0x8(%rbx), %rcx
leaq 0x1(%rsi), %rdx
movzbl 0x1(%rsi), %edi
cmpl $0x2d, %edi
je 0x199f
testl %edi, %edi
jne 0x19a5
jmp 0x19cb
cmpb $0x0, 0x2(%rsi)
je 0x19bc
cmpb $0x0, (%rdx)
leaq 0x1(%rdx), %rdx
jne 0x19a5
movb $0x1, %dl
movq %rcx, %rbx
movl %eax, %r14d
testb %dl, %dl
jne 0x1976
jmp 0x19cb
addl $-0x2, %r14d
addq $0x10, %rbx
xorl %edx, %edx
movl %r14d, %eax
jmp 0x19b3
testl %eax, %eax
js 0x1a11
leaq 0x3657(%rip), %rdi      # 0x502d
callq 0x1529
leaq 0xc7fe(%rip), %rbx      # 0xe1e0
movq %rbx, %rdi
callq 0x1ae4
leaq 0xc8ab(%rip), %rdi      # 0xe29c
callq 0x3d93
movw $0x80, 0xc7ef(%rip)     # 0xe1ee
movq %rbx, %rdi
callq 0x3355
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x1240
nop
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/kd11b.c
// Function: fetchop
static int
fetchop(KD11B *cpu, int t, int m, int b, int pse)
{
	int r;
	r = m&7;
	if((m&070) == 0)
		cpu->r[t] = cpu->r[r];
	else{
		if(dati(cpu, b, pse)) return 1;
		cpu->r[t] = cpu->bus->data;
		if(b && cpu->ba&1) cpu->r[t] = cpu->r[t]>>8;
	}
	if(b) cpu->r[t] = sxt(cpu->r[t]);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
testb $0x38, %dl
je 0x32cb
movq %rbx, %rdi
movl %r14d, %esi
movl %r8d, %edx
callq 0x1b41
movl $0x1, %r15d
testl %eax, %eax
jne 0x32f7
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %ecx
movl %ebp, %eax
movw %cx, (%rbx,%rax,2)
testl %r14d, %r14d
je 0x32f4
testb $0x1, 0x22(%rbx)
je 0x32d8
movzwl %cx, %ecx
shrl $0x8, %ecx
movw %cx, (%rbx,%rax,2)
jmp 0x32d8
andl $0x7, %edx
movzwl (%rbx,%rdx,2), %eax
movl %ebp, %ecx
movw %ax, (%rbx,%rcx,2)
xorl %r15d, %r15d
testl %r14d, %r14d
je 0x32f7
movl %ebp, %r14d
movzbl (%rbx,%r14,2), %edi
callq 0x1524
movw %ax, (%rbx,%r14,2)
jmp 0x32f7
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/asc16.c
// Function: asc16_load
int asc16_load(asc16_t *asc16, const char *filename)
{
	FILE *pf;
	int size;

	pf = fopen(filename, "rb");
	if (pf == NULL)
		return -1;

	size = file_readall(pf, &asc16->data);
	
	fclose(pf);

	if (size == -1)
		return -1;

	asc16->size = size;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x3602(%rip), %rsi      # 0x5004
movq %rax, %rdi
callq 0x1140
testq %rax, %rax
je 0x1acf
movq %rax, %r14
movq %rax, %rdi
callq 0x10f0
movq %rax, %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r15d
je 0x1a7a
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1120
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1a7a
movq %r14, %rdi
callq 0x10f0
movq %rax, %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r12d
je 0x1a7a
movslq %r15d, %rsi
xorl %r13d, %r13d
movq %r14, %rdi
xorl %edx, %edx
callq 0x1120
negl %eax
sbbl %r13d, %r13d
orl %r12d, %r13d
cmpl $-0x1, %r13d
je 0x1abb
movslq %r13d, %r12
movq %r12, %rdi
callq 0x1100
testq %rax, %rax
je 0x1abb
movq %rax, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1080
cmpq %r12, %rax
jne 0x1ab3
movq %r15, (%rbx)
movl %r13d, %ebp
jmp 0x1abb
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1090
cmpl $-0x1, %ebp
je 0x1acf
movl %ebp, 0x8(%rbx)
xorl %eax, %eax
jmp 0x1ad4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/asc16.c
// Function: asc16_gylph_print
void asc16_gylph_print(char *d)
{
	int i, j;
	for (j = 0; j < ASC16_GYLPH_HEIGHT; j++, d++) {
		for (i = 0; i < ASC16_GYLPH_WIDTH; i++) {
			if (asc16_is_setpixel(d, i))
				printf("*");
			else
				printf(" ");
		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movzbl (%rbx), %eax
movl %ebp, %ecx
shll %cl, %eax
movl $0x20, %edi
testb %al, %al
jns 0x1b04
movl $0x2a, %edi
callq 0x1040
incl %ebp
cmpl $0x8, %ebp
jne 0x1aef
movl $0xa, %edi
callq 0x1040
incl %r14d
incq %rbx
cmpl $0x10, %r14d
jne 0x1aed
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: free_draw_state
static void free_draw_state(draw_state_t *st)
{
	dlitem_t *curr, *next;
	rbnil_t *nil;

	if (st) {
		free(st->rows);
		dllist_foreach(&st->nils, curr, next, rbnil_t, nil, dlentry) {
			dllist_remove(curr);
			if (rbnode_is_left(&nil->base.rbentry))
				nil->base.rbentry.parent->left = rbnode_nil;
			else if (rbnode_is_right(&nil->base.rbentry))
				nil->base.rbentry.parent->right = rbnode_nil;
			free_nil(nil);
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x2249
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1030
movq 0x30(%rbx), %r14
addq $0x30, %rbx
cmpq %rbx, %r14
je 0x2242
movq %r14, %rax
leaq -0x40(%r14), %rdi
movq (%r14), %r14
movq 0x8(%rax), %rcx
movq %r14, (%rcx)
movq (%rax), %rdx
movq %rcx, 0x8(%rdx)
movq -0x20(%rax), %rax
cmpq %rdi, 0x10(%rax)
je 0x2230
cmpq %rdi, 0x18(%rax)
jne 0x223b
addq $0x18, %rax
jmp 0x2234
addq $0x10, %rax
movq $0x0, (%rax)
callq 0x1030
jmp 0x21fd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_init
int bitmap_init(bitmap_t *bitmap, int w, int h, color_t bg)
{
	int i;
	bitmap->w = w;
	bitmap->h = h;

	bitmap->colors = malloc(w * h * sizeof(color_t));
	if (bitmap->colors == NULL)
		return -1;
	for (i = 0; i < w * h; i++) {
		bitmap->colors[i] = bg;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
imull %esi, %ebp
movslq %ebp, %rdi
shlq $0x2, %rdi
callq 0x1100
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x2289
testl %ebp, %ebp
jle 0x2290
movl %ebp, %edx
xorl %ecx, %ecx
xorl %esi, %esi
movl %ebx, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x227c
jmp 0x2292
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x2292
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_point
int bitmap_draw_point(bitmap_t *bitmap, int x, int y, color_t c)
{
	int i = x + y * bitmap->w;
	if (i >= 0 && i < (bitmap->w * bitmap->h)) {
		bitmap->colors[i] = c;
		return 0;
	}
	else {
		errno = ERANGE;
		return -1;
	}
}

// Assembly:
movl (%rdi), %eax
imull %eax, %edx
addl %esi, %edx
js 0x22c5
imull 0x4(%rdi), %eax
cmpl %eax, %edx
jge 0x22c5
movq 0x8(%rdi), %rax
movl %edx, %edx
movl %ecx, (%rax,%rdx,4)
xorl %eax, %eax
retq
pushq %rax
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_line
int bitmap_draw_line(bitmap_t *bitmap, int x1, int y1, int x2, int y2, color_t color)
{
	int ix, iy, cx, cy, n2dy, n2dydx, d;
	int dx, dy, yy;
	int r = 0;
	
	dx = abs(x2 - x1);
	dy = abs(y2 - y1);
	yy = 0;

	if (dx < dy) {
		yy = 1;
		swap_int(&x1, &y1);
		swap_int(&x2, &y2);
		swap_int(&dx, &dy);
	}

	ix = (x2 - x1) > 0 ? 1 : -1;
	iy = (y2 - y1) > 0 ? 1 : -1;
	cx = x1;
	cy = y1;
	n2dy = dy * 2;
	n2dydx = (dy - dx) * 2;
	d = dy * 2 - dx;

	if (yy) { /* ����ֱ���� x ���ļнǴ��� 45 �� */
		while (cx != x2) {
			if (d < 0) {
				d += n2dy;
			}
			else {
				cy += iy;
				d += n2dydx;
			}
			if (bitmap_draw_point(bitmap, cy, cx, color) != 0)
				r = -1;
			cx += ix;
		}
	}
	else { /* ����ֱ���� x ���ļн�С�� 45 �� */
		while (cx != x2) {
			if (d < 0) {
				d += n2dy;
			}
			else {
				cy += iy;
				d += n2dydx;
			}
			if (bitmap_draw_point(bitmap, cx, cy, color) != 0)
				r = -1;
			cx += ix;
		}
	}

	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x4(%rsp)
movl %esi, %ebp
movl %ecx, %esi
subl %ebp, %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movq %rdi, %r14
movl %r8d, %edi
subl %edx, %edi
movl %edi, %esi
negl %esi
cmovsl %edi, %esi
cmpl %esi, %eax
jae 0x231b
movl %edx, %r15d
movl %r8d, %r9d
movl %esi, %edx
movl %eax, %r13d
jmp 0x232b
movl %ebp, %r15d
movl %edx, %ebp
movl %ecx, %r9d
movl %r8d, %ecx
movl %eax, %edx
movl %esi, %r13d
xorl %edi, %edi
cmpl %r15d, %r9d
setg %dil
xorl %r8d, %r8d
cmpl %ebp, %ecx
setg %r8b
leal (,%r13,2), %ebx
subl %edx, %r13d
addl %r13d, %r13d
movl %ebx, 0x14(%rsp)
subl %edx, %ebx
leal -0x1(,%rdi,2), %ecx
movl %ecx, 0x10(%rsp)
leal -0x1(,%r8,2), %ecx
movl %ecx, 0xc(%rsp)
cmpl %esi, %eax
movl %r9d, 0x8(%rsp)
jae 0x23dc
cmpl %r9d, %r15d
je 0x23e1
xorl %eax, %eax
movl %ebp, %ecx
testl %ebx, %ebx
movl 0xc(%rsp), %ebp
movl $0x0, %edx
cmovsl %edx, %ebp
movl %r13d, %r12d
cmovsl 0x14(%rsp), %r12d
addl %ecx, %ebp
movl (%r14), %edx
movl %edx, %ecx
imull %r15d, %ecx
addl %ebp, %ecx
js 0x23b8
imull 0x4(%r14), %edx
cmpl %edx, %ecx
jge 0x23b8
movq 0x8(%r14), %rdx
movl %ecx, %ecx
movl 0x4(%rsp), %esi
movl %esi, (%rdx,%rcx,4)
jmp 0x23cd
callq 0x1060
movl 0x8(%rsp), %r9d
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %r12d, %ebx
addl 0x10(%rsp), %r15d
cmpl %r15d, %r9d
jne 0x2378
jmp 0x2449
cmpl %r9d, %r15d
jne 0x23e5
xorl %eax, %eax
jmp 0x2449
xorl %eax, %eax
movl %ebp, %ecx
testl %ebx, %ebx
movl 0xc(%rsp), %ebp
movl $0x0, %edx
cmovsl %edx, %ebp
movl %r13d, %r12d
cmovsl 0x14(%rsp), %r12d
addl %ecx, %ebp
movl (%r14), %edx
movl %edx, %ecx
imull %ebp, %ecx
addl %r15d, %ecx
js 0x2427
imull 0x4(%r14), %edx
cmpl %edx, %ecx
jge 0x2427
movq 0x8(%r14), %rdx
movl %ecx, %ecx
movl 0x4(%rsp), %esi
movl %esi, (%rdx,%rcx,4)
jmp 0x243c
callq 0x1060
movl 0x8(%rsp), %r9d
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %r12d, %ebx
addl 0x10(%rsp), %r15d
cmpl %r15d, %r9d
jne 0x23e7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_circle
int bitmap_draw_circle(bitmap_t *bitmap, int xc, int yc, int r, int fill, color_t c)
{
	int x = 0, y = r, yi, d;
	int rc = 0;

	/* ����Բ��ͼƬ�ɼ������⣬ֱ���˳� */
	if (xc + r < 0 || xc - r >= bitmap->w ||
		yc + r < 0 || yc - r >= bitmap->h) {
		errno = ERANGE;
		return -1;
	}

	d = 3 - 2 * r;

	if (fill) {
		/* �������䣨��ʵ��Բ��*/
		while (x <= y) {
			for (yi = x; yi <= y; yi++) {
				if (draw_circle_8(bitmap, xc, yc, x, yi, c) != 0)
					rc = -1;
			}

			if (d < 0) {
				d = d + 4 * x + 6;
			}
			else {
				d = d + 4 * (x - y) + 10;
				y--;
			}
			x++;
		}
	}
	else {
		/* ���������䣨������Բ��*/
		while (x <= y) {
			if (draw_circle_8(bitmap, xc, yc, x, y, c) != 0)
				rc = -1;

			if (d < 0) {
				d = d + 4 * x + 6;
			}
			else {
				d = d + 4 * (x - y) + 10;
				y--;
			}
			x++;
		}
	}

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %eax
addl %esi, %eax
js 0x2540
movl %ecx, %ebp
movl %esi, %eax
subl %ecx, %eax
cmpl (%rdi), %eax
setge %al
addl %edx, %ecx
sets %cl
orb %al, %cl
jne 0x2540
movl %edx, %eax
subl %ebp, %eax
cmpl 0x4(%rdi), %eax
jge 0x2540
movl $0x3, %ebx
subl %ebp, %ebx
subl %ebp, %ebx
testl %r8d, %r8d
movl %r9d, 0x4(%rsp)
movl %edx, (%rsp)
movl %esi, %r12d
movq %rdi, %r15
je 0x2563
testl %ebp, %ebp
js 0x25d9
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %rbx, 0x8(%rsp)
cmpl %r14d, %ebp
movq %rbp, %rax
movl %r14d, %ebp
movq %rax, 0x10(%rsp)
cmovgl %eax, %ebp
incl %ebp
movl %r14d, %ebx
movq %r15, %rdi
movl %r12d, %esi
movl (%rsp), %edx
movl %r14d, %ecx
movl %ebx, %r8d
movl 0x4(%rsp), %r9d
callq 0x25e1
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %r13d
incl %ebx
cmpl %ebx, %ebp
jne 0x24de
movq 0x8(%rsp), %rbx
testl %ebx, %ebx
js 0x2526
movl %r14d, %eax
movq 0x10(%rsp), %rbp
subl %ebp, %eax
leal (%rbx,%rax,4), %ebx
addl $0xa, %ebx
decl %ebp
jmp 0x2532
leal (%rbx,%r14,4), %ebx
addl $0x6, %ebx
movq 0x10(%rsp), %rbp
leal 0x1(%r14), %eax
cmpl %ebp, %r14d
movl %eax, %r14d
jl 0x24c3
jmp 0x2551
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
js 0x25d9
xorl %r13d, %r13d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x6, %r8d
xorl %r14d, %r14d
movl %r8d, 0x8(%rsp)
incl %ecx
movl %ecx, 0x10(%rsp)
movl %ebp, %r8d
callq 0x25e1
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
testl %ebx, %ebx
js 0x25ac
movl %r14d, %ecx
subl %ebp, %ecx
leal (%rbx,%rcx,4), %ebx
addl $0xa, %ebx
decl %ebp
movl 0x8(%rsp), %r8d
jmp 0x25b4
movl 0x8(%rsp), %r8d
addl %r8d, %ebx
orl %eax, %r13d
incl %r14d
addl $0x4, %r8d
movl 0x10(%rsp), %ecx
cmpl %ebp, %ecx
movl 0x4(%rsp), %r9d
movl (%rsp), %edx
movl %r12d, %esi
movq %r15, %rdi
jl 0x2578
jmp 0x2551
xorl %r13d, %r13d
jmp 0x2551
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_rect
int bitmap_draw_rect(bitmap_t *bitmap, int x0, int y0, int x1, int y1, int fill, color_t color)
{
	int x, y;
	int r = 0;
	if (fill) {
		for (y = y0; y < y1; y++) {
			for (x = x0; x <= x1; x++) {
				if (bitmap_draw_point(bitmap, x, y, color) != 0)
					r = -1;
			}
		}
	}
	else {
		for (x = x0; x <= x1; x++) {
			if (bitmap_draw_point(bitmap, x, y0, color) != 0)
				r = -1;
			if (bitmap_draw_point(bitmap, x, y1, color) != 0)
				r = -1;
		}
		for (y = y0; y < y1; y++) {
			if (bitmap_draw_point(bitmap, x0, y, color) != 0)
				r = -1;
			if (bitmap_draw_point(bitmap, x1, y, color) != 0)
				r = -1;
		}
	}

	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %ebp
movq %rdi, %r12
movl 0x50(%rsp), %r13d
testl %r9d, %r9d
movl %r8d, 0xc(%rsp)
movl %esi, 0x10(%rsp)
je 0x28a8
xorl %eax, %eax
cmpl %ebx, %ebp
jge 0x29af
leal 0x1(%r14), %r15d
xorl %eax, %eax
movq %r14, %rbx
movl 0x10(%rsp), %ecx
cmpl %r14d, %ecx
jg 0x2898
movl %ecx, %r14d
movl (%r12), %edx
movl %ebp, %ecx
imull %edx, %ecx
addl %r14d, %ecx
js 0x2880
imull 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x2880
movq 0x8(%r12), %rdx
movl %ecx, %ecx
movl %r13d, (%rdx,%rcx,4)
jmp 0x2890
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %r14d
cmpl %r14d, %r15d
jne 0x285b
incl %ebp
cmpl 0xc(%rsp), %ebp
movq %rbx, %r14
jne 0x284c
jmp 0x29af
xorl %eax, %eax
cmpl %r14d, %esi
jg 0x2936
leal 0x1(%r14), %eax
movl %eax, 0x14(%rsp)
xorl %eax, %eax
movl 0x10(%rsp), %r15d
movl (%r12), %edx
movl %edx, %ecx
imull %ebp, %ecx
addl %r15d, %ecx
js 0x28e7
imull 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x28e7
movq 0x8(%r12), %rdx
movl %ecx, %ecx
movl %r13d, (%rdx,%rcx,4)
jmp 0x28f7
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl (%r12), %edx
movl %edx, %ecx
imull %ebx, %ecx
addl %r15d, %ecx
js 0x291c
imull 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x291c
movq 0x8(%r12), %rdx
movl %ecx, %ecx
movl %r13d, (%rdx,%rcx,4)
jmp 0x292c
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %r15d
cmpl %r15d, 0x14(%rsp)
jne 0x28c2
cmpl %ebx, %ebp
jge 0x29af
movl (%r12), %edx
movl %edx, %ecx
imull %ebp, %ecx
addl 0x10(%rsp), %ecx
js 0x2960
imull 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x2960
movq 0x8(%r12), %rdx
movl %ecx, %ecx
movl %r13d, (%rdx,%rcx,4)
jmp 0x2970
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl 0xc(%rsp), %ebx
movl (%r12), %edx
movl %edx, %ecx
imull %ebp, %ecx
addl %r14d, %ecx
js 0x2999
imull 0x4(%r12), %edx
cmpl %edx, %ecx
jge 0x2999
movq 0x8(%r12), %rdx
movl %ecx, %ecx
movl %r13d, (%rdx,%rcx,4)
jmp 0x29a9
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %ebp
cmpl %ebp, %ebx
jne 0x293a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_char
int bitmap_draw_char(bitmap_t *bitmap, int ch, int x, int y, color_t c, asc16_t *asc16)
{
	int i, j, r = 0;
	char *d;
	d = asc16_gylph_data(asc16, ch);
	for (j = 0; j < ASC16_GYLPH_HEIGHT; j++, d++) {
		for (i = 0; i < ASC16_GYLPH_WIDTH; i++) {
			if (asc16_is_setpixel(d, i))
				if (bitmap_draw_point(bitmap, x + i, y + j, c) != 0)
					r = -1;
		}
	}
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, 0x4(%rsp)
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %r15
shll $0x4, %esi
movslq %esi, %r13
addq (%r9), %r13
xorl %eax, %eax
xorl %ebx, %ebx
xorl %r12d, %r12d
movzbl (%r13), %edx
movl %r12d, %ecx
shll %cl, %edx
testb %dl, %dl
jns 0x2a2c
movl (%r15), %edx
movl %ebp, %ecx
imull %edx, %ecx
leal (%r14,%r12), %esi
addl %esi, %ecx
js 0x2a1c
imull 0x4(%r15), %edx
cmpl %edx, %ecx
jge 0x2a1c
movq 0x8(%r15), %rdx
movl %ecx, %ecx
movl 0x4(%rsp), %esi
movl %esi, (%rdx,%rcx,4)
jmp 0x2a2c
callq 0x1060
movl $0x22, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %r12d
cmpl $0x8, %r12d
jne 0x29e6
incl %ebx
incq %r13
incl %ebp
cmpl $0x10, %ebx
jne 0x29e3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_draw_string
int bitmap_draw_string(bitmap_t *bitmap, char *str, int x, int y, color_t c, asc16_t *asc16)
{
	int r = 0;
	while (*str) {
		if (bitmap_draw_char(bitmap, *str, x, y, c, asc16) != 0)
			r = -1;
		x += ASC16_ADVANCE;
		str++;
	}
	return r;
}

// Assembly:
movb (%rsi), %al
testb %al, %al
je 0x2ac1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbp
movl %r8d, %r14d
movl %ecx, %r13d
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
incq %r12
xorl %edx, %edx
movl %edx, 0x4(%rsp)
movsbl %al, %esi
movq %rbx, %rdi
movl %r15d, %edx
movl %r13d, %ecx
movl %r14d, %r8d
movq %rbp, %r9
callq 0x29be
movl 0x4(%rsp), %edx
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %edx
addl $0x8, %r15d
movb (%r12), %al
incq %r12
testb %al, %al
jne 0x2a78
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ac3
xorl %edx, %edx
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: fwritei24
static inline int fwritei24(int v, FILE *pf)
{
	char buf[4];
	int r;
	buf[0] = v & 0xff;
	buf[1] = (v >> 8) & 0xff;
	buf[2] = (v >> 16) & 0xff;
	r = fwrite(buf, 1, 3, pf);
	if (r != 3)
		return -1;
	return 0;
}

// Assembly:
pushq %rax
movq %rsi, %rcx
movl %edi, %eax
leaq 0x4(%rsp), %rdi
movb %al, (%rdi)
movb %ah, 0x5(%rsp)
shrl $0x10, %eax
movb %al, 0x2(%rdi)
movl $0x1, %esi
movl $0x3, %edx
callq 0x1160
xorl %ecx, %ecx
cmpl $0x3, %eax
setne %cl
negl %ecx
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: bitmap_save
int bitmap_save(bitmap_t *bitmap, const char *filename)
{
	FILE *pf;
	int r;

	pf = fopen(filename, "wb");
	if (pf == NULL)
		return -1;

	r = bitmap_print(bitmap, pf);

	fclose(pf);

	return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x22e2(%rip), %rsi      # 0x5020
movq %rax, %rdi
callq 0x1140
testq %rax, %rax
je 0x2d67
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2ac6
movl %eax, %ebx
movq %r14, %rdi
callq 0x1090
movl %ebx, %eax
jmp 0x2d6c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/bitmap.c
// Function: move_x_fixup
static void move_x_fixup(draw_state_t *st, rbpoint_t *point)
{
	rbnode_t *n;
	rbpoint_t *m;
	dllist_t *list;
	int x;
	n = rbnode_is_nil(point->rbentry.left) ?
		point->rbentry.right :
		point->rbentry.left;
	if (!rbnode_is_nil(n)) {
		m = container_of(n, rbpoint_t, rbentry);
		if (m->x < point->x - 1) {
			x = point->x - 1 - m->x;
			m->x += x;
			list = st->rows + m->y;
			while (m->dlentry.next != &list->head) {
				m = container_of(m->dlentry.next, rbpoint_t, dlentry);
				m->x += x;
				move_x_fixup(st, m);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rsi), %rax
testq %rax, %rax
jne 0x2d8b
movq 0x18(%rsi), %rax
testq %rax, %rax
je 0x2dc9
movl 0x38(%rsi), %ecx
decl %ecx
movl %ecx, %ebp
subl 0x38(%rax), %ebp
jle 0x2dc9
movl %ecx, 0x38(%rax)
movslq 0x3c(%rax), %r14
shlq $0x4, %r14
addq 0x20(%rbx), %r14
movq 0x28(%rax), %r15
cmpq %r14, %r15
je 0x2dc9
leaq -0x28(%r15), %rsi
addl %ebp, 0x10(%r15)
movq %rbx, %rdi
callq 0x2d74
movq (%r15), %r15
jmp 0x2daf
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: insert
static void insert(int v)
{
	rbpoint_t *point;

	if (v < 0) {
		printf("insert %d error: require positive integer.\n", v);
		return;
	}

	point = malloc(sizeof(rbpoint_t));
	if (point == NULL) {
		printf("insert %d error: alloc.\n", v);
		return;
	}
	memset(point, 0, sizeof(rbpoint_t));
	point->rbentry.key = itop(v);
	if (rbtree_insert(&tree, &point->rbentry) == 0) {
		printf("insert %d.\n", v);
		entries++;
	}
	else {
		printf("insert %d error: exist.\n", v);
	}
}

// Assembly:
pushq %rbx
movl %edi, %ebx
testl %edi, %edi
js 0x3796
movl $0x40, %edi
callq 0x1100
testq %rax, %rax
je 0x379f
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movl %ebx, %ecx
movq %rcx, (%rax)
leaq 0x494f(%rip), %rdi      # 0x80d0
movq %rax, %rsi
callq 0x127c
testl %eax, %eax
je 0x37b0
leaq 0x1977(%rip), %rdi      # 0x510b
jmp 0x37a6
leaq 0x191d(%rip), %rdi      # 0x50ba
jmp 0x37a6
leaq 0x1940(%rip), %rdi      # 0x50e6
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x10b0
leaq 0x1948(%rip), %rdi      # 0x50ff
movl %ebx, %esi
xorl %eax, %eax
callq 0x10b0
incl 0x49ba(%rip)            # 0x8180
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: delete
static void delete(int v)
{
	rbnode_t *n;
	rbpoint_t *point;
	n = rbtree_lookup(&tree, itop(v));
	if (n == NULL) {
		printf("%d not exist.\n", v);
	}
	else {
		point = container_of(n, rbpoint_t, rbentry);
		rbtree_remove(&tree, n);
		printf("delete %d\n", ptoi(n->key));
		free_point(point);
		entries--;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl %edi, %esi
leaq 0x48fa(%rip), %rdi      # 0x80d0
callq 0x13ec
testq %rax, %rax
je 0x3817
movq %rax, %rbx
leaq 0x48e6(%rip), %rdi      # 0x80d0
movq %rax, %rsi
callq 0x1426
movl (%rbx), %esi
leaq 0x1938(%rip), %rdi      # 0x5133
xorl %eax, %eax
callq 0x10b0
movq %rbx, %rdi
callq 0x1030
decl 0x4970(%rip)            # 0x8180
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1906(%rip), %rdi      # 0x5124
movl %ebp, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: lookup
static void lookup(int v)
{
	rbnode_t *n;
	n = rbtree_lookup(&tree, itop(v));
	if (n == NULL) {
		printf("%d not exist.\n", v);
	}
	else {
		print_node(&tree, n, NULL);
	}
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl %edi, %esi
leaq 0x4897(%rip), %rdi      # 0x80d0
callq 0x13ec
testq %rax, %rax
je 0x384c
movq %rax, %rsi
popq %rbx
jmp 0x3c2d
leaq 0x18d1(%rip), %rdi      # 0x5124
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: do_print
static void do_print(const char *opt)
{
	printf("parent node color   dir    x    y\n");
	if (opt == NULL)
		rbtree_foreach_print(&tree, print_node, NULL);
	else if (strcmp("pre", opt) == 0)
		rbtree_foreach_preorder(&tree, print_node, NULL);
	else if (strcmp("in", opt) == 0)
		rbtree_foreach_inorder(&tree, print_node, NULL);
	else if (strcmp("post", opt) == 0)
		rbtree_foreach_postorder(&tree, print_node, NULL);
	else {
		if (strlen(opt) != 0) {
			printf("warning: unknow print option \"%s\", print in default mode.\n", opt);
		}
		rbtree_foreach_print(&tree, print_node, NULL);
	}

	printf("%d entries.\n", entries);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x1f63(%rip), %rdi      # 0x57cb
callq 0x1070
testq %rbx, %rbx
je 0x38c1
leaq 0x17dc(%rip), %rdi      # 0x5055
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x38d8
leaq 0x17cd(%rip), %rdi      # 0x5059
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x38ef
leaq 0x17bd(%rip), %rdi      # 0x505c
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x3906
cmpb $0x0, (%rbx)
je 0x38c1
leaq 0x18be(%rip), %rdi      # 0x5175
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x4808(%rip), %rdi      # 0x80d0
leaq 0x35e(%rip), %rsi       # 0x3c2d
xorl %edx, %edx
callq 0x1822
jmp 0x391b
leaq 0x47f1(%rip), %rdi      # 0x80d0
leaq 0x347(%rip), %rsi       # 0x3c2d
xorl %edx, %edx
callq 0x16d0
jmp 0x391b
leaq 0x47da(%rip), %rdi      # 0x80d0
leaq 0x330(%rip), %rsi       # 0x3c2d
xorl %edx, %edx
callq 0x1744
jmp 0x391b
leaq 0x47c3(%rip), %rdi      # 0x80d0
leaq 0x319(%rip), %rsi       # 0x3c2d
xorl %edx, %edx
callq 0x17b4
movl 0x485f(%rip), %esi      # 0x8180
leaq 0x1926(%rip), %rdi      # 0x524e
xorl %eax, %eax
popq %rbx
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: do_load
static void do_load(const char *path)
{
	FILE *pf;
	char buf[1024];
	int r, i, ch, v;

	printf("Loading from %s ...\n", path);

	pf = fopen(path, "rb");
	if (pf == NULL) {
		printf("Can't open the file %s.\n", path);
		return;
	}

	v = -1;

	while ((r = fread(buf, 1, sizeof(buf), pf)) > 0) {
		for (i = 0; i < r; i++) {
			ch = buf[i];
			if (isspace(ch)) {
				if (v >= 0) {
					insert(v);
					v = -1;
				}
			}
			else if (!isdigit(ch)) {
				printf("Invalid file format %s.\n", path);
				fclose(pf);
				return;
			}
			else {
				if (v == -1)
					v = ch - '0';
				else {
					v *= 10;
					v += ch - '0';
				}
			}
		}
	}

	if (v >= 0) {
		insert(v);
		v = -1;
	}

	fclose(pf);

	printf("%d entries.\n", entries);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x1865(%rip), %rdi      # 0x51b0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x16a8(%rip), %rsi      # 0x5004
movq %rbx, %rdi
callq 0x1140
testq %rax, %rax
je 0x3a5e
movq %rax, %r14
movq %rsp, %rdi
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %rax, %rcx
callq 0x1080
movq %rax, %r13
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %r13d, %r13d
jle 0x3a24
callq 0x1170
movq %rax, %r12
movl $0x1, %eax
cmpl $0x2, %r13d
cmovll %eax, %r13d
xorl %ebp, %ebp
movsbq (%rsp,%rbp), %rax
movq (%r12), %rcx
movzwl (%rcx,%rax,2), %ecx
btl $0xd, %ecx
jb 0x39df
btl $0xb, %ecx
jae 0x3a80
cmpl $-0x1, %r15d
je 0x39f4
leal (%r15,%r15,4), %ecx
leal (%rax,%rcx,2), %r15d
addl $-0x30, %r15d
jmp 0x39fa
testl %r15d, %r15d
js 0x39fa
movl %r15d, %edi
callq 0x374d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x39fa
addl $-0x30, %eax
movl %eax, %r15d
incq %rbp
cmpq %rbp, %r13
jne 0x39ae
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %rsp, %rdi
movq %r14, %rcx
callq 0x1080
movq %rax, %r13
testl %r13d, %r13d
movl $0x1, %eax
jg 0x39a4
testl %r15d, %r15d
js 0x3a31
movl %r15d, %edi
callq 0x374d
movq %r14, %rdi
callq 0x1090
movl 0x4741(%rip), %esi      # 0x8180
leaq 0x1808(%rip), %rdi      # 0x524e
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
leaq 0x1760(%rip), %rdi      # 0x51c5
movq %rbx, %rsi
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
leaq 0x1757(%rip), %rdi      # 0x51de
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movq %r14, %rdi
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: do_save
static void do_save(const char *path)
{
	FILE *pf;
	int r;
	struct save_state ss = { 0 };

	printf("Saving to %s ...\n", path);

	pf = fopen(path, "wb");
	if (pf == NULL) {
		printf("Can't open the file %s.\n", path);
		return;
	}

	ss.pf = pf;
	ss.i = 0;

	r = rbtree_foreach_inorder(&tree, save_node, &ss);
	if (r != 0)
		printf("Failed to write file %s.\n", path);

	fclose(pf);

	printf("%d entries.\n", entries);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x1735(%rip), %rdi      # 0x51f7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x154d(%rip), %rsi      # 0x5020
movq %rbx, %rdi
callq 0x1140
testq %rax, %rax
je 0x3b3c
movq %rax, %r14
movq %rsp, %rdx
movq %rax, (%rdx)
movl $0x0, 0x8(%rdx)
leaq 0x45d9(%rip), %rdi      # 0x80d0
leaq 0x214(%rip), %rsi       # 0x3d12
callq 0x1744
testl %eax, %eax
je 0x3b18
leaq 0x16fb(%rip), %rdi      # 0x5209
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movq %r14, %rdi
callq 0x1090
movl 0x465a(%rip), %esi      # 0x8180
leaq 0x1721(%rip), %rdi      # 0x524e
xorl %eax, %eax
callq 0x10b0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x1682(%rip), %rdi      # 0x51c5
movq %rbx, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: do_bmp
static void do_bmp(const char *path, int nil)
{
	bitmap_t *bitmap;
	printf("Creating bitmap...\n");

	bitmap = rbtree_save_as_bitmap(&tree, &asc16, nil);

	if (bitmap == NULL) {
		printf("Failed to create bitmap.\n");
		return;
	}

	if (path && strlen(path) > 0) {
		if (bitmap_save(bitmap, path) != 0) {
			bitmap_free(bitmap);
			printf("Failed to save bitmap to file %s.\n", path);
			return;
		}
	}
	else {
		if (bitmap_print(bitmap, stdout) != 0) {
			bitmap_free(bitmap);
			printf("Failed to print bitmap to \"stdout\".\n");
			return;
		}
		printf("\n");
	}

	bitmap_free(bitmap);

	printf("Done. %d entries.\n", entries);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x18bc(%rip), %rdi      # 0x5420
callq 0x1070
leaq 0x4560(%rip), %rdi      # 0x80d0
leaq 0x45f9(%rip), %rsi      # 0x8170
movl %ebx, %edx
callq 0x1b31
testq %rax, %rax
je 0x3be7
movq %rax, %rbx
testq %r14, %r14
je 0x3bc0
cmpb $0x0, (%r14)
je 0x3bc0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d2d
testl %eax, %eax
je 0x3c04
movq %rbx, %rdi
callq 0x2299
leaq 0x1676(%rip), %rdi      # 0x5225
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10b0
movq 0x4411(%rip), %rax      # 0x7fd8
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2ac6
testl %eax, %eax
je 0x3bfa
movq %rbx, %rdi
callq 0x2299
leaq 0x184e(%rip), %rdi      # 0x5433
jmp 0x3bee
leaq 0x1869(%rip), %rdi      # 0x5457
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
movl $0xa, %edi
callq 0x1040
movq %rbx, %rdi
callq 0x2299
movl 0x456e(%rip), %esi      # 0x8180
leaq 0x162f(%rip), %rdi      # 0x5248
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: print_node
static int print_node(rbtree_t *tree, rbnode_t *n, void *state)
{
	rbpoint_t *point = container_of(n, rbpoint_t, rbentry);
	if (n->parent == NULL) {
		printf("       %4d %5s       %4d %4d\n", ptoi(n->key),
			n->color == rbnode_red ? "r" : "b",
			point->x, point->y);
	}
	else {
		printf("%6d %4d %5s %5s %4d %4d\n",
			ptoi(n->parent->key),
			ptoi(n->key),
			n->color == rbnode_red ? "r" : "b",
			n->parent->right == n ? "r" : "l",
			point->x, point->y);
	}
	return 0;
}

// Assembly:
pushq %rax
movq 0x20(%rsi), %rdi
testq %rdi, %rdi
je 0x3c7c
movl (%rdi), %eax
cmpl $0x1, 0x8(%rsi)
leaq 0x1407(%rip), %r9       # 0x504b
leaq 0x13ba(%rip), %rcx      # 0x5005
cmoveq %r9, %rcx
movl (%rsi), %edx
cmpq %rsi, 0x18(%rdi)
leaq 0x1413(%rip), %r8       # 0x506f
cmoveq %r9, %r8
movl 0x38(%rsi), %r9d
movl 0x3c(%rsi), %esi
movl %esi, (%rsp)
leaq 0x14eb(%rip), %rdi      # 0x515c
movl %eax, %esi
xorl %eax, %eax
callq 0x10b0
jmp 0x3cab
movl (%rsi), %eax
cmpl $0x1, 0x8(%rsi)
leaq 0x13c2(%rip), %rcx      # 0x504b
leaq 0x1375(%rip), %rdx      # 0x5005
cmoveq %rcx, %rdx
movl 0x38(%rsi), %ecx
movl 0x3c(%rsi), %r8d
leaq 0x149c(%rip), %rdi      # 0x513e
movl %eax, %esi
xorl %eax, %eax
callq 0x10b0
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: do_clean
static void do_clean()
{
	printf("Cleaning...\n");
	free_rbtree(&tree);
	rbtree_init(&tree, keycmp);
	entries = 0;
	printf("%d entries.\n", entries);
}

// Assembly:
pushq %rax
leaq 0x17b9(%rip), %rdi      # 0x5470
callq 0x1070
leaq 0x440d(%rip), %rdi      # 0x80d0
leaq 0x3b(%rip), %rsi        # 0x3d05
xorl %edx, %edx
callq 0x17b4
movq $0x0, 0x43f4(%rip) # 0x80d0
leaq -0xbc(%rip), %rax       # 0x3c27
movq %rax, 0x43ee(%rip)      # 0x80d8
movl $0x0, 0x448c(%rip)      # 0x8180
leaq 0x1553(%rip), %rdi      # 0x524e
xorl %esi, %esi
xorl %eax, %eax
popq %rcx
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: save_node
static int save_node(rbtree_t *tree, rbnode_t *n, void *state)
{
	struct save_state *ss = state;
	char *key;
	int r;

	if (ss->i > 0) {
		if ((ss->i % 8) == 0) {
			if (fwrite("\n", 1, 1, ss->pf) != 1)
				return -1;
		}
		else {
			if (fwrite("\t", 1, 1, ss->pf) != 1)
				return -1;
		}
	}

    key = keytostr(n->key);

	r = strlen(key);

	if (fwrite(key, 1, r, ss->pf) != r)
		return -1;

	ss->i++;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl 0x8(%rdx), %eax
testl %eax, %eax
jle 0x3d58
movq (%rbx), %rcx
testb $0x7, %al
je 0x3d34
leaq 0x14f1(%rip), %rdi      # 0x5223
jmp 0x3d3b
leaq 0x1488(%rip), %rdi      # 0x51c3
movl $0x1, %esi
movl $0x1, %edx
callq 0x1160
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x1, %rcx
jne 0x3da8
movl (%r14), %ecx
leaq 0x442e(%rip), %r14      # 0x8190
leaq 0x12be(%rip), %rdx      # 0x5027
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
callq 0x10a0
movslq %eax, %r15
movq (%rbx), %rcx
movl $0x1, %esi
movq %r14, %rdi
movq %r15, %rdx
callq 0x1160
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r15, %rcx
jne 0x3da8
incl 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]rbtree/test/test.c
// Function: next_arg
static int next_arg(char *buf, int bufsize)
{
	int i, ch;
	skip_blank();
	for (i = 0, ch = getchar();
		ch != '\n' && ch != EOF && i < bufsize;
		i++, ch = getchar()) {
		if (isblank(ch))
			break;
		buf[i] = (char)ch;
	}
	if (i < bufsize)
		buf[i] = '\0';
	if (i > 0) {
		if (ch == '\n' || ch == EOF)
			ungetc('\n', stdin);
	}
	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x10e0
movl %eax, %r14d
cmpl $-0x1, %eax
je 0x3de2
cmpl $0xa, %r14d
je 0x3de2
callq 0x1170
movq (%rax), %rax
movslq %r14d, %rcx
testb $0x1, (%rax,%rcx,2)
jne 0x3dbe
cmpl $-0x1, %r14d
movl $0xa, %edi
cmovnel %r14d, %edi
movq 0x41ea(%rip), %r12      # 0x7fe0
movq (%r12), %rsi
callq 0x1110
callq 0x10e0
movl %eax, %r15d
xorl %r13d, %r13d
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
cmpl $-0x1, %r15d
je 0x3e49
cmpl $0xa, %r15d
je 0x3e49
cmpq %r13, %r14
je 0x3e4c
callq 0x1170
movq (%rax), %rax
movslq %r15d, %rcx
testb $0x1, (%rax,%rcx,2)
jne 0x3e49
movb %r15b, (%rbx,%r13)
incq %r13
callq 0x10e0
movl %eax, %r15d
jmp 0x3e16
movl %r13d, %r14d
cmpl %ebp, %r14d
jge 0x3e58
movl %r14d, %eax
movb $0x0, (%rbx,%rax)
testl %r14d, %r14d
je 0x3e77
cmpl $0xa, %r15d
je 0x3e69
cmpl $-0x1, %r15d
jne 0x3e77
movq (%r12), %rsi
movl $0xa, %edi
callq 0x1110
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq