LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_TSTB
INSTR(TSTB) {
  I32 r0 = LOAD_REG_I32(0);
  I32 gbr = LOAD_GBR_I32();
  I32 addr = ADD_I32(r0, gbr);
  I8 v = LOAD_I8(addr);
  I8 imm = (uint8_t)i->imm;
  I8 r = CMPEQ_IMM_I8(AND_I8(v, imm), 0);
  STORE_T_I32(r);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x20(%rdi), %rax
movslq 0x10(%rdi), %rcx
addq %rax, %rcx
movq 0x160(%rdi), %rax
andq 0x168(%rdi), %rcx
movsbl (%rax,%rcx), %eax
movsbl 0x10(%rsi), %ecx
xorl %edx, %edx
testl %eax, %ecx
sete %dl
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
orl %eax, %edx
movl %edx, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_XORI
INSTR(XORI) {
  I32 r0 = LOAD_REG_I32(0);
  uint32_t mask = (uint32_t)i->imm;
  I32 v = XOR_IMM_I32(r0, mask);
  STORE_REG_I32(0, v);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x10(%rsi), %eax
xorl %eax, 0x20(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_XORB
INSTR(XORB) {
  I32 r0 = LOAD_REG_I32(0);
  I32 gbr = LOAD_GBR_I32();
  I32 addr = ADD_I32(r0, gbr);
  I8 v = XOR_I8(LOAD_I8(addr), (uint8_t)i->imm);
  STORE_I8(addr, v);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x20(%rdi), %rax
movslq 0x10(%rdi), %rcx
addq %rax, %rcx
movq 0x160(%rdi), %rax
andq 0x168(%rdi), %rcx
movb 0x10(%rsi), %dl
xorb %dl, (%rax,%rcx)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_ROTL
INSTR(ROTL) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_msb = AND_I32(LSHR_IMM_I32(rn, 31), 0x1);
  I32 v = OR_I32(SHL_IMM_I32(rn, 1), rn_msb);
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_msb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
movl %ecx, %edx
roll %edx
movl %edx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
shrl $0x1f, %ecx
orl %eax, %ecx
movl %ecx, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_ROTR
INSTR(ROTR) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_lsb = AND_IMM_I32(rn, 0x1);
  I32 v = OR_I32(SHL_IMM_I32(rn_lsb, 31), LSHR_IMM_I32(rn, 1));
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_lsb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
movl %ecx, %edx
andl $0x1, %edx
rorl %ecx
movl %ecx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
orl %edx, %eax
movl %eax, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_ROTCL
INSTR(ROTCL) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_msb = AND_IMM_I32(LSHR_IMM_I32(rn, 31), 0x1);
  I32 v = OR_I32(SHL_IMM_I32(rn, 1), LOAD_T_I32());
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_msb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
movl 0x14c(%rdi), %edx
andl $0x1, %edx
leal (%rdx,%rcx,2), %edx
movl %edx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
shrl $0x1f, %ecx
orl %eax, %ecx
movl %ecx, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_ROTCR
INSTR(ROTCR) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_lsb = AND_IMM_I32(rn, 0x1);
  I32 v = OR_I32(SHL_IMM_I32(LOAD_T_I32(), 31), LSHR_IMM_I32(rn, 1));
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_lsb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
movl 0x14c(%rdi), %edx
shldl $0x1f, %ecx, %edx
andl $0x1, %ecx
movl %edx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
orl %ecx, %eax
movl %eax, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_SHAD
INSTR(SHAD) {
  // when Rm >= 0, Rn << Rm
  // when Rm < 0, Rn >> Rm
  // when shifting right > 32, Rn = (Rn >= 0 ? 0 : -1)
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rm = LOAD_REG_I32(i->rm);
  STORE_REG_I32(i->rn, ASHD_I32(rn, rm));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %edx
movzwl 0xa(%rsi), %ecx
movl 0x20(%rdi,%rcx,4), %esi
movl %esi, %ecx
andl $0x1f, %ecx
testl %esi, %esi
js 0x44fe
shll %cl, %edx
jmp 0x450b
testl %ecx, %ecx
je 0x4508
negb %cl
sarl %cl, %edx
jmp 0x450b
sarl $0x1f, %edx
movl %edx, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_SHAL
INSTR(SHAL) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_msb = AND_I32(LSHR_IMM_I32(rn, 31), 0x1);
  I32 v = SHL_IMM_I32(rn, 1);
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_msb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
leal (%rcx,%rcx), %edx
movl %edx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
shrl $0x1f, %ecx
orl %eax, %ecx
movl %ecx, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_SHAR
INSTR(SHAR) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rn_lsb = AND_IMM_I32(rn, 0x1);
  I32 v = ASHR_IMM_I32(rn, 1);
  STORE_REG_I32(i->rn, v);
  STORE_T_I32(rn_lsb);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %ecx
movl %ecx, %edx
andl $0x1, %edx
sarl %ecx
movl %ecx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
andl $-0x2, %eax
orl %edx, %eax
movl %eax, 0x14c(%rdi)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_SHLD
INSTR(SHLD) {
  // when Rm >= 0, Rn << Rm
  // when Rm < 0, Rn >> Rm
  // when shifting right >= 32, Rn = 0
  I32 rn = LOAD_REG_I32(i->rn);
  I32 rm = LOAD_REG_I32(i->rm);
  STORE_REG_I32(i->rn, LSHD_I32(rn, rm));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %edx
movzwl 0xa(%rsi), %ecx
movl 0x20(%rdi,%rcx,4), %esi
movl %esi, %ecx
andl $0x1f, %ecx
testl %esi, %esi
js 0x4591
shll %cl, %edx
jmp 0x459d
testl %ecx, %ecx
je 0x459b
negb %cl
sarl %cl, %edx
jmp 0x459d
xorl %edx, %edx
movl %edx, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BFS
INSTR(BFS) {
  I32 cond = LOAD_T_I32();
  uint32_t dest_addr = ((int8_t)i->disp * 2) + ctx->pc + 4;
  DELAY_INSTR();
  BRANCH_FALSE_IMM_I32(cond, dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
leal 0x2(%rax), %ecx
movsbl 0xe(%rsi), %edx
movl %ecx, (%rdi)
testb $0x1, 0x14c(%rdi)
leal 0x4(%rax,%rdx,2), %eax
cmovnel %ecx, %eax
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BTS
INSTR(BTS) {
  I32 cond = LOAD_T_I32();
  uint32_t dest_addr = ((int8_t)i->disp * 2) + ctx->pc + 4;
  DELAY_INSTR();
  BRANCH_TRUE_IMM_I32(cond, dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
leal 0x2(%rax), %ecx
movsbl 0xe(%rsi), %edx
movl %ecx, (%rdi)
testb $0x1, 0x14c(%rdi)
leal 0x4(%rax,%rdx,2), %eax
cmovel %ecx, %eax
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BRA
INSTR(BRA) {
  int32_t disp = ((i->disp & 0xfff) << 20) >>
                 20;  // 12-bit displacement must be sign extended
  uint32_t dest_addr = (disp * 2) + ctx->pc + 4;
  DELAY_INSTR();
  BRANCH_IMM_I32(dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xe(%rsi), %eax
shll $0x14, %eax
sarl $0x13, %eax
movl 0x4(%rdi), %ecx
addl %ecx, %eax
addl $0x4, %eax
addl $0x2, %ecx
movl %ecx, (%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BRAF
INSTR(BRAF) {
  I32 rn = LOAD_REG_I32(i->rn);
  I32 dest_addr = ADD_IMM_I32(rn, ctx->pc + 4);
  DELAY_INSTR();
  BRANCH_I32(dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %eax
movl 0x4(%rdi), %ecx
addl %ecx, %eax
addl $0x4, %eax
addl $0x2, %ecx
movl %ecx, (%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BSR
INSTR(BSR) {
  int32_t disp = ((i->disp & 0xfff) << 20) >>
                 20;  // 12-bit displacement must be sign extended
  uint32_t ret_addr = ctx->pc + 4;
  uint32_t dest_addr = ret_addr + disp * 2;
  DELAY_INSTR();
  STORE_PR_IMM_I32(ret_addr);
  BRANCH_IMM_I32(dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xe(%rsi), %eax
shll $0x14, %eax
movl 0x4(%rdi), %ecx
leal 0x4(%rcx), %edx
sarl $0x13, %eax
addl %ecx, %eax
addl $0x4, %eax
addl $0x2, %ecx
movl %ecx, (%rdi)
movl %edx, 0xc(%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_BSRF
INSTR(BSRF) {
  I32 rn = LOAD_REG_I32(i->rn);
  uint32_t ret_addr = ctx->pc + 4;
  I32 dest_addr = ADD_IMM_I32(rn, ret_addr);
  DELAY_INSTR();
  STORE_PR_IMM_I32(ret_addr);
  BRANCH_I32(dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x4(%rdi), %ecx
leal 0x4(%rcx), %edx
movl 0x20(%rdi,%rax,4), %eax
addl %edx, %eax
addl $0x2, %ecx
movl %ecx, (%rdi)
movl %edx, 0xc(%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_JSR
INSTR(JSR) {
  I32 dest_addr = LOAD_REG_I32(i->rn);
  uint32_t ret_addr = ctx->pc + 4;
  DELAY_INSTR();
  STORE_PR_IMM_I32(ret_addr);
  BRANCH_I32(dest_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movl 0x20(%rdi,%rax,4), %eax
movl 0x4(%rdi), %ecx
leal 0x4(%rcx), %edx
addl $0x2, %ecx
movl %ecx, (%rdi)
movl %edx, 0xc(%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_LDCMSR
INSTR(LDCMSR) {
  I32 addr = LOAD_REG_I32(i->rm);
  I32 v = LOAD_I32(addr);
  STORE_SR_I32(v);
  // reload Rm, sr store could have swapped banks
  addr = LOAD_REG_I32(i->rm);
  STORE_REG_I32(i->rm, ADD_I32(addr, 4));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xa(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
movq 0x160(%rdi), %rdx
andq 0x168(%rdi), %rcx
movl (%rdx,%rcx), %ecx
movl %ecx, 0x14c(%rdi)
addl $0x4, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_LDCMGBR
INSTR(LDCMGBR) {
  I32 addr = LOAD_REG_I32(i->rm);
  I32 v = LOAD_I32(addr);
  STORE_GBR_I32(v);
  STORE_REG_I32(i->rm, ADD_I32(addr, 4));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xa(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
movq 0x160(%rdi), %rdx
leal 0x4(%rcx), %esi
andq 0x168(%rdi), %rcx
movl (%rdx,%rcx), %ecx
movl %ecx, 0x10(%rdi)
movl %esi, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_LDCMDBR
INSTR(LDCMDBR) {
  I32 addr = LOAD_REG_I32(i->rm);
  I32 v = LOAD_I32(addr);
  STORE_DBR_I32(v);
  STORE_REG_I32(i->rm, ADD_I32(addr, 4));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xa(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
movq 0x160(%rdi), %rdx
leal 0x4(%rcx), %esi
andq 0x168(%rdi), %rcx
movl (%rdx,%rcx), %ecx
movl %ecx, 0x108(%rdi)
movl %esi, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_LDSMMACL
INSTR(LDSMMACL) {
  I32 addr = LOAD_REG_I32(i->rm);
  I32 v = LOAD_I32(addr);
  STORE_MACL_I32(v);
  STORE_REG_I32(i->rm, ADD_I32(addr, 4));
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xa(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
movq 0x160(%rdi), %rdx
leal 0x4(%rcx), %esi
andq 0x168(%rdi), %rcx
movl (%rdx,%rcx), %ecx
movl %ecx, 0x1c(%rdi)
movl %esi, 0x20(%rdi,%rax,4)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_RTE
INSTR(RTE) {
  I32 ssr = LOAD_SSR_I32();
  I32 spc = LOAD_SPC_I32();
  STORE_SR_I32(ssr);
  BRANCH_I32(spc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %eax
movl 0x150(%rdi), %ecx
movl %ecx, 0x14c(%rdi)
movl %eax, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_STCMSR
INSTR(STCMSR) {
  I32 addr = SUB_IMM_I32(LOAD_REG_I32(i->rn), 4);
  STORE_REG_I32(i->rn, addr);
  I32 v = LOAD_SR_I32();
  STORE_I32(addr, v);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
addq $-0x4, %rcx
movl %ecx, 0x20(%rdi,%rax,4)
movl 0x14c(%rdi), %eax
movq 0x160(%rdi), %rdx
andq 0x168(%rdi), %rcx
movl %eax, (%rdx,%rcx)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_STCMSSR
INSTR(STCMSSR) {
  I32 addr = SUB_IMM_I32(LOAD_REG_I32(i->rn), 4);
  STORE_REG_I32(i->rn, addr);
  I32 v = LOAD_SSR_I32();
  STORE_I32(addr, v);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
addq $-0x4, %rcx
movl %ecx, 0x20(%rdi,%rax,4)
movl 0x150(%rdi), %eax
movq 0x160(%rdi), %rdx
andq 0x168(%rdi), %rcx
movl %eax, (%rdx,%rcx)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_STCMSPC
INSTR(STCMSPC) {
  I32 addr = SUB_IMM_I32(LOAD_REG_I32(i->rn), 4);
  STORE_REG_I32(i->rn, addr);
  I32 v = LOAD_SPC_I32();
  STORE_I32(addr, v);
  NEXT_INSTR();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0xc(%rsi), %eax
movslq 0x20(%rdi,%rax,4), %rcx
addq $-0x4, %rcx
movl %ecx, 0x20(%rdi,%rax,4)
movl 0x8(%rdi), %eax
movq 0x160(%rdi), %rdx
andq 0x168(%rdi), %rcx
movl %eax, (%rdx,%rcx)
addl $0x2, 0x4(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_arg_mask
static void ARG_MASK(const char *sig, char arg, uint16_t *mask,
                     uint16_t *shift) {
  int len = (int)strlen(sig);
  if (mask) {
    *mask = 0;
  }
  if (shift) {
    *shift = 0;
  }
  for (int i = 0; i < len; i++) {
    if ((!arg && sig[i] == '1') || (arg && sig[i] == arg)) {
      if (mask) {
        *mask |= (1 << (len - i - 1));
      }
      if (shift) {
        *shift = (uint16_t)(len - i - 1);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
callq 0x30b0
testq %r14, %r14
je 0x5076
movw $0x0, (%r14)
testq %rbx, %rbx
je 0x5080
movw $0x0, (%rbx)
testl %eax, %eax
jle 0x50c9
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal -0x1(%rax), %ecx
xorl %eax, %eax
movb (%r12,%rax), %sil
testb %r15b, %r15b
je 0x50a1
cmpb %r15b, %sil
je 0x50a7
jmp 0x50bf
cmpb $0x31, %sil
jne 0x50bf
testq %r14, %r14
je 0x50b7
movl $0x1, %esi
shll %cl, %esi
orw %si, (%r14)
testq %rbx, %rbx
je 0x50bf
movw %cx, (%rbx)
incq %rax
decl %ecx
cmpq %rax, %rdx
jne 0x5091
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./sh4.h
// Function: sh4_decode
int DECODE(uint16_t data, INSTR_T *instr) {
  INSTR_TYPE_T *type = instr_lookup[data];

  if (!type) {
    return 0;
  }

  instr->type = type;
  instr->rm = (data & type->rm_mask) >> type->rm_shift;
  instr->rn = (data & type->rn_mask) >> type->rn_shift;
  instr->disp = (data & type->disp_mask) >> type->disp_shift;
  instr->imm = (data & type->imm_mask) >> type->imm_shift;

  return 1;
}

// Assembly:
movl %edi, %eax
leaq 0x9005(%rip), %rcx      # 0xe0e0
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x513b
pushq %rbp
movq %rsp, %rbp
movq %rax, (%rsi)
movzwl 0x20(%rax), %ecx
andw %di, %cx
movzwl %cx, %edx
movb 0x22(%rax), %cl
shrl %cl, %edx
movw %dx, 0xa(%rsi)
movzwl 0x24(%rax), %ecx
andw %di, %cx
movzwl %cx, %edx
movb 0x26(%rax), %cl
shrl %cl, %edx
movw %dx, 0xc(%rsi)
movzwl 0x1c(%rax), %ecx
andw %di, %cx
movzwl %cx, %edx
movb 0x1e(%rax), %cl
shrl %cl, %edx
movw %dx, 0xe(%rsi)
andw 0x18(%rax), %di
movzwl %di, %edx
movb 0x1a(%rax), %cl
shrl %cl, %edx
movw %dx, 0x10(%rsi)
movl $0x1, %eax
popq %rbp
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: gdb_server_create
gdb_server_t *gdb_server_create(gdb_target_t *target, int port) {
  if (!target) {
    return NULL;
  }

  gdb_server_t *sv = GDB_SERVER_MALLOC(sizeof(gdb_server_t));
  memset(sv, 0, sizeof(*sv));
  sv->target = target;
  sv->listen = INVALID_SOCKET;
  sv->client = INVALID_SOCKET;

  if (gdb_server_create_listen(sv, port) == -1) {
    GDB_SERVER_FREE(sv);
    sv = NULL;
  }

  return sv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x5261
movl %esi, %r14d
movq %rdi, %r15
movl $0x40020, %edi          # imm = 0x40020
callq 0x3150
movq %rax, %rbx
movl $0x40020, %edx          # imm = 0x40020
movq %rax, %rdi
xorl %esi, %esi
callq 0x3100
movq %r15, (%rbx)
movq $-0x1, 0x8(%rbx)
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x31e0
movl %eax, %r15d
movl %eax, 0x8(%rbx)
cmpl $-0x1, %eax
je 0x521e
leaq -0x1c(%rbp), %rcx
movl $0x1, (%rcx)
movl %r15d, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x3080
cmpl $-0x1, %eax
je 0x5227
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rsi
movaps %xmm0, (%rsi)
movw $0x2, (%rsi)
movl %r14d, %eax
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
movl $0x0, 0x4(%rsi)
movl %r15d, %edi
movl $0x10, %edx
callq 0x3190
cmpl $-0x1, %eax
je 0x5230
movl %r15d, %edi
movl $0x1, %esi
callq 0x3160
cmpl $-0x1, %eax
je 0x5239
leaq 0x2c94(%rip), %rdi      # 0x7ea6
movl %r14d, %esi
xorl %eax, %eax
callq 0x30d0
jmp 0x5263
leaq 0x2fb9(%rip), %rdi      # 0x81de
jmp 0x5240
leaq 0x2f84(%rip), %rdi      # 0x81b2
jmp 0x5240
leaq 0x2f61(%rip), %rdi      # 0x8198
jmp 0x5240
leaq 0x2f39(%rip), %rdi      # 0x8179
callq 0x3060
movl %r15d, %edi
movl $0x2, %esi
callq 0x30a0
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x3030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: gdb_server_send_packet
static int gdb_server_send_packet(gdb_server_t *sv, const char *data) {
  uint8_t cs = packet_data_checksum(data);

  // make sure the data won't overflow our buffer
  int length = (int)strlen(data);
  if (length > GDB_MAX_DATA_SIZE) {
    return -1;
  }

  snprintf(sv->conn.last_sent, sizeof(sv->conn.last_sent), "%c%s%c%02x",
           GDB_PACKET_BEGIN, data, GDB_PACKET_END, cs);

  return gdb_server_send_raw(sv, sv->conn.last_sent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30b0
testl %eax, %eax
jle 0x52e5
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%r14,%rcx), %esi
addl %esi, %edx
incq %rcx
cmpq %rcx, %rax
jne 0x52d0
movzbl %dl, %r12d
jmp 0x52e8
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x30b0
cmpl $0x1fffb, %eax          # imm = 0x1FFFB
jle 0x5304
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20015(%rbx), %r15
movl %r12d, (%rsp)
leaq 0x2c73(%rip), %rdx      # 0x7f89
movl $0x20000, %esi          # imm = 0x20000
movq %r15, %rdi
movl $0x24, %ecx
movq %r14, %r8
movl $0x23, %r9d
xorl %eax, %eax
callq 0x30e0
movq %rbx, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x611d
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: sh4_server_init
void sh4_server_init(gdb_target_t *target, sh4_context_t *ctx) {
  target->ctx = ctx;
  target->endian = GDB_LITTLE_ENDIAN;
  target->num_regs = 59;
  target->stop = &server_stop;
  target->resume = &server_resume;
  target->step = &server_step;
  target->add_bp = &server_add_bp;
  target->rem_bp = &server_rem_bp;
  target->read_reg = &server_read_reg;
  target->read_mem = &server_read_mem;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, (%rdi)
movabsq $0x3b00000000, %rax     # imm = 0x3B00000000
movq %rax, 0x8(%rdi)
leaq 0x48(%rip), %rax        # 0x5dc4
movq %rax, 0x10(%rdi)
leaq 0x4d(%rip), %rax        # 0x5dd4
movq %rax, 0x18(%rdi)
leaq 0x52(%rip), %rax        # 0x5de4
movq %rax, 0x20(%rdi)
leaq 0xee(%rip), %rax        # 0x5e8b
movq %rax, 0x28(%rdi)
leaq 0xef(%rip), %rax        # 0x5e97
movq %rax, 0x30(%rdi)
leaq 0x138(%rip), %rax       # 0x5eeb
movq %rax, 0x40(%rdi)
leaq 0x231(%rip), %rax       # 0x5fef
movq %rax, 0x38(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: server_step
static void server_step(void *data) {
  sh4_context_t *ctx = (sh4_context_t *)data;
  ctx->running = 1;

  uint32_t target = server_next_pc(ctx);
  add_temp_bp(ctx, target);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
movl $0x1, 0x15c(%rdi)
leaq -0x1a8(%rbp), %rdi
movl $0x188, %edx            # imm = 0x188
movq %rbx, %rsi
callq 0x3130
movl 0x4(%rbx), %eax
andl 0x168(%rbx), %eax
movq 0x160(%rbx), %rcx
movzwl (%rcx,%rax), %edi
leaq -0x20(%rbp), %rsi
callq 0x50d2
testl %eax, %eax
je 0x5e6c
movq -0x20(%rbp), %rax
testb $0x2, 0x4(%rax)
je 0x5e4a
leaq -0x1a8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq *0x10(%rax)
movl -0x1a4(%rbp), %esi
addl $0x2, %esi
movq %rbx, %rdi
callq 0x63fe
movl $0x1, 0x8(%rax)
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %rbp
retq
leaq 0x228d(%rip), %rdi      # 0x8100
leaq 0x229f(%rip), %rsi      # 0x8119
leaq 0x22a5(%rip), %rcx      # 0x8126
movl $0x44, %edx
callq 0x30f0
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: server_rem_bp
static void server_rem_bp(void *data, int type, intmax_t addr) {
  sh4_context_t *ctx = (sh4_context_t *)data;
  breakpoint_t *bp = find_bp(ctx, addr);
  assert(bp);
  rem_bp(ctx, bp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x180(%rdi), %rax
testq %rax, %rax
jle 0x5ebf
movq 0x178(%rdi), %rcx
cmpl %edx, (%rcx)
cmoveq %rcx, %rsi
je 0x5ec1
addq $0xc, %rcx
decq %rax
jne 0x5eae
xorl %esi, %esi
testq %rsi, %rsi
je 0x5ecc
popq %rbp
jmp 0x605e
leaq 0x114d(%rip), %rdi      # 0x7020
leaq 0x223f(%rip), %rsi      # 0x8119
leaq 0x226e(%rip), %rcx      # 0x814f
movl $0x6a, %edx
callq 0x30f0
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: server_read_reg
static void server_read_reg(void *data, int n, intmax_t *value, int *size) {
  sh4_context_t *ctx = (sh4_context_t *)data;

  if (n < 16) {
    *value = ctx->r[n];
  } else if (n == 16) {
    *value = ctx->pc;
  } else if (n == 17) {
    *value = ctx->pr;
  } else if (n == 18) {
    *value = ctx->gbr;
  } else if (n == 19) {
    *value = ctx->vbr;
  } else if (n == 20) {
    *value = ctx->mach;
  } else if (n == 21) {
    *value = ctx->macl;
  } else if (n == 22) {
    *value = ctx->sr;
  } else if (n == 23) {
    *value = ctx->fpul;
  } else if (n == 24) {
    *value = ctx->fpscr;
  } else if (n < 41) {
    *value = ctx->fr[n - 25];
  } else if (n == 41) {
    *value = ctx->ssr;
  } else if (n == 42) {
    *value = ctx->spc;
  } else if (n < 51) {
    uint32_t *b0 = (ctx->sr & RB) ? ctx->ralt : ctx->r;
    *value = b0[n - 43];
  } else if (n < 59) {
    uint32_t *b1 = (ctx->sr & RB) ? ctx->r : ctx->ralt;
    *value = b1[n - 51];
  }

  *size = 4;
}

// Assembly:
cmpl $0xf, %esi
jg 0x5f0c
movslq %esi, %rax
leaq (%rdi,%rax,4), %rdi
addq $0x20, %rdi
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
movq %rax, (%rdx)
popq %rbp
movl $0x4, (%rcx)
retq
leal -0x10(%rsi), %eax
cmpl $0x8, %eax
ja 0x5f63
leaq 0x1f61(%rip), %rsi      # 0x7e7c
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
addq $0x4, %rdi
jmp 0x5efb
addq $0x18, %rdi
jmp 0x5efb
addq $0x10, %rdi
jmp 0x5efb
addq $0x14, %rdi
jmp 0x5efb
addq $0x104, %rdi            # imm = 0x104
jmp 0x5efb
addq $0xc, %rdi
jmp 0x5efb
addq $0x1c, %rdi
jmp 0x5efb
addq $0x14c, %rdi            # imm = 0x14C
jmp 0x5efb
addq $0x158, %rdi            # imm = 0x158
jmp 0x5efb
cmpl $0x28, %esi
jg 0x5f78
addl $-0x19, %esi
leaq (%rdi,%rsi,4), %rdi
addq $0x84, %rdi
jmp 0x5efb
cmpl $0x2a, %esi
je 0x5f8e
cmpl $0x29, %esi
jne 0x5f97
addq $0x150, %rdi            # imm = 0x150
jmp 0x5efb
addq $0x8, %rdi
jmp 0x5efb
cmpl $0x32, %esi
jg 0x5fc2
movb 0x14f(%rdi), %al
andb $0x20, %al
shrb $0x5, %al
movzbl %al, %eax
shll $0x6, %eax
addq %rdi, %rax
movl %esi, %esi
leaq (%rax,%rsi,4), %rdi
addq $-0x8c, %rdi
jmp 0x5efb
cmpl $0x3a, %esi
jg 0x5f05
xorl %eax, %eax
testb $0x20, 0x14f(%rdi)
sete %al
shll $0x6, %eax
addq %rdi, %rax
movl %esi, %esi
leaq (%rax,%rsi,4), %rdi
addq $-0xac, %rdi
jmp 0x5efb
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: server_read_mem
static void server_read_mem(void *data, intmax_t addr, uint8_t *buffer, int size) {
  sh4_context_t *ctx = (sh4_context_t *)data;

  addr &= ctx->physical_mask;

  int available = ctx->physical_size - addr;
  if (available < 0) {
    available = 0;
  }

  if (size > available) {
    size = available;
  }

  memcpy(buffer, &ctx->physical_base[addr], size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq 0x168(%rdi), %rsi
movq %rdx, %rax
movl 0x170(%rdi), %edx
subl %esi, %edx
xorl %r8d, %r8d
testl %edx, %edx
cmovgl %edx, %r8d
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
addq 0x160(%rdi), %rsi
movslq %r8d, %rdx
movq %rax, %rdi
popq %rbp
jmp 0x3130
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: rem_bp
static void rem_bp(sh4_context_t *ctx, breakpoint_t *bp) {
  int n = bp - ctx->bp;
  uint32_t addr = bp->addr & ctx->physical_mask;
  uint16_t data = bp->data;

  // shift and resize the breakpoints array
  for (int i = n; i < ctx->num_bp - 1; i++) {
    ctx->bp[i] = ctx->bp[i + 1];
  }
  ctx->bp = realloc(ctx->bp, sizeof(breakpoint_t) * --ctx->num_bp);

  // swap the original instructon back
  *(uint16_t *)&ctx->physical_base[addr] = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %r14d
movq %rsi, %rax
subq 0x178(%rdi), %rax
movzwl 0x4(%rsi), %r15d
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
movq 0x168(%rdi), %rax
movl 0x180(%rdi), %ecx
decl %ecx
cmpl %edx, %ecx
jle 0x60df
movslq %edx, %rdx
leaq (,%rdx,4), %rcx
leaq (%rcx,%rcx,2), %rsi
movq 0x178(%rbx), %rcx
incq %rdx
movl 0x14(%rcx,%rsi), %edi
movl %edi, 0x8(%rcx,%rsi)
movq 0xc(%rcx,%rsi), %rdi
movq %rdi, (%rcx,%rsi)
movslq 0x180(%rbx), %rcx
decq %rcx
addq $0xc, %rsi
cmpq %rcx, %rdx
jl 0x60b1
andl %eax, %r14d
movq 0x178(%rbx), %rdi
movl %ecx, 0x180(%rbx)
movslq %ecx, %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rsi
callq 0x3180
movq %rax, 0x178(%rbx)
movq 0x160(%rbx), %rax
movw %r15w, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: gdb_server_send_raw
static int gdb_server_send_raw(gdb_server_t *sv, const char *data) {
  int len = (int)strlen(data);
  int n = send(sv->client, data, len, 0);

  if (n != len) {
    GDB_SERVER_LOG("gdb server failed to send raw packet %s, %d", data, n);
    return -1;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x30b0
movl 0xc(%r14), %edi
movslq %eax, %r15
xorl %r14d, %r14d
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x30c0
cmpl %r15d, %eax
je 0x616a
leaq 0x1e04(%rip), %rdi      # 0x7f5c
movq %rbx, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x30d0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: gdb_server_handle_m
static int gdb_server_handle_m(gdb_server_t *sv, const char *data) {
  int addr = 0;
  data = parse_hex(&data[1], &addr);

  int length = 0;
  data = parse_hex(&data[1], &length);

  // read bytes from the target
  uint8_t *memory = alloca(length);
  memset(memory, 0, length);
  sv->target->read_mem(sv->target->ctx, addr, memory, length);

  // format bytes into response
  char *buffer = scratch_buffer;
  int remaining = (int)sizeof(scratch_buffer);
  GDB_SERVER_ASSERT((length * 2 + 1) < remaining);

  for (int i = 0; i < length; i++) {
    int n = snprintf(buffer, remaining, "%02x", memory[i]);
    GDB_SERVER_ASSERT(n);
    buffer += n;
    remaining -= n;
  }

  gdb_server_send_packet(sv, scratch_buffer);

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
xorl %ebx, %ebx
leaq -0x2c(%rbp), %rax
movl %ebx, (%rax)
leaq 0x1(%rsi), %rdi
movq %rax, %rsi
callq 0x629f
leaq -0x3c(%rbp), %r14
movl %ebx, (%r14)
leaq 0x1(%rax), %rdi
movq %r14, %rsi
callq 0x629f
movl (%r14), %r13d
movslq %r13d, %r12
movq %rsp, %r14
leaq 0xf(%r12), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3100
movq %r15, -0x38(%rbp)
movq (%r15), %rax
movq (%rax), %rdi
leaq -0x2c(%rbp), %rcx
movslq (%rcx), %rsi
movq %r14, %rdx
movl %r12d, %ecx
callq *0x38(%rax)
leal 0x1(,%r12,2), %eax
cmpl $0x1fffa, %eax          # imm = 0x1FFFA
jg 0x6280
testl %r13d, %r13d
jle 0x6242
leaq 0x87ed3(%rip), %r15     # 0x8e0e0
movl $0x1fffb, %ebx          # imm = 0x1FFFB
xorl %r12d, %r12d
movslq %ebx, %rsi
movzbl (%r14,%r12), %ecx
movq %r15, %rdi
leaq 0x1c7a(%rip), %rdx      # 0x7ea1
xorl %eax, %eax
callq 0x30e0
testl %eax, %eax
je 0x6261
movslq %eax, %rcx
addq %rcx, %r15
subl %eax, %ebx
incq %r12
cmpq %r12, %r13
jne 0x6215
leaq 0x87e97(%rip), %rsi     # 0x8e0e0
movq -0x38(%rbp), %rdi
callq 0x52a6
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe2d(%rip), %rdi       # 0x7095
leaq 0x1c7e(%rip), %rsi      # 0x7eed
leaq 0x1e24(%rip), %rcx      # 0x809a
movl $0x306, %edx            # imm = 0x306
callq 0x30f0
leaq 0x1df6(%rip), %rdi      # 0x807d
leaq 0x1c5f(%rip), %rsi      # 0x7eed
leaq 0x1e05(%rip), %rcx      # 0x809a
movl $0x302, %edx            # imm = 0x302
callq 0x30f0
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: parse_hex
static const char *parse_hex(const char *buffer, int *value) {
  while (isxdigit(*buffer)) {
    *value <<= 4;
    *value |= xtoi(*buffer);
    buffer++;
  }
  return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x31d0
movq (%rax), %r15
movsbq (%rbx), %rax
testb $0x10, 0x1(%r15,%rax,2)
je 0x630f
callq 0x31c0
movq (%rax), %rax
movl (%r14), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
shll $0x4, %edx
movl %edx, (%r14)
movsbq (%rbx), %rsi
movsbl (%rax,%rsi,4), %esi
leal -0x61(%rsi), %edi
leal -0x57(%rsi), %r8d
addl $-0x30, %esi
cmpl $0xa, %esi
cmovael %ecx, %esi
cmpl $0x6, %edi
cmovbl %r8d, %esi
orl %edx, %esi
movl %esi, (%r14)
movsbq 0x1(%rbx), %rdx
incq %rbx
testb $0x10, 0x1(%r15,%rdx,2)
movl %esi, %edx
jne 0x62d3
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/./gdb_server.h
// Function: format_register
static int format_register(intmax_t value, int width, endianness_t endian,
                           char *buffer, int size) {
  uint8_t *ptr = (uint8_t *)&value;
  int remaining = size;

  for (int i = 0; i < width; i++) {
    uint8_t c = endian == GDB_LITTLE_ENDIAN ? ptr[i] : ptr[width - 1 - i];
    int n = snprintf(buffer, remaining, "%02x", c);
    GDB_SERVER_ASSERT(n);
    buffer += n;
    remaining -= n;
  }

  return size - remaining;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebx
movq %rdi, -0x38(%rbp)
movl %r8d, -0x2c(%rbp)
testl %esi, %esi
jle 0x6387
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %r13d
decq %r13
xorl %r12d, %r12d
movl -0x2c(%rbp), %ebx
testl %r15d, %r15d
movq %r13, %rax
cmoveq %r12, %rax
movzbl -0x38(%rbp,%rax), %ecx
movslq %ebx, %rsi
movq %r14, %rdi
leaq 0x1b36(%rip), %rdx      # 0x7ea1
xorl %eax, %eax
callq 0x30e0
testl %eax, %eax
je 0x639b
movslq %eax, %rcx
addq %rcx, %r14
subl %eax, %ebx
incq %r12
addq $-0x1, %r13
jb 0x634f
movl -0x2c(%rbp), %eax
subl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcf3(%rip), %rdi       # 0x7095
leaq 0x1b44(%rip), %rsi      # 0x7eed
leaq 0x1c85(%rip), %rcx      # 0x8035
movl $0x112, %edx            # imm = 0x112
callq 0x30f0
// File: /workspace/github_c_makefile_star2_O1/inolen[P]gdb_server/sh4_server.c
// Function: add_bp
static breakpoint_t *add_bp(sh4_context_t *ctx, uint32_t addr) {
  int n = ctx->num_bp;
  addr &= ctx->physical_mask;

  // resize the breakpoints array
  ctx->bp = realloc(ctx->bp, sizeof(breakpoint_t) * ++ctx->num_bp);

  // setup the new breakpoint
  breakpoint_t *bp = &ctx->bp[n];
  bp->addr = addr;
  bp->data = *(uint16_t *)&ctx->physical_base[addr];
  bp->temp = 0;

  // write out invalid opcode to the program
  *(uint16_t *)&ctx->physical_base[addr] = 0;

  return bp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movslq 0x180(%rdi), %r15
andl 0x168(%rdi), %ebx
movq 0x178(%rdi), %rdi
leal 0x1(%r15), %eax
movl %eax, 0x180(%r14)
shlq $0x2, %r15
leaq (%r15,%r15,2), %rsi
addq $0xc, %rsi
callq 0x3180
movq %rax, 0x178(%r14)
leaq (%r15,%r15,2), %rdx
leaq (%rax,%rdx), %rcx
movl %ebx, (%rax,%rdx)
movq 0x160(%r14), %rsi
movzwl (%rsi,%rbx), %edi
movw %di, 0x4(%rax,%rdx)
movl $0x0, 0x8(%rax,%rdx)
movw $0x0, (%rsi,%rbx)
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/KhuramAli[P]JAM-Benchmark/Single-Producer_Single-Consumer_RingBuffer_Lock-Synchronized_boost/code09.cpp
// Function: producer()
void producer(void)
{
	for (int i = 0; i != iterations; ++i) {
		int value = ++producer_count;
		myMutex.lock();
		cb.push_back(value);
		myMutex.unlock();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x989680, %ebp         # imm = 0x989680
leaq 0x2e19(%rip), %rbx      # 0x40f8
leaq 0x2dea(%rip), %r14      # 0x40d0
leaq 0x4(%rsp), %r15
movl 0x2dd3(%rip), %eax      # 0x40c4
incl %eax
movl %eax, 0x2dcb(%rip)      # 0x40c4
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x132b
movq %r14, %rdi
movq %r15, %rsi
callq 0x15b4
movq %rbx, %rdi
callq 0x1080
decl %ebp
jne 0x12eb
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/KhuramAli[P]JAM-Benchmark/Single-Producer_Single-Consumer_RingBuffer_Lock-Synchronized_boost/code09.cpp
// Function: consumer()
void consumer(void)
{
	while (!done) {
		myMutex.lock();
		if(!cb.empty()){
			cb.pop_front();
			++consumer_count;
		}
		myMutex.unlock();
	}
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x2de6(%rip)      # 0x4120
jne 0x13a5
leaq 0x2db5(%rip), %rbx      # 0x40f8
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x13a7
movq 0x2d9a(%rip), %rax      # 0x40f0
testq %rax, %rax
je 0x1394
movq 0x2d7e(%rip), %rcx      # 0x40e0
addq $0x4, %rcx
movq %rcx, 0x2d73(%rip)      # 0x40e0
cmpq 0x2d64(%rip), %rcx      # 0x40d8
jne 0x1384
movq 0x2d53(%rip), %rcx      # 0x40d0
movq %rcx, 0x2d5c(%rip)      # 0x40e0
decq %rax
movq %rax, 0x2d62(%rip)      # 0x40f0
incl 0x2d34(%rip)            # 0x40c8
movq %rbx, %rdi
callq 0x1080
cmpb $0x1, 0x2d7d(%rip)      # 0x4120
jne 0x1343
popq %rbx
retq
movl %eax, %edi
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/KhuramAli[P]JAM-Benchmark/Single-Producer_Single-Consumer_RingBuffer_Lock-Synchronized_boost/code09.cpp
// Function: main
int main(int argc, char* argv[])
{
	std::thread producer_thread(producer);
	std::thread consumer_thread(consumer);

	producer_thread.join();

	done = true;
	consumer_thread.join();

	std::cout << "produced " << producer_count << " objects." << std::endl;
	std::cout << "consumed " << consumer_count << " objects." << std::endl;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq -0xee(%rip), %rsi       # 0x12cc
leaq 0x8(%rsp), %rdi
callq 0x14f8
leaq -0x99(%rip), %rsi       # 0x1332
movq %rsp, %rdi
callq 0x14f8
leaq 0x8(%rsp), %rdi
callq 0x1110
movb $0x1, 0x2d3c(%rip)      # 0x4120
movq %rsp, %rdi
callq 0x1110
movq 0x2be5(%rip), %rdi      # 0x3fd8
leaq 0xc0a(%rip), %rsi       # 0x2004
movl $0x9, %edx
callq 0x10e0
movl 0x2cba(%rip), %esi      # 0x40c4
movq 0x2bc7(%rip), %rdi      # 0x3fd8
callq 0x1120
movq %rax, %rbx
leaq 0xbee(%rip), %rsi       # 0x200e
movl $0x9, %edx
movq %rax, %rdi
callq 0x10e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq 0x2b7d(%rip), %rdi      # 0x3fd8
leaq 0xbb6(%rip), %rsi       # 0x2018
movl $0x9, %edx
callq 0x10e0
movl 0x2c56(%rip), %esi      # 0x40c8
movq 0x2b5f(%rip), %rdi      # 0x3fd8
callq 0x1120
movq %rax, %rbx
leaq 0xb86(%rip), %rsi       # 0x200e
movl $0x9, %edx
movq %rax, %rdi
callq 0x10e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
cmpq $0x0, (%rsp)
jne 0x14ec
cmpq $0x0, 0x8(%rsp)
jne 0x14ec
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
jmp 0x14dc
cmpq $0x0, (%rsp)
jne 0x14ec
cmpq $0x0, 0x8(%rsp)
jne 0x14ec
movq %rax, %rdi
callq 0x1130
callq 0x1040
nop
// File: /workspace/github_c_makefile_star2_O1/chrispanag[P]operating-systems-scheduler/strace-test.c
// Function: main
int main(int argc, char *argv[])
{
	int status;
	pid_t p, waitp;

	p = fork();
	if (p < 0) {
		perror("fork");
		exit(1);
	}

	if (p == 0) {
		raise(STOP_SIGNAL);
		/* Should never reach this point */
		printf("Child: FAIL.\n");
		exit(1);
	}

	/*
	 * Father sleeps for a while and kills the child.
	 * The child should be alive when the father wakes.
	 */
	printf("Parent: sleeping for a while...\n");
	sleep(2);

	if (kill(p, SIGKILL) < 0) {
		perror("kill");
		exit(1);
	}

	waitp = wait(&status);
	assert(p == waitp);
	if (WIFEXITED(status)) {
		printf("Parent: FAIL. Child exited, status = %d\n",
			WEXITSTATUS(status));
		exit(1);
	}

	if (!WIFSIGNALED(status)) {
		printf("Parent: FAIL. Child not signaled?\n");
		exit(1);
	}

	printf("Parent: SUCCESS. Child killed, sig = %d\n",
		WTERMSIG(status));
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x10c0
testl %eax, %eax
js 0x1278
je 0x127d
movl %eax, %ebx
leaq 0xe7b(%rip), %rdi       # 0x2090
callq 0x1040
movl $0x2, %edi
callq 0x10a0
movl %ebx, %edi
movl $0x9, %esi
callq 0x1070
testl %eax, %eax
js 0x1290
leaq 0xc(%rsp), %rdi
callq 0x10b0
cmpl %eax, %ebx
jne 0x1295
movl 0xc(%rsp), %ecx
movl %ecx, %eax
andl $0x7f, %eax
je 0x12b4
movl %eax, %ecx
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x1ffffff, %ecx        # imm = 0x1FFFFFF
jle 0x12c7
leaq 0xe00(%rip), %rdi       # 0x2067
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0x10f5
movl $0x14, %edi
callq 0x1030
leaq 0xe44(%rip), %rdi       # 0x20d2
jmp 0x12ce
callq 0x10e0
leaq 0xd72(%rip), %rdi       # 0x200e
leaq 0xd76(%rip), %rsi       # 0x2019
leaq 0xd7d(%rip), %rcx       # 0x2027
movl $0x35, %edx
callq 0x1060
movzbl %ch, %esi
leaq 0xd80(%rip), %rdi       # 0x203e
xorl %eax, %eax
callq 0x1050
jmp 0x12d3
leaq 0xde2(%rip), %rdi       # 0x20b0
callq 0x1040
movl $0x1, %edi
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/zconf.tab.c
// Function: zconfprint
static void zconfprint(const char *err, ...)
{
	va_list ap;

	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
	va_start(ap, err);
	vfprintf(stderr, err, ap);
	va_end(ap);
	fprintf(stderr, "\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2381
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x13c70(%rip), %r14     # 0x15ff8
movq 0x14a11(%rip), %rax     # 0x16da0
testq %rax, %rax
jne 0x239d
leaq 0xf4f3(%rip), %rdx      # 0x1188e
jmp 0x23a8
movq 0x149ec(%rip), %rcx     # 0x16d90
movq 0x10(%rcx), %rdx
movq (%r14), %rdi
testq %rax, %rax
jne 0x23b5
pushq $0x1
popq %rcx
jmp 0x23bf
movq 0x149d4(%rip), %rax     # 0x16d90
movl 0x18(%rax), %ecx
leaq 0xfeb0(%rip), %rsi      # 0x12276
xorl %eax, %eax
callq 0x21a0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x2290
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x2140
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: conf_string
int conf_string(struct menu *menu)
{
	struct symbol *sym = menu->sym;
	const char *def, *help;

	while (1) {
		printf("%*s%s ", indent - 1, "", menu->prompt->text);
		printf("(%s) ", sym->name);
		def = sym_get_string_value(sym);
		if (sym_get_string_value(sym))
			printf("[%s] ", def);
		conf_askvalue(sym, def);
		switch (line[0]) {
		case '\n':
			break;
		case '?':
			/* print help */
			if (line[1] == 0) {
				help = nohelp_text;
				if (menu->sym->help)
					help = menu->sym->help;
				printf("\n%s\n", menu->sym->help);
				def = NULL;
				break;
			}
		default:
			line[strlen(line)-1] = 0;
			def = line;
		}
		if (def && sym_set_string_value(sym, def))
			return 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
leaq 0xed6e(%rip), %r12      # 0x116c3
leaq 0x972b(%rip), %r13      # 0xc087
leaq 0x13a9d(%rip), %r15     # 0x16400
movl 0x13837(%rip), %esi     # 0x161a0
decl %esi
movq 0x20(%rbx), %rax
movq 0x18(%rax), %rcx
leaq 0x9706(%rip), %rdi      # 0xc080
movq %r12, %rdx
xorl %eax, %eax
callq 0x2100
movq 0x8(%r14), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x2100
movq %r14, %rdi
callq 0x8e12
movq %rax, %rbp
movq %r14, %rdi
callq 0x8e12
testq %rax, %rax
je 0x29bb
leaq 0x96dc(%rip), %rdi      # 0xc08d
movq %rbp, %rsi
xorl %eax, %eax
callq 0x2100
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2a3a
movzbl 0x13a33(%rip), %eax     # 0x16400
cmpl $0xa, %eax
je 0x29f1
cmpl $0x3f, %eax
jne 0x29e0
cmpb $0x0, 0x13a23(%rip)     # 0x16401
je 0x2a0f
movq %r15, %rdi
callq 0x20e0
movb $0x0, -0x1(%rax,%r15)
movq %r15, %rbp
testq %rbp, %rbp
je 0x2963
movq %r14, %rdi
movq %rbp, %rsi
callq 0xafc5
testb %al, %al
je 0x2963
jmp 0x2a29
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0xecac(%rip), %rdi      # 0x116ca
xorl %eax, %eax
callq 0x2100
xorl %ebp, %ebp
jmp 0x29f1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: check_conf
static void check_conf(struct menu *menu)
{
	struct symbol *sym;
	struct menu *child;

	if (!menu_is_visible(menu))
		return;

	sym = menu->sym;
	if (sym) {
		if (sym_is_changable(sym) && !sym_has_value(sym)) {
			if (!conf_cnt++)
				printf("*\n* Restart config...\n*\n");
			rootEntry = menu_get_parent_menu(menu);
			conf(rootEntry);
		}
		if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
			return;
	}

	for (child = menu->list; child; child = child->next)
		check_conf(child);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8d75
testb %al, %al
je 0x3327
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x3311
movq %r14, %rdi
callq 0xb133
testb %al, %al
je 0x3303
testb $0x8, 0x45(%r14)
je 0x3303
movl 0x131b5(%rip), %eax     # 0x16488
leal 0x1(%rax), %ecx
movl %ecx, 0x131ac(%rip)     # 0x16488
testl %eax, %eax
jne 0x32ec
leaq 0x8f1c(%rip), %rdi      # 0xc203
callq 0x20a0
movq %rbx, %rdi
callq 0xb2a4
movq %rax, 0x13185(%rip)     # 0x16480
movq %rax, %rdi
callq 0x2dc5
testb $0x10, 0x44(%r14)
je 0x3311
cmpl $0x1, 0x28(%r14)
jne 0x3327
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x3327
movq %rbx, %rdi
callq 0x32a1
movq (%rbx), %rbx
jmp 0x3315
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: check_stdin
static void check_stdin(void)
{
	if (!valid_stdin && input_mode == ask_silent) {
		printf("aborted!\n\n");
		printf("Console input/output is redirected. ");
		printf("Run 'make oldconfig' to update configuration.\n\n");
		exit(1);
	}
}

// Assembly:
cmpl $0x0, 0x12eaa(%rip)     # 0x161e0
jne 0x3341
cmpl $0x2, 0x130b1(%rip)     # 0x163f0
je 0x3342
retq
pushq %rax
leaq 0x8ed1(%rip), %rdi      # 0xc21b
callq 0x20a0
leaq 0x8d93(%rip), %rdi      # 0xc0e9
xorl %eax, %eax
callq 0x2100
leaq 0x8ec1(%rip), %rdi      # 0xc225
callq 0x20a0
movl $0x1, %edi
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: strip
static void strip(char *str)
{
	char *p = str;
	int l;

	while ((isspace(*p)))
		p++;
	l = strlen(p);
	if (p != str)
		memmove(str, p, l + 1);
	if (!l)
		return;
	p = str + l - 1;
	while ((isspace(*p)))
		*p-- = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
callq 0x2300
movq %rax, %rbx
movq (%rax), %rax
movq $-0x1, %r13
leaq 0x12e55(%rip), %r12     # 0x16400
movsbq 0x1(%r13,%r12), %rcx
incq %r13
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x35ab
leaq (%r12,%r13), %r15
movq %r15, %rdi
callq 0x20e0
movq %rax, %r14
testq %r13, %r13
je 0x35e5
leal 0x1(%r14), %eax
movslq %eax, %rdx
leaq 0x12e23(%rip), %rdi     # 0x16400
movq %r15, %rsi
callq 0x2260
testl %r14d, %r14d
je 0x3618
movslq %r14d, %rax
movq (%rbx), %rcx
movsbq -0x1(%rax,%r12), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x3618
addq %r12, %rax
decq %rax
movb $0x0, (%rax)
movq (%rbx), %rcx
movsbq -0x1(%rax), %rdx
decq %rax
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x3603
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop