LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/include/tinyopt/tinyopt.h
// Function: to::keyword_parser<int>::operator()(char const*) const
maybe<V> operator()(const char* text) const {
        if (!text) return nothing;
        for (const auto& p: map_) {
            if (text==p.first) return p.second;
        }
        return nothing;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rdx, %rdx
je 0x4500
movq (%rsi), %r14
movq 0x8(%rsi), %r12
cmpq %r12, %r14
sete %bpl
je 0x4500
movq %rdx, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
testl %eax, %eax
je 0x44ef
addq $0x28, %r14
cmpq %r12, %r14
sete %bpl
jne 0x44d1
jmp 0x4500
movb $0x1, (%rbx)
movl 0x20(%r14), %eax
movl %eax, 0x4(%rbx)
movb $0x1, %al
testb %bpl, %bpl
je 0x4502
xorl %eax, %eax
movb %al, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: atohex(char*)
u32 atohex(char *s)
{
u32 val;

   // return 32-bit integer value of a hex ascii string (can have leading 0x)

   if(s == 0) return 0;
   if((s[0] == '0') && (s[1] == 'x')) s += 2;
   else if((s[0] == '0') && (s[1] == 'X')) s += 2;

   val = 0;
   sscanf(s, "%x", &val);
   return val;
}

// Assembly:
testq %rdi, %rdi
je 0x98dd
movb (%rdi), %al
cmpb $0x30, %al
jne 0x98f1
cmpb $0x78, 0x1(%rdi)
jne 0x98e0
addq $0x2, %rdi
jmp 0x98f1
xorl %eax, %eax
retq
cmpb $0x30, %al
jne 0x98f1
xorl %eax, %eax
cmpb $0x58, 0x1(%rdi)
sete %al
leaq (%rdi,%rax,2), %rdi
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0xc(%rbp), %rbx
movl $0x0, (%rbx)
leaq 0x117991(%rip), %rsi    # 0x121299
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9360
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: atosecs(char*)
double atosecs(char *s)
{
double val;

   // return integer value of a hex ascii string
   if(s == 0) return 0;

   val = 0;
   val = atof(s);

   if(strchr(s, 'm') || strchr(s, 'M')) val *= 60.0;
   else if(strchr(s, 'h') || strchr(s, 'H')) val *= 60.0*60.0;
   else if(strchr(s, 'd') || strchr(s, 'D')) val *= 24.0*60.0*60.0;

   return val;
}

// Assembly:
testq %rdi, %rdi
je 0x996b
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9470
movsd %xmm0, -0x10(%rbp)
movq %rbx, %rdi
movl $0x6d, %esi
callq 0x9100
testq %rax, %rax
jne 0x9957
movq %rbx, %rdi
movl $0x4d, %esi
callq 0x9100
testq %rax, %rax
je 0x996f
movsd -0x10(%rbp), %xmm0
mulsd 0xff6a4(%rip), %xmm0    # 0x109008
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorps %xmm0, %xmm0
retq
movq %rbx, %rdi
movl $0x68, %esi
callq 0x9100
testq %rax, %rax
jne 0x9993
movq %rbx, %rdi
movl $0x48, %esi
callq 0x9100
testq %rax, %rax
je 0x99a2
movsd -0x10(%rbp), %xmm0
mulsd 0xff670(%rip), %xmm0    # 0x109010
jmp 0x9964
movq %rbx, %rdi
movl $0x64, %esi
callq 0x9100
testq %rax, %rax
jne 0x99c6
movq %rbx, %rdi
movl $0x44, %esi
callq 0x9100
testq %rax, %rax
je 0x99d5
movsd -0x10(%rbp), %xmm0
mulsd 0xff645(%rip), %xmm0    # 0x109018
jmp 0x9964
movsd -0x10(%rbp), %xmm0
jmp 0x9964
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: tune_exists(char*, int)
int tune_exists(char *file, int add_path)
{
char tune[MAX_PATH+1];
FILE *f;

   // This routine sees if a sound file exists

   if(add_path) sprintf(tune, "%s%s", heather_path, file);
   else         sprintf(tune, "%s", file);

   f = topen(tune, "r");
   if(f) {
      fclose(f);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, %rcx
testl %esi, %esi
je 0x9a0c
leaq 0x101b98(%rip), %rsi    # 0x10b58d
leaq 0x167294(%rip), %rdx    # 0x170c90
leaq -0x110(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0x9a1b
leaq -0x110(%rbp), %rdi
movq %rcx, %rsi
callq 0x9340
leaq 0x11728b(%rip), %rsi    # 0x120cad
leaq -0x110(%rbp), %rdi
callq 0x9a4d
testq %rax, %rax
je 0x9a42
movq %rax, %rdi
callq 0x9370
movl $0x1, %eax
jmp 0x9a44
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: topen(char*, char*)
FILE *topen(char *fn, char *m)
{
char *f;

   // open a file,  trim leading whitespace from the name
   if(m == 0) return 0;
   f = trim_whitespace(fn);
   if(f == 0) return 0;

if(show_debug_info) printf("topen(%s, %s)\n", f,m);  //zorky
   return path_open(f, m);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x9aaf
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
jne 0x9a69
jmp 0x9a7b
incq %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
je 0x9a66
cmpl $0x20, %eax
je 0x9a66
testl %eax, %eax
jne 0x9a7e
xorl %r14d, %r14d
testq %r14, %r14
je 0x9aaf
cmpb $0x0, 0x20ee3a(%rip)    # 0x2188c4
je 0x9aa0
leaq 0xffe2d(%rip), %rdi     # 0x1098c0
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9030
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xa280
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: alarm_clock()
void alarm_clock()
{
   if(alarm_file)           play_tune(ALARM_FILE, 1);
   else if(chord_file == 2) play_tune(USER_CHORD_FILE, 1);
   else if(chord_file)      play_tune(CHORD_FILE, 0);
   else                     BEEP(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x3044db(%rip)    # 0x30e2c3
je 0x9dfc
leaq 0xff858(%rip), %rdi     # 0x109649
movl $0x1, %esi
popq %rbp
jmp 0x9cd3
movzbl 0x3042ba(%rip), %eax    # 0x30e0bd
testl %eax, %eax
je 0x9e15
cmpl $0x2, %eax
jne 0x9e20
leaq 0xff8ca(%rip), %rdi     # 0x1096dd
jmp 0x9df1
movl $0x1, %edi
popq %rbp
jmp 0x9d80
leaq 0xff8c8(%rip), %rdi     # 0x1096ef
xorl %esi, %esi
jmp 0x9df6
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: cuckoo_clock()
void cuckoo_clock()
{
char fn[MAX_PATH+1];

   if(singing_clock) {  // sing a song file
      get_alarm_time();
      if((singing_clock == 2) && (g_minutes == 0)) {  // Big Ben mode - play a different file each hour on the hour
         sprintf(fn, HOUR_NAME, g_hours%12);
      }
      else {
         sprintf(fn, SONG_NAME, g_minutes);
      }
      play_tune(fn, 1);
      cuckoo_beeps = 0;
   }
   else if(ships_clock && (ring_bell >= 0) && (bell_number >= 0) && (bell_number < MAX_BELLS)) {
      if(bell_file && (bells[ring_bell][bell_number])) play_tune(BELL_FILE, 1);
      if(++bell_number >= MAX_BELLS) bell_number = (-1);
   }
   else if(chime_file) play_tune(CHIME_FILE, 1);
   else if(notify_file == 2) play_tune(USER_NOTIFY_FILE, 1);
   else if(notify_file) play_tune(NOTIFY_FILE, 0);
   else BEEP(2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
cmpb $0x0, 0x3040a0(%rip)    # 0x30dedd
je 0x9e9a
callq 0xe2431
cmpb $0x2, 0x304092(%rip)    # 0x30dedd
sete %al
movl 0x303858(%rip), %edx    # 0x30d6ac
testl %edx, %edx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x9f1d
movslq 0x30383d(%rip), %rdx    # 0x30d6a8
imulq $0x2aaaaaab, %rdx, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x21, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
subl %eax, %edx
leaq 0xff97e(%rip), %rsi     # 0x10980c
leaq -0x110(%rbp), %rdi
jmp 0x9f2b
cmpb $0x0, 0x304040(%rip)    # 0x30dee1
setne %cl
movl 0x30403a(%rip), %eax    # 0x30dee4
testl %eax, %eax
setns %dl
andb %cl, %dl
movl 0x304031(%rip), %ecx    # 0x30dee8
cmpl $0xc, %ecx
setb %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x9f53
cmpb $0x0, 0x3043f5(%rip)    # 0x30e2c7
je 0x9f01
movl %eax, %eax
movl %ecx, %ecx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x155069(%rip), %rdx    # 0x15ef50
addq %rax, %rdx
cmpl $0x0, (%rdx,%rcx,4)
je 0x9f01
leaq 0xff79d(%rip), %rdi     # 0x109694
movl $0x1, %esi
callq 0x9cd3
movl 0x303fe1(%rip), %eax    # 0x30dee8
leal 0x1(%rax), %ecx
cmpl $0xb, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovll %ecx, %eax
movl %eax, 0x303fcd(%rip)    # 0x30dee8
jmp 0x9f4a
leaq 0xff8fd(%rip), %rsi     # 0x109821
leaq -0x110(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
leaq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x9cd3
movb $0x0, 0x303f95(%rip)    # 0x30dedf
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
cmpb $0x0, 0x304366(%rip)    # 0x30e2c0
je 0x9f75
leaq 0xff6d4(%rip), %rdi     # 0x109637
movl $0x1, %esi
addq $0x110, %rsp            # imm = 0x110
popq %rbp
jmp 0x9cd3
movzbl 0x304142(%rip), %eax    # 0x30e0be
testl %eax, %eax
je 0x9f8e
cmpl $0x2, %eax
jne 0x9fa0
leaq 0xff77e(%rip), %rdi     # 0x10970a
jmp 0x9f63
movl $0x2, %edi
addq $0x110, %rsp            # imm = 0x110
popq %rbp
jmp 0x9d80
leaq 0xff776(%rip), %rdi     # 0x10971d
xorl %esi, %esi
jmp 0x9f68
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: text_editor()
void text_editor()
{
char *e;

   // run a text editor program
   if(no_exec) return;

   e = getenv("HEATHER_EDITOR");
   if(!e || !*e) {
      e = getenv("EDITOR");
   }
   if(!e || !*e) {
      e = editor;
   }

   run_program(e, 0);
}

// Assembly:
cmpl $0x0, 0x303f63(%rip)    # 0x30e0b4
je 0xa154
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xff71a(%rip), %rdi     # 0x109879
callq 0x9460
testq %rax, %rax
je 0xa16e
cmpb $0x0, (%rax)
jne 0xa17a
leaq 0xff70c(%rip), %rdi     # 0x109881
callq 0x9460
testq %rax, %rax
je 0xa184
cmpb $0x0, (%rax)
jne 0xa18b
movq 0x153b8d(%rip), %rax    # 0x15dd18
movq %rax, %rdi
xorl %esi, %esi
popq %rbp
jmp 0x9ffb
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: exec_program()
void exec_program()
{
char *e;

   // run a user defined program on a schedule
   if(no_exec) return;

   e = getenv("HEATHER_EXEC");
   if(!e || !*e) {
      e = heather_exec;
   }
   strcpy(edit_buffer, e);
   strcpy(out, e);

   run_program(out, 0);
}

// Assembly:
cmpl $0x0, 0x303f17(%rip)    # 0x30e0b4
je 0xa1a0
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xff6da(%rip), %rdi     # 0x109888
callq 0x9460
testq %rax, %rax
je 0xa1c0
movq %rax, %rbx
cmpb $0x0, (%rax)
jne 0xa1c7
movq 0x153b59(%rip), %rbx    # 0x15dd20
leaq 0x335112(%rip), %rdi    # 0x33f2e0
movq %rbx, %rsi
callq 0x9340
leaq 0x332043(%rip), %r14    # 0x33c220
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9340
movq %r14, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ffb
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: path_unlink(char*)
int path_unlink(char *fn)
{
char name[2048+1];
char *f;

   // delete a file, add path name if none given
   f = trim_whitespace(fn);
   if(f == 0) return 1;

   strcpy(name, f);

#ifdef WINDOWS
#else // __linux__  __MACH__  __FreeBSD__
   if(f[0] == '.') ;       // user gave a path
   else if(f[0] == '/') ;  // user gave a path
   else {  // add path to heather directory
      strcpy(name, heather_path);
      strcat(name, f);
   }
#endif

   return unlink(name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
testq %rdi, %rdi
je 0xa222
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0xa219
cmpl $0x20, %eax
jne 0xa21e
incq %rbx
jmp 0xa20c
testl %eax, %eax
jne 0xa224
xorl %ebx, %ebx
testq %rbx, %rbx
je 0xa26f
leaq -0x820(%rbp), %rdi
movq %rbx, %rsi
callq 0x9340
movb (%rbx), %al
andb $-0x2, %al
cmpb $0x2e, %al
je 0xa261
leaq 0x166a49(%rip), %rsi    # 0x170c90
leaq -0x820(%rbp), %r14
movq %r14, %rdi
callq 0x9340
movq %r14, %rdi
movq %rbx, %rsi
callq 0x96c0
leaq -0x820(%rbp), %rdi
callq 0x9130
jmp 0xa274
movl $0x1, %eax
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: path_open(char*, char*)
FILE *path_open(char *fn, char *m)
{
char name[2048+1];
char *f;
FILE *fp;

   // open a file, add path name if none given
   if(m == 0) return 0;
   f = trim_whitespace(fn);
   if(f == 0) return 0;

   strcpy(name, f);

#ifdef WINDOWS
#else // __linux__  __MACH__  __FreeBSD__
   if(f[0] == '.') ;       // user gave a path
   else if(f[0] == '/') ;  // user gave a path
   else {  // add path to heather directory
      strcpy(name, heather_path);
      strcat(name, f);
   }
#endif

   fp = fopen(name, m);
   if(fp) {
      if(debug_file) fprintf(debug_file, "! file %s opened\n", name);
   }
if(show_debug_info) printf("path_open(%s, %s) -> %p\n", name, m, fp);
   return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
testq %rsi, %rsi
je 0xa367
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
jne 0xa2a9
jmp 0xa2bb
incq %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
je 0xa2a6
cmpl $0x20, %eax
je 0xa2a6
testl %eax, %eax
jne 0xa2be
xorl %r14d, %r14d
testq %r14, %r14
je 0xa367
leaq -0x820(%rbp), %rdi
movq %r14, %rsi
callq 0x9340
movb (%r14), %al
andb $-0x2, %al
cmpb $0x2e, %al
je 0xa300
leaq 0x1669aa(%rip), %rsi    # 0x170c90
leaq -0x820(%rbp), %r15
movq %r15, %rdi
callq 0x9340
movq %r15, %rdi
movq %r14, %rsi
callq 0x96c0
leaq -0x820(%rbp), %rdi
movq %rbx, %rsi
callq 0x9430
movq %rax, %r14
testq %rax, %rax
setne %al
movq 0x234071(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa341
leaq 0xff562(%rip), %rsi     # 0x109895
leaq -0x820(%rbp), %rdx
xorl %eax, %eax
callq 0x9560
cmpb $0x0, 0x20e57c(%rip)    # 0x2188c4
je 0xa36a
leaq 0xff556(%rip), %rdi     # 0x1098a7
leaq -0x820(%rbp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x9030
jmp 0xa36a
xorl %r14d, %r14d
movq %r14, %rax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: open_debug_file(char*)
FILE *open_debug_file(char *f)
{
char *s;
char *star;

   s = trim_whitespace(f);
   if(s == 0) return 0;

   if(debug_file) {
      fclose(debug_file);
      debug_file = 0;
   }

   star = strchr(s, FLUSH_CHAR);
   if(star) {
      *star = 0;
      dbg_flush_mode = 1;
   }
   else dbg_flush_mode = 0;

   debug_file = topen(s, "w");
   strcpy(debug_name, s);
   return debug_file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xa3a0
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0xa397
cmpl $0x20, %eax
jne 0xa39c
incq %rbx
jmp 0xa38a
testl %eax, %eax
jne 0xa3a2
xorl %ebx, %ebx
testq %rbx, %rbx
je 0xa3df
movq 0x233fe2(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
je 0xa3c3
callq 0x9370
movq $0x0, 0x233fcd(%rip) # 0x23e390
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa3e4
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa3e6
xorl %r14d, %r14d
jmp 0xa414
xorl %eax, %eax
movl %eax, 0x23403c(%rip)    # 0x23e428
leaq 0x116ee8(%rip), %rsi    # 0x1212db
movq %rbx, %rdi
callq 0x9a4d
movq %rax, %r14
movq %rax, 0x233f8b(%rip)    # 0x23e390
leaq 0x233654(%rip), %rdi    # 0x23da60
movq %rbx, %rsi
callq 0x9340
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: open_rinex_file(char*)
FILE *open_rinex_file(char *f)
{
char *s;
char *star;

   s = trim_whitespace(f);
   if(s == 0) return 0;

   if(rinex_file) {
      fclose(rinex_file);
      rinex_file = 0;
   }

   star = strchr(s, FLUSH_CHAR);
   if(star) {
      *star = 0;
      rinex_flush_mode = 1;
   }
   else rinex_flush_mode = 0;

   rinex_file = topen(s, "w");
   if(rinex_file) {
      if(debug_file) fprintf(debug_file, "! RINEX file %s opened\n", s);
   }
   strcpy(rinex_name, s);
   rinex_header_written = 0;
   first_obs = 1;
   return rinex_file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa57c
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0xa573
cmpl $0x20, %eax
jne 0xa578
incq %rbx
jmp 0xa566
testl %eax, %eax
jne 0xa57e
xorl %ebx, %ebx
testq %rbx, %rbx
je 0xa5bb
movq 0x233dde(%rip), %rdi    # 0x23e368
testq %rdi, %rdi
je 0xa59f
callq 0x9370
movq $0x0, 0x233dc9(%rip) # 0x23e368
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa5bf
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa5c1
xorl %eax, %eax
jmp 0xa632
xorl %eax, %eax
movl %eax, 0x233e5d(%rip)    # 0x23e424
leaq 0x116d0d(%rip), %rsi    # 0x1212db
movq %rbx, %rdi
callq 0x9a4d
movq %rax, 0x233d8b(%rip)    # 0x23e368
testq %rax, %rax
setne %al
movq 0x233da6(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa608
leaq 0xff2e2(%rip), %rsi     # 0x1098e0
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
leaq 0x232951(%rip), %rdi    # 0x23cf60
movq %rbx, %rsi
callq 0x9340
movl $0x0, 0x233dcb(%rip)    # 0x23e3ec
movl $0x1, 0x302f55(%rip)    # 0x30d580
movq 0x233d36(%rip), %rax    # 0x23e368
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: open_raw_file(char*, char*)
FILE *open_raw_file(char *name, char *mode)
{
char *s;
FILE *file;

   if(name == 0) return 0;
   if(mode == 0) return 0;

   if(raw_file) {
      fclose(raw_file);
      raw_file = 0;
   }

   s = strchr(name, FLUSH_CHAR);
   if(s) {
      *s = 0;
      raw_flush_mode = 1;
   }
   else raw_flush_mode = 0;

//lfs drain_port(RCVR_PORT);
   wakeup_tsip_msg = 0;        // cause wait for full receiver message before logging raw data
   saw_rcvr_msg = 0;
   file = topen(name, mode);
   if(file) {
      if(debug_file) fprintf(debug_file, "! raw capture file %s opened\n", name);
   }
   wakeup_tsip_msg = 0;        // cause wait for full receiver message before logging raw data
   saw_rcvr_msg = 0;

   return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0xa658
xorl %r14d, %r14d
jmp 0xa701
movq %rsi, %r14
movq %rdi, %rbx
movq 0x233d0b(%rip), %rdi    # 0x23e370
testq %rdi, %rdi
je 0xa67a
callq 0x9370
movq $0x0, 0x233cf6(%rip) # 0x23e370
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa696
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa698
xorl %eax, %eax
movl %eax, 0x233d7e(%rip)    # 0x23e41c
movq $0x0, 0x2348ef(%rip) # 0x23ef98
movl $0x0, 0x2348ed(%rip)    # 0x23efa0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a4d
movq %rax, %r14
testq %rax, %rax
setne %al
movq 0x233cc2(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa6ec
leaq 0xff216(%rip), %rsi     # 0x1098f8
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
movq $0x0, 0x2348a1(%rip) # 0x23ef98
movl $0x0, 0x23489f(%rip)    # 0x23efa0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: open_prn_file(char*, char*)
FILE *open_prn_file(char *name, char *mode)
{
char *s;
FILE *file;

   if(name == 0) return 0;
   if(mode == 0) return 0;

   if(prn_file) {
      fclose(prn_file);
      prn_file = 0;
      prn_count = 0;
   }

   s = strchr(name, FLUSH_CHAR);
   if(s) {
      *s = 0;
      prn_flush_mode = 1;
   }
   else prn_flush_mode = 0;

//lfs drain_port(RCVR_PORT);
   file = topen(name, mode);
   if(file) {
      fprintf(file, "#JD UTC         PRN   AZ     EL     SIG\n");
      fprintf(file, "# 1\n");
      if(prn_flush_mode) fflush(file);
      prn_count = 1;
      if(debug_file) fprintf(debug_file, "! PRN file %s opened\n", name);
   }

   return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0xa728
xorl %r14d, %r14d
jmp 0xa7f5
movq %rsi, %r14
movq %rdi, %rbx
movq 0x233c43(%rip), %rdi    # 0x23e378
testq %rdi, %rdi
je 0xa754
callq 0x9370
movq $0x0, 0x233c2e(%rip) # 0x23e378
movl $0x0, 0x233cc4(%rip)    # 0x23e418
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa770
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa772
xorl %eax, %eax
movl %eax, 0x233cb4(%rip)    # 0x23e42c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a4d
movq %rax, %r14
testq %rax, %rax
je 0xa7f5
leaq 0xff184(%rip), %rdi     # 0x109916
movl $0x28, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x9750
leaq 0xff194(%rip), %rdi     # 0x10993f
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x9750
cmpl $0x0, 0x233c68(%rip)    # 0x23e42c
je 0xa7ce
movq %r14, %rdi
callq 0x9420
movl $0x1, 0x233c40(%rip)    # 0x23e418
movq 0x233bb1(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
je 0xa7f5
leaq 0xff159(%rip), %rsi     # 0x109944
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: get_sim_char(unsigned int)
u08 get_sim_char(unsigned port)
{
int flag;
u08 c;

   // get a character from a simulation file.
   if(sim_file == 0) return 0;  // simulation file not being used

   if(sim_eof) {
      return 0;
   }

   flag = fread(&c, 1, 1, sim_file);
   if(flag <= 0) {  // just reached the end of file
      BEEP(4);
      sim_eof = 1;

      sprintf(plot_title, "Reached end of simulation file: %s", sim_name);
      refresh_page();
      return 0;
   }

   if((zoom_screen == 'O') && (port == monitor_port)) {   // send char to "terminal" format monitor screen
      echo_term(monitor_port, c, monitor_hex, 0);
   }
   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x2338fd(%rip), %rcx    # 0x23e3c0
xorl %r14d, %r14d
testq %rcx, %rcx
je 0xab53
cmpl $0x0, 0x233902(%rip)    # 0x23e3d8
jne 0xab53
movl %edi, %ebx
leaq -0x11(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x9590
testl %eax, %eax
jle 0xab1b
cmpb $0x4f, 0x301cb0(%rip)   # 0x30c7a8
jne 0xab15
movl 0x3037d0(%rip), %edi    # 0x30e2d0
cmpl %ebx, %edi
jne 0xab15
movzbl -0x11(%rbp), %esi
movl 0x233936(%rip), %edx    # 0x23e444
xorl %ecx, %ecx
callq 0xac26
movb -0x11(%rbp), %r14b
jmp 0xab53
movl $0x4, %edi
callq 0x9d80
movl $0x1, 0x2338a9(%rip)    # 0x23e3d8
leaq 0x333d1a(%rip), %rdi    # 0x33e850
leaq 0xfee1d(%rip), %rsi     # 0x10995a
leaq 0x232a1c(%rip), %rdx    # 0x23d560
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x9060
callq 0xab5f
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: refresh_page()
void refresh_page(void)
{
   // if double buffering the screen, copy background pixmap to display window
   // also flush the X11 drawing queue

   if(display == 0) return;

if(0 && sim_file && (sim_eof == 0)) {  // this can double the sim file rate
   if((com_tick % 200) != 10) return;
}

   if(pix_map && x11_io_done) {
      SWAP(SCREEN_WIDTH,SCREEN_HEIGHT);
      XCopyArea(display,pix_map,screen,gc, 0,0, SCREEN_WIDTH,SCREEN_HEIGHT, 0,0);
      SWAP(SCREEN_WIDTH,SCREEN_HEIGHT);
   }

   XFlush(display);

   x11_io_done = 0;
}

// Assembly:
movq 0x16635a(%rip), %rdi    # 0x170ec0
testq %rdi, %rdi
je 0xac25
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x166354(%rip), %rsi    # 0x170ed0
testq %rsi, %rsi
je 0xac0c
cmpb $0x0, 0x16631c(%rip)    # 0x170ea8
je 0xac0c
cmpl $0x0, 0x20dc93(%rip)    # 0x218828
je 0xabb5
movl 0x20dc67(%rip), %eax    # 0x218804
movl %eax, 0x20dc89(%rip)    # 0x21882c
movl 0x20dc57(%rip), %ecx    # 0x218800
movl %ecx, 0x20dc55(%rip)    # 0x218804
movl %eax, 0x20dc4b(%rip)    # 0x218800
movq 0x16630c(%rip), %rdx    # 0x170ec8
movq 0x16631d(%rip), %rcx    # 0x170ee0
movl 0x20dc37(%rip), %eax    # 0x218800
movl 0x20dc34(%rip), %r10d   # 0x218804
xorl %ebx, %ebx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq %rbx
pushq %r10
pushq %rax
callq 0x9150
addq $0x20, %rsp
cmpl %ebx, 0x20dc3c(%rip)    # 0x218828
je 0xac0c
movl 0x20dc10(%rip), %eax    # 0x218804
movl %eax, 0x20dc32(%rip)    # 0x21882c
movl 0x20dc00(%rip), %ecx    # 0x218800
movl %ecx, 0x20dbfe(%rip)    # 0x218804
movl %eax, 0x20dbf4(%rip)    # 0x218800
movq 0x1662ad(%rip), %rdi    # 0x170ec0
callq 0x95c0
movb $0x0, 0x166289(%rip)    # 0x170ea8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: SendBreak(unsigned int)
void SendBreak(unsigned port)
{
   // This routine sends a 300 msec BREAK signal to the serial port
   if(port >= NUM_COM_PORTS) return;
   if(com[port].com_fd < 0) return;  // !!!! should also return if IP connected

// tcsendbreak(com[port].com_fd, 0);  // send a 200..500 ms (supposedly) break
   SetBreak(port, 1);  // a more reliable way to do the BREAK
   Sleep(500);
   SetBreak(port, 0);
   Sleep(100);
}

// Assembly:
cmpl $0x12, %edi
ja 0xaff6
movl %edi, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x30333c(%rip), %rcx    # 0x30e2e0
movl 0x8(%rax,%rcx), %edi
testl %edi, %edi
js 0xaff6
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq (%rax,%rcx), %rbx
addq $0x8, %rbx
movl $0x5427, %esi           # imm = 0x5427
xorl %edx, %edx
xorl %eax, %eax
callq 0x9530
movl $0x7a120, %edi          # imm = 0x7A120
callq 0x9540
movl (%rbx), %edi
testl %edi, %edi
js 0xafe6
movl $0x5428, %esi           # imm = 0x5428
xorl %edx, %edx
xorl %eax, %eax
callq 0x9530
movl $0x186a0, %edi          # imm = 0x186A0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9540
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: Sleep(int)
void Sleep(int time)
{
   time *= 1000;   // convert msecs to usecs
   while(time > 1000000) {
      usleep(1000000);
      time -= 1000000;
   }
   usleep(time);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
imull $0x3e8, %edi, %ebx      # imm = 0x3E8
cmpl $0x3e9, %edi            # imm = 0x3E9
jl 0xb027
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x9540
leal -0xf4240(%rbx), %edi
cmpl $0x1e8480, %ebx         # imm = 0x1E8480
movl %edi, %ebx
jg 0xb00b
jmp 0xb029
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9540
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: kill_com(unsigned int, int)
void kill_com(unsigned port, int why)
{
   // close the serial communications device
   if(port >= NUM_COM_PORTS) return;
   com[port].port_used = 1;   // port has been closed

   if(com[port].com_fd < 0) return;

   tcsetattr(com[port].com_fd, TCSANOW, &oldtio);
   close(com[port].com_fd);

   com[port].com_fd = (-1);
   com[port].com_running = (-11); //NOT_RUNNING;
}

// Assembly:
cmpl $0x12, %edi
ja 0xb092
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x303291(%rip), %rbx    # 0x30e2e0
movl $0x1, 0x222c(%rax,%rbx)
movl 0x8(%rax,%rbx), %edi
testl %edi, %edi
js 0xb08c
addq %rax, %rbx
leaq 0x165e94(%rip), %rdx    # 0x170f00
xorl %esi, %esi
callq 0x94c0
movl 0x8(%rbx), %edi
callq 0x9760
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movl $0xfffffff5, 0x2230(%rbx) # imm = 0xFFFFFFF5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: error_exit(int, char*)
void error_exit(int num,  char *s)
{
char err[1024];

   if(s) sprintf(err, "Error exit %d: %s", num, s);
   else  sprintf(err, "Error exit %d!", num);

   break_flag = 1;

   #ifdef WIN_VFX
      SAL_alert_box("Error", err);
   #else   // __linux__  __MACH__  __FreeBSD__
      printf("*** ERROR: %s\n", err);
   #endif

   if(num) shut_down(num);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %edi, %ebx
testq %rsi, %rsi
je 0xb454
movq %rsi, %rcx
leaq 0xfec97(%rip), %rsi     # 0x10a0d9
leaq -0x410(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
jmp 0xb46b
leaq 0xfec90(%rip), %rsi     # 0x10a0eb
leaq -0x410(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movl $0x1, 0x32bbaf(%rip)    # 0x337024
leaq 0xfec7e(%rip), %rdi     # 0x10a0fa
leaq -0x410(%rbp), %rsi
xorl %eax, %eax
callq 0x9030
testl %ebx, %ebx
jne 0xb498
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %rbp
retq
movl %ebx, %edi
callq 0xdd23
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: init_hardware()
void init_hardware(void)
{
   init_com(RCVR_PORT, 2);
   init_screen(9103);

   if(NO_SCPI_BREAK && (rcvr_type == SCPI_RCVR)) ;
   else if(nortel == 0) {    // To wake up a Nortel NTGS55A, etc receiver
      SendBreak(RCVR_PORT);
   }

   need_screen_init = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0xa, %edi
callq 0xb49f
movl $0x238f, %edi           # imm = 0x238F
callq 0xbe9d
cmpb $0x0, 0x2330b4(%rip)    # 0x23ef39
jne 0xbe91
movl $0xa, %edi
callq 0xaf8f
movl $0x0, 0x20c94d(%rip)    # 0x2187e8
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: kill_screen()
void kill_screen(void)
{
   // shutdown the X11 server and screen

   if(display == 0) return;
   XFlush(display);

   if(pix_map) XFreePixmap(display, pix_map);
   pix_map = 0;

   if(icon_map) XFreePixmap(display, icon_map);
   icon_map = 0;

   XDestroyWindow(display, screen);
   screen = 0;
   XFlush(display);

   XFreeGC(display, gc);
   gc = 0;
   XFlush(display);

   if(size_hints) XFree(size_hints);
   size_hints = 0;
   if(wm_hints) XFree(wm_hints);
   wm_hints = 0;
   if(class_hints) XFree(class_hints);
   class_hints = 0;

   XFlush(display);
   XCloseDisplay(display);
   display = 0;

   x11_io_done = 0;
   last_x11_color = 0x80;
   Sleep(X11_sleep);
}

// Assembly:
movq 0x164657(%rip), %rdi    # 0x170ec0
testq %rdi, %rdi
je 0xc99c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x95c0
movq 0x16464c(%rip), %rsi    # 0x170ed0
testq %rsi, %rsi
je 0xc895
movq 0x164630(%rip), %rdi    # 0x170ec0
callq 0x96e0
movq $0x0, 0x164630(%rip) # 0x170ed0
movq 0x164631(%rip), %rsi    # 0x170ed8
testq %rsi, %rsi
je 0xc8b8
movq 0x16460d(%rip), %rdi    # 0x170ec0
callq 0x96e0
xorl %ebx, %ebx
movq %rbx, 0x164617(%rip)    # 0x170ed8
movq 0x1645f8(%rip), %rdi    # 0x170ec0
movq 0x1645f9(%rip), %rsi    # 0x170ec8
callq 0x9620
movq %rbx, 0x1645ed(%rip)    # 0x170ec8
movq 0x1645de(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x1645d2(%rip), %rdi    # 0x170ec0
movq 0x1645eb(%rip), %rsi    # 0x170ee0
callq 0x91f0
movq %rbx, 0x1645df(%rip)    # 0x170ee0
movq 0x1645b8(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x333644(%rip), %rdi    # 0x33ff58
testq %rdi, %rdi
je 0xc91e
callq 0x94b0
movq $0x0, 0x33362f(%rip) # 0x33ff58
movq 0x333630(%rip), %rdi    # 0x33ff60
testq %rdi, %rdi
je 0xc93a
callq 0x94b0
movq $0x0, 0x33361b(%rip) # 0x33ff60
movq 0x33361c(%rip), %rdi    # 0x33ff68
testq %rdi, %rdi
je 0xc956
callq 0x94b0
xorl %ebx, %ebx
movq %rbx, 0x333609(%rip)    # 0x33ff68
movq 0x16455a(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x16454e(%rip), %rdi    # 0x170ec0
callq 0x9720
movq %rbx, 0x164542(%rip)    # 0x170ec0
movb $0x0, 0x164523(%rip)    # 0x170ea8
movb $-0x80, 0x152748(%rip)  # 0x15f0d4
movl $0x186a0, %edi          # imm = 0x186A0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9540
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: RGB_NATIVE(int, int, int)
u32 RGB_NATIVE(int r, int g, int b)
{
u32 color;

   // convert 8-bit R,G,B values to X11 pixel color
   // !!!!!! we need to use the proper X11 way to do this... whatever that is

   if     (wattr.depth == 15) color = (((u32) (r>>3))<<10)  | (((u32) (g>>3))<<5) | ((u32) (b>>3));
   else if(wattr.depth == 16) color = (((u32) (r>>3))<<11)  | (((u32) (g>>2))<<5) | ((u32) (b>>3));
   else if(wattr.depth == 18) color = (((u32) (r>>2))<<12)  | (((u32) (g>>2))<<6) | ((u32) (b>>2));
   else if(wattr.depth == 24) color = (((u32) r)<<16)       | (((u32) g)<<8)      | ((u32) b);
   else if(wattr.depth == 30) color = (((u32) r)<<20)       | (((u32) g)<<10)     | ((u32) (b<<2));
   else                       color = (((u32) r)<<16)       | (((u32) g)<<8)      | ((u32) b) | 0xFF000000;
   return color;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
movl 0x33308e(%rip), %esi    # 0x33ff84
leal -0xf(%rsi), %ecx
cmpl $0x9, %ecx
ja 0xcf19
leaq 0xfc2bb(%rip), %rsi     # 0x1091c0
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
andl $-0x8, %edi
shll $0x7, %edi
shll $0x2, %eax
jmp 0xcf62
cmpl $0x1e, %esi
jne 0xcf2b
shll $0x14, %edi
shll $0xa, %eax
orl %edi, %eax
shll $0x2, %edx
jmp 0xcf6a
shll $0x10, %edi
shll $0x8, %eax
orl %edi, %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
jmp 0xcf6c
andl $-0x4, %edi
shll $0xa, %edi
shll $0x4, %eax
andl $-0x40, %eax
orl %edi, %eax
sarl $0x2, %edx
jmp 0xcf6a
shll $0x10, %edi
shll $0x8, %eax
orl %edi, %eax
jmp 0xcf6a
andl $-0x8, %edi
shll $0x8, %edi
shll $0x3, %eax
andl $-0x20, %eax
orl %edi, %eax
sarl $0x3, %edx
orl %edx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: setup_palette()
void setup_palette()
{
int i;
int j;

   // initialize working palettes from the standard palette table

   j = 0;
   for(i=0; i<16; i++) {  // setup native device and .BMP file palettes
      palette[i] = RGB_NATIVE(cmap[i].r, cmap[i].g, cmap[i].b);

      bmp_pal[j++] = cmap[i].b;   // bitmap palette is BGRx format
      bmp_pal[j++] = cmap[i].g;
      bmp_pal[j++] = cmap[i].r;
      bmp_pal[j++] = 0;
   }

   bmp_pal[j++] = 0;    // bmp_yellow - special color used to print yellow on white background
   bmp_pal[j++] = 168;
   bmp_pal[j++] = 92;
   bmp_pal[j++] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1530a9(%rip), %r12    # 0x160498
xorl %r13d, %r13d
movl -0x8(%r12), %ebx
movl -0x4(%r12), %r14d
movl (%r12), %r15d
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0xceea
leaq 0x163b6c(%rip), %rcx    # 0x170f80
movl %eax, (%r13,%rcx)
leaq 0x332c40(%rip), %rax    # 0x340060
movb %r15b, (%r13,%rax)
movb %r14b, 0x1(%r13,%rax)
movb %bl, 0x2(%r13,%rax)
movb $0x0, 0x3(%r13,%rax)
addq $0x4, %r13
addq $0xc, %r12
cmpq $0x40, %r13
jne 0xd3f2
movl $0x5ca800, 0x332c53(%rip) # imm = 0x5CA800
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: set_x11_color(unsigned char)
void set_x11_color(u08 color)
{
   // set the graphics context color

   if(color != last_x11_color) {  // color has changed, update context
      last_x11_color = color;
      if(color == 0xFF) XSetForeground(display, gc, RGB_NATIVE(0,0,35)); // special plot area background color highlight
      else              XSetForeground(display, gc, palette[color]);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
cmpb %al, 0x151c5f(%rip)     # 0x15f0d4
jne 0xd479
popq %rbp
retq
movb %al, 0x151c55(%rip)     # 0x15f0d4
movq 0x163a3a(%rip), %rdi    # 0x170ec0
movq 0x163a53(%rip), %rsi    # 0x170ee0
cmpb $-0x1, %al
je 0xd4a4
movzbl %al, %eax
leaq 0x163ae5(%rip), %rcx    # 0x170f80
movl (%rcx,%rax,4), %edx
popq %rbp
jmp 0x90d0
movl 0x332ada(%rip), %eax    # 0x33ff84
cmpl $0x17, %eax
jg 0xd4c8
movl $0x4, %edx
leal -0xf(%rax), %ecx
cmpl $0x2, %ecx
jb 0xd49e
cmpl $0x12, %eax
jne 0xd4e0
movl $0x8, %edx
jmp 0xd49e
cmpl $0x18, %eax
je 0xd4d9
cmpl $0x1e, %eax
jne 0xd4e0
movl $0x8c, %edx
jmp 0xd49e
movl $0x23, %edx
jmp 0xd49e
movl $0xff000023, %edx       # imm = 0xFF000023
jmp 0xd49e
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: add_kbd(int)
void add_kbd(int key)
{
   // add a keystroke to the keyboard queue

   last_kbd_jd = jd_utc;
   if(++kbd_in >= KBD_Q_SIZE) kbd_in = 0;
   if(kbd_in == kbd_out) {  // kbd queue is full
      if(--kbd_in < 0) kbd_in = KBD_Q_SIZE-1;
   }
   else {  // put keystoke in the queue
      kbd_queue[kbd_in] = key;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x30003d(%rip), %xmm0   # 0x30d530
movl 0x332b4b(%rip), %ecx    # 0x340044
leal 0x1(%rcx), %edx
xorl %eax, %eax
cmpl $0xf, %ecx
cmovll %edx, %eax
movsd %xmm0, 0x300084(%rip)   # 0x30d590
movl %eax, 0x332b32(%rip)    # 0x340044
cmpl 0x332b30(%rip), %eax    # 0x340048
jne 0xd52f
leal -0x1(%rax), %ecx
testl %eax, %eax
movl $0xf, %eax
cmovgl %ecx, %eax
movl %eax, 0x332b17(%rip)    # 0x340044
jmp 0xd53b
cltq
leaq 0x332ac8(%rip), %rcx    # 0x340000
movl %edi, (%rcx,%rax,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: set_title_bar(int)
void set_title_bar(int why)
{
unsigned i;

   // set program title bar to the string szAppName
   // use executable file name and unit_file_name if no szAppName string.

   if((szAppName[0] == 0) && unit_file_name) {
      strcpy(szAppName, unit_file_name);  // the device name
      szAppName[32] = 0;
      strupr(szAppName);

      if(1) {   // include the executable file name
         strcat(szAppName, " - ");
         strcpy(out, exe_name);
         out[255-32-3] = 0;
         strcat(szAppName, out);
      }
   }

   for(i=0; i<strlen(szAppName); i++) {
      if(szAppName[i] == '_') szAppName[i] = ' ';
   }

   #ifdef WINDOWS
      SetWindowText(hWnd, &szAppName[0]);
   #endif

   #ifdef USE_X11
      init_screen(3498);
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x14fd5b(%rip)    # 0x15dc10
sete %al
movq 0x162dc9(%rip), %rsi    # 0x170c88
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xdf40
leaq 0x14fd3d(%rip), %rbx    # 0x15dc10
movq %rbx, %rdi
callq 0x9340
movb $0x0, 0x14fd4e(%rip)    # 0x15dc30
movb 0x14fd28(%rip), %al     # 0x15dc10
testb %al, %al
je 0xdf09
leaq 0x14fd1e(%rip), %r14    # 0x15dc11
movsbl %al, %edi
callq 0x9700
movb %al, -0x1(%r14)
movb (%r14), %al
incq %r14
testb %al, %al
jne 0xdef3
movq %rbx, %rdi
callq 0x9120
movl $0x202d20, (%rax,%rbx)  # imm = 0x202D20
leaq 0x32e301(%rip), %r14    # 0x33c220
leaq 0x331eba(%rip), %rsi    # 0x33fde0
movq %r14, %rdi
callq 0x9340
movb $0x0, 0x32e3c7(%rip)    # 0x33c2fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96c0
cmpb $0x0, 0x14fcc9(%rip)    # 0x15dc10
je 0xdf78
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x14fcb7(%rip), %rbx    # 0x15dc10
cmpb $0x5f, (%r15,%rbx)
jne 0xdf65
movb $0x20, (%r15,%rbx)
movl %r14d, %r15d
movq %rbx, %rdi
callq 0x9120
incl %r14d
cmpq %r15, %rax
ja 0xdf59
movl $0xdaa, %edi            # imm = 0xDAA
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbe9d
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: character_width(unsigned char)
int character_width(u08 c)
{
int h,w;
int p;

   // get the width of a (mono-spaced) VFX font character

   if(dot_font == 0) dot_font = &h_font_12[0];
   if(c > 127) c = ' ';  // char out of range

   h = dot_font[8];      // char height

   p = (4*4) + (c*4);    // index of offset to char definition
   p = (dot_font[p+1] * 256) + dot_font[p+0];  // pointer to char definition
   w = dot_font[p];      // char width
   return w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x331f50(%rip)    # 0x33fee8
jne 0xdfa8
leaq 0x14483f(%rip), %rax    # 0x1527e0
movq %rax, 0x331f40(%rip)    # 0x33fee8
testb %dil, %dil
movzbl %dil, %eax
movl $0x20, %ecx
cmovnsl %eax, %ecx
movq 0x331f2a(%rip), %rax    # 0x33fee8
movzbl %cl, %ecx
movzwl 0x10(%rax,%rcx,4), %ecx
movzbl (%rax,%rcx), %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: line(int, int, int, int, unsigned char)
void line(COORD x1,COORD y1, COORD x2,COORD y2, u08 color)
{
   // draw a single pixel width line on the screen

   SWAPXY(x1,y1);
   SWAPXY(x2,y2);

#ifdef WIN_VFX
   if(stage == 0) return;

   VFX_io_done = 1;
   VFX_line_draw(stage, x1,y1, x2,y2, LD_DRAW, palette[color]);
#endif


#ifdef USE_X11
   if(display == 0) return;

   set_x11_color(color);
   XDrawLine(display,win,gc, x1,y1, x2,y2);
   flush_x11();
#endif

#ifdef USE_SDL
   lineColor(display, x1,y1,x2,y2,get_sdl_color(color));
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r15d
movl %esi, %ebx
movl %edi, %r14d
movl 0x20a448(%rip), %eax    # 0x218828
testl %eax, %eax
je 0xe3fa
movl %ebx, 0x20a442(%rip)    # 0x21882c
notl %ebx
movl %ebx, %edx
addl 0x20a410(%rip), %edx    # 0x218804
movl %r14d, %ebx
movl %edx, %r14d
testl %eax, %eax
je 0xe411
movl %ecx, 0x20a428(%rip)    # 0x21882c
notl %ecx
addl 0x20a3f8(%rip), %ecx    # 0x218804
movl %ecx, %r12d
jmp 0xe417
movl %r15d, %r12d
movl %ecx, %r15d
cmpq $0x0, 0x162aa1(%rip)    # 0x170ec0
je 0xe458
movzbl %r8b, %edi
callq 0xd469
movq 0x162a8f(%rip), %rdi    # 0x170ec0
movq 0x162a98(%rip), %rsi    # 0x170ed0
movq 0x162aa1(%rip), %rdx    # 0x170ee0
movl %r15d, (%rsp)
movl %r14d, %ecx
movl %ebx, %r8d
movl %r12d, %r9d
callq 0x9630
movb $0x1, 0x162a50(%rip)    # 0x170ea8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: dot(int, int, unsigned char)
void dot(int x, int y, u08 color)
{
   // draw a pixel on the screen

   SWAPXY(x,y);

#ifdef WIN_VFX
   if(stage == 0) return;

   VFX_io_done = 1;
   VFX_pixel_write(stage, x,y, palette[color]);
#endif

#ifdef USE_X11
   if(display == 0) return;

   set_x11_color(color);
   XDrawPoint(display,win, gc, x,y);
   flush_x11();
#endif

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
cmpl $0x0, 0x20a175(%rip)    # 0x218828
je 0xe6cb
movl %ebx, 0x20a171(%rip)    # 0x21882c
notl %ebx
movl %ebx, %eax
addl 0x20a13f(%rip), %eax    # 0x218804
movl %r14d, %ebx
movl %eax, %r14d
cmpq $0x0, 0x1627ed(%rip)    # 0x170ec0
je 0xe704
movzbl %dl, %edi
callq 0xd469
movq 0x1627dc(%rip), %rdi    # 0x170ec0
movq 0x1627e5(%rip), %rsi    # 0x170ed0
movq 0x1627ee(%rip), %rdx    # 0x170ee0
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x92a0
movb $0x1, 0x1627a4(%rip)    # 0x170ea8
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: deg_char(int, int, unsigned char)
int deg_char(COORD row, COORD col, u08 color)
{
   // erase the old character cell (and probably a little extra)
   erase_rectangle(col,row, TEXT_WIDTH,TEXT_HEIGHT);

   // draw the degrees symbol (which is not in the normal font)
   dot(col+2, row+0, color);
   dot(col+3, row+0, color);
   dot(col+1, row+1, color);
   dot(col+4, row+1, color);
   dot(col+1, row+2, color);
   dot(col+4, row+2, color);
   dot(col+2, row+3, color);
   dot(col+3, row+3, color);

   return DEG_WIDTH;  // width
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movl %edi, %r14d
movl 0x20a0eb(%rip), %edx    # 0x218810
movl 0x20a0e9(%rip), %ecx    # 0x218814
movl %esi, %edi
movl %r14d, %esi
xorl %r8d, %r8d
callq 0xf30c
leal 0x2(%r15), %edi
movl %edi, -0x30(%rbp)
movl %r14d, %esi
movl %ebx, %edx
callq 0xe6a0
leal 0x3(%r15), %edi
movl %edi, -0x2c(%rbp)
movl %r14d, %esi
movl %ebx, %edx
callq 0xe6a0
leal 0x1(%r15), %r12d
leal 0x1(%r14), %r13d
movl %r12d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe6a0
addl $0x4, %r15d
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe6a0
leal 0x2(%r14), %r13d
movl %r12d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe6a0
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe6a0
addl $0x3, %r14d
movl -0x30(%rbp), %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xe6a0
movl -0x2c(%rbp), %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xe6a0
movl $0x6, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: erase_vchar(int, int)
int vchar_stroke()
{
   // return vchar line width in pixels

   if(VCHAR_SCALE <= 1) return 1;
   else if(VCHAR_SCALE <= 3) return 2;
   else if(vc_font_scale > 100) return 2;
   else return (VCHAR_SCALE / 2);
}

// Assembly:
movl 0x214a97(%rip), %eax    # 0x22353c
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmpl $0x2, %eax
jl 0xeaca
movl %eax, %ecx
shrl %ecx
cmpl $0x65, 0x214a8a(%rip)   # 0x223544
notl %ecx
movl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
cmovgel %edx, %ecx
cmpl $0x4, %eax
cmovll %edx, %ecx
movl $0x1, %r8d
movl $0x1, %edx
cmpl $0x2, %eax
jl 0xeaf6
movl %eax, %edx
shrl %edx
cmpl $0x65, 0x214a5f(%rip)   # 0x223544
movl $0x2, %r9d
cmovgel %r9d, %edx
cmpl $0x4, %eax
cmovll %r9d, %edx
movl 0x209d13(%rip), %r10d   # 0x218810
movl 0x209d10(%rip), %r9d    # 0x218814
cmpl $0x2, %eax
jl 0xeb27
movl %eax, %r8d
shrl %r8d
cmpl $0x65, 0x214a2e(%rip)   # 0x223544
movl $0x2, %r11d
cmovgel %r11d, %r8d
cmpl $0x4, %eax
cmovll %r11d, %r8d
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movl %eax, %r11d
shll $0x4, %r11d
leal (,%rax,8), %ebx
cmpl $0x2, %eax
cmovgel %r11d, %r9d
cmovgel %ebx, %r10d
addl %r10d, %edx
addl %r8d, %ecx
addl %r9d, %ecx
xorl %r8d, %r8d
popq %rbx
popq %rbp
jmp 0xf30c
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: xthick_line(int, int, int, int, unsigned char, unsigned char)
void xthick_line(COORD x1,COORD y1,  COORD x2,COORD y2, u08 color, u08 thickness)
{
COORD x,y;

   // draw a thick line on the screen (using single pixel wide lines)

   if(thickness <= 1) {
      return line(x1,y1, x2,y2, color);
   }

   for(x=0; x<thickness; x++) {
      for(y=0; y<thickness; y++) {
         line(x1+x,y1+y, x2+x,y2+y, color);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebx
movl %ecx, %r15d
movl %esi, %r13d
cmpb $0x2, %bl
jae 0xeb94
movzbl %r8b, %r8d
movl %r13d, %esi
movl %r15d, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe3c3
xorl %eax, %eax
movzbl %r8b, %r14d
movl %r15d, -0x34(%rbp)
movq %rdx, -0x48(%rbp)
movl %ebx, -0x30(%rbp)
movl %r13d, -0x2c(%rbp)
movq %rdi, -0x40(%rbp)
addl %eax, %edi
movl %edi, -0x38(%rbp)
movq %rax, -0x50(%rbp)
leal (%rax,%rdx), %r12d
movl -0x38(%rbp), %edi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0xe3c3
incl %r15d
incl %r13d
decl %ebx
jne 0xebba
movq -0x50(%rbp), %rax
incl %eax
movl -0x30(%rbp), %ebx
cmpl %ebx, %eax
movl -0x34(%rbp), %r15d
movq -0x48(%rbp), %rdx
movl -0x2c(%rbp), %r13d
movq -0x40(%rbp), %rdi
jne 0xebad
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: vchar_string(int, int, unsigned char, char*)
void vchar_string(int row, int col, u08 color, char *s)
{
u08 c;
int i;

   // draw a text string using vector graphics characters

   if(1 && graphics_coords) {
   }
   else {
      row *= TEXT_HEIGHT;  //!!!!!!
      col *= TEXT_WIDTH;
      row += TEXT_Y_MARGIN;
      col += TEXT_X_MARGIN;
row += 2;
   }
   vc_col = col;
   vc_row = row;

   i = 0;
   while((c = *s++)) {  // to save time,  we only draw the chars that changed
      vchar(col, row, 1, color, c);
      if(i<(VSTRING_LEN-1)) ++i;
      col += VCharWidth;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %esi, %r14d
movl %edi, %r15d
cmpb $0x0, 0x209c49(%rip)    # 0x218868
jne 0xec3c
incl %r15d
imull 0x209be8(%rip), %r15d   # 0x218814
addl $0x2, %r14d
imull 0x209bd8(%rip), %r14d   # 0x218810
addl $0x2, %r15d
movl %r14d, 0x32c745(%rip)   # 0x33b388
movl %r15d, 0x32c73a(%rip)   # 0x33b384
movb (%rbx), %al
testb %al, %al
je 0xec90
incq %rbx
movzbl %dl, %r12d
movzbl %al, %r8d
movl %r14d, %edi
movl %r15d, %esi
movl $0x1, %edx
movl %r12d, %ecx
callq 0xe211
movl 0x2148c8(%rip), %eax    # 0x22353c
cmpl $0x2, %eax
jge 0xec81
movl 0x209b91(%rip), %eax    # 0x218810
jmp 0xec84
shll $0x3, %eax
addl %eax, %r14d
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0xec57
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq