LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/main.c
// Function: main
int main(int argc, char *argv[]) {
  int run = 1, quit = 0, trace = 1, reset = 0;

  if(!display_start()) {
    fprintf(stderr,"Unable to initialise display\n");
    return 0;
  }

  if(!memory_initialise()) {
    return 0;
  }
  display_log("Memory inisitalised");

  if(!riscv_initialise()) {
    return 0;
  }
  display_log("RISC-V initalised");
  riscv_reset();
  display_log("Press SPACE to run a sigle instruction, or 'r' to run. 'q' to quit");

  while(!quit) {
    if(run) {
       if(!memory_run())
         run = 0;
    }
    if(run) {
       if(!riscv_run() ||run == 1)
         run = 0;
    }
    display_update();
    display_process_input(&run, &quit, &trace, &reset);
    if(reset) {
      riscv_reset();
      reset = 0;
    }
  }
  riscv_dump();
  riscv_finish();
  display_log("RISC-V shutdown");
  memory_finish();
  display_log("Memory shutdown");
  display_update();
  display_end();
  
  return 0;
}

// Assembly:
subq $0x28, %rsp
movl $0x0, 0x24(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x1, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
callq 0x6380
cmpl $0x0, %eax
jne 0x2364
movq 0xbcb2(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x7cb4(%rip), %rsi      # 0xa004
movb $0x0, %al
callq 0x2130
movl $0x0, 0x24(%rsp)
jmp 0x2478
callq 0x8d90
cmpl $0x0, %eax
jne 0x237b
movl $0x0, 0x24(%rsp)
jmp 0x2478
leaq 0x7ca0(%rip), %rdi      # 0xa022
callq 0x6b20
callq 0x2fa0
cmpl $0x0, %eax
jne 0x239e
movl $0x0, 0x24(%rsp)
jmp 0x2478
leaq 0x7c91(%rip), %rdi      # 0xa036
callq 0x6b20
callq 0x2f60
leaq 0x7c92(%rip), %rdi      # 0xa048
callq 0x6b20
cmpl $0x0, 0x10(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x23cb
jmp 0x243f
cmpl $0x0, 0x14(%rsp)
je 0x23e6
callq 0x90a0
cmpl $0x0, %eax
jne 0x23e4
movl $0x0, 0x14(%rsp)
jmp 0x23e6
cmpl $0x0, 0x14(%rsp)
je 0x2408
callq 0x3160
cmpl $0x0, %eax
je 0x23fe
cmpl $0x1, 0x14(%rsp)
jne 0x2406
movl $0x0, 0x14(%rsp)
jmp 0x2408
callq 0x6690
leaq 0x14(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x6da0
cmpl $0x0, 0x8(%rsp)
je 0x243a
callq 0x2f60
movl $0x0, 0x8(%rsp)
jmp 0x23bb
callq 0x3380
callq 0x3390
leaq 0x7c3b(%rip), %rdi      # 0xa08b
callq 0x6b20
callq 0x9320
leaq 0x7c3a(%rip), %rdi      # 0xa09b
callq 0x6b20
callq 0x6690
callq 0x6fb0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: riscv_reset
void riscv_reset(void) {
  memory_reset();
  memset(regs,0xFF,sizeof(regs));
  regs[0] = 0;
  pc = 0x20400000;
  display_log("RISC-V reset");
}

// Assembly:
pushq %rax
callq 0x8d00
leaq 0xfab3(%rip), %rdi      # 0x12a20
movl $0xff, %esi
movl $0x80, %edx
callq 0x20e0
movl $0x0, 0xfa9a(%rip)      # 0x12a20
movl $0x20400000, 0xba70(%rip) # imm = 0x20400000
leaq 0x78ed(%rip), %rdi      # 0xa884
callq 0x6b20
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: riscv_initialise
int riscv_initialise(void) {
  int i;
  for(i = 0; i < sizeof(opcodes)/sizeof(struct opcode_entry); i++) {
     int j;
     if(strlen(opcodes[i].spec) != 32) {
       return 0;
     }
     opcodes[i].mask = 0;
     opcodes[i].value = 0;
     for(j = 0; j < 32; j++) {
       opcodes[i].value <<= 1;
       opcodes[i].mask  <<= 1;

       /* Change the string specifiers into masks */
       switch(opcodes[i].spec[j]) {
          case '0':
             opcodes[i].mask  |= 1;
             break;
          case '1':
             opcodes[i].mask  |= 1;
             opcodes[i].value |= 1;
             break;
          case '-':
             break;
          default:
	     display_log("Unknown character in opcode");
	     return 0;
        }
     }
  }
  return 1;
}

// Assembly:
subq $0x18, %rsp
movl $0x0, 0x10(%rsp)
movslq 0x10(%rsp), %rax
cmpq $0x38, %rax
jae 0x3128
movslq 0x10(%rsp), %rcx
leaq 0xb159(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x2090
cmpq $0x20, %rax
je 0x2fe9
movl $0x0, 0x14(%rsp)
jmp 0x3130
movslq 0x10(%rsp), %rcx
leaq 0xb12b(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x24(%rax)
movslq 0x10(%rsp), %rcx
leaq 0xb111(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x20(%rax)
movl $0x0, 0xc(%rsp)
cmpl $0x20, 0xc(%rsp)
jge 0x3116
movslq 0x10(%rsp), %rax
leaq (%rax,%rax,4), %rcx
leaq 0xb0e0(%rip), %rax      # 0xe120
movl 0x20(%rax,%rcx,8), %edx
addl %edx, %edx
movl %edx, 0x20(%rax,%rcx,8)
movslq 0x10(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x24(%rax,%rcx,8), %edx
addl %edx, %edx
movl %edx, 0x24(%rax,%rcx,8)
movslq 0x10(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, 0x8(%rsp)
subl $0x2d, %eax
je 0x30ec
jmp 0x307e
movl 0x8(%rsp), %eax
subl $0x30, %eax
je 0x3094
jmp 0x3089
movl 0x8(%rsp), %eax
subl $0x31, %eax
je 0x30b2
jmp 0x30ee
movslq 0x10(%rsp), %rcx
leaq 0xb080(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x24(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x3104
movslq 0x10(%rsp), %rcx
leaq 0xb062(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x24(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x24(%rax)
movslq 0x10(%rsp), %rcx
leaq 0xb046(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x20(%rax)
jmp 0x3104
jmp 0x3104
leaq 0x779c(%rip), %rdi      # 0xa891
callq 0x6b20
movl $0x0, 0x14(%rsp)
jmp 0x3130
jmp 0x3106
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x3025
jmp 0x3118
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x2fac
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: riscv_run
int riscv_run(void) {
  ///////////////////////////////////////
  // Update counters 
  ////////////////////////////////////
  csr[CSR_RDCYCLE]++;
  if(csr[CSR_RDCYCLE] == 0)
    csr[CSR_RDCYCLEH]++;
  csr[CSR_MCYCLE] = csr[CSR_RDCYCLE];

  if(do_op()) {
    csr[CSR_RDTIME]++;
    if(csr[CSR_RDTIME] == 0)
      csr[CSR_RDTIMEH]++;
    return 1;
  } else {
    char buffer[100];
    sprintf(buffer,"Instruction : %08x",current_instr);
    display_log(buffer);
  }
  return 0;
}

// Assembly:
subq $0x68, %rsp
movl 0xe8a6(%rip), %eax      # 0x11a10
addl $0x1, %eax
movl %eax, 0xe89d(%rip)      # 0x11a10
cmpl $0x0, 0xe896(%rip)      # 0x11a10
jne 0x318b
movl 0xea9a(%rip), %eax      # 0x11c1c
addl $0x1, %eax
movl %eax, 0xea91(%rip)      # 0x11c1c
movl 0xe87f(%rip), %eax      # 0x11a10
movl %eax, 0xe479(%rip)      # 0x11610
callq 0x3210
cmpl $0x0, %eax
je 0x31d2
movl 0xe86d(%rip), %eax      # 0x11a14
addl $0x1, %eax
movl %eax, 0xe864(%rip)      # 0x11a14
cmpl $0x0, 0xe85d(%rip)      # 0x11a14
jne 0x31c8
movl 0xea55(%rip), %eax      # 0x11c14
addl $0x1, %eax
movl %eax, 0xea4c(%rip)      # 0x11c14
movl $0x1, 0x64(%rsp)
jmp 0x31f9
movq %rsp, %rdi
movl 0xf8c5(%rip), %edx      # 0x12aa0
leaq 0x76cb(%rip), %rsi      # 0xa8ad
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6b20
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: do_op
static int do_op(void) {
  int i;
  if((pc & 3) != 0) {
    display_log("Attempt to execute unaligned code");
    return 0;
  }

  if(!stalled) {
    /* Fetch */
    if(!fetch_in_progress) {
      if(!memory_fetch_request(pc)) {
        display_log("Unable to fetch instruction");
        return 0;
      }
      fetch_in_progress = 1;
    } else if(!memory_fetch_data_empty()) {
      fetch_in_progress = 0;

      current_instr = memory_fetch_data();
      /* Decode */
      if(!decode()) 
        return 0;
    }
  } 

  if(stalled || fetch_in_progress) {
    stalled_count++;
  }

  if(fetch_in_progress) {
    //display_trace("Fetch in progress");
    return 1;
  }

  /* Execute */
  for(i = 0; i < sizeof(opcodes)/sizeof(struct opcode_entry); i++) {
     if((current_instr & opcodes[i].mask) == opcodes[i].value) {
       op = opcodes+i;
       return op->func();
    }
  }
  return 0;
}

// Assembly:
pushq %rax
movl 0xb7e9(%rip), %eax      # 0xea00
andl $0x3, %eax
cmpl $0x0, %eax
je 0x3238
leaq 0x7b46(%rip), %rdi      # 0xad6c
callq 0x6b20
movl $0x0, 0x4(%rsp)
jmp 0x3373
cmpb $0x0, 0xf879(%rip)      # 0x12ab8
jne 0x32b5
cmpb $0x0, 0xf89c(%rip)      # 0x12ae4
jne 0x327c
movl 0xb7b0(%rip), %edi      # 0xea00
callq 0x8e20
cmpl $0x0, %eax
jne 0x3273
leaq 0x7b2d(%rip), %rdi      # 0xad8e
callq 0x6b20
movl $0x0, 0x4(%rsp)
jmp 0x3373
movb $0x1, 0xf86a(%rip)      # 0x12ae4
jmp 0x32b3
callq 0x8eb0
cmpl $0x0, %eax
jne 0x32b1
movb $0x0, 0xf857(%rip)      # 0x12ae4
callq 0x8f50
movl %eax, 0xf808(%rip)      # 0x12aa0
callq 0x3f20
cmpl $0x0, %eax
jne 0x32af
movl $0x0, 0x4(%rsp)
jmp 0x3373
jmp 0x32b1
jmp 0x32b3
jmp 0x32b5
movzbl 0xf7fc(%rip), %eax      # 0x12ab8
cmpl $0x0, %eax
jne 0x32cd
movzbl 0xf81c(%rip), %eax      # 0x12ae4
cmpl $0x0, %eax
je 0x32dc
movl 0xf73d(%rip), %eax      # 0x12a10
addl $0x1, %eax
movl %eax, 0xf734(%rip)      # 0x12a10
cmpb $0x0, 0xf801(%rip)      # 0x12ae4
je 0x32f2
movl $0x1, 0x4(%rsp)
jmp 0x3373
movl $0x0, (%rsp)
movslq (%rsp), %rax
cmpq $0x38, %rax
jae 0x336b
movl 0xf797(%rip), %eax      # 0x12aa0
movslq (%rsp), %rdx
leaq 0xae0c(%rip), %rcx      # 0xe120
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
andl 0x24(%rcx), %eax
movslq (%rsp), %rdx
leaq 0xadf7(%rip), %rcx      # 0xe120
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jne 0x335e
movslq (%rsp), %rcx
leaq 0xade0(%rip), %rax      # 0xe120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xf75a(%rip)      # 0x12aa8
movq 0xf753(%rip), %rax      # 0x12aa8
callq *0x8(%rax)
movl %eax, 0x4(%rsp)
jmp 0x3373
jmp 0x3360
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x32f9
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: trace
static void trace(char *fmt, uint32_t a, uint32_t b, uint32_t c) {
  char buffer[128];
  if(!trace_active)
    return;
  sprintf(buffer,"%08X:%c",pc, stalled ? '*' : ' ');
  sprintf(buffer+10, fmt, a, b, c);
  display_trace(buffer);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movl %esi, 0x8c(%rsp)
movl %edx, 0x88(%rsp)
movl %ecx, 0x84(%rsp)
cmpl $0x0, 0xad45(%rip)      # 0xe110
jne 0x33cf
jmp 0x3431
movq %rsp, %rdi
movl 0xb628(%rip), %edx      # 0xea00
movzbl 0xf6d9(%rip), %esi      # 0x12ab8
movl $0x20, %ecx
movl $0x2a, %eax
cmpl $0x0, %esi
cmovnel %eax, %ecx
leaq 0x74dc(%rip), %rsi      # 0xa8d2
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
addq $0xa, %rdi
movq 0x90(%rsp), %rsi
movl 0x8c(%rsp), %edx
movl 0x88(%rsp), %ecx
movl 0x84(%rsp), %r8d
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6c50
addq $0x98, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/riscv.c
// Function: exception
static void exception( char *reason) {
  char buffer[200];
  if(strlen(reason) < 100)
    sprintf(buffer, "EXCEPTION: %s : instruction 0x%08x", reason, current_instr);
  else
    sprintf(buffer, "EXCEPTION: [reason too long] : instruction 0x%08x", current_instr);
  display_log(reason);
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x2090
cmpq $0x64, %rax
jae 0x3ef3
movq %rsp, %rdi
movq 0xd0(%rsp), %rdx
movl 0xebbd(%rip), %ecx      # 0x12aa0
leaq 0x6d2a(%rip), %rsi      # 0xac14
movb $0x0, %al
callq 0x21e0
jmp 0x3f0a
movq %rsp, %rdi
movl 0xeba4(%rip), %edx      # 0x12aa0
leaq 0x6d34(%rip), %rsi      # 0xac37
movb $0x0, %al
callq 0x21e0
movq 0xd0(%rsp), %rdi
callq 0x6b20
addq $0xd8, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/memorymap.c
// Function: memorymap_aligned_read
int memorymap_aligned_read(uint32_t address, uint32_t *value) {
   struct region *r = first_region;

   /* Find the region */
   while(r != NULL) {
     if(address >= r->base && address < r->base+r->size)
       break;
     r = r->next;
   }

   /* If no region found then exit */
   if(r == NULL) {
     char buffer[128];
     sprintf(buffer, "Read of invalid address %08X",address);
     display_log(buffer);
     return 0;
   }

   /* Trap a currently unhandled error */
   if(address+4 > r->base + r->size) {
     display_log("Need to split the read of address as it crosses boundary");
     return 0;
   }
   return r->get(r, address-r->base, value);
}

// Assembly:
subq $0x98, %rsp
movl %edi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0xe9d3(%rip), %rax      # 0x12af0
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x417c
movl 0x90(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x4167
movl 0x90(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq 0x80(%rsp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jae 0x4167
jmp 0x417c
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x4125
cmpq $0x0, 0x80(%rsp)
jne 0x41b4
movq %rsp, %rdi
movl 0x90(%rsp), %edx
leaq 0x6c12(%rip), %rsi      # 0xadaa
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6b20
movl $0x0, 0x94(%rsp)
jmp 0x4228
movl 0x90(%rsp), %eax
addl $0x4, %eax
movq 0x80(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq 0x80(%rsp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jbe 0x41f1
leaq 0x6be8(%rip), %rdi      # 0xadc7
callq 0x6b20
movl $0x0, 0x94(%rsp)
jmp 0x4228
movq 0x80(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x80(%rsp), %rdi
movl 0x90(%rsp), %esi
movq 0x80(%rsp), %rcx
subl 0x8(%rcx), %esi
movq 0x88(%rsp), %rdx
callq *%rax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/memorymap.c
// Function: memorymap_aligned_write
int memorymap_aligned_write(uint32_t address, uint8_t mask, uint32_t value) {
   struct region *r = first_region;

   /* Find the region */
   while(r != NULL) {
     if(address >= r->base && address < r->base+r->size)
       break;
     r = r->next;
   }

   /* If no region found then exit */
   if(r == NULL) {
     char buffer[128];
     sprintf(buffer, "Write of invalid address %08X",address);
     display_log(buffer);
     return 0;
   }

   /* Trap a currently unhandled error */
   if(address+4 > r->base + r->size) {
     display_log("Write to split the read of address as it crosses boundary");
     return 0;
   }
   return r->set(r, address-r->base, mask, value);
}

// Assembly:
subq $0x98, %rsp
movb %sil, %al
movl %edi, 0x90(%rsp)
movb %al, 0x8f(%rsp)
movl %edx, 0x88(%rsp)
movq 0xe88a(%rip), %rax      # 0x12af0
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x42c5
movl 0x90(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x42b0
movl 0x90(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq 0x80(%rsp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jae 0x42b0
jmp 0x42c5
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x426e
cmpq $0x0, 0x80(%rsp)
jne 0x42fd
movq %rsp, %rdi
movl 0x90(%rsp), %edx
leaq 0x6b1f(%rip), %rsi      # 0xae00
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6b20
movl $0x0, 0x94(%rsp)
jmp 0x437a
movl 0x90(%rsp), %eax
addl $0x4, %eax
movq 0x80(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq 0x80(%rsp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jbe 0x433a
leaq 0x6af6(%rip), %rdi      # 0xae1e
callq 0x6b20
movl $0x0, 0x94(%rsp)
jmp 0x437a
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x80(%rsp), %rdi
movl 0x90(%rsp), %esi
movq 0x80(%rsp), %rcx
subl 0x8(%rcx), %esi
movb 0x8f(%rsp), %dl
movl 0x88(%rsp), %ecx
movzbl %dl, %edx
callq *%rax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/memorymap.c
// Function: add_region
static int add_region(uint32_t base, uint32_t size, 
  int  (*init)(struct region *r),
  int (*get)(struct region *r, uint32_t address, uint32_t *value),
  int (*set)(struct region *r, uint32_t address, uint8_t mask, uint32_t value),
  void (*free)(struct region *r),
  void (*dump)(struct region *r)) {
  struct region *r = NULL;

  /* Allocate space */
  r = malloc(sizeof(struct region));
  if(r == NULL) {
    return 0;
  }

  /* Initialise it */
  memset(r,0,sizeof(struct region));
  r->base = base;
  r->size = size;
  r->init = init;
  r->get  = get;
  r->set  = set;
  r->free = free;
  r->dump = dump;

  /* Add to list */
  if(first_region == NULL) {
    first_region = r;
    r->next = NULL;
  } else {
    struct region *c = first_region;
    while(c->next != NULL)
      c = c->next;
    c->next = r;
    r->next = NULL;
  }
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq 0x50(%rsp), %rax
movl %edi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x40, %edi
callq 0x2180
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x4712
movl $0x0, 0x44(%rsp)
jmp 0x47ec
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x20e0
movl 0x40(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x3c(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x50(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
cmpq $0x0, 0xe367(%rip)      # 0x12af0
jne 0x47a5
movq 0x10(%rsp), %rax
movq %rax, 0xe359(%rip)      # 0x12af0
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
jmp 0x47e4
movq 0xe344(%rip), %rax      # 0x12af0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x47cb
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x47b1
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/memorymap.c
// Function: memorymap_finish
void memorymap_finish(void) {
   while(first_region != NULL) {
      struct region *r = first_region;
      first_region = first_region->next;
      r->free(r);
      free(r);
   }
}

// Assembly:
pushq %rax
cmpq $0x0, 0xdb87(%rip)      # 0x12af0
je 0x4fa0
movq 0xdb7e(%rip), %rax      # 0x12af0
movq %rax, (%rsp)
movq 0xdb73(%rip), %rax      # 0x12af0
movq (%rax), %rax
movq %rax, 0xdb69(%rip)      # 0x12af0
movq (%rsp), %rax
movq 0x28(%rax), %rax
movq (%rsp), %rdi
callq *%rax
movq (%rsp), %rdi
callq 0x2040
jmp 0x4f61
popq %rax
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/ram.c
// Function: RAM_init
int RAM_init(struct region *r) {
  uint32_t *data;

  if(r->data != NULL) {
    display_log("RAM already initialized");
    return 0;
  }
 
  data = malloc(r->size);
  if(data == NULL){
    return 0;
  }
  r->data = (void *)data;
  memset(r->data, 0, r->size);
  attempt_to_read(r);
  display_log("Set up memory region");
  return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4fdb
leaq 0x5f38(%rip), %rdi      # 0xaf04
callq 0x6b20
movl $0x0, 0x14(%rsp)
jmp 0x5044
movq 0x8(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
callq 0x2180
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x4fff
movl $0x0, 0x14(%rsp)
jmp 0x5044
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x8(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x20e0
movq 0x8(%rsp), %rdi
callq 0x5050
leaq 0x5ee5(%rip), %rdi      # 0xaf1c
callq 0x6b20
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/ram.c
// Function: RAM_set
int RAM_set(struct region *r, uint32_t address, uint8_t mask, uint32_t value) {

   if(address+4 > r->size) {
     fprintf(stderr,"Memory region boundary crossed at 0x%08x\n", r->base+address);
     return 0;
   }

   if((address & 3) != 0) {
     fprintf(stderr,"Unaligned memory write 0x%08x\n", r->base+address);
   }
#if 0
   fprintf(stderr, "Write %08x %x, 0x%08x\n", address, mask, value);
#endif
   if(mask & 1) {
      ((unsigned char *)r->data)[address+0] = value; 
   }
   if(mask & 2) {
      ((unsigned char *)r->data)[address+1] = value>>8; 
   }
   if(mask & 4) {
      ((unsigned char *)r->data)[address+2] = value>>16; 
   }
   if(mask & 8) {
      ((unsigned char *)r->data)[address+3] = value>>24; 
   }
   return 1;
}

// Assembly:
subq $0x28, %rsp
movb %dl, %al
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movb %al, 0x13(%rsp)
movl %ecx, 0xc(%rsp)
movl 0x14(%rsp), %eax
addl $0x4, %eax
movq 0x18(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jbe 0x53b9
movq 0x8c69(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edx
addl 0x14(%rsp), %edx
leaq 0x5b8c(%rip), %rsi      # 0xaf31
movb $0x0, %al
callq 0x2130
movl $0x0, 0x24(%rsp)
jmp 0x549a
movl 0x14(%rsp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x53e9
movq 0x8c2c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edx
addl 0x14(%rsp), %edx
leaq 0x5b79(%rip), %rsi      # 0xaf5b
movb $0x0, %al
callq 0x2130
movzbl 0x13(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5411
movl 0xc(%rsp), %eax
movb %al, %dl
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
addl $0x0, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movzbl 0x13(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x543c
movl 0xc(%rsp), %eax
shrl $0x8, %eax
movb %al, %dl
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movzbl 0x13(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5467
movl 0xc(%rsp), %eax
shrl $0x10, %eax
movb %al, %dl
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movzbl 0x13(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5492
movl 0xc(%rsp), %eax
shrl $0x18, %eax
movb %al, %dl
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/ram.c
// Function: RAM_get
int RAM_get(struct region *r, uint32_t address, uint32_t *value) {
   uint32_t v = 0;
   if((address & 3) != 0) {
     fprintf(stderr,"Unaligned memory read 0x%08x\n", r->base+address);
     return 0;
   }

   if(address+4 > r->size) {
     fprintf(stderr,"Memory region boundary crossed at 0x%08x\n", r->base+address);
     return 0;
   }

   v = ((unsigned char *)r->data)[address++]; 
   v = v + (((unsigned char *)r->data)[address++] << 8); 
   v = v + (((unsigned char *)r->data)[address++] << 16); 
   v = v + (((unsigned char *)r->data)[address++] << 24); 
   *value = v;
   return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq %rdx, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x14(%rsp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x5507
movq 0x8b1b(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edx
addl 0x14(%rsp), %edx
leaq 0x5a87(%rip), %rsi      # 0xaf7a
movb $0x0, %al
callq 0x2130
movl $0x0, 0x24(%rsp)
jmp 0x55f7
movl 0x14(%rsp), %eax
addl $0x4, %eax
movq 0x18(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jbe 0x5549
movq 0x8ad9(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edx
addl 0x14(%rsp), %edx
leaq 0x59fc(%rip), %rsi      # 0xaf31
movb $0x0, %al
callq 0x2130
movl $0x0, 0x24(%rsp)
jmp 0x55f7
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x14(%rsp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
movq 0x38(%rcx), %rcx
movl 0x14(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x14(%rsp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
movq 0x38(%rcx), %rcx
movl 0x14(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x14(%rsp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
addl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
movq 0x38(%rcx), %rcx
movl 0x14(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x14(%rsp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
shll $0x18, %ecx
addl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/ram.c
// Function: RAM_dump
void RAM_dump(struct region *r) {
   int i;

   printf("RAM 0x%08x length 0x%08x\n", r->base, r->size);
   for(i = 0; i < r->size && i < 4096; i++) {
      if(i%32 == 0) {
	 printf("%08x:", r->base+i);
      }
      printf(" %02x", ((unsigned char *)(r->data))[i]);
      if(i%32 == 31)
	 printf("\n");
   }
   if(i%32 != 0)
     printf("\n");
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %esi
movq 0x10(%rsp), %rax
movl 0xc(%rax), %edx
leaq 0x5978(%rip), %rdi      # 0xaf98
movb $0x0, %al
callq 0x20b0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rdx
xorl %eax, %eax
cmpl 0xc(%rdx), %ecx
movb %al, 0xb(%rsp)
jae 0x5652
cmpl $0x1000, 0xc(%rsp)      # imm = 0x1000
setl %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x565c
jmp 0x56d8
movl 0xc(%rsp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5687
movq 0x10(%rsp), %rax
movl 0x8(%rax), %esi
addl 0xc(%rsp), %esi
leaq 0x5932(%rip), %rdi      # 0xafb2
movb $0x0, %al
callq 0x20b0
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0xc(%rsp), %rcx
movzbl (%rax,%rcx), %esi
leaq 0x5918(%rip), %rdi      # 0xafb8
movb $0x0, %al
callq 0x20b0
movl 0xc(%rsp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
cmpl $0x1f, %edx
jne 0x56c6
leaq 0x5fd9(%rip), %rdi      # 0xb698
movb $0x0, %al
callq 0x20b0
jmp 0x56c8
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x562f
movl 0xc(%rsp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x56f7
leaq 0x5fa8(%rip), %rdi      # 0xb698
movb $0x0, %al
callq 0x20b0
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/ram.c
// Function: RAM_free
void RAM_free(struct region *r) {
   char buffer[100];
   sprintf(buffer, "Releasing RAM at 0x%08x", r->base);
   display_log(buffer);
   if(r->data != NULL) 
     free(r->data);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsp, %rdi
movq 0x70(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x58a3(%rip), %rsi      # 0xafbe
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6b20
movq 0x70(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x5744
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x2040
addq $0x78, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/uart.c
// Function: UART_init
int UART_init(struct region *r) {
  struct uart_data *data;

  if(r->data != NULL) {
    display_log("UART already initialized");
    return 0;
  }
 
  data = malloc(sizeof(struct uart_data));
  if(data == NULL){
    return 0;
  }

  memset(data, 0, sizeof(struct uart_data));
  data->divisor = 0xffff;
  data->debug   = UART_DEBUG;
  r->data = (void *)data;

  display_log("Set up UART region");
  return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x577b
leaq 0x5a28(%rip), %rdi      # 0xb194
callq 0x6b20
movl $0x0, 0x14(%rsp)
jmp 0x57dc
movl $0x22, %edi
callq 0x2180
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x579a
movl $0x0, 0x14(%rsp)
jmp 0x57dc
movq (%rsp), %rdi
xorl %esi, %esi
movl $0x22, %edx
callq 0x20e0
movq (%rsp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movq (%rsp), %rax
movb $0x0, 0x21(%rax)
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x38(%rax)
leaq 0x59de(%rip), %rdi      # 0xb1ad
callq 0x6b20
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/uart.c
// Function: UART_rx_enqueue
void UART_rx_enqueue(struct region *r, uint8_t c) {
  char buffer[100];
  struct uart_data *data = r->data;
  if(data->rx_enable) {
    if(data->rx_count < UART_QUEUE_DEPTH) {
      data->rx_fifo[data->tx_write_ptr] = c;
      data->rx_count++;
      data->tx_write_ptr = (data->tx_write_ptr == UART_FIFO_SIZE-1) ? 0 : data->tx_write_ptr+1;
      if(data->debug) {
        sprintf(buffer,"UART data added to rx queue 0x%02x", c);
        display_log(buffer);
      }
    } else {
      if(data->debug) {
        sprintf(buffer,"UART rx queue overflow adding 0x%02x", c);
        display_log(buffer);
      }
    }
  } else {
    if(data->debug) {
      sprintf(buffer,"UART rx disabled while adding 0x%02x", c);
      display_log(buffer);
    }
  }
}

// Assembly:
subq $0x88, %rsp
movb %sil, %al
movq %rdi, 0x80(%rsp)
movb %al, 0x7f(%rsp)
movq 0x80(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpb $0x0, 0x1b(%rax)
je 0x5d80
movq 0x8(%rsp), %rax
movzbl 0x17(%rax), %eax
cmpl $0x8, %eax
jge 0x5d4f
movb 0x7f(%rsp), %dl
movq 0x8(%rsp), %rax
movq 0x8(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movb %dl, 0xd(%rax,%rcx)
movq 0x8(%rsp), %rax
movb 0x17(%rax), %cl
addb $0x1, %cl
movb %cl, 0x17(%rax)
movq 0x8(%rsp), %rax
movzbl 0xb(%rax), %eax
cmpl $0x7, %eax
jne 0x5d02
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x5d12
movq 0x8(%rsp), %rax
movzbl 0xb(%rax), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movb %al, %cl
movq 0x8(%rsp), %rax
movb %cl, 0xb(%rax)
movq 0x8(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x5d4d
leaq 0x10(%rsp), %rdi
movzbl 0x7f(%rsp), %edx
leaq 0x55a3(%rip), %rsi      # 0xb2df
movb $0x0, %al
callq 0x21e0
leaq 0x10(%rsp), %rdi
callq 0x6b20
jmp 0x5d7e
movq 0x8(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x5d7c
leaq 0x10(%rsp), %rdi
movzbl 0x7f(%rsp), %edx
leaq 0x5597(%rip), %rsi      # 0xb302
movb $0x0, %al
callq 0x21e0
leaq 0x10(%rsp), %rdi
callq 0x6b20
jmp 0x5d7e
jmp 0x5daf
movq 0x8(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x5dad
leaq 0x10(%rsp), %rdi
movzbl 0x7f(%rsp), %edx
leaq 0x558b(%rip), %rsi      # 0xb327
movb $0x0, %al
callq 0x21e0
leaq 0x10(%rsp), %rdi
callq 0x6b20
jmp 0x5daf
addq $0x88, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/uart.c
// Function: UART_free
void UART_free(struct region *r) {
   char buffer[100];
   sprintf(buffer, "Releasing UART at 0x%08x", r->base);
   display_log(buffer);
   if(r->data != NULL) 
     free(r->data);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsp, %rdi
movq 0x70(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x5158(%rip), %rsi      # 0xb4a3
movb $0x0, %al
callq 0x21e0
movq %rsp, %rdi
callq 0x6b20
movq 0x70(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x6374
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x2040
addq $0x78, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: display_update
void display_update(void) {
  update_reg();

  if(log_changed) 
    update_log();

  if(trace_changed) 
    update_trace();
 
  if(uart_changed) 
    update_uart();
 
  refresh();
}

// Assembly:
pushq %rax
callq 0x66e0
cmpl $0x0, 0x8343(%rip)      # 0xe9e0
je 0x66a4
callq 0x67f0
cmpl $0x0, 0x8339(%rip)      # 0xe9e4
je 0x66b2
callq 0x6900
cmpl $0x0, 0x832f(%rip)      # 0xe9e8
je 0x66c0
callq 0x6a20
movq 0x7911(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x20d0
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: update_reg
static void update_reg(void) {
  int i;
  move(0, 0);
  attron(COLOR_PAIR(BORDER_PAIR));
  printw("Registers:");
  attron(COLOR_PAIR(ACTIVE_PAIR));
  for(i = 0; i < 16; i++) {
    move(1+i, 0);
    printw("r%02i %08X", i,    riscv_reg(i));
    printw(" r%02i %08X", i+16, riscv_reg(i+16));
  }
  move(1+i, 0);
  printw("       pc %08X       ",riscv_pc());
}

// Assembly:
subq $0x18, %rsp
movq 0x78ed(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x21b0
movq 0x78da(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
leaq 0x4e4a(%rip), %rdi      # 0xb560
movb $0x0, %al
callq 0x21d0
movq 0x78b4(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
movl $0x0, 0x14(%rsp)
cmpl $0x10, 0x14(%rsp)
jge 0x67b9
movq 0x788d(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl 0x14(%rsp), %esi
addl $0x1, %esi
xorl %edx, %edx
callq 0x21b0
movl 0x14(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %edi
callq 0x2f20
movl 0xc(%rsp), %esi
movl %eax, %edx
leaq 0x4df2(%rip), %rdi      # 0xb56c
movb $0x0, %al
callq 0x21d0
movl 0x14(%rsp), %eax
addl $0x10, %eax
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %edi
addl $0x10, %edi
callq 0x2f20
movl 0x10(%rsp), %esi
movl %eax, %edx
leaq 0x4dc6(%rip), %rdi      # 0xb56b
movb $0x0, %al
callq 0x21d0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x673d
movq 0x7818(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl 0x14(%rsp), %esi
addl $0x1, %esi
xorl %edx, %edx
callq 0x21b0
callq 0x2ef0
movl %eax, %esi
leaq 0x4d98(%rip), %rdi      # 0xb577
movb $0x0, %al
callq 0x21d0
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: update_log
static void update_log(void) {
  int i, index;

  index = log_index-LOG_SHOW;
  if(index < 0) index = 0;

  move(18,0);
  attron(COLOR_PAIR(BORDER_PAIR));
  printw("Log:");
  attron(COLOR_PAIR(ACTIVE_PAIR));
  for(i = 0; i < LOG_SHOW; i++) {
     move(19+i,0);
     if(log_lines[index+i])
       printw("%-80s", log_lines[index+i]);
     else
       printw("%-80s", "");
  }
  log_changed = 0;
}

// Assembly:
pushq %rax
movl 0xc431(%rip), %eax      # 0x12c28
subl $0x6, %eax
movl %eax, (%rsp)
cmpl $0x0, (%rsp)
jge 0x680a
movl $0x0, (%rsp)
movq 0x77c7(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x12, %esi
xorl %edx, %edx
callq 0x21b0
movq 0x77b1(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
leaq 0x4d4e(%rip), %rdi      # 0xb58d
movb $0x0, %al
callq 0x21d0
movq 0x778b(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
movl $0x0, 0x4(%rsp)
cmpl $0x6, 0x4(%rsp)
jge 0x68e6
movq 0x7764(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl 0x4(%rsp), %esi
addl $0x13, %esi
xorl %edx, %edx
callq 0x21b0
movl (%rsp), %eax
addl 0x4(%rsp), %eax
movslq %eax, %rcx
leaq 0xc39a(%rip), %rax      # 0x12c30
cmpq $0x0, (%rax,%rcx,8)
je 0x68c2
movl (%rsp), %eax
addl 0x4(%rsp), %eax
movslq %eax, %rcx
leaq 0xc382(%rip), %rax      # 0x12c30
movq (%rax,%rcx,8), %rsi
leaq 0x4cd9(%rip), %rdi      # 0xb592
movb $0x0, %al
callq 0x21d0
jmp 0x68d7
leaq 0x4cc9(%rip), %rdi      # 0xb592
leaq 0x4dc9(%rip), %rsi      # 0xb699
movb $0x0, %al
callq 0x21d0
jmp 0x68d9
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x6866
movl $0x0, 0x80f0(%rip)      # 0xe9e0
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: update_trace
static void update_trace(void) {
  int i, index;

  move(0, 28);
  attron(COLOR_PAIR(BORDER_PAIR));
  printw("Trace:    Stalled %6i     Cycle: %6i", riscv_stalled_count(), riscv_cycle_count());
  clrtoeol();
  index = trace_index-TRACE_SHOW;
  if(index < 0) index = 0;

  attron(COLOR_PAIR(ACTIVE_PAIR));
  for(i = 0; i < TRACE_SHOW; i++) {
     move(1+i,28);
     if(trace_lines[index+i])
       printw("%s", trace_lines[index+i]);
  }
  trace_changed = 0;
}

// Assembly:
subq $0x18, %rsp
movq 0x76cd(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
xorl %esi, %esi
movl $0x1c, %edx
callq 0x21b0
movq 0x76b7(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
callq 0x2f10
movl %eax, 0xc(%rsp)
callq 0x2f00
movl 0xc(%rsp), %esi
movl %eax, %edx
leaq 0x4c4b(%rip), %rdi      # 0xb598
movb $0x0, %al
callq 0x21d0
movq 0x767d(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x21c0
movl 0xc2f7(%rip), %eax      # 0x12c60
subl $0x11, %eax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jge 0x697f
movl $0x0, 0x10(%rsp)
movq 0x7652(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
movl $0x0, 0x14(%rsp)
cmpl $0x11, 0x14(%rsp)
jge 0x6a0d
movq 0x762b(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl 0x14(%rsp), %esi
addl $0x1, %esi
movl $0x1c, %edx
callq 0x21b0
movl 0x10(%rsp), %eax
addl 0x14(%rsp), %eax
movslq %eax, %rcx
leaq 0xc13d(%rip), %rax      # 0x12b10
cmpq $0x0, (%rax,%rcx,8)
je 0x69fe
movl 0x10(%rsp), %eax
addl 0x14(%rsp), %eax
movslq %eax, %rcx
leaq 0xc124(%rip), %rax      # 0x12b10
movq (%rax,%rcx,8), %rsi
leaq 0x4bc6(%rip), %rdi      # 0xb5bd
movb $0x0, %al
callq 0x21d0
jmp 0x6a00
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x699f
movl $0x0, 0x7fcd(%rip)      # 0xe9e4
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: update_uart
static void update_uart(void) {
  int i, index;

  move(25, 0);
  attron(COLOR_PAIR(BORDER_PAIR));
  printw("UART data:");
  clrtoeol();
  index = uart_index-UART_SHOW;
  if(index < 0) index = 0;

  attron(COLOR_PAIR(ACTIVE_PAIR));
  for(i = 0; i < UART_SHOW; i++) {
     move(26+i,0);
     if(uart_lines[index+i])
       printw("%s", uart_lines[index+i]);
  }
  uart_changed = 0;
}

// Assembly:
pushq %rax
movq 0x75b0(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x19, %esi
xorl %edx, %edx
callq 0x21b0
movq 0x759a(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
leaq 0x4b6a(%rip), %rdi      # 0xb5c0
movb $0x0, %al
callq 0x21d0
movq 0x7574(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x21c0
movl 0xc1fa(%rip), %eax      # 0x12c6c
subl $0x6, %eax
movl %eax, (%rsp)
cmpl $0x0, (%rsp)
jge 0x6a85
movl $0x0, (%rsp)
movq 0x754c(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x2120
movl $0x0, 0x4(%rsp)
cmpl $0x6, 0x4(%rsp)
jge 0x6b0e
movq 0x7525(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl 0x4(%rsp), %esi
addl $0x1a, %esi
xorl %edx, %edx
callq 0x21b0
movl (%rsp), %eax
addl 0x4(%rsp), %eax
movslq %eax, %rcx
leaq 0xc0cb(%rip), %rax      # 0x12ba0
cmpq $0x0, (%rax,%rcx,8)
je 0x6aff
movl (%rsp), %eax
addl 0x4(%rsp), %eax
movslq %eax, %rcx
leaq 0xc0b3(%rip), %rax      # 0x12ba0
movq (%rax,%rcx,8), %rsi
leaq 0x4ac5(%rip), %rdi      # 0xb5bd
movb $0x0, %al
callq 0x21d0
jmp 0x6b01
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x6aa5
movl $0x0, 0x7ed0(%rip)      # 0xe9e8
popq %rax
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: display_log
void display_log(char *str) {
  if(log_file != NULL) {
    fprintf(log_file,"%s\n",str);
  }
  if(log_index == N_LOG) {
    ////////////////////
    // Free up a line 
    ////////////////////
    int i;
    if(log_lines[0] != NULL)
      free(log_lines[0]);
    for(i = 1; i < N_LOG; i++) {
      log_lines[i-1] = log_lines[i];
    }	    
    log_lines[N_LOG-1] = NULL;
    log_index--;
    log_changed = 1;
  }  

  log_lines[log_index] = malloc(strlen(str)+1);

  if(log_lines[log_index] == NULL)
    return;

  log_changed = 1;
  strcpy(log_lines[log_index],str);
  log_index++;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
cmpq $0x0, 0xbfcf(%rip)      # 0x12b00
je 0x6b4d
movq 0xbfc6(%rip), %rdi      # 0x12b00
movq 0x10(%rsp), %rdx
leaq 0x4a16(%rip), %rsi      # 0xb55c
movb $0x0, %al
callq 0x2130
cmpl $0x6, 0xc0d4(%rip)      # 0x12c28
jne 0x6bd1
cmpq $0x0, 0xc0d2(%rip)      # 0x12c30
je 0x6b6c
movq 0xc0c9(%rip), %rdi      # 0x12c30
callq 0x2040
movl $0x1, 0xc(%rsp)
cmpl $0x6, 0xc(%rsp)
jge 0x6bad
movslq 0xc(%rsp), %rcx
leaq 0xc0a9(%rip), %rax      # 0x12c30
movq (%rax,%rcx,8), %rdx
movl 0xc(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xc094(%rip), %rax      # 0x12c30
movq %rdx, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x6b74
movq $0x0, 0xc0a0(%rip) # 0x12c58
movl 0xc06a(%rip), %eax      # 0x12c28
addl $-0x1, %eax
movl %eax, 0xc061(%rip)      # 0x12c28
movl $0x1, 0x7e0f(%rip)      # 0xe9e0
movq 0x10(%rsp), %rdi
callq 0x2090
movq %rax, %rdi
addq $0x1, %rdi
callq 0x2180
movq %rax, %rdx
movslq 0xc037(%rip), %rcx      # 0x12c28
leaq 0xc038(%rip), %rax      # 0x12c30
movq %rdx, (%rax,%rcx,8)
movslq 0xc025(%rip), %rcx      # 0x12c28
leaq 0xc026(%rip), %rax      # 0x12c30
cmpq $0x0, (%rax,%rcx,8)
jne 0x6c13
jmp 0x6c48
movl $0x1, 0x7dc3(%rip)      # 0xe9e0
movslq 0xc004(%rip), %rcx      # 0x12c28
leaq 0xc005(%rip), %rax      # 0x12c30
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
callq 0x2060
movl 0xbfe9(%rip), %eax      # 0x12c28
addl $0x1, %eax
movl %eax, 0xbfe0(%rip)      # 0x12c28
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: display_trace
void display_trace(char *str) {
  int i; 
  trace_changed = 1;

  if(trace_index == N_TRACE) {
    char *temp;
    ////////////////////
    // Move top line to the bottom (to be overwritten)
    ////////////////////
    temp = trace_lines[0];
    for(i = 1; i < N_TRACE; i++) {
      trace_lines[i-1] = trace_lines[i];
    }
    trace_lines[N_TRACE-1] = temp;
    trace_index--;
  } 

  if(trace_lines[trace_index] == NULL)
    return;

  for(i = 0; str[i] != '\0' && i < TRACE_WIDTH; i++){
    trace_lines[trace_index][i] = str[i];
  }

  for(; i < TRACE_WIDTH; i++) {
    trace_lines[trace_index][i] = ' ';
  }

  trace_index++;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x1, 0x7d85(%rip)      # 0xe9e4
cmpl $0x11, 0xbffa(%rip)     # 0x12c60
jne 0x6cd0
movq 0xbea1(%rip), %rax      # 0x12b10
movq %rax, -0x18(%rsp)
movl $0x1, -0xc(%rsp)
cmpl $0x11, -0xc(%rsp)
jge 0x6cb5
movslq -0xc(%rsp), %rcx
leaq 0xbe81(%rip), %rax      # 0x12b10
movq (%rax,%rcx,8), %rdx
movl -0xc(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xbe6c(%rip), %rax      # 0x12b10
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x6c7c
movq -0x18(%rsp), %rax
movq %rax, 0xbecf(%rip)      # 0x12b90
movl 0xbf99(%rip), %eax      # 0x12c60
addl $-0x1, %eax
movl %eax, 0xbf90(%rip)      # 0x12c60
movslq 0xbf89(%rip), %rcx      # 0x12c60
leaq 0xbe32(%rip), %rax      # 0x12b10
cmpq $0x0, (%rax,%rcx,8)
jne 0x6cea
jmp 0x6d95
movl $0x0, -0xc(%rsp)
movq -0x8(%rsp), %rax
movslq -0xc(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rsp)
je 0x6d17
cmpl $0x34, -0xc(%rsp)
setl %al
movb %al, -0x19(%rsp)
movb -0x19(%rsp), %al
testb $0x1, %al
jne 0x6d21
jmp 0x6d55
movq -0x8(%rsp), %rax
movslq -0xc(%rsp), %rcx
movb (%rax,%rcx), %dl
movslq 0xbf2b(%rip), %rcx      # 0x12c60
leaq 0xbdd4(%rip), %rax      # 0x12b10
movq (%rax,%rcx,8), %rax
movslq -0xc(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x6cf2
jmp 0x6d57
cmpl $0x34, -0xc(%rsp)
jge 0x6d86
movslq 0xbefb(%rip), %rcx      # 0x12c60
leaq 0xbda4(%rip), %rax      # 0x12b10
movq (%rax,%rcx,8), %rax
movslq -0xc(%rsp), %rcx
movb $0x20, (%rax,%rcx)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x6d57
movl 0xbed4(%rip), %eax      # 0x12c60
addl $0x1, %eax
movl %eax, 0xbecb(%rip)      # 0x12c60
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: display_process_input
void display_process_input(int *run, int *quit, int *trace, int *reset) {
  int key = getch();
  switch(key) {
    case 'R':
       *reset = 1;
       break;
    case 'r':
       *run = *run ? 0 : 2;
       break;
    case 't':
       *trace = !*trace;
       break;
    case 'q':
       *quit = !*quit;
       break;
    case ' ':
       *run = 1;
       break;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x7219(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x2070
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
subl $0x20, %eax
je 0x6e65
jmp 0x6ddd
movl (%rsp), %eax
subl $0x52, %eax
je 0x6e05
jmp 0x6de7
movl (%rsp), %eax
subl $0x71, %eax
je 0x6e4a
jmp 0x6df1
movl (%rsp), %eax
subl $0x72, %eax
je 0x6e12
jmp 0x6dfb
movl (%rsp), %eax
subl $0x74, %eax
je 0x6e2f
jmp 0x6e70
movq 0x8(%rsp), %rax
movl $0x1, (%rax)
jmp 0x6e70
movq 0x20(%rsp), %rax
movl (%rax), %edx
movl $0x2, %ecx
xorl %eax, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
jmp 0x6e70
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
jmp 0x6e70
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x6e70
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hamsternz[P]emulate-risc-v/display.c
// Function: display_uart_write
void display_uart_write(char c) {

  /* Only display printable characters */
  if(c > 27 && c < 127) {
    uart_lines[uart_cursor_y][uart_cursor_x] = c;
    uart_cursor_x++;
  }

  /* Caridge return brings the cursor to the left */
  if(c == '\r') {
    uart_cursor_x = 0;
  }

  /* Do we need to move to the next line? */
  if(c == '\n' || uart_cursor_x == UART_WIDTH) {
    uart_cursor_y++;
    uart_cursor_x = 0;
    /* Have we run out of lines */
    if(uart_cursor_y == N_UART) {
      /* shuffle the lines up, moving the first line to the end */
      int i;
      char *t = uart_lines[0];
      for(i = 1; i < N_UART; i++) {
	uart_lines[i-1] = uart_lines[i];
      }
      uart_lines[N_UART-1] = t;

      /* Empty out the first line */
      memset(uart_lines[N_UART-1],' ', UART_WIDTH);
      uart_cursor_y--;
    }
  }
  uart_changed = 1;
}

// Assembly:
subq $0x18, %rsp
movb %dil, %al
movb %al, 0x17(%rsp)
movsbl 0x17(%rsp), %eax
cmpl $0x1b, %eax
jle 0x6ece
movsbl 0x17(%rsp), %eax
cmpl $0x7f, %eax
jge 0x6ece
movb 0x17(%rsp), %dl
movslq 0xbdba(%rip), %rcx      # 0x12c64
leaq 0xbcef(%rip), %rax      # 0x12ba0
movq (%rax,%rcx,8), %rax
movslq 0xbdac(%rip), %rcx      # 0x12c68
movb %dl, (%rax,%rcx)
movl 0xbda3(%rip), %eax      # 0x12c68
addl $0x1, %eax
movl %eax, 0xbd9a(%rip)      # 0x12c68
movsbl 0x17(%rsp), %eax
cmpl $0xd, %eax
jne 0x6ee2
movl $0x0, 0xbd86(%rip)      # 0x12c68
movsbl 0x17(%rsp), %eax
cmpl $0xa, %eax
je 0x6ef9
cmpl $0x50, 0xbd75(%rip)     # 0x12c68
jne 0x6f9b
movl 0xbd65(%rip), %eax      # 0x12c64
addl $0x1, %eax
movl %eax, 0xbd5c(%rip)      # 0x12c64
movl $0x0, 0xbd56(%rip)      # 0x12c68
cmpl $0x6, 0xbd4b(%rip)      # 0x12c64
jne 0x6f99
movq 0xbc7e(%rip), %rax      # 0x12ba0
movq %rax, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
cmpl $0x6, 0x10(%rsp)
jge 0x6f68
movslq 0x10(%rsp), %rcx
leaq 0xbc5e(%rip), %rax      # 0x12ba0
movq (%rax,%rcx,8), %rdx
movl 0x10(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xbc49(%rip), %rax      # 0x12ba0
movq %rdx, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x6f2f
movq 0x8(%rsp), %rax
movq %rax, 0xbc54(%rip)      # 0x12bc8
movq 0xbc4d(%rip), %rdi      # 0x12bc8
movl $0x20, %esi
movl $0x50, %edx
callq 0x20e0
movl 0xbcd4(%rip), %eax      # 0x12c64
addl $-0x1, %eax
movl %eax, 0xbccb(%rip)      # 0x12c64
jmp 0x6f9b
movl $0x1, 0x7a43(%rip)      # 0xe9e8
addq $0x18, %rsp
retq
nopw (%rax,%rax)