LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: showsect2d
void
showsect2d(int s,int z)
{
     int  endwall,i,startwall;

     startwall=sectptr[s]->wallptr;
     endwall=startwall+sectptr[s]->wallnum-1;
     for (i=startwall ; i <= endwall ; i++) {
          if (wallptr[i]->nextwall != -1) {
               if (sectptr[wallptr[i]->nextsector]->floorz == z) {
                    showwall2d(i,0);
                    showwall2d(wallptr[i]->nextwall,0);
               }
               else {
                    showwall2d(i,1);
                    showwall2d(wallptr[i]->nextwall,1);
               }
          }
     }
}

// Assembly:
pushq %r14
pushq %rbx
movslq %edi, %rcx
leaq 0x1cb25a(%rip), %rax    # 0x1f9230
movq (%rax,%rcx,8), %rcx
movswq 0x2(%rcx), %rdx
testq %rdx, %rdx
jle 0x2e094
movswq (%rcx), %rdi
addq %rdi, %rdx
leaq 0x1d323a(%rip), %r8     # 0x201230
leaq 0x52eb63(%rip), %r9     # 0x55cb60
movq (%r8,%rdi,8), %r10
cmpw $-0x1, 0xa(%r10)
je 0x2e088
movl %edi, %ecx
andb $0x7, %cl
movl $0x1, %r11d
shll %cl, %r11d
movswq 0xc(%r10), %rcx
movq (%rax,%rcx,8), %r14
movl %edi, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movb (%r9,%rcx), %bl
cmpl %esi, 0x8(%r14)
jne 0x2e061
notb %r11b
andb %r11b, %bl
movb %bl, (%r9,%rcx)
movswl 0xa(%r10), %r10d
movl %r10d, %ecx
andb $0x7, %cl
movl $0x1, %r11d
shll %cl, %r11d
shrl $0x3, %r10d
movswq %r10w, %rcx
notb %r11b
andb %r11b, (%r9,%rcx)
jmp 0x2e088
orb %r11b, %bl
movb %bl, (%r9,%rcx)
movswl 0xa(%r10), %r10d
movl %r10d, %ecx
andb $0x7, %cl
movl $0x1, %r11d
shll %cl, %r11d
shrl $0x3, %r10d
movswq %r10w, %rcx
orb %r11b, (%r9,%rcx)
incq %rdi
cmpq %rdx, %rdi
jl 0x2dffd
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: showsect2dtoggle
void
showsect2dtoggle(int s,int onoff)
{
     int  endwall,i,startwall;

     startwall=sectptr[s]->wallptr;
     endwall=startwall+sectptr[s]->wallnum-1;
     for (i=startwall ; i <= endwall ; i++) {
          if (wallptr[i]->nextwall != -1) {
               showwall2d(i,onoff);
               showwall2d(wallptr[i]->nextwall,onoff);
          }
     }
}

// Assembly:
pushq %rbx
movslq %edi, %rax
leaq 0x1cb18d(%rip), %rcx    # 0x1f9230
movq (%rcx,%rax,8), %rcx
movswq 0x2(%rcx), %rax
testq %rax, %rax
jle 0x2e157
movswq (%rcx), %rdx
addq %rdx, %rax
leaq 0x1d316d(%rip), %rdi    # 0x201230
leaq 0x52ea96(%rip), %r8     # 0x55cb60
movq (%rdi,%rdx,8), %r9
cmpw $-0x1, 0xa(%r9)
je 0x2e14b
movl %edx, %ecx
andb $0x7, %cl
movl $0x1, %r10d
shll %cl, %r10d
movl %edx, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movb (%r8,%rcx), %r11b
movl %r10d, %ebx
notb %bl
andb %r11b, %bl
orb %r10b, %r11b
testl %esi, %esi
movzbl %r11b, %r10d
movzbl %bl, %r11d
cmovnel %r10d, %r11d
movb %r11b, (%r8,%rcx)
movswl 0xa(%r9), %r9d
movl %r9d, %ecx
andb $0x7, %cl
movl $0x1, %r10d
shll %cl, %r10d
shrl $0x3, %r9d
movswq %r9w, %rcx
movb (%r8,%rcx), %r9b
movl %r10d, %r11d
notb %r11b
andb %r9b, %r11b
orb %r10b, %r9b
testl %esi, %esi
movzbl %r11b, %r10d
movzbl %r9b, %r9d
cmovel %r10d, %r9d
movb %r9b, (%r8,%rcx)
incq %rdx
cmpq %rax, %rdx
jl 0x2e0ca
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: sectorblocked
int
sectorblocked(int   s)
{
     int       i,rv;

     rv=0;

     for( i=connecthead ; i >= 0 ; i=connectpoint2[i] ) {
          if( cursectnum[i] == s )
               rv=1;
          if( testneighborsectors(cursectnum[i], s) == 1 )
               rv=1;
     }
     if( headspritesect[s] != -1 )
          rv=1;

     return(rv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x7779c3(%rip), %rax    # 0x7a5b30
movl (%rax), %eax
xorl %r14d, %r14d
testl %eax, %eax
js 0x2e1b1
movl $0x1, %r12d
movswl %bx, %ebp
leaq 0x7779ba(%rip), %r13    # 0x7a5b40
movl %eax, %r15d
leaq 0xb7590(%rip), %rax     # 0xe5720
movswl (%rax,%r15,2), %edi
cmpl %ebx, %edi
cmovel %r12d, %r14d
movl %ebp, %esi
callq 0x29e23
testl %eax, %eax
cmovnel %r12d, %r14d
movl (%r13,%r15,4), %eax
testl %eax, %eax
jns 0x2e186
movslq %ebx, %rax
leaq 0x52f1d5(%rip), %rcx    # 0x55d390
cmpw $-0x1, (%rcx,%rax,2)
movl $0x1, %eax
cmovel %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: teksetdelayfunc
void                          // kick off function after specified tics elapse
teksetdelayfunc(void (*delayfunc)(short),int tics,short parm)
{
     int  i,n;

     if (delayfunc == NULL) {
       return;
     }
     n=numdelayfuncs;
     for (i=0 ; i < n ; i++) {
       if (delayfuncptr[i]->func == delayfunc) {
            if (tics == 0) {
              memmove(delayfuncptr[i],delayfuncptr[numdelayfuncs-1],
                sizeof(struct delayfunc));
              memset(delayfuncptr[numdelayfuncs-1],0,
                sizeof(struct delayfunc));
              numdelayfuncs--;
              return;
            }
            else {
              delayfuncptr[i]->tics=tics;
              delayfuncptr[i]->parm=parm;
              return;
            }
       }
     }
     delayfuncptr[numdelayfuncs]->func=delayfunc;
     delayfuncptr[numdelayfuncs]->tics=tics;
     delayfuncptr[numdelayfuncs]->parm=parm;
     numdelayfuncs++;
}

// Assembly:
testq %rdi, %rdi
je 0x2e28a
movswq 0x3005ff(%rip), %rax    # 0x32e830
leaq 0x300808(%rip), %rcx    # 0x32ea40
testq %rax, %rax
jle 0x2e25a
leaq (,%rax,8), %r9
xorl %r8d, %r8d
movq (%r8,%rcx), %r10
cmpq %rdi, (%r10)
je 0x2e27a
addq $0x8, %r8
cmpq %r8, %r9
jne 0x2e248
movq (%rcx,%rax,8), %r8
movq %rdi, (%r8)
movq (%rcx,%rax,8), %rdi
movl %esi, 0x8(%rdi)
movq (%rcx,%rax,8), %rcx
movw %dx, 0xc(%rcx)
incl %eax
movw %ax, 0x3005b7(%rip)     # 0x32e830
retq
testl %esi, %esi
je 0x2e28b
movl %esi, 0x8(%r10)
movq (%r8,%rcx), %rax
movw %dx, 0xc(%rax)
retq
movzwl %ax, %edx
movq -0x8(%rcx,%rdx,8), %rsi
movups (%rsi), %xmm0
movups %xmm0, (%r10)
movq -0x8(%rcx,%rdx,8), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
decl %eax
movw %ax, 0x300582(%rip)     # 0x32e830
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: setanimpic
void
setanimpic(short *pic,short tics,short frames)
{
     int  i;

     for (i=0 ; i < numanimates ; i++) {
          if (animpicptr[i]->pic == pic) {
               return;
          }
     }
     if (numanimates+1 < MAXANIMPICS) {
          animpicptr[numanimates]->pic=pic;
          animpicptr[numanimates]->tics=tics;
          animpicptr[numanimates]->frames=frames;
          animpicptr[numanimates]->nextclock=lockclock+tics;
          numanimates++;
     }
}

// Assembly:
movslq 0x30016e(%rip), %rcx    # 0x32e424
leaq 0x300473(%rip), %rax    # 0x32e730
testq %rcx, %rcx
jle 0x2e2e5
leaq (,%rcx,8), %r8
xorl %r9d, %r9d
movq (%r9,%rax), %r10
cmpq %rdi, 0x8(%r10)
je 0x2e31f
addq $0x8, %r9
cmpq %r9, %r8
jne 0x2e2cd
cmpl $0x1e, %ecx
jg 0x2e31f
movq (%rax,%rcx,8), %r8
movq %rdi, 0x8(%r8)
movq (%rax,%rcx,8), %rdi
movw %si, 0x10(%rdi)
movq (%rax,%rcx,8), %rcx
movw %dx, (%rcx)
leaq 0xb6185(%rip), %rcx     # 0xe4488
movswl %si, %edx
addl (%rcx), %edx
movslq 0x300115(%rip), %rcx    # 0x32e424
movq (%rax,%rcx,8), %rax
movl %edx, 0x14(%rax)
leal 0x1(%rcx), %eax
movl %eax, 0x300105(%rip)    # 0x32e424
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: tekheadbob
void
tekheadbob(void)
{
     if( headbobon && (activemenu == 0) ) {
          headbob+=bobstep;
          if( headbob < -BOBBMAX || headbob > BOBBMAX ) {
               bobstep=-bobstep;
          }
     }
}

// Assembly:
cmpl $0x0, 0xa4019(%rip)     # 0xd28e0
je 0x2e902
leaq 0x100c24(%rip), %rax    # 0x12f4f4
cmpl $0x0, (%rax)
jne 0x2e902
movl 0xa4009(%rip), %eax     # 0xd28e4
movl 0x30027f(%rip), %ecx    # 0x32eb60
leal (%rcx,%rax), %edx
movl %edx, 0x300276(%rip)    # 0x32eb60
addl %eax, %ecx
addl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
cmpl $0xfffffbfe, %ecx       # imm = 0xFFFFFBFE
ja 0x2e902
negl %eax
movl %eax, 0xa3fe2(%rip)     # 0xd28e4
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektxt.c
// Function: crashgame
void
crashgame(char *s,...)
{
     va_list argptr;

     musicoff();
     sendlogoff();
     uninitmultiplayers();
     uninitsb();
     cduninit();
     uninittimer();
     uninitinput();
     uninitengine();
     uninitgroupfile();
     teksavesetup();

     va_start(argptr,s);
     vprintf(s,argptr);
     va_end(argptr);
     printf("\n");
     exit(0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x2ebe9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x1c362
callq 0x5da42
callq 0x5da43
callq 0x1c2d1
callq 0xa5e7
callq 0x81ca5
callq 0x81c67
callq 0x37bfa
callq 0x34053
callq 0x1b6ad
movq %rsp, %rsi
movq %r14, 0x10(%rsi)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsi)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsi)
movq %rbx, %rdi
callq 0x89d0
movl $0xa, %edi
callq 0x90a0
xorl %edi, %edi
callq 0x8950
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/datascan.c
// Function: ImportDataFromPath
int ImportDataFromPath(const char *path, struct importdatameta *cbs)
{
    struct stat st;
    int found = 0, errors = 0;

    if (stat(path, &st) < 0) return IMPORTDATA_OK;

    if (st.st_mode & S_IFDIR) {
        switch (ImportFilesFromDir(path, cbs)) {
            case IMPORTDATA_COPIED: found = 1; break;
            case IMPORTDATA_ERROR: errors = 1; break;
        }
    }

    if (found) {
        if (WritePaletteFile() == COPYFILE_OK) {
            buildprintf("Wrote PALETTE.DAT\n");
        }
        return IMPORTDATA_COPIED;         // Finding anything is considered fine.
    }
    else if (errors) return IMPORTDATA_ERROR; // Finding nothing but errors reports back errors.
    return IMPORTDATA_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rsi
callq 0x8140
xorl %ebx, %ebx
testl %eax, %eax
js 0x2ed44
testb $0x40, 0x21(%rsp)
je 0x2ed44
movq %r15, %rdi
movq %r14, %rsi
callq 0x2ed58
cmpl $-0x1, %eax
je 0x2ed2b
cmpl $0x2, %eax
jne 0x2ed44
leaq 0x62149(%rip), %rdi     # 0x90df7
movl $0xc1, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x8670
movl $0x2, %ebx
testl %eax, %eax
js 0x2ed44
movl %eax, %ebp
leaq 0x74443(%rip), %rax     # 0xa3114
movslq (%rax), %r15
testq %r15, %r15
jle 0x2ed2f
xorl %r12d, %r12d
movl $0x4000, %r13d          # imm = 0x4000
movq %r15, %rdx
subq %r12, %rdx
cmpq %r13, %rdx
cmovgeq %r13, %rdx
leaq 0x6211a(%rip), %rax     # 0x90e10
leaq (%r12,%rax), %rsi
movl %ebp, %edi
callq 0x8f10
movq %rax, %r14
testq %rax, %rax
js 0x2ed11
addq %r14, %r12
cmpq %r15, %r12
jl 0x2ece2
movl %ebp, %edi
callq 0x8310
testq %r14, %r14
jns 0x2ed36
leaq 0x620d3(%rip), %rdi     # 0x90df7
callq 0x82a0
jmp 0x2ed44
movl %eax, %ebx
jmp 0x2ed44
movl %ebp, %edi
callq 0x8310
leaq 0x61feb(%rip), %rdi     # 0x90d28
xorl %eax, %eax
callq 0x372d1
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/datascan.c
// Function: ImportDataFromFile
static int ImportDataFromFile(const char *path, int size, struct importdatameta *cbs)
{
    char *fn;
    int fh, rv;

    fn = strrchr(path, '/');
#ifdef _WIN32
    fn = max(fn, strrchr(path, '\\'));
#endif
    if (!fn) fn = strdup(path);
    else fn = strdup(fn+1);
    strlwr(fn);

    fh = open(path, O_RDONLY|O_BINARY, S_IREAD);
    if (fh < 0) return IMPORTDATA_OK;  // Maybe no permission. Whatever.

    switch (CopyFile(fh, size, fn, cbs)) {
        case COPYFILE_ERR_CANCELLED:
            rv = IMPORTDATA_OK;
            break;
        case COPYFILE_ERR_EXISTS:
            rv = IMPORTDATA_SKIPPED;
            break;
        case COPYFILE_OK: // Copied.
            rv = IMPORTDATA_COPIED;
            break;
        default:
            rv = IMPORTDATA_ERROR;
            break;
    }
    close(fh);
    free(fn);
    return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4018, %rsp           # imm = 0x4018
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r13
movl $0x2f, %esi
callq 0x8dd0
testq %rax, %rax
je 0x2ef7d
incq %rax
movq %rax, %rdi
jmp 0x2ef80
movq %r13, %rdi
callq 0x8070
movq %rax, %rbx
movq %rax, %rdi
callq 0x35b60
xorl %r12d, %r12d
movq %r13, %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x8670
testl %eax, %eax
js 0x2f0b0
movl %eax, %ebp
movq %rbx, %rdi
movl $0xc1, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x8670
testl %eax, %eax
js 0x2f030
movl %eax, %r12d
movl %r14d, 0xc(%rsp)
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x83b0
leaq 0x10(%rsp), %r13
movq (%r15), %rdi
callq *0x10(%r15)
testl %eax, %eax
jne 0x2f042
movl $0x4000, %edx           # imm = 0x4000
movl %ebp, %edi
movq %r13, %rsi
callq 0x8b20
testq %rax, %rax
js 0x2f04a
je 0x2f052
movq %rax, %r14
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x8f10
cmpq $0x4000, %r14           # imm = 0x4000
jne 0x2f01e
cmpq %r14, %rax
je 0x2efde
xorl %ecx, %ecx
cmpq %r14, %rax
sete %cl
leal (%rcx,%rcx,2), %r14d
addl $-0x3, %r14d
jmp 0x2f055
callq 0x8ea0
cmpl $0x11, (%rax)
movl $0x1, %r12d
jne 0x2f093
jmp 0x2f0a1
movl $0xfffffffc, %r14d      # imm = 0xFFFFFFFC
jmp 0x2f055
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
jmp 0x2f055
xorl %r14d, %r14d
movl %r12d, %edi
callq 0x8310
movslq 0xc(%rsp), %r15
xorl %r12d, %r12d
movl %ebp, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x83b0
cmpq %r15, %rax
movl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
cmovel %r14d, %r15d
testl %r15d, %r15d
je 0x2f09b
movq %rbx, %rdi
callq 0x82a0
cmpl $-0x4, %r15d
je 0x2f0a1
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x2f0a1
movl $0x2, %r12d
movl %ebp, %edi
callq 0x8310
movq %rbx, %rdi
callq 0x8270
movl %r12d, %eax
addq $0x4018, %rsp           # imm = 0x4018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_memory
smk smk_open_memory(const unsigned char * buffer, const unsigned long size)
{
	smk s = NULL;
	union smk_read_t fp;

	if (buffer == NULL) {
		fputs("libsmacker::smk_open_memory() - ERROR: buffer pointer is NULL\n", stderr);
		return NULL;
	}

	/* set up the read union for Memory mode */
	fp.ram = (unsigned char *)buffer;

	if (!(s = smk_open_generic(0, fp, size, SMK_MODE_MEMORY)))
		fprintf(stderr, "libsmacker::smk_open_memory(buffer,%lu) - ERROR: Fatal error in smk_open_generic, returning NULL.\n", size);

	return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2f0f9
movq %rsi, %rbx
movq %rdi, %rsi
xorl %edi, %edi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x2f123
movq %rax, %r14
testq %rax, %rax
je 0x2f103
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x9270
xorl %r14d, %r14d
jmp 0x2f0ee
movq 0xa1e86(%rip), %rax     # 0xd0f90
movq (%rax), %rdi
leaq 0x7412b(%rip), %rsi     # 0xa323f
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
jmp 0x2f0ee
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_filepointer
smk smk_open_filepointer(FILE * file, const unsigned char mode)
{
	smk s = NULL;
	union smk_read_t fp;

	if (file == NULL) {
		fputs("libsmacker::smk_open_filepointer() - ERROR: file pointer is NULL\n", stderr);
		return NULL;
	}

	/* Copy file ptr to internal union */
	fp.file = file;

	if (!(s = smk_open_generic(1, fp, 0, mode))) {
		fprintf(stderr, "libsmacker::smk_open_filepointer(file,%u) - ERROR: Fatal error in smk_open_generic, returning NULL.\n", mode);
		fclose(fp.file);
		goto error;
	}

	if (mode == SMK_MODE_MEMORY)
		fclose(fp.file);
	else
		s->source.file.fp = fp.file;

	/* fall through, return s or null */
error:
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x30163
movl %esi, %ebp
movq %rdi, %rbx
movzbl %bpl, %r15d
movl $0x1, %edi
movq %rbx, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x2f123
testq %rax, %rax
je 0x3016a
movq %rax, %r14
cmpb $0x1, %bpl
jne 0x3015d
movq %rbx, %rdi
callq 0x8640
jmp 0x30178
movq %rbx, 0x28(%r14)
jmp 0x30178
callq 0x99ac
jmp 0x30175
movl %r15d, %edi
movq %rbx, %rsi
callq 0x9980
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_file
smk smk_open_file(const char * filename, const unsigned char mode)
{
	FILE * fp;

	if (filename == NULL) {
		fputs("libsmacker::smk_open_file() - ERROR: filename is NULL\n", stderr);
		return NULL;
	}

	if (!(fp = fopen(filename, "rb"))) {
		fprintf(stderr, "libsmacker::smk_open_file(%s,%u) - ERROR: could not open file\n", filename, mode);
		perror("\tError reported was");
		goto error;
	}

	/* kick processing to smk_open_filepointer */
	return smk_open_filepointer(fp, mode);
	/* fall through, return s or null */
error:
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x301b7
movl %esi, %ebx
movq %rdi, %r14
leaq 0x731e5(%rip), %rsi     # 0xa3380
callq 0x91d0
testq %rax, %rax
je 0x301be
movzbl %bl, %esi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3011e
callq 0x99f2
jmp 0x301c9
movzbl %bl, %edi
movq %r14, %rsi
callq 0x99c2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_all
char smk_info_all(const smk object, unsigned long * frame, unsigned long * frame_count, double * usf)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_all() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!frame && !frame_count && !usf) {
		fputs("libsmacker::smk_info_all(object,frame,frame_count,usf) - ERROR: Request for info with all-NULL return references\n", stderr);
		goto error;
	}

	if (frame)
		*frame = (object->cur_frame % object->f);

	if (frame_count)
		*frame_count = object->f;

	if (usf)
		*usf = object->usf;

	return 0;
error:
	return -1;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x3044c
movq %rdx, %r8
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
je 0x30453
testq %rsi, %rsi
je 0x3042e
movq 0x20(%rdi), %rax
xorl %edx, %edx
divq 0x10(%rdi)
movq %rdx, (%rsi)
testq %r8, %r8
je 0x3043a
movq 0x10(%rdi), %rax
movq %rax, (%r8)
testq %rcx, %rcx
je 0x30448
movsd 0x8(%rdi), %xmm0
movsd %xmm0, (%rcx)
xorl %eax, %eax
popq %rcx
retq
callq 0x9a34
jmp 0x30458
callq 0x9a1e
movb $-0x1, %al
jmp 0x3044a
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_video
char smk_info_video(const smk object, unsigned long * w, unsigned long * h, unsigned char * y_scale_mode)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_video() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!w && !h && !y_scale_mode) {
		fputs("libsmacker::smk_info_all(object,w,h,y_scale_mode) - ERROR: Request for info with all-NULL return references\n", stderr);
		return -1;
	}

	if (w)
		*w = object->video.w;

	if (h)
		*h = object->video.h;

	if (y_scale_mode)
		*y_scale_mode = object->video.y_scale_mode;

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x30493
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
je 0x3049a
testq %rsi, %rsi
je 0x30479
movq 0x58(%rdi), %rax
movq %rax, (%rsi)
testq %rdx, %rdx
je 0x30485
movq 0x60(%rdi), %rax
movq %rax, (%rdx)
testq %rcx, %rcx
je 0x3048f
movb 0x68(%rdi), %al
movb %al, (%rcx)
xorl %eax, %eax
popq %rcx
retq
callq 0x9a60
jmp 0x3049f
callq 0x9a4a
movb $-0x1, %al
jmp 0x30491
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_audio
char smk_info_audio(const smk object, unsigned char * track_mask, unsigned char channels[7], unsigned char bitdepth[7], unsigned long audio_rate[7])
{
	unsigned char i;

	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_audio() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!track_mask && !channels && !bitdepth && !audio_rate) {
		fputs("libsmacker::smk_info_audio(object,track_mask,channels,bitdepth,audio_rate) - ERROR: Request for info with all-NULL return references\n", stderr);
		return -1;
	}

	if (track_mask) {
		*track_mask = ((object->audio[0].exists) |
				((object->audio[1].exists) << 1) |
				((object->audio[2].exists) << 2) |
				((object->audio[3].exists) << 3) |
				((object->audio[4].exists) << 4) |
				((object->audio[5].exists) << 5) |
				((object->audio[6].exists) << 6));
	}

	if (channels) {
		for (i = 0; i < 7; i ++)
			channels[i] = object->audio[i].channels;
	}

	if (bitdepth) {
		for (i = 0; i < 7; i ++)
			bitdepth[i] = object->audio[i].bitdepth;
	}

	if (audio_rate) {
		for (i = 0; i < 7; i ++)
			audio_rate[i] = object->audio[i].rate;
	}

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x30585
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
orq %r8, %rax
je 0x3058e
testq %rsi, %rsi
je 0x3051b
movb 0x428(%rdi), %al
addb %al, %al
orb 0x3f8(%rdi), %al
movb 0x458(%rdi), %r9b
shlb $0x2, %r9b
movb 0x488(%rdi), %r10b
shlb $0x3, %r10b
orb %r9b, %r10b
movb 0x4b8(%rdi), %r9b
shlb $0x4, %r9b
orb %r10b, %r9b
movb 0x4e8(%rdi), %r10b
shlb $0x5, %r10b
orb %r9b, %r10b
movb 0x518(%rdi), %r9b
shlb $0x6, %r9b
orb %r10b, %r9b
orb %al, %r9b
movb %r9b, (%rsi)
testq %rdx, %rdx
je 0x3053d
leaq 0x3fa(%rdi), %rax
xorl %esi, %esi
movb (%rax), %r9b
movb %r9b, (%rdx,%rsi)
incq %rsi
addq $0x30, %rax
cmpq $0x7, %rsi
jne 0x30529
testq %rcx, %rcx
je 0x3055f
leaq 0x3fb(%rdi), %rax
xorl %edx, %edx
movb (%rax), %sil
movb %sil, (%rcx,%rdx)
incq %rdx
addq $0x30, %rax
cmpq $0x7, %rdx
jne 0x3054b
testq %r8, %r8
je 0x30581
addq $0x400, %rdi            # imm = 0x400
xorl %eax, %eax
movq (%rdi), %rcx
movq %rcx, (%r8,%rax,8)
incq %rax
addq $0x30, %rdi
cmpq $0x7, %rax
jne 0x3056d
xorl %eax, %eax
popq %rcx
retq
leaq 0x73064(%rip), %rdi     # 0xa35f0
jmp 0x30595
leaq 0x7308e(%rip), %rdi     # 0xa3623
callq 0x9a76
movb $-0x1, %al
jmp 0x30583
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_enable_all
char smk_enable_all(smk object, const unsigned char mask)
{
	unsigned char i;

	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_enable_all() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	/* set video-enable */
	object->video.enable = (mask & 0x80);

	for (i = 0; i < 7; i ++) {
		if (object->audio[i].exists)
			object->audio[i].enable = (mask & (1 << i));
	}

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x305d7
movl %esi, %eax
andb $-0x80, %al
movb %al, 0x50(%rdi)
addq $0x3f9, %rdi            # imm = 0x3F9
xorl %ecx, %ecx
cmpb $0x0, -0x1(%rdi)
je 0x305c6
movl $0x1, %eax
shll %cl, %eax
andb %sil, %al
movb %al, (%rdi)
incq %rcx
addq $0x30, %rdi
cmpq $0x7, %rcx
jne 0x305b4
xorl %eax, %eax
popq %rcx
retq
callq 0x9a85
movb $-0x1, %al
jmp 0x305d5
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_first
char smk_first(smk s)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_first() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	s->cur_frame = 0;

	if (smk_render(s) < 0) {
		fprintf(stderr, "libsmacker::smk_first(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
		return -1;
	}

	if (s->f == 1) return SMK_LAST;

	return SMK_MORE;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x306c8
movq %rdi, %rbx
movq $0x0, 0x20(%rdi)
callq 0x306df
testb %al, %al
js 0x306cf
cmpq $0x1, 0x10(%rbx)
sete %al
incb %al
popq %rbx
retq
callq 0x9b3d
jmp 0x306db
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x9b1f
movb $-0x1, %al
jmp 0x306c6
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_next
char smk_next(smk s)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_next() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (s->cur_frame + 1 < (s->f + s->ring_frame)) {
		s->cur_frame ++;

		if (smk_render(s) < 0) {
			fprintf(stderr, "libsmacker::smk_next(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
			return -1;
		}

		if (s->cur_frame + 1 == (s->f + s->ring_frame))
			return SMK_LAST;

		return SMK_MORE;
	} else if (s->ring_frame) {
		s->cur_frame = 1;

		if (smk_render(s) < 0) {
			fprintf(stderr, "libsmacker::smk_next(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
			return -1;
		}

		if (s->cur_frame + 1 == (s->f + s->ring_frame))
			return SMK_LAST;

		return SMK_MORE;
	}

	return SMK_DONE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3131c
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq 0x20(%rdi), %rax
incq %rax
movzbl 0x18(%rdi), %ecx
movq 0x10(%rdi), %rdx
addq %rcx, %rdx
cmpq %rdx, %rax
jae 0x312e1
movq %rax, 0x20(%rbx)
movq %rbx, %rdi
callq 0x306df
testb %al, %al
jns 0x312f9
movq %r14, %rdi
callq 0x9c5c
jmp 0x3132b
testb %cl, %cl
je 0x31318
movq $0x1, 0x20(%rbx)
movq %rbx, %rdi
callq 0x306df
testb %al, %al
js 0x31323
movq 0x20(%rbx), %rax
movzbl 0x18(%rbx), %ecx
addq 0x10(%rbx), %rcx
incq %rax
cmpq %rcx, %rax
sete %al
incb %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x31310
callq 0x9c7a
jmp 0x3132b
movq %r14, %rdi
callq 0x9c3e
movb $-0x1, %al
jmp 0x31310
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_seek_keyframe
char smk_seek_keyframe(smk s, unsigned long f)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_seek_keyframe() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	/* rewind (or fast forward!) exactly to f */
	s->cur_frame = f;

	/* roll back to previous keyframe in stream, or 0 if no keyframes exist */
	while (s->cur_frame > 0 && !(s->keyframe[s->cur_frame]))
		s->cur_frame --;

	/* render the frame: we're ready */
	if (smk_render(s) < 0) {
		fprintf(stderr, "libsmacker::smk_seek_keyframe(s,%lu) - Warning: frame %lu: smk_render returned errors.\n", f, s->cur_frame);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x31376
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x20(%rdi)
testq %rsi, %rsi
je 0x31360
movq 0x40(%r14), %rax
leaq -0x1(%rbx), %rcx
cmpb $0x0, 0x1(%rax,%rcx)
jne 0x31360
movq %rcx, 0x20(%r14)
addq $-0x1, %rcx
jb 0x3134f
movq %r14, %rdi
callq 0x306df
testb %al, %al
js 0x3137d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x9c90
jmp 0x3139c
movq 0x9fc0c(%rip), %rax     # 0xd0f90
movq (%rax), %rdi
movq 0x20(%r14), %rcx
leaq 0x725ab(%rip), %rsi     # 0xa393d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x3136e
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker_jftekwar.c
// Function: smk_render_frame
char smk_render_frame(smk s, unsigned long f)
{
    /* null check */
    if (s == NULL) {
        fputs("libsmacker::smk_render_frame() - ERROR: smk is NULL\n", stderr);
        return -1;
    }
    
    /* rewind (or fast forward!) exactly to f */
    s->cur_frame = f;
    
    /* render the frame: we're ready */
    if ( smk_render(s) < 0) {
        fprintf(stderr, "libsmacker::smk_render_frame(s,%lu) - Warning: frame %lu: smk_render returned errors.\n", f, s->cur_frame);
        goto error;
    }
    
    return 0;
    
error:
    return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x313c6
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x20(%rdi)
callq 0x306df
testb %al, %al
js 0x313cd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x9ca6
jmp 0x313ec
movq 0x9fbbc(%rip), %rax     # 0xd0f90
movq (%rax), %rdi
movq 0x20(%r14), %rcx
leaq 0x725e8(%rip), %rsi     # 0xa39ca
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x313be
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_read_file
static char smk_read_file(void * buf, const size_t size, FILE * fp)
{
	/* don't bother checking buf or fp, fread does it for us */
	size_t bytesRead = fread(buf, 1, size, fp);

	if (bytesRead != size) {
		fprintf(stderr, "libsmacker::smk_read_file(buf,%lu,fp) - ERROR: Short read, %lu bytes returned\n", (unsigned long)size, (unsigned long)bytesRead);
		perror("\tReason");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbx
movq %rdx, %rcx
movq %rsi, %rbx
movl $0x1, %esi
movq %rbx, %rdx
callq 0x87a0
cmpq %rbx, %rax
jne 0x3140d
xorl %eax, %eax
popq %rbx
retq
movq 0x9fb7c(%rip), %rcx     # 0xd0f90
movq (%rcx), %rdi
leaq 0x72e61(%rip), %rsi     # 0xa427f
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x8290
leaq 0x72e9c(%rip), %rdi     # 0xa42ce
callq 0x83f0
movb $-0x1, %al
jmp 0x3140b
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_bs_read_1
static int smk_bs_read_1(struct smk_bit_t * const bs)
{
	int ret;
	/* null check */
	assert(bs);

	/* don't die when running out of bits, but signal */
	if (bs->buffer >= bs->end) {
		fputs("libsmacker::smk_bs_read_1(): ERROR: bitstream exhausted.\n", stderr);
		return -1;
	}

	/* get next bit and store for return */
	ret = (*bs->buffer >> bs->bit_num) & 1;

	/* advance to next bit */
	if (bs->bit_num >= 7) {
		/* Out of bits in this byte: next! */
		bs->buffer ++;
		bs->bit_num = 0;
	} else
		bs->bit_num ++;

	return ret;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x3147c
movq (%rdi), %rsi
cmpq 0x8(%rdi), %rsi
jae 0x31470
movzbl (%rsi), %ecx
movl 0x10(%rdi), %edx
xorl %eax, %eax
btl %edx, %ecx
setb %cl
cmpl $0x7, %edx
jb 0x31467
incq %rsi
movq %rsi, (%rdi)
xorl %edx, %edx
jmp 0x31469
incl %edx
movb %cl, %al
movl %edx, 0x10(%rdi)
popq %rcx
retq
callq 0x9cbc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3146e
leaq 0x73f8f(%rip), %rdi     # 0xa5412
leaq 0x71f89(%rip), %rsi     # 0xa3413
leaq 0x7319b(%rip), %rcx     # 0xa462c
movl $0x33, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_build
static int smk_huff8_build(struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit;
	/* null check */
	assert(t);
	assert(bs);

	/* Smacker huff trees begin with a set-bit. */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::smk_huff8_build() - ERROR: initial get_bit returned -1\n", stderr);
		return 0;
	}

	/* OK to fill out the struct now */
	t->size = 0;

	/* First bit indicates whether a tree is present or not. */
	/*  Very small or audio-only files may have no tree. */
	if (bit) {
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::smk_huff8_build() - ERROR: tree build failed\n", stderr);
			return 0;
		}
	} else
		t->tree[0] = 0;

	/* huff trees end with an unset-bit */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::smk_huff8_build() - ERROR: final get_bit returned -1\n", stderr);
		return 0;
	}

	/* a 0 is expected here, a 1 generally indicates a problem! */
	if (bit) {
		fputs("libsmacker::smk_huff8_build() - ERROR: final get_bit returned 1\n", stderr);
		return 0;
	}

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x31528
movq %rsi, %rbx
testq %rsi, %rsi
je 0x31547
movq %rdi, %r14
movq %rbx, %rdi
callq 0x3143b
testl %eax, %eax
js 0x31506
movq $0x0, (%r14)
je 0x314e4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3176f
testl %eax, %eax
jne 0x314eb
leaq 0x7323b(%rip), %rdi     # 0xa471d
jmp 0x3151f
movw $0x0, 0x8(%r14)
movq %rbx, %rdi
callq 0x3143b
testl %eax, %eax
js 0x3150f
movl $0x1, %eax
jne 0x31518
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x731cc(%rip), %rdi     # 0xa46d9
jmp 0x3151f
leaq 0x73241(%rip), %rdi     # 0xa4757
jmp 0x3151f
leaq 0x7327a(%rip), %rdi     # 0xa4799
callq 0x9cd2
xorl %eax, %eax
jmp 0x314fe
leaq 0x5f8d2(%rip), %rdi     # 0x90e01
leaq 0x71edd(%rip), %rsi     # 0xa3413
leaq 0x73154(%rip), %rcx     # 0xa4691
movl $0xb3, %edx
callq 0x8240
leaq 0x73ec4(%rip), %rdi     # 0xa5412
leaq 0x71ebe(%rip), %rsi     # 0xa3413
leaq 0x73135(%rip), %rcx     # 0xa4691
movl $0xb4, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_bs_read_8
static int smk_bs_read_8(struct smk_bit_t * const bs)
{
	/* null check */
	assert(bs);

	/* don't die when running out of bits, but signal */
	if (bs->buffer + (bs->bit_num > 0) >= bs->end) {
		fputs("libsmacker::smk_bs_read_8(): ERROR: bitstream exhausted.\n", stderr);
		return -1;
	}

	if (bs->bit_num) {
		/* unaligned read */
		int ret = *bs->buffer >> bs->bit_num;
		bs->buffer ++;
		return ret | (*bs->buffer << (8 - bs->bit_num) & 0xFF);
	}

	/* aligned read */
	return *bs->buffer++;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x315be
movq (%rdi), %rax
movl 0x10(%rdi), %ecx
cmpl $0x1, %ecx
movq %rax, %rdx
sbbq $-0x1, %rdx
cmpq 0x8(%rdi), %rdx
jae 0x315b2
testl %ecx, %ecx
je 0x315a6
movzbl (%rax), %edx
shrl %cl, %edx
leaq 0x1(%rax), %rsi
movq %rsi, (%rdi)
movzbl 0x1(%rax), %esi
movb $0x8, %al
subb %cl, %al
movl %eax, %ecx
shll %cl, %esi
movzbl %sil, %eax
orl %edx, %eax
jmp 0x315b0
leaq 0x1(%rax), %rcx
movq %rcx, (%rdi)
movzbl (%rax), %eax
popq %rcx
retq
callq 0x9ce1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x315b0
leaq 0x73e4d(%rip), %rdi     # 0xa5412
leaq 0x71e47(%rip), %rsi     # 0xa3413
leaq 0x7335c(%rip), %rcx     # 0xa492f
movl $0x4e, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_build_rec
static int _smk_huff8_build_rec(struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit, value;
	assert(t);
	assert(bs);

	/* Make sure we aren't running out of bounds */
	if (t->size >= 511) {
		fputs("libsmacker::_smk_huff8_build_rec() - ERROR: size exceeded\n", stderr);
		return 0;
	}

	/* Read the next bit */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::_smk_huff8_build_rec() - ERROR: get_bit returned -1\n", stderr);
		return 0;
	}

	if (bit) {
		/* Bit set: this forms a Branch node.
			what we have to do is build the left-hand branch,
			assign the "jump" address,
			then build the right hand branch from there.
		*/
		/* track the current index */
		value = t->size ++;

		/* go build the left branch */
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: failed to build left sub-tree\n", stderr);
			return 0;
		}

		/* now go back to our current location, and
			mark our location as a "jump" */
		t->tree[value] = SMK_HUFF8_BRANCH | t->size;

		/* continue building the right side */
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: failed to build right sub-tree\n", stderr);
			return 0;
		}
	} else {
		/* Bit unset signifies a Leaf node. */
		/* Attempt to read value */
		if ((value = smk_bs_read_8(bs)) < 0) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: get_byte returned -1\n", stderr);
			return 0;
		}

		/* store to tree */
		t->tree[t->size ++] = value;
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x1ff, (%rdi)          # imm = 0x1FF
jae 0x317f8
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x3143b
testl %eax, %eax
js 0x317ff
je 0x317d6
movq (%rbx), %r15
leaq 0x1(%r15), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3176f
testl %eax, %eax
je 0x31806
movl $0x8000, %eax           # imm = 0x8000
orl (%rbx), %eax
movslq %r15d, %rcx
movw %ax, 0x8(%rbx,%rcx,2)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3176f
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x31814
callq 0x9d7b
jmp 0x31812
movq %r14, %rdi
callq 0x31566
testl %eax, %eax
js 0x3180d
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movw %ax, 0x8(%rbx,%rcx,2)
movl $0x1, %eax
jmp 0x31814
callq 0x9dd3
jmp 0x31812
callq 0x9dbd
jmp 0x31812
callq 0x9d91
jmp 0x31812
callq 0x9da7
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_lookup
static int smk_huff8_lookup(const struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit, index = 0;
	/* null check */
	assert(t);
	assert(bs);

	while (t->tree[index] & SMK_HUFF8_BRANCH) {
		if ((bit = smk_bs_read_1(bs)) < 0) {
			fputs("libsmacker::smk_huff8_lookup() - ERROR: get_bit returned -1\n", stderr);
			return -1;
		}

		if (bit) {
			/* take the right branch */
			index = t->tree[index] & SMK_HUFF8_LEAF_MASK;
		} else {
			/* take the left branch */
			index ++;
		}
	}

	/* at leaf node.  return the value at this point. */
	return t->tree[index];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x31889
movq %rsi, %rbx
testq %rsi, %rsi
je 0x318a8
movq %rdi, %r14
movzwl 0x8(%rdi), %eax
testw %ax, %ax
jns 0x3186f
addq $0x8, %r14
xorl %ebp, %ebp
movq %r14, %r15
movq %rbx, %rdi
callq 0x3143b
testl %eax, %eax
js 0x3187d
je 0x3185d
movzwl (%r15), %ebp
andl $0x7fff, %ebp           # imm = 0x7FFF
jmp 0x3185f
incl %ebp
movslq %ebp, %rax
leaq (%r14,%rax,2), %r15
movzwl (%r15), %eax
testw %ax, %ax
js 0x31843
movzwl %ax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x9de9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x31872
leaq 0x5f571(%rip), %rdi     # 0x90e01
leaq 0x71b7c(%rip), %rsi     # 0xa3413
leaq 0x73346(%rip), %rcx     # 0xa4be4
movl $0xde, %edx
callq 0x8240
leaq 0x73b63(%rip), %rdi     # 0xa5412
leaq 0x71b5d(%rip), %rsi     # 0xa3413
leaq 0x73327(%rip), %rcx     # 0xa4be4
movl $0xdf, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff16_lookup
static int smk_huff16_lookup(struct smk_huff16_t * const t, struct smk_bit_t * const bs)
{
	int bit, value, index = 0;
	/* null check */
	assert(t);
	assert(bs);

	while (t->tree[index] & SMK_HUFF16_BRANCH) {
		if ((bit = smk_bs_read_1(bs)) < 0) {
			fputs("libsmacker::smk_huff16_lookup() - ERROR: get_bit returned -1\n", stderr);
			return -1;
		}

		if (bit) {
			/* take the right branch */
			index = t->tree[index] & SMK_HUFF16_LEAF_MASK;
		} else {
			/* take the left branch */
			index ++;
		}
	}

	/* Get the value at this point */
	value = t->tree[index];

	if (value & SMK_HUFF16_CACHE) {
		/* uses cached value instead of actual value */
		value = t->cache[value & SMK_HUFF16_LEAF_MASK];
	}

	if (t->cache[0] != value) {
		/* Update the cache, by moving val to the front of the queue,
			if it isn't already there. */
		t->cache[2] = t->cache[1];
		t->cache[1] = t->cache[0];
		t->cache[0] = value;
	}

	return value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x31964
movq %rsi, %r14
testq %rsi, %rsi
je 0x31983
movq %rdi, %rbx
movq (%rdi), %rax
movl (%rax), %eax
testl %eax, %eax
jns 0x31926
xorl %r12d, %r12d
movl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x3143b
testl %eax, %eax
js 0x31958
je 0x31915
movq (%rbx), %rax
movl (%rax,%r12,4), %r15d
andl %ebp, %r15d
jmp 0x3191b
incl %r15d
movq (%rbx), %rax
movslq %r15d, %r12
movl (%rax,%r12,4), %eax
testl %eax, %eax
js 0x318fb
cmpl $0x40000000, %eax       # imm = 0x40000000
jb 0x31937
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movzwl 0x10(%rbx,%rax,2), %eax
movzwl 0x10(%rbx), %ecx
cmpl %ecx, %eax
je 0x3194f
movzwl 0x12(%rbx), %edx
movw %dx, 0x14(%rbx)
movw %cx, 0x12(%rbx)
movw %ax, 0x10(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x9dff
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3194f
leaq 0x5f496(%rip), %rdi     # 0x90e01
leaq 0x71aa1(%rip), %rsi     # 0xa3413
leaq 0x7398d(%rip), %rcx     # 0xa5306
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x8240
leaq 0x73a88(%rip), %rdi     # 0xa5412
leaq 0x71a82(%rip), %rsi     # 0xa3413
leaq 0x7396e(%rip), %rcx     # 0xa5306
movl $0x1c5, %edx            # imm = 0x1C5
callq 0x8240
nop
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/startgtk_game.c
// Function: setup_messages_mode
static void setup_messages_mode(gboolean allowcancel)
{
    gtk_notebook_set_current_page(GTK_NOTEBOOK(controls.tabs), TAB_MESSAGES);

    // Disable all the controls on the Configuration page.
    gtk_container_foreach(GTK_CONTAINER(controls.configbox),
            foreach_gtk_widget_set_sensitive, (gpointer)FALSE);
    gtk_widget_set_sensitive(controls.alwaysshowcheck, FALSE);

    gtk_widget_set_sensitive(controls.chooseimportbutton, FALSE);
    gtk_widget_set_sensitive(controls.importinfobutton, FALSE);

    gtk_widget_set_sensitive(controls.cancelbutton, allowcancel);
    gtk_widget_set_sensitive(controls.startbutton, FALSE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x2fd0c0(%rip), %r14    # 0x32ee90
callq 0x8fd0
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
movq %rax, %rdi
movl $0x1, %esi
callq 0x9230
movq 0x2fd0a4(%rip), %r14    # 0x32ee98
callq 0x8b90
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
leaq 0xdc4(%rip), %rsi       # 0x32bcf
movq %rax, %rdi
xorl %edx, %edx
callq 0x8bb0
movq 0x2fd084(%rip), %rdi    # 0x32eea0
xorl %esi, %esi
callq 0x91a0
movq 0x2fd0be(%rip), %rdi    # 0x32eee8
xorl %esi, %esi
callq 0x91a0
movq 0x2fd0b8(%rip), %rdi    # 0x32eef0
xorl %esi, %esi
callq 0x91a0
movq 0x2fd042(%rip), %rdi    # 0x32ee88
movl %ebx, %esi
callq 0x91a0
movq 0x2fd02c(%rip), %rdi    # 0x32ee80
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x91a0
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/startgtk_game.c
// Function: startwin_puts_inner
static gboolean startwin_puts_inner(gpointer str)
{
    GtkTextBuffer *textbuffer;
    GtkTextIter enditer;
    GtkTextMark *mark;
    const char *aptr, *bptr;

    textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(controls.messagestext));

    gtk_text_buffer_get_end_iter(textbuffer, &enditer);
    for (aptr = bptr = (const char *)str; *aptr != 0; ) {
        switch (*bptr) {
            case '\b':
                if (bptr > aptr) {
                    // Insert any normal characters seen so far.
                    gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
                }
                gtk_text_buffer_backspace(textbuffer, &enditer, FALSE, TRUE);
                aptr = ++bptr;
                break;
            case 0:
                if (bptr > aptr) {
                    gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr));
                }
                aptr = bptr;
                break;
            default:
                bptr++;
                break;
        }
    }

    mark = gtk_text_buffer_create_mark(textbuffer, NULL, &enditer, 1);
    gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(controls.messagestext), mark, 0.0, FALSE, 0.0, 1.0);
    gtk_text_buffer_delete_mark(textbuffer, mark);

    free(str);
    return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x2fcf87(%rip), %r14    # 0x32eea8
callq 0x8990
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
movq %rax, %rdi
callq 0x8350
movq %rax, %r14
movq %rsp, %rsi
movq %rax, %rdi
callq 0x8f00
movb (%rbx), %al
testb %al, %al
je 0x31fbb
movq %rsp, %r12
movq %rbx, %r13
movq %rbx, %rdx
testb %al, %al
je 0x31f93
movzbl %al, %eax
cmpl $0x8, %eax
jne 0x31fad
cmpq %rdx, %r13
jbe 0x31f7c
movl %edx, %ecx
notl %ecx
addl %r13d, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x8c60
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x87f0
incq %r13
jmp 0x31fa8
cmpq %rdx, %r13
jbe 0x31fa8
movl %r13d, %ecx
subl %edx, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x8c60
movq %r13, %rdx
jmp 0x31fb0
incq %r13
cmpb $0x0, (%rdx)
je 0x31fbb
movb (%r13), %al
jmp 0x31f59
movq %rsp, %rdx
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x8e50
movq %rax, %r12
movq 0x2fced1(%rip), %rdi    # 0x32eea8
movq %r15, %rsi
callq 0x8160
movsd 0x733a9(%rip), %xmm2    # 0xa5390
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x8030
movq %r14, %rdi
movq %r12, %rsi
callq 0x8050
movq %rbx, %rdi
callq 0x8270
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/startgtk_game.c
// Function: on_importinfobutton_clicked
static void on_importinfobutton_clicked(GtkButton *button, gpointer user_data)
{
    GtkWidget *dialog;

    (void)button; (void)user_data;

    dialog = gtk_message_dialog_new(startwin, GTK_DIALOG_DESTROY_WITH_PARENT,
        GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
        "JFTekWar can scan locations of your choosing for TekWar game data");
    gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog),
        "Click the 'Choose a location...' button, then locate a folder to scan.\n\n"
        "Common locations to check include:\n"
        " • CD/DVD drives\n"
        " • Unzipped data from copies of the full DOS game");
    gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);
}

// Assembly:
pushq %rbx
movq 0x2fc611(%rip), %rdi    # 0x32ee70
leaq 0x72d1c(%rip), %r8      # 0xa5582
movl $0x2, %esi
xorl %edx, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x8d30
movq %rax, %rbx
callq 0x8d80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8160
leaq 0x72d31(%rip), %rsi     # 0xa55c4
movq %rax, %rdi
xorl %eax, %eax
callq 0x8ec0
callq 0x8980
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8160
movq %rax, %rdi
callq 0x8360
movq %rbx, %rdi
popq %rbx
jmp 0x81e0