LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/crossc-hlsl.cc
// Function: crossc_hlsl_create
crossc_compiler *crossc_hlsl_create(const uint32_t *words, size_t word_count)
{
	crossc_compiler *comp = new crossc_compiler;
	try {
		comp->c = std::make_unique<spirv_cross::CompilerHLSL>(words, word_count);
	} catch (const std::exception &e) {
		comp->error = std::string { e.what() };
	}
	return comp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r12
movl $0x48, %edi
callq 0x6250
movq %rax, %rbx
xorl %eax, %eax
movq %rax, (%rbx)
leaq 0x18(%rbx), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movb %al, 0x18(%rbx)
leaq 0x38(%rbx), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movb %al, 0x38(%rbx)
movl $0x7e8, %edi            # imm = 0x7E8
callq 0x6250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xa262e
leaq 0x4928d(%rip), %rax     # 0xfc730
addq $0x10, %rax
movq %rax, (%r14)
movl $0x1e, 0x788(%r14)
xorl %eax, %eax
movw %ax, 0x78c(%r14)
movq %rax, 0x7a0(%r14)
movw %ax, 0x7a8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x7d0(%r14)
movq %rax, 0x7e0(%r14)
movq %rax, 0x790(%r14)
movq %rax, 0x795(%r14)
movups %xmm0, 0x7b0(%r14)
movups %xmm0, 0x7bc(%r14)
movq (%rbx), %rdi
movq %r14, (%rbx)
testq %rdi, %rdi
je 0xb350f
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r12
movq %rax, %r15
movl $0x7e8, %esi            # imm = 0x7E8
movq %r14, %rdi
callq 0x6260
jmp 0xb3539
movq %rdx, %r12
movq %rax, %r15
cmpl $0x1, %r12d
jne 0xb35a2
movq %r15, %rdi
callq 0x6110
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0x6100
movq %rbx, %rdi
addq $0x28, %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb3590
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
callq 0x6440
jmp 0xb350f
movq %rax, %r15
callq 0x6440
movq %r15, %rdi
callq 0x64a0
movq %rax, %rdi
callq 0xd549
// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/crossc.cc
// Function: crossc_compile
const char *crossc_compile(crossc_compiler *comp)
{
	if (!comp->c)
		return nullptr;
	try {
		comp->output = comp->c->compile();
		return comp->output.c_str();
	} catch (const std::exception &e) {
		comp->error = std::string { e.what() };
		return nullptr;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %rsi
testq %rsi, %rsi
je 0xb3694
movq %rdi, %rbx
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x10(%rax)
addq $0x8, %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb3631
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq (%rbx), %rax
jmp 0xb3696
movq %rax, %r14
cmpl $0x1, %edx
jne 0xb36a6
movq %r14, %rdi
callq 0x6110
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %rax, %rsi
callq 0x6100
addq $0x28, %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb368f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
callq 0x6440
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
callq 0x6440
movq %r14, %rdi
callq 0x64a0
movq %rax, %rdi
callq 0xd549
// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/include/tinyopt/tinyopt.h
// Function: to::default_parser<int>::operator()(char const*) const
maybe<V> operator()(const char* text) const {
        if (!text) return nothing;
        V v;
        std::istringstream stream(text);
        if (!(stream >> v)) return nothing;
        if (!stream.eof()) stream >> std::ws;
        return stream.eof()? maybe<V>(v): nothing;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
testq %rdx, %rdx
je 0x3edf
movq %rdx, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rdx, %rdi
callq 0x20a0
leaq (%rax,%r14), %rdx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3c66
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x2230
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x3e72
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x20f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ebb
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x50(%rsp,%rax), %eax
testb $0x2, %al
jne 0x3eb7
leaq 0x30(%rsp), %rdi
callq 0x2140
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x50(%rsp,%rax), %eax
testb $0x2, %al
jne 0x3ef2
xorl %eax, %eax
movb %al, (%rbx)
movq 0x7102(%rip), %rsi      # 0xafc8
leaq 0x30(%rsp), %rdi
callq 0x21d0
leaq 0xa8(%rsp), %rdi
callq 0x2060
jmp 0x3ee2
movb $0x0, (%rbx)
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rbx)
movb $0x1, %al
jmp 0x3ebd
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x3f3f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x3f3f
movq %rax, %rbx
jmp 0x3f3f
movq %rax, %rbx
movq 0x70a0(%rip), %rsi      # 0xafc8
leaq 0x30(%rsp), %rdi
callq 0x21d0
leaq 0xa8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdx, %rdx
je 0x44d5
movq (%rsi), %r15
movq 0x8(%rsi), %r12
cmpq %r12, %r15
je 0x44d5
movq %rdx, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2040
testl %eax, %eax
je 0x44e8
addq $0x28, %r15
cmpq %r12, %r15
jne 0x44bd
xorl %eax, %eax
movb %al, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0x20(%r15), %eax
movl %eax, 0x4(%rbx)
movb $0x1, %al
jmp 0x44d7
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
cmpb $0x30, (%rdi)
jne 0x98eb
movb 0x1(%rdi), %al
cmpb $0x78, %al
jne 0x98e0
addq $0x2, %rdi
jmp 0x98eb
xorl %eax, %eax
retq
xorl %ecx, %ecx
cmpb $0x58, %al
sete %cl
leaq (%rdi,%rcx,2), %rdi
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0xc(%rbp), %rbx
movl $0x0, (%rbx)
leaq 0x117a77(%rip), %rsi    # 0x121379
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_O3/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 0x9965
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 0x9951
movq %rbx, %rdi
movl $0x4d, %esi
callq 0x9100
testq %rax, %rax
je 0x9969
movsd -0x10(%rbp), %xmm0
mulsd 0xff6aa(%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 0x998d
movq %rbx, %rdi
movl $0x48, %esi
callq 0x9100
testq %rax, %rax
je 0x999c
movsd -0x10(%rbp), %xmm0
mulsd 0xff676(%rip), %xmm0    # 0x109010
jmp 0x995e
movq %rbx, %rdi
movl $0x64, %esi
callq 0x9100
testq %rax, %rax
jne 0x99c0
movq %rbx, %rdi
movl $0x44, %esi
callq 0x9100
testq %rax, %rax
je 0x99cf
movsd -0x10(%rbp), %xmm0
mulsd 0xff64b(%rip), %xmm0    # 0x109018
jmp 0x995e
movsd -0x10(%rbp), %xmm0
jmp 0x995e
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9a06
leaq 0x101bab(%rip), %rsi    # 0x10b59a
leaq 0x16729a(%rip), %rdx    # 0x170c90
leaq -0x110(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0x9a15
leaq -0x110(%rbp), %rdi
movq %rcx, %rsi
callq 0x9340
leaq 0x117371(%rip), %rsi    # 0x120d8d
leaq -0x110(%rbp), %rdi
callq 0x9a47
testq %rax, %rax
je 0x9a3c
movq %rax, %rdi
callq 0x9370
movl $0x1, %eax
jmp 0x9a3e
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x9a7b
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
je 0x9a72
cmpl $0x20, %eax
jne 0x9a77
incq %r14
jmp 0x9a64
testl %eax, %eax
jne 0x9a82
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpb $0x0, 0x20ee3b(%rip)    # 0x2188c4
je 0x9a9f
leaq 0xffe3e(%rip), %rdi     # 0x1098d0
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9030
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xa268
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x3044e3(%rip)    # 0x30e2c3
je 0x9df4
leaq 0xff870(%rip), %rdi     # 0x109659
movl $0x1, %esi
popq %rbp
jmp 0x9ccb
movzbl 0x3042c2(%rip), %eax    # 0x30e0bd
testl %eax, %eax
je 0x9e0d
cmpl $0x2, %eax
jne 0x9e18
leaq 0xff8e2(%rip), %rdi     # 0x1096ed
jmp 0x9de9
movl $0x1, %edi
popq %rbp
jmp 0x9d78
leaq 0xff8e0(%rip), %rdi     # 0x1096ff
xorl %esi, %esi
jmp 0x9dee
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x3040a8(%rip)    # 0x30dedd
je 0x9e92
callq 0xe2f80
cmpb $0x2, 0x30409a(%rip)    # 0x30dedd
sete %al
movl 0x303860(%rip), %edx    # 0x30d6ac
testl %edx, %edx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x9f15
movslq 0x303845(%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 0xff996(%rip), %rsi     # 0x10981c
leaq -0x110(%rbp), %rdi
jmp 0x9f23
cmpb $0x0, 0x304048(%rip)    # 0x30dee1
setne %al
movl 0x304042(%rip), %ecx    # 0x30dee4
testl %ecx, %ecx
setns %dl
andb %al, %dl
movl 0x304039(%rip), %eax    # 0x30dee8
cmpl $0xc, %eax
setb %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x9f4b
cmpb $0x0, 0x3043fd(%rip)    # 0x30e2c7
je 0x9eff
movl %ecx, %ecx
movl %eax, %edx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
leaq 0x155071(%rip), %rsi    # 0x15ef50
addq %rcx, %rsi
cmpl $0x0, (%rsi,%rdx,4)
je 0x9eff
leaq 0xff7b5(%rip), %rdi     # 0x1096a4
movl $0x1, %esi
callq 0x9ccb
movl 0x303fe9(%rip), %eax    # 0x30dee8
leal 0x1(%rax), %ecx
cmpl $0xb, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovll %ecx, %eax
movl %eax, 0x303fd5(%rip)    # 0x30dee8
jmp 0x9f42
leaq 0xff915(%rip), %rsi     # 0x109831
leaq -0x110(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
leaq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x9ccb
movb $0x0, 0x303f9d(%rip)    # 0x30dedf
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
cmpb $0x0, 0x30436e(%rip)    # 0x30e2c0
je 0x9f6d
leaq 0xff6ec(%rip), %rdi     # 0x109647
movl $0x1, %esi
addq $0x110, %rsp            # imm = 0x110
popq %rbp
jmp 0x9ccb
movzbl 0x30414a(%rip), %eax    # 0x30e0be
testl %eax, %eax
je 0x9f86
cmpl $0x2, %eax
jne 0x9f98
leaq 0xff796(%rip), %rdi     # 0x10971a
jmp 0x9f5b
movl $0x2, %edi
addq $0x110, %rsp            # imm = 0x110
popq %rbp
jmp 0x9d78
leaq 0xff78e(%rip), %rdi     # 0x10972d
xorl %esi, %esi
jmp 0x9f60
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x303f78(%rip)    # 0x30e0b4
je 0xa13f
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xff73f(%rip), %rdi     # 0x109889
callq 0x9460
testq %rax, %rax
je 0xa159
cmpb $0x0, (%rax)
jne 0xa176
leaq 0xff731(%rip), %rdi     # 0x109891
callq 0x9460
testq %rax, %rax
je 0xa16f
cmpb $0x0, (%rax)
jne 0xa176
movq 0x153ba2(%rip), %rax    # 0x15dd18
movq %rax, %rdi
xorl %esi, %esi
popq %rbp
jmp 0x9ff3
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x303f2c(%rip)    # 0x30e0b4
je 0xa18b
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xff6ff(%rip), %rdi     # 0x109898
callq 0x9460
testq %rax, %rax
je 0xa1ab
movq %rax, %rbx
cmpb $0x0, (%rax)
jne 0xa1b2
movq 0x153b6e(%rip), %rbx    # 0x15dd20
leaq 0x335127(%rip), %rdi    # 0x33f2e0
movq %rbx, %rsi
callq 0x9340
leaq 0x332058(%rip), %r14    # 0x33c220
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9340
movq %r14, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ff3
// File: /workspace/github_cpp_makefile_star2_O3/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:
movl $0x1, %eax
testq %rdi, %rdi
je 0xa267
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rdi, %rbx
movzbl (%rbx), %r14d
cmpl $0x9, %r14d
je 0xa20c
cmpl $0x20, %r14d
jne 0xa211
incq %rbx
jmp 0xa1fc
testl %r14d, %r14d
je 0xa25c
leaq -0x820(%rbp), %rdi
movq %rbx, %rsi
callq 0x9340
andb $-0x2, %r14b
cmpb $0x2e, %r14b
je 0xa250
leaq 0x166a5a(%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
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0xa2a8
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%r14), %r15d
cmpl $0x9, %r15d
je 0xa29e
cmpl $0x20, %r15d
jne 0xa2a3
incq %r14
jmp 0xa28e
testl %r15d, %r15d
jne 0xa2bc
xorl %r14d, %r14d
movq %r14, %rax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x820(%rbp), %rdi
movq %r14, %rsi
callq 0x9340
andb $-0x2, %r15b
cmpb $0x2e, %r15b
je 0xa2f6
leaq 0x1669b4(%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 0x23407b(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa337
leaq 0xff57c(%rip), %rsi     # 0x1098a5
leaq -0x820(%rbp), %rdx
xorl %eax, %eax
callq 0x9560
cmpb $0x0, 0x20e586(%rip)    # 0x2188c4
je 0xa2ab
leaq 0xff56c(%rip), %rdi     # 0x1098b7
leaq -0x820(%rbp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x9030
jmp 0xa2ab
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa389
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0xa380
cmpl $0x20, %eax
jne 0xa385
incq %rbx
jmp 0xa373
testl %eax, %eax
jne 0xa38e
xorl %r14d, %r14d
jmp 0xa3f6
movq 0x233ffb(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
je 0xa3aa
callq 0x9370
movq $0x0, 0x233fe6(%rip) # 0x23e390
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa3c6
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa3c8
xorl %eax, %eax
movl %eax, 0x23405a(%rip)    # 0x23e428
leaq 0x116fe6(%rip), %rsi    # 0x1213bb
movq %rbx, %rdi
callq 0x9a47
movq %rax, %r14
movq %rax, 0x233fa9(%rip)    # 0x23e390
leaq 0x233672(%rip), %rdi    # 0x23da60
movq %rbx, %rsi
callq 0x9340
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
testq %rdi, %rdi
je 0xa55f
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0xa556
cmpl $0x20, %eax
jne 0xa55b
incq %rbx
jmp 0xa549
testl %eax, %eax
jne 0xa567
xorl %r14d, %r14d
jmp 0xa615
movq 0x233dfa(%rip), %rdi    # 0x23e368
testq %rdi, %rdi
je 0xa583
callq 0x9370
movq $0x0, 0x233de5(%rip) # 0x23e368
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa59f
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa5a1
xorl %eax, %eax
movl %eax, 0x233e7d(%rip)    # 0x23e424
leaq 0x116e0d(%rip), %rsi    # 0x1213bb
movq %rbx, %rdi
callq 0x9a47
movq %rax, %r14
movq %rax, 0x233da8(%rip)    # 0x23e368
testq %rax, %rax
setne %al
movq 0x233dc3(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa5f2
leaq 0xff30f(%rip), %rsi     # 0x1098f0
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
movq 0x233d76(%rip), %r14    # 0x23e368
leaq 0x232967(%rip), %rdi    # 0x23cf60
movq %rbx, %rsi
callq 0x9340
movl $0x0, 0x233de1(%rip)    # 0x23e3ec
movl $0x1, 0x302f6b(%rip)    # 0x30d580
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa63c
xorl %r14d, %r14d
jmp 0xa6e5
movq %rsi, %r14
movq %rdi, %rbx
movq 0x233d27(%rip), %rdi    # 0x23e370
testq %rdi, %rdi
je 0xa65e
callq 0x9370
movq $0x0, 0x233d12(%rip) # 0x23e370
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa67a
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa67c
xorl %eax, %eax
movl %eax, 0x233d9a(%rip)    # 0x23e41c
movq $0x0, 0x23490b(%rip) # 0x23ef98
movl $0x0, 0x234909(%rip)    # 0x23efa0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a47
movq %rax, %r14
testq %rax, %rax
setne %al
movq 0x233cde(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa6d0
leaq 0xff242(%rip), %rsi     # 0x109908
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
movq $0x0, 0x2348bd(%rip) # 0x23ef98
movl $0x0, 0x2348bb(%rip)    # 0x23efa0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
jne 0xa7d7
movq %rsi, %r14
movq %rdi, %rbx
movq 0x233c63(%rip), %rdi    # 0x23e378
testq %rdi, %rdi
je 0xa734
callq 0x9370
movq $0x0, 0x233c4e(%rip) # 0x23e378
movl $0x0, 0x233ce4(%rip)    # 0x23e418
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0xa750
movb $0x0, (%rax)
movl $0x1, %eax
jmp 0xa752
xorl %eax, %eax
movl %eax, 0x233cd4(%rip)    # 0x23e42c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a47
testq %rax, %rax
je 0xa7d7
movq %rax, %r14
leaq 0xff1b4(%rip), %rdi     # 0x109926
movl $0x28, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x9750
leaq 0xff1c4(%rip), %rdi     # 0x10994f
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x9750
cmpl $0x0, 0x233c88(%rip)    # 0x23e42c
je 0xa7ae
movq %r14, %rdi
callq 0x9420
movl $0x1, 0x233c60(%rip)    # 0x23e418
movq 0x233bd1(%rip), %rdi    # 0x23e390
testq %rdi, %rdi
je 0xa7da
leaq 0xff189(%rip), %rsi     # 0x109954
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
jmp 0xa7da
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x23390f(%rip), %rcx    # 0x23e3c0
xorl %ebx, %ebx
testq %rcx, %rcx
je 0xab49
cmpl $0x0, 0x233915(%rip)    # 0x23e3d8
jne 0xab49
movl %edi, %r14d
leaq -0x11(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x9590
testl %eax, %eax
jle 0xab0d
cmpb $0x4f, 0x301cbe(%rip)   # 0x30c7a8
jne 0xab46
movb -0x11(%rbp), %bl
cmpl %r14d, 0x3037da(%rip)   # 0x30e2d0
jne 0xab49
movzbl %bl, %esi
movl 0x233943(%rip), %edx    # 0x23e444
movl %r14d, %edi
xorl %ecx, %ecx
callq 0xac18
jmp 0xab49
movl $0x4, %edi
callq 0x9d78
movl $0x1, 0x2338b7(%rip)    # 0x23e3d8
leaq 0x333d28(%rip), %rdi    # 0x33e850
leaq 0xfee3b(%rip), %rsi     # 0x10996a
leaq 0x232a2a(%rip), %rdx    # 0x23d560
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9060
callq 0xab54
jmp 0xab49
movb -0x11(%rbp), %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x166365(%rip), %rdi    # 0x170ec0
testq %rdi, %rdi
je 0xac17
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x16635f(%rip), %rsi    # 0x170ed0
testq %rsi, %rsi
je 0xabfe
cmpb $0x0, 0x166327(%rip)    # 0x170ea8
je 0xabfe
cmpl $0x0, 0x20dc9e(%rip)    # 0x218828
movl 0x20dc70(%rip), %ecx    # 0x218800
movl 0x20dc6e(%rip), %eax    # 0x218804
je 0xabaf
movl %eax, 0x20dc8e(%rip)    # 0x21882c
movl %ecx, 0x20dc60(%rip)    # 0x218804
movl %eax, 0x20dc56(%rip)    # 0x218800
movl %ecx, %r10d
jmp 0xabb4
movl %eax, %r10d
movl %ecx, %eax
movq 0x16630d(%rip), %rdx    # 0x170ec8
movq 0x16631e(%rip), %rcx    # 0x170ee0
xorl %ebx, %ebx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq %rbx
pushq %r10
pushq %rax
callq 0x9150
addq $0x20, %rsp
cmpl %ebx, 0x20dc4a(%rip)    # 0x218828
je 0xabfe
movl 0x20dc1e(%rip), %eax    # 0x218804
movl %eax, 0x20dc40(%rip)    # 0x21882c
movl 0x20dc0e(%rip), %ecx    # 0x218800
movl %ecx, 0x20dc0c(%rip)    # 0x218804
movl %eax, 0x20dc02(%rip)    # 0x218800
movq 0x1662bb(%rip), %rdi    # 0x170ec0
callq 0x95c0
movb $0x0, 0x166297(%rip)    # 0x170ea8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xafe7
movl %edi, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x30334b(%rip), %rcx    # 0x30e2e0
movl 0x8(%rax,%rcx), %edi
testl %edi, %edi
js 0xafe7
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 0xafd7
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_O3/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 0xb018
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x9540
leal -0xf4240(%rbx), %edi
cmpl $0x1e8480, %ebx         # imm = 0x1E8480
movl %edi, %ebx
jg 0xaffc
jmp 0xb01a
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9540
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb083
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x3032a0(%rip), %rbx    # 0x30e2e0
movl $0x1, 0x222c(%rax,%rbx)
movl 0x8(%rax,%rbx), %edi
testl %edi, %edi
js 0xb07d
addq %rax, %rbx
leaq 0x165ea3(%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_O3/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 0xb453
movq %rsi, %rcx
leaq 0xfeca8(%rip), %rsi     # 0x10a0e9
leaq -0x410(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
jmp 0xb46a
leaq 0xfeca1(%rip), %rsi     # 0x10a0fb
leaq -0x410(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movl $0x1, 0x32bbb0(%rip)    # 0x337024
leaq 0xfec8f(%rip), %rdi     # 0x10a10a
leaq -0x410(%rbp), %rsi
xorl %eax, %eax
callq 0x9030
testl %ebx, %ebx
jne 0xb497
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %rbp
retq
movl %ebx, %edi
callq 0xdcff
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb49e
movl $0x238f, %edi           # imm = 0x238F
callq 0xbe88
cmpb $0x0, 0x2330c9(%rip)    # 0x23ef39
jne 0xbe7c
movl $0xa, %edi
callq 0xaf80
movl $0x0, 0x20c962(%rip)    # 0x2187e8
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x164659(%rip), %rdi    # 0x170ec0
testq %rdi, %rdi
je 0xc99a
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x95c0
movq 0x16464e(%rip), %rsi    # 0x170ed0
testq %rsi, %rsi
je 0xc893
movq 0x164632(%rip), %rdi    # 0x170ec0
callq 0x96e0
movq $0x0, 0x164632(%rip) # 0x170ed0
movq 0x164633(%rip), %rsi    # 0x170ed8
testq %rsi, %rsi
je 0xc8b6
movq 0x16460f(%rip), %rdi    # 0x170ec0
callq 0x96e0
xorl %ebx, %ebx
movq %rbx, 0x164619(%rip)    # 0x170ed8
movq 0x1645fa(%rip), %rdi    # 0x170ec0
movq 0x1645fb(%rip), %rsi    # 0x170ec8
callq 0x9620
movq %rbx, 0x1645ef(%rip)    # 0x170ec8
movq 0x1645e0(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x1645d4(%rip), %rdi    # 0x170ec0
movq 0x1645ed(%rip), %rsi    # 0x170ee0
callq 0x91f0
movq %rbx, 0x1645e1(%rip)    # 0x170ee0
movq 0x1645ba(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x333646(%rip), %rdi    # 0x33ff58
testq %rdi, %rdi
je 0xc91c
callq 0x94b0
movq $0x0, 0x333631(%rip) # 0x33ff58
movq 0x333632(%rip), %rdi    # 0x33ff60
testq %rdi, %rdi
je 0xc938
callq 0x94b0
movq $0x0, 0x33361d(%rip) # 0x33ff60
movq 0x33361e(%rip), %rdi    # 0x33ff68
testq %rdi, %rdi
je 0xc954
callq 0x94b0
xorl %ebx, %ebx
movq %rbx, 0x33360b(%rip)    # 0x33ff68
movq 0x16455c(%rip), %rdi    # 0x170ec0
callq 0x95c0
movq 0x164550(%rip), %rdi    # 0x170ec0
callq 0x9720
movq %rbx, 0x164544(%rip)    # 0x170ec0
movb $0x0, 0x164525(%rip)    # 0x170ea8
movb $-0x80, 0x15274a(%rip)  # 0x15f0d4
movl $0x186a0, %edi          # imm = 0x186A0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9540
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x333086(%rip), %esi    # 0x33ff84
leal -0xf(%rsi), %ecx
cmpl $0x9, %ecx
ja 0xcf21
leaq 0xfc2c3(%rip), %rsi     # 0x1091d0
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
andl $-0x8, %edi
shll $0x7, %edi
shll $0x2, %eax
jmp 0xcf6a
cmpl $0x1e, %esi
jne 0xcf33
shll $0x14, %edi
shll $0xa, %eax
orl %edi, %eax
shll $0x2, %edx
jmp 0xcf72
shll $0x10, %edi
shll $0x8, %eax
orl %edi, %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
jmp 0xcf74
andl $-0x4, %edi
shll $0xa, %edi
shll $0x4, %eax
andl $-0x40, %eax
orl %edi, %eax
sarl $0x2, %edx
jmp 0xcf72
shll $0x10, %edi
shll $0x8, %eax
orl %edi, %eax
jmp 0xcf72
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_O3/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 0x1530c8(%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 0xcef2
leaq 0x163b8b(%rip), %rcx    # 0x170f80
movl %eax, (%r13,%rcx)
leaq 0x332c5f(%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 0xd3d3
movl $0x5ca800, 0x332c72(%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_O3/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, 0x151c7e(%rip)     # 0x15f0d4
jne 0xd45a
popq %rbp
retq
movb %al, 0x151c74(%rip)     # 0x15f0d4
movq 0x163a59(%rip), %rdi    # 0x170ec0
movq 0x163a72(%rip), %rsi    # 0x170ee0
cmpb $-0x1, %al
je 0xd485
movzbl %al, %eax
leaq 0x163b04(%rip), %rcx    # 0x170f80
movl (%rcx,%rax,4), %edx
popq %rbp
jmp 0x90d0
movl 0x332af9(%rip), %eax    # 0x33ff84
cmpl $0x17, %eax
jg 0xd4a9
movl $0x4, %edx
leal -0xf(%rax), %ecx
cmpl $0x2, %ecx
jb 0xd47f
cmpl $0x12, %eax
jne 0xd4c1
movl $0x8, %edx
jmp 0xd47f
cmpl $0x18, %eax
je 0xd4ba
cmpl $0x1e, %eax
jne 0xd4c1
movl $0x8c, %edx
jmp 0xd47f
movl $0x23, %edx
jmp 0xd47f
movl $0xff000023, %edx       # imm = 0xFF000023
jmp 0xd47f
// File: /workspace/github_cpp_makefile_star2_O3/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 0x30005c(%rip), %xmm0   # 0x30d530
movl 0x332b6a(%rip), %ecx    # 0x340044
leal 0x1(%rcx), %edx
xorl %eax, %eax
cmpl $0xf, %ecx
cmovll %edx, %eax
movsd %xmm0, 0x3000a3(%rip)   # 0x30d590
movl %eax, 0x332b51(%rip)    # 0x340044
cmpl 0x332b4f(%rip), %eax    # 0x340048
jne 0xd510
leal -0x1(%rax), %ecx
testl %eax, %eax
movl $0xf, %eax
cmovgl %ecx, %eax
movl %eax, 0x332b36(%rip)    # 0x340044
jmp 0xd51c
cltq
leaq 0x332ae7(%rip), %rcx    # 0x340000
movl %edi, (%rcx,%rax,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movb 0x14fd80(%rip), %al     # 0x15dc10
testb %al, %al
sete %cl
movq 0x162dec(%rip), %rsi    # 0x170c88
testq %rsi, %rsi
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xdf23
leaq 0x14fd60(%rip), %rbx    # 0x15dc10
movq %rbx, %rdi
callq 0x9340
movb $0x0, 0x14fd71(%rip)    # 0x15dc30
movb 0x14fd4b(%rip), %al     # 0x15dc10
testb %al, %al
je 0xdee6
leaq 0x14fd41(%rip), %r14    # 0x15dc11
movsbl %al, %edi
callq 0x9700
movb %al, -0x1(%r14)
movb (%r14), %al
incq %r14
testb %al, %al
jne 0xded0
movq %rbx, %rdi
callq 0x9120
movl $0x202d20, (%rax,%rbx)  # imm = 0x202D20
leaq 0x32e324(%rip), %r14    # 0x33c220
leaq 0x331edd(%rip), %rsi    # 0x33fde0
movq %r14, %rdi
callq 0x9340
movb $0x0, 0x32e3ea(%rip)    # 0x33c2fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96c0
movb 0x14fced(%rip), %al     # 0x15dc10
testb %al, %al
je 0xdf56
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x14fcd9(%rip), %rbx    # 0x15dc10
cmpb $0x5f, (%r15,%rbx)
jne 0xdf43
movb $0x20, (%r15,%rbx)
movl %r14d, %r15d
movq %rbx, %rdi
callq 0x9120
incl %r14d
cmpq %r15, %rax
ja 0xdf37
movl $0xdaa, %edi            # imm = 0xDAA
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbe88
// File: /workspace/github_cpp_makefile_star2_O3/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
movq 0x331f73(%rip), %rax    # 0x33fee8
testq %rax, %rax
jne 0xdf88
leaq 0x14485f(%rip), %rax    # 0x1527e0
movq %rax, 0x331f60(%rip)    # 0x33fee8
testb %dil, %dil
movzbl %dil, %ecx
movl $0x20, %edx
cmovnsl %ecx, %edx
movzbl %dl, %ecx
movzwl 0x10(%rax,%rcx,4), %ecx
movzbl (%rax,%rcx), %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14d
movl %edi, %ebx
cmpl $0x0, 0x20a483(%rip)    # 0x218828
je 0xe3c3
movl 0x20a457(%rip), %eax    # 0x218804
notl %esi
addl %eax, %esi
movl %ecx, 0x20a475(%rip)    # 0x21882c
notl %ecx
addl %eax, %ecx
movl %esi, %r15d
movl %ecx, %r12d
jmp 0xe3ce
movl %ebx, %r15d
movl %esi, %ebx
movl %r14d, %r12d
movl %ecx, %r14d
cmpq $0x0, 0x162aea(%rip)    # 0x170ec0
je 0xe40f
movzbl %r8b, %edi
callq 0xd44a
movq 0x162ad8(%rip), %rdi    # 0x170ec0
movq 0x162ae1(%rip), %rsi    # 0x170ed0
movq 0x162aea(%rip), %rdx    # 0x170ee0
movl %r14d, (%rsp)
movl %r15d, %ecx
movl %ebx, %r8d
movl %r12d, %r9d
callq 0x9630
movb $0x1, 0x162a99(%rip)    # 0x170ea8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x20a1be(%rip)    # 0x218828
je 0xe682
movl %ebx, 0x20a1ba(%rip)    # 0x21882c
notl %ebx
movl %ebx, %eax
addl 0x20a188(%rip), %eax    # 0x218804
movl %r14d, %ebx
movl %eax, %r14d
cmpq $0x0, 0x162836(%rip)    # 0x170ec0
je 0xe6bb
movzbl %dl, %edi
callq 0xd44a
movq 0x162825(%rip), %rdi    # 0x170ec0
movq 0x16282e(%rip), %rsi    # 0x170ed0
movq 0x162837(%rip), %rdx    # 0x170ee0
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x92a0
movb $0x1, 0x1627ed(%rip)    # 0x170ea8
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x20a134(%rip), %edx    # 0x218810
movl 0x20a132(%rip), %ecx    # 0x218814
movl %esi, %edi
movl %r14d, %esi
xorl %r8d, %r8d
callq 0xf298
leal 0x2(%r15), %edi
movl %edi, -0x30(%rbp)
movl %r14d, %esi
movl %ebx, %edx
callq 0xe657
leal 0x3(%r15), %edi
movl %edi, -0x2c(%rbp)
movl %r14d, %esi
movl %ebx, %edx
callq 0xe657
leal 0x1(%r15), %r12d
leal 0x1(%r14), %r13d
movl %r12d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe657
addl $0x4, %r15d
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe657
leal 0x2(%r14), %r13d
movl %r12d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe657
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %edx
callq 0xe657
addl $0x3, %r14d
movl -0x30(%rbp), %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xe657
movl -0x2c(%rbp), %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xe657
movl $0x6, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq