LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/mono/mono.c
// Function: commentHandler
static void commentHandler(FILE *in, FILE *out)
    {
    int ch, count=0;
    char s[512] = "";
    char *token = NULL;

    ch = fgetc(in);

    if(ch == 'm')
        {
        fprintf(stderr,"mono comment found \n");
        
        while(ch != '\n')
            {
            s[count++] = ch;
            ch = fgetc(in);
            }

        s[count] = '\0';

        token = strtok(s," ");

        token  =strtok(NULL , " ");

        Channel = atoi(token);

        fprintf(stderr,"Channel selected is %d\n",Channel);

        if (trackChannel < Channel)
            {
            Fatal("mono: bad channel: %d\n",Channel);
            Channel = -1;
            }
        }
    else
        {
        ungetc(ch,out);
        outputComment(in,out);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x10b0
movq $0x0, -0x228(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10c0
movl %eax, -0x14(%rbp)
cmpl $0x6d, -0x14(%rbp)
jne 0x19ce
movq 0x6703(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x382d(%rip), %rsi      # 0x512c
movb $0x0, %al
callq 0x1110
cmpl $0xa, -0x14(%rbp)
je 0x1933
movl -0x14(%rbp), %eax
movb %al, %cl
movl -0x18(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
cltq
movb %cl, -0x220(%rbp,%rax)
movq -0x8(%rbp), %rdi
callq 0x10c0
movl %eax, -0x14(%rbp)
jmp 0x1906
movslq -0x18(%rbp), %rax
movb $0x0, -0x220(%rbp,%rax)
leaq -0x220(%rbp), %rdi
leaq 0x3cf6(%rip), %rsi      # 0x5643
callq 0x11a0
movq %rax, -0x228(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq 0x3cdf(%rip), %rsi      # 0x5643
callq 0x11a0
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
callq 0x11d0
movl %eax, 0x67ae(%rip)      # 0x8130
movq 0x666f(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movl 0x679e(%rip), %edx      # 0x8130
leaq 0x37a8(%rip), %rsi      # 0x5141
movb $0x0, %al
callq 0x1110
movl 0x678e(%rip), %eax      # 0x8134
cmpl 0x6784(%rip), %eax      # 0x8130
jge 0x19cc
movl 0x677c(%rip), %esi      # 0x8130
leaq 0x3718(%rip), %rdi      # 0x50d3
movb $0x0, %al
callq 0x19f0
movl $0xffffffff, 0x6764(%rip) # imm = 0xFFFFFFFF
jmp 0x19e7
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1160
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3900
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/AtifChy[P]st/x.c
// Function: reload
void
reload(int sig)
{
	config_init();

	/* colors, fonts */
	xloadcols();
	xunloadfonts();
	usedfont = (opt_font == NULL)? font : opt_font;
	xloadfonts(usedfont, 0);

	/* pretend the window just got resized */
	cresize(win.w, win.h);

	redraw();

	/* triggers re-render if we're visible. */
	ttywrite("\033[O", 3, 1);

	signal(SIGUSR1, reload);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
callq 0xf9f0
callq 0xdc20
callq 0xfa80
cmpq $0x0, 0x13e16(%rip)     # 0x23788
jne 0xf981
movq 0xaecd(%rip), %rax      # 0x1a848
movq %rax, -0x10(%rbp)
jmp 0xf98c
movq 0x13e00(%rip), %rax     # 0x23788
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x13df9(%rip)     # 0x23790
movq 0x13df2(%rip), %rdi     # 0x23790
xorps %xmm0, %xmm0
callq 0xfb10
movl 0x13d9c(%rip), %edi     # 0x23748
movl 0x13d9a(%rip), %esi     # 0x2374c
callq 0xfe20
callq 0x9b90
leaq 0x6624(%rip), %rdi      # 0x15fe7
movl $0x3, %esi
movl $0x1, %edx
callq 0x8270
movl $0xa, %edi
leaq -0x8e(%rip), %rsi       # 0xf950
callq 0x6070
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/AtifChy[P]st/x.c
// Function: config_init
void
config_init(void)
{
	char *resm;
	XrmDatabase db;
	ResourcePref *p;

	XrmInitialize();
	resm = XResourceManagerString(XOpenDisplay(NULL));
	if (!resm)
		return;

	db = XrmGetStringDatabase(resm);
	for (p = resources; p < resources + LEN(resources); p++)
		resource_load(db, p->name, p->type, p->dst);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x65e0
xorl %eax, %eax
movl %eax, %edi
callq 0x6310
movq %rax, %rdi
callq 0x6190
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xfa1b
jmp 0xfa73
movq -0x8(%rbp), %rdi
callq 0x6760
movq %rax, -0x10(%rbp)
leaq 0xb671(%rip), %rax      # 0x1b0a0
movq %rax, -0x18(%rbp)
leaq 0xb666(%rip), %rax      # 0x1b0a0
addq $0x2e8, %rax            # imm = 0x2E8
cmpq %rax, -0x18(%rbp)
jae 0xfa73
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0xf780
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
jmp 0xfa33
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/AtifChy[P]st/x.c
// Function: opencopied
void
opencopied(const Arg *arg)
{
	const size_t max_cmd = 2048;
	const char *clip = xsel.clipboard;
	if(!clip) {
		fprintf(stderr, "Warning: nothing copied to clipboard\n");
		return;
	}

	/* account for space/quote (3) and \0 (1) and & (1) */
	char cmd[max_cmd + strlen(clip) + 5];
	strncpy(cmd, (char *)arg->v, max_cmd);
	cmd[max_cmd] = '\0';

	strcat(cmd, " \"");
	strcat(cmd, clip);
	strcat(cmd, "\"");
	strcat(cmd, "&");

	system(cmd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x800, -0x10(%rbp)     # imm = 0x800
movq 0x120a5(%rip), %rax     # 0x237d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x11753
movq 0x88b3(%rip), %rax      # 0x19ff0
movq (%rax), %rdi
leaq 0x48c2(%rip), %rsi      # 0x16009
movb $0x0, %al
callq 0x6990
jmp 0x117f0
movq -0x18(%rbp), %rdi
callq 0x63b0
movq %rax, %rcx
movq %rcx, %rax
addq $0x805, %rax            # imm = 0x805
movq %rsp, %rdx
movq %rdx, -0x20(%rbp)
addq $0x814, %rcx            # imm = 0x814
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x30(%rbp)
movq %rdi, %rsp
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x800, %edx            # imm = 0x800
callq 0x6860
movq -0x30(%rbp), %rdi
movb $0x0, 0x800(%rdi)
leaq 0x4881(%rip), %rsi      # 0x1602f
callq 0x6500
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6500
movq -0x30(%rbp), %rdi
leaq 0x4865(%rip), %rsi      # 0x16030
callq 0x6500
movq -0x30(%rbp), %rdi
leaq 0x4857(%rip), %rsi      # 0x16032
callq 0x6500
movq -0x30(%rbp), %rdi
callq 0x6240
movq -0x20(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AtifChy[P]st/x.c
// Function: cmessage
void
cmessage(XEvent *e)
{
	/*
	 * See xembed specs
	 *  http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
	 */
	if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) {
		if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) {
			win.mode |= MODE_FOCUSED;
			xseturgency(0);
		} else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) {
			win.mode &= ~MODE_FOCUSED;
		}
	} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
		ttyhangup();
		exit(0);
	} else if (strcmp(XGetAtomName(xw.dpy, e->xclient.message_type), "ReloadColors") == 0) {
		config_init();
		xloadcols();
		cresize(win.w, win.h);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpq 0x1063d(%rip), %rax     # 0x23668
jne 0x13078
movq -0x8(%rbp), %rax
cmpl $0x20, 0x30(%rax)
jne 0x13078
movq -0x8(%rbp), %rax
cmpq $0x4, 0x40(%rax)
jne 0x1305a
movl 0x10718(%rip), %eax     # 0x23760
orl $0x2, %eax
movl %eax, 0x1070f(%rip)     # 0x23760
xorl %edi, %edi
callq 0xf700
jmp 0x13076
movq -0x8(%rbp), %rax
cmpq $0x5, 0x40(%rax)
jne 0x13074
movl 0x106f5(%rip), %eax     # 0x23760
andl $-0x3, %eax
movl %eax, 0x106ec(%rip)     # 0x23760
jmp 0x13076
jmp 0x130dc
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
cmpq 0x105e9(%rip), %rax     # 0x23670
jne 0x13095
callq 0x87a0
xorl %edi, %edi
callq 0x61a0
movq 0x105a4(%rip), %rdi     # 0x23640
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x66e0
movq %rax, %rdi
leaq 0x376d(%rip), %rsi      # 0x16820
callq 0x6700
cmpl $0x0, %eax
jne 0x130d8
callq 0xf9f0
callq 0xdc20
movl 0x1067b(%rip), %edi     # 0x23748
movl 0x10679(%rip), %esi     # 0x2374c
callq 0xfe20
jmp 0x130da
jmp 0x130dc
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/accre[P]Cprogramming/variable_types.c
// Function: main
int main()
{
   int i; // declare an integer 
   int j = 12; // declare and initialize an integer
   const int k = 345; // declare and initialize a constant integer
   unsigned int l = 6789; // declare and initialize an unsigned integer

   char myletter; // declare a character called "myletter"

   float x = 1.23; // declare and initialize a single-precision floating point number
   double y = 45.6789; // declare and initialize a double-precision floating point number

   // arrays are contiguous in memory and can be
   // accessed like so: myarray[0], myarray[1], ...
   // Note that the first index is always 0 in C!
   int myarray[5] = { 2, 4, 6, 8, 10 }; // declare and initialize a 5-element integer array
   float farray[100]; // declare a 100-element array of single-precision floating point numbers

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
movl $0xc, -0xc(%rbp)
movl $0x159, -0x10(%rbp)     # imm = 0x159
movl $0x1a85, -0x14(%rbp)    # imm = 0x1A85
movss 0xeb1(%rip), %xmm0      # 0x2010
movss %xmm0, -0x1c(%rbp)
movsd 0xe9c(%rip), %xmm0      # 0x2008
movsd %xmm0, -0x28(%rbp)
movq 0xea8(%rip), %rax       # 0x2020
movq %rax, -0x40(%rbp)
movq 0xea5(%rip), %rax       # 0x2028
movq %rax, -0x38(%rbp)
movl 0xea3(%rip), %eax       # 0x2030
movl %eax, -0x30(%rbp)
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/antonblanchard[P]will-it-scale/tests/open1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char *tmpfile = tmpfiles[nr];

	while (1) {
		int fd = open(tmpfile, O_RDWR);
		assert(fd >= 0);
		close(fd);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xb069(%rip), %rax      # 0xd1b0
imulq $0x18, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x1220
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x216e
jmp 0x218d
leaq 0x1150(%rip), %rdi      # 0x32c5
leaq 0x10fe(%rip), %rsi      # 0x327a
movl $0x27, %edx
leaq 0x1145(%rip), %rcx      # 0x32cd
callq 0x1130
movl -0x1c(%rbp), %edi
callq 0x1160
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x2153
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: main
int main(int argc, char **argv)
{
	poly_t p;
	int r = 0;

	if (argc < 3) {
		usage(argv[0]);
		return 1;
	}

	if (!strcasecmp(argv[1], "search"))
		return poly_search(atoi(argv[2]));

	if (parse_poly(argv[1], &p) < 0)
		return -1;

	if (gf_init(p) < 0)
		return -1;

	if (!strcasecmp(argv[2], "exp")) {
		gf_dump(gf_exp);
	} else if (!strcasecmp(argv[2], "log")) {
		gf_dump(gf_log);
	} else if (!strcasecmp(argv[2], "bch")) {
		poly_t gen;

		if (argc < 4) {
			usage(argv[0]);
			return 1;
		}

		if (bch_generator(atoi(argv[3]), &gen) < 0)
			r = -1;
	} else {
		fprintf(stderr, "unknown operation: %s\n", argv[2]);
		r = -1;
	}

	gf_exit();
	return r;
}

// Assembly:
subq $0x28, %rsp
movl $0x0, 0x24(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x3, 0x20(%rsp)
jge 0x11fe
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x1370
movl $0x1, 0x24(%rsp)
jmp 0x1367
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0xdf6(%rip), %rsi       # 0x2004
callq 0x1040
cmpl $0x0, %eax
jne 0x1236
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x10b0
movl %eax, %edi
callq 0x13a0
movl %eax, 0x24(%rsp)
jmp 0x1367
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1420
cmpl $0x0, %eax
jge 0x125b
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x1367
movq 0x10(%rsp), %rdi
callq 0x1580
cmpl $0x0, %eax
jge 0x1277
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x1367
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xd84(%rip), %rsi       # 0x200b
callq 0x1040
cmpl $0x0, %eax
jne 0x12a2
movq 0x2de0(%rip), %rdi      # 0x4078
callq 0x16e0
jmp 0x135a
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xd5d(%rip), %rsi       # 0x200f
callq 0x1040
cmpl $0x0, %eax
jne 0x12cd
movq 0x2dbd(%rip), %rdi      # 0x4080
callq 0x16e0
jmp 0x1358
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xd36(%rip), %rsi       # 0x2013
callq 0x1040
cmpl $0x0, %eax
jne 0x132d
cmpl $0x4, 0x20(%rsp)
jge 0x1305
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x1370
movl $0x1, 0x24(%rsp)
jmp 0x1367
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x10b0
movq %rsp, %rsi
movzwl %ax, %edi
callq 0x17e0
cmpl $0x0, %eax
jge 0x132b
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1356
movq 0x2cc4(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdx
leaq 0xcd0(%rip), %rsi       # 0x2017
movb $0x0, %al
callq 0x1080
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1358
jmp 0x135a
callq 0x1a10
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: poly_search
static int poly_search(int degree)
{
	poly_t i;

	for (i = 1 << degree; (i >> degree) <= 1; i++)
		if (is_primitive(i)) {
			print_poly('x', i);
			printf("\n");
		}

	return 0;
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
shrq %cl, %rax
cmpq $0x1, %rax
ja 0x140a
movq 0x8(%rsp), %rdi
callq 0x1a20
cmpl $0x0, %eax
je 0x13f8
movq 0x8(%rsp), %rsi
movl $0x78, %edi
callq 0x1b10
leaq 0xd58(%rip), %rdi       # 0x2149
movb $0x0, %al
callq 0x1050
jmp 0x13fa
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x13ba
xorl %eax, %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: parse_poly
static int parse_poly(const char *text, poly_t *out)
{
	poly_t r = 0;

	while ((*text == '0') || (*text == 'x'))
		text++;

	while (*text) {
		char c = *(text++);

		r <<= 4;
		if ((c >= '0') && (c <= '9')) {
			r |= (c - '0');
		} else if ((c >= 'A') && (c <= 'F')) {
			r |= (c - 'A' + 10);
		} else if ((c >= 'a') && (c <= 'f')) {
			r |= (c - 'a' + 10);
		} else {
			fprintf(stderr, "parse_poly: invalid character: %s\n",
				text);
			return -1;
		}
	}

	*out = r;
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x30, %ecx
movb %al, 0x6(%rsp)
je 0x145c
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
sete %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x1466
jmp 0x1476
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x1437
jmp 0x1478
movq 0x18(%rsp), %rax
cmpb $0x0, (%rax)
je 0x1562
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb (%rax), %al
movb %al, 0x7(%rsp)
movq 0x8(%rsp), %rax
shlq $0x4, %rax
movq %rax, 0x8(%rsp)
movsbl 0x7(%rsp), %eax
cmpl $0x30, %eax
jl 0x14d8
movsbl 0x7(%rsp), %eax
cmpl $0x39, %eax
jg 0x14d8
movsbl 0x7(%rsp), %eax
subl $0x30, %eax
cltq
orq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x155d
movsbl 0x7(%rsp), %eax
cmpl $0x41, %eax
jl 0x1505
movsbl 0x7(%rsp), %eax
cmpl $0x46, %eax
jg 0x1505
movsbl 0x7(%rsp), %eax
subl $0x41, %eax
addl $0xa, %eax
cltq
orq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x155b
movsbl 0x7(%rsp), %eax
cmpl $0x61, %eax
jl 0x1532
movsbl 0x7(%rsp), %eax
cmpl $0x66, %eax
jg 0x1532
movsbl 0x7(%rsp), %eax
subl $0x61, %eax
addl $0xa, %eax
cltq
orq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x1559
movq 0x2abf(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rdx
leaq 0xc24(%rip), %rsi       # 0x216c
movb $0x0, %al
callq 0x1080
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x1577
jmp 0x155b
jmp 0x155d
jmp 0x1478
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: gf_init
static int gf_init(poly_t generator)
{
	const int deg = degree(generator);
	const int tab_size = 1 << deg;
	poly_t a = 1;
	int i;

	if (deg > sizeof(gf_elem_t) * 8) {
		fprintf(stderr, "gf_init: generator degree out of bounds\n");
		return -1;
	}

	gf_order = tab_size - 1;
	gf_degree = deg;

	gf_exp = malloc(tab_size * 2 * sizeof(gf_exp[0]));
	if (!gf_exp) {
		perror("gf_init: malloc");
		return -1;
	}

	gf_log = gf_exp + tab_size;

	for (i = 0; i < tab_size; i++) {
		gf_exp[i] = a;
		gf_log[a] = i;

		a <<= 1;
		if (a >> deg)
			a ^= generator;
	}

	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1c00
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x10(%rsp)
movq $0x1, 0x8(%rsp)
movslq 0x14(%rsp), %rax
cmpq $0x10, %rax
jbe 0x15df
movq 0x2a37(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xbc4(%rip), %rsi       # 0x218f
movb $0x0, %al
callq 0x1080
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x16d2
movl 0x10(%rsp), %eax
subl $0x1, %eax
movw %ax, 0x2a9b(%rip)       # 0x4088
movl 0x14(%rsp), %eax
movw %ax, 0x2a92(%rip)       # 0x408a
movl 0x10(%rsp), %eax
shll %eax
movslq %eax, %rdi
shlq %rdi
callq 0x1090
movq %rax, 0x2a68(%rip)      # 0x4078
cmpq $0x0, 0x2a60(%rip)      # 0x4078
jne 0x1633
leaq 0xb97(%rip), %rdi       # 0x21b8
callq 0x10a0
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x16d2
movq 0x2a3e(%rip), %rax      # 0x4078
movslq 0x10(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, 0x2a34(%rip)      # 0x4080
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x10(%rsp), %eax
jge 0x16ca
movq 0x8(%rsp), %rax
movw %ax, %dx
movq 0x2a0b(%rip), %rax      # 0x4078
movslq 0x4(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl 0x4(%rsp), %eax
movw %ax, %dx
movq 0x29fc(%rip), %rax      # 0x4080
movq 0x8(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movq 0x8(%rsp), %rax
shlq %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
shrq %cl, %rax
cmpq $0x0, %rax
je 0x16bb
movq 0x18(%rsp), %rax
xorq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x16bd
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x1654
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: gf_dump
static void gf_dump(const gf_elem_t *tab)
{
	const int tab_size = 1 << gf_degree;
	const int digits = (gf_degree + 3) >> 2;
	const int per_line = 72 / (digits + 5);
	char fmt[16];
	int i;

	snprintf(fmt, sizeof(fmt), "0x%%0%dx,", digits);

	for (i = 0; i < tab_size; i++) {
		if (i % per_line)
			printf(" ");

		printf(fmt, tab[i]);

		if (!((i + 1) % per_line))
			printf("\n");
	}

	if (i % per_line)
		printf("\n");
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movzwl 0x299a(%rip), %ecx      # 0x408a
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x2c(%rsp)
movzwl 0x2988(%rip), %eax      # 0x408a
addl $0x3, %eax
sarl $0x2, %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %ecx
addl $0x5, %ecx
movl $0x48, %eax
cltd
idivl %ecx
movl %eax, 0x24(%rsp)
leaq 0x10(%rsp), %rdi
movl 0x28(%rsp), %ecx
movl $0x10, %esi
leaq 0xa94(%rip), %rdx       # 0x21c8
movb $0x0, %al
callq 0x1060
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x17b1
movl 0xc(%rsp), %eax
cltd
idivl 0x24(%rsp)
cmpl $0x0, %edx
je 0x1769
leaq 0x9fd(%rip), %rdi       # 0x215f
movb $0x0, %al
callq 0x1050
leaq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rax
movslq 0xc(%rsp), %rcx
movzwl (%rax,%rcx,2), %esi
movb $0x0, %al
callq 0x1050
movl 0xc(%rsp), %eax
addl $0x1, %eax
cltd
idivl 0x24(%rsp)
cmpl $0x0, %edx
jne 0x17a2
leaq 0x9ae(%rip), %rdi       # 0x2149
movb $0x0, %al
callq 0x1050
jmp 0x17a4
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1743
movl 0xc(%rsp), %eax
cltd
idivl 0x24(%rsp)
cmpl $0x0, %edx
je 0x17cd
leaq 0x983(%rip), %rdi       # 0x2149
movb $0x0, %al
callq 0x1050
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: is_primitive
static int is_primitive(poly_t p)
{
	const int d = degree(p);
	const int max_order = (1 << d) - 1;
	poly_t r = 1;
	poly_t start;
	int i;

	/* Choose a starting element */
	for (i = 0; i < max_order; i++) {
		r <<= 1;
		if (r >> d)
			r ^= p;
	}

	/* Keep going until we hit the same element again */
	start = r;
	i = 0;
	do {
		r <<= 1;
		if (r >> d)
			r ^= p;
		i++;
	} while (r != start);

	return i == max_order;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x1c00
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, 0x18(%rsp)
movq $0x1, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x18(%rsp), %eax
jge 0x1aa1
movq 0x10(%rsp), %rax
shlq %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x1c(%rsp), %ecx
shrq %cl, %rax
cmpq $0x0, %rax
je 0x1a92
movq 0x20(%rsp), %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x1a94
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x1a5a
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rax
shlq %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x1c(%rsp), %ecx
shrq %cl, %rax
cmpq $0x0, %rax
je 0x1ae1
movq 0x20(%rsp), %rax
xorq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x1ab3
movl 0x4(%rsp), %eax
cmpl 0x18(%rsp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: print_poly
static void print_poly(char var, poly_t p)
{
	int have_term = 0;
	int i;

	printf("0x%lx [0x%lx] -> ", p, reciprocal(p));

	for (i = MAX_DEGREE; i >= 0; i--) {
		if (!((p >> i) & 1))
			continue;

		if (have_term)
			printf(" + ");

		if (!i)
			printf("1");
		else if (i == 1)
			printf("%c", var);
		else
			printf("%c^%d", var, i);

		have_term = 1;
	}
}

// Assembly:
subq $0x28, %rsp
movb %dil, %al
movb %al, 0x27(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1c40
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x600(%rip), %rdi       # 0x214b
movb $0x0, %al
callq 0x1050
movl $0x3f, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jl 0x1bf6
movq 0x18(%rsp), %rax
movl 0x10(%rsp), %ecx
shrq %cl, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1b7d
jmp 0x1be6
cmpl $0x0, 0x14(%rsp)
je 0x1b92
leaq 0x5d2(%rip), %rdi       # 0x215d
movb $0x0, %al
callq 0x1050
cmpl $0x0, 0x10(%rsp)
jne 0x1ba9
leaq 0x5c1(%rip), %rdi       # 0x2161
movb $0x0, %al
callq 0x1050
jmp 0x1bde
cmpl $0x1, 0x10(%rsp)
jne 0x1bc5
movsbl 0x27(%rsp), %esi
leaq 0x5a7(%rip), %rdi       # 0x2163
movb $0x0, %al
callq 0x1050
jmp 0x1bdc
movsbl 0x27(%rsp), %esi
movl 0x10(%rsp), %edx
leaq 0x591(%rip), %rdi       # 0x2166
movb $0x0, %al
callq 0x1050
jmp 0x1bde
movl $0x1, 0x14(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1b5a
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: degree
static int degree(poly_t p)
{
	int d = 0;

	while (p > 1) {
		p >>= 1;
		d++;
	}

	return d;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0xc(%rsp)
cmpq $0x1, -0x8(%rsp)
jbe 0x1c2f
movq -0x8(%rsp), %rax
shrq %rax
movq %rax, -0x8(%rsp)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x1c0d
movl -0xc(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: reciprocal
static poly_t reciprocal(poly_t p)
{
	poly_t r = 0;

	while (p) {
		r <<= 1;
		r |= (p & 1);
		p >>= 1;
	}

	return r;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq $0x0, -0x10(%rsp)
cmpq $0x0, -0x8(%rsp)
je 0x1c85
movq -0x10(%rsp), %rax
shlq %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
andq $0x1, %rax
orq -0x10(%rsp), %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
shrq %rax
movq %rax, -0x8(%rsp)
jmp 0x1c4e
movq -0x10(%rsp), %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: minimal
static gf_elem_t minimal(gf_elem_t x)
{
	poly_t i;

	for (i = 1; (i >> gf_degree) <= 1; i++)
		if (!eval_poly(i, x))
			break;

	return i;
}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0x16(%rsp)
movq $0x1, 0x8(%rsp)
movq 0x8(%rsp), %rax
movzwl 0x23b9(%rip), %ecx      # 0x408a
movl %ecx, %ecx
shrq %cl, %rax
cmpq $0x1, %rax
ja 0x1d05
movq 0x8(%rsp), %rdi
movzwl 0x16(%rsp), %esi
callq 0x1e10
cmpw $0x0, %ax
jne 0x1cf3
jmp 0x1d05
jmp 0x1cf5
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x1cc5
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: mul_poly
static poly_t mul_poly(poly_t a, poly_t b)
{
	poly_t r = 0;

	while (a) {
		if (a & 1)
			r ^= b;

		a >>= 1;
		b <<= 1;
	}

	return r;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $0x0, -0x18(%rsp)
cmpq $0x0, -0x8(%rsp)
je 0x1db5
movq -0x8(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1d99
movq -0x10(%rsp), %rax
xorq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
shrq %rax
movq %rax, -0x8(%rsp)
movq -0x10(%rsp), %rax
shlq %rax
movq %rax, -0x10(%rsp)
jmp 0x1d73
movq -0x18(%rsp), %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/tools/gftool.c
// Function: eval_poly
static gf_elem_t eval_poly(poly_t p, gf_elem_t x)
{
	const gf_elem_t log_x = gf_log[x];
	gf_elem_t r = 0;
	gf_elem_t log_t = 1;

	p = reciprocal(p);

	while (p) {
		if (p & 1)
			r ^= gf_exp[log_t];

		p >>= 1;
		log_t = mod_s(log_t + log_x);
	}

	return r;
}

// Assembly:
subq $0x18, %rsp
movw %si, %ax
movq %rdi, 0x10(%rsp)
movw %ax, 0xe(%rsp)
movq 0x2258(%rip), %rax      # 0x4080
movzwl 0xe(%rsp), %ecx
movw (%rax,%rcx,2), %ax
movw %ax, 0xc(%rsp)
movw $0x0, 0xa(%rsp)
movw $0x1, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x1c40
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x1eae
movq 0x10(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1e86
movq 0x2207(%rip), %rax      # 0x4078
movzwl 0x8(%rsp), %ecx
movzwl (%rax,%rcx,2), %ecx
movzwl 0xa(%rsp), %eax
xorl %ecx, %eax
movw %ax, 0xa(%rsp)
movq 0x10(%rsp), %rax
shrq %rax
movq %rax, 0x10(%rsp)
movzwl 0x8(%rsp), %eax
movzwl 0xc(%rsp), %ecx
addl %ecx, %eax
movzwl %ax, %edi
callq 0x1ec0
movw %ax, 0x8(%rsp)
jmp 0x1e53
movw 0xa(%rsp), %ax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: cpu_frame
void cpu_frame(void){

	while(regs.sp != h.sp || regs.pc){
		cpu_step();
	}

	debug_separator();

	regs.pc = h.play_addr;
	mem[regs.sp-1] = mem[regs.sp-2] = 0;
	regs.sp -= 2;

	ui_redraw(&h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
jmp 0x570a
movzwl 0x11187(%rip), %ecx     # 0x16898
movzwl 0x11190(%rip), %edx     # 0x168a8
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x1(%rbp)
jne 0x5731
movzwl 0x11172(%rip), %eax     # 0x1689a
cmpl $0x0, %eax
setne %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
testb $0x1, %al
jne 0x573a
jmp 0x5741
callq 0x57b0
jmp 0x570a
callq 0xac90
movw 0x11159(%rip), %ax      # 0x168a6
movw %ax, 0x11146(%rip)      # 0x1689a
movq 0x111b5(%rip), %rax     # 0x16910
movzwl 0x11136(%rip), %ecx     # 0x16898
subl $0x2, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq 0x1119d(%rip), %rax     # 0x16910
movzwl 0x1111e(%rip), %ecx     # 0x16898
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movzwl 0x1110d(%rip), %eax     # 0x16898
subl $0x2, %eax
movw %ax, 0x11103(%rip)      # 0x16898
leaq 0x11100(%rip), %rdi     # 0x1689c
callq 0xdb10
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: usage
static void usage(const char* argv0, FILE* out){
	fprintf(out,
			"Usage: %s [-dhmqswt] file [song index]\n\n"
			"  -h, Output this info to stdout.\n\n"
			"  -d, Debug mode   : Dump a cpu trace to stdout, implies -q.\n"
			"  -m, Mono mode    : Disable colors.\n"
			"  -q, Quiet mode   : Disable UI.\n"
			"  -s, Subdued mode : Don't flash/embolden changed registers.\n\n"
			"  -w <file>, Write .wav to specified file instead of usual behaviour.\n"
			"  -t <secs>, Number of seconds of audio to write (default 120).\n\n",
			argv0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x6d08(%rip), %rsi      # 0x10807
movb $0x0, %al
callq 0x5580
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: config_read
static void config_read(void){
	FILE* f = config_open("r");
	if(!f) return;

	char cmd[16], rest[32];
	while(fscanf(f, "%15s %31[^\n]", cmd, rest) == 2){
		if(strcmp(cmd, "volume") == 0){
			int v = MAX(0, MIN(100, atoi(rest)));
			cfg.volume = v / 100.0f;
			if(v != 100){
				ui_msg_set("Volume: %d%%\n", v);
			}
		}
	}
	fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
leaq 0x7440(%rip), %rdi      # 0x10f5f
callq 0xa050
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9b34
jmp 0x9c10
jmp 0x9b36
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq 0x6e52(%rip), %rsi      # 0x1099b
movb $0x0, %al
callq 0x50f0
cmpl $0x2, %eax
jne 0x9c07
leaq -0x20(%rbp), %rdi
leaq 0x6e44(%rip), %rsi      # 0x109a8
callq 0x5460
cmpl $0x0, %eax
jne 0x9c02
movl $0x0, -0x48(%rbp)
movl $0x64, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x53a0
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x54(%rbp), %eax
jg 0x9b9c
movl -0x50(%rbp), %eax
movl %eax, -0x60(%rbp)
jmp 0x9ba2
movl -0x54(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jle 0x9bbe
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x9bc4
movl -0x4c(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x44(%rbp)
cvtsi2ssl -0x44(%rbp), %xmm0
movss 0x6433(%rip), %xmm1     # 0x10010
divss %xmm1, %xmm0
movss %xmm0, 0xcd4b(%rip)     # 0x16934
cmpl $0x64, -0x44(%rbp)
je 0x9c00
movl -0x44(%rbp), %esi
leaq 0x6b42(%rip), %rdi      # 0x1073b
movb $0x0, %al
callq 0xd6e0
jmp 0x9c02
jmp 0x9b36
movq -0x8(%rbp), %rdi
callq 0x54c0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: fd_clear
static void fd_clear(int fd){
	uint64_t blah;
	ssize_t ret;

	do {
		ret = read(fd, &blah, 8);
	} while(ret == -1 && errno == EAGAIN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x5190
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $-0x1, -0x18(%rbp)
movb %al, -0x19(%rbp)
jne 0x9e1a
callq 0x5410
cmpl $0xb, (%rax)
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x9deb
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: config_write
static void config_write(void){
	FILE* f = config_open("w");
	if(!f) return;
	fprintf(f, "volume %d\n", (int)roundf(cfg.volume * 100.0f));
	fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x8222(%rip), %rdi      # 0x12061
callq 0xa050
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9e51
jmp 0x9e8d
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movss 0x61af(%rip), %xmm0     # 0x10010
mulss 0xcacb(%rip), %xmm0     # 0x16934
callq 0x50d0
movq -0x10(%rbp), %rdi
cvttss2si %xmm0, %edx
leaq 0x6bee(%rip), %rsi      # 0x10a6b
movb $0x0, %al
callq 0x5580
movq -0x8(%rbp), %rdi
callq 0x54c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: config_open
static FILE* config_open(const char* mode){
	const int flags = WRDE_NOCMD | WRDE_UNDEF | WRDE_APPEND;
	wordexp_t w = {};

	wordexp("$XDG_CONFIG_DIR/minigbsrc", &w, flags);
	wordexp("~/.config/minigbsrc"      , &w, flags);

	FILE* config = w.we_wordc > 0 ? fopen(w.we_wordv[0], mode) : NULL;
	wordfree(&w);
	return config;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x26, -0xc(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x5080
leaq 0x6935(%rip), %rdi      # 0x109af
leaq -0x28(%rbp), %rsi
movl $0x26, %edx
callq 0x5300
leaq 0x693a(%rip), %rdi      # 0x109c9
leaq -0x28(%rbp), %rsi
movl $0x26, %edx
callq 0x5300
cmpq $0x0, -0x28(%rbp)
jbe 0xa0ba
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x51c0
movq %rax, -0x38(%rbp)
jmp 0xa0c2
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0xa0c2
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5520
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/minigbs.c
// Function: bank_switch
static void bank_switch(uint8_t which){
	debug_msg("Bank switching to %d.", which);

	if (which == 0){
		which = 1;
	}

	if(which < 32 && banks[which]){
		memcpy(mem + 0x4000, banks[which], 0x4000);
		debug_msg("Bank switch success.");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %esi
leaq 0x6947(%rip), %rdi      # 0x10a40
movb $0x0, %al
callq 0xacd0
movzbl -0x1(%rbp), %eax
cmpl $0x0, %eax
jne 0xa10d
movb $0x1, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x20, %eax
jge 0xa161
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
leaq 0xc82d(%rip), %rax      # 0x16950
cmpq $0x0, (%rax,%rcx,8)
je 0xa161
movq 0xc7df(%rip), %rdi      # 0x16910
addq $0x4000, %rdi           # imm = 0x4000
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
leaq 0xc80b(%rip), %rax      # 0x16950
movq (%rax,%rcx,8), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x55c0
leaq 0x68fc(%rip), %rdi      # 0x10a56
movb $0x0, %al
callq 0xacd0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/debug.c
// Function: debug_is_jump
static bool debug_is_jump(uint8_t op){
	const char* str = opcodes[op];
	return strncmp(str, "call", 4) == 0
		|| strncmp(str, "jr", 2) == 0
		|| strncmp(str, "jp", 2) == 0
		|| strncmp(str, "rst", 3) == 0
		|| strncmp(str, "ret", 3) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
leaq 0xb445(%rip), %rax      # 0x15dd0
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x65bb(%rip), %rsi      # 0x10f59
movl $0x4, %edx
callq 0x51a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0xaa39
movq -0x10(%rbp), %rdi
leaq 0x659b(%rip), %rsi      # 0x10f5e
movl $0x2, %edx
callq 0x51a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0xaa39
movq -0x10(%rbp), %rdi
leaq 0x657d(%rip), %rsi      # 0x10f61
movl $0x2, %edx
callq 0x51a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0xaa39
movq -0x10(%rbp), %rdi
leaq 0x655f(%rip), %rsi      # 0x10f64
movl $0x3, %edx
callq 0x51a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0xaa39
movq -0x10(%rbp), %rdi
leaq 0x6542(%rip), %rsi      # 0x10f68
movl $0x3, %edx
callq 0x51a0
cmpl $0x0, %eax
sete %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/debug.c
// Function: debug_print_colour_reg_16
static void debug_print_colour_reg_16(uint32_t mask, void* regs, off_t offset){
	uint16_t a = ((uint16_t*)regs)[offset/2];
	uint16_t b = ((uint16_t*)&prev_regs)[offset/2];

	int name_colour
		= (mask & reg_by_offset[offset].mask)
		? colours[DBG_COLOUR_ACTIVE]
		: colours[DBG_COLOUR_PLAIN]
		;

	int val_colour
		= a == b
		? name_colour
		: colours[DBG_COLOUR_CHANGED]
		;

	printf("\e[%dm%s\e[0m:\e[%dm%04x\e[0m ",
		   name_colour,
		   reg_by_offset[offset].name,
		   val_colour,
		   a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rbp), %rax
movw (%rax,%rcx,2), %ax
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
leaq 0xbfb2(%rip), %rax      # 0x16a52
movw (%rax,%rcx,2), %ax
movw %ax, -0x1c(%rbp)
movl -0x4(%rbp), %eax
movq -0x18(%rbp), %rdx
leaq 0xbb1a(%rip), %rcx      # 0x165d0
shlq $0x4, %rdx
addq %rdx, %rcx
andl 0x8(%rcx), %eax
cmpl $0x0, %eax
je 0xaad0
movl 0xb249(%rip), %eax      # 0x15d14
movl %eax, -0x34(%rbp)
jmp 0xaad9
movl 0xb23a(%rip), %eax      # 0x15d10
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x20(%rbp)
movzwl -0x1a(%rbp), %eax
movzwl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jne 0xaaf3
movl -0x20(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0xaafc
movl 0xb21f(%rip), %eax      # 0x15d18
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %esi
movq -0x18(%rbp), %rcx
leaq 0xbac0(%rip), %rax      # 0x165d0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movl -0x24(%rbp), %ecx
movzwl -0x1a(%rbp), %r8d
leaq 0x6443(%rip), %rdi      # 0x10f6c
movb $0x0, %al
callq 0x5050
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/debug.c
// Function: debug_print_colour_reg
static void debug_print_colour_reg(uint32_t mask, void* regs, off_t offset){
	int val_colours[2];
	int name_colours[2];

	for(int i = 0; i < 2; ++i){
		uint8_t a = ((uint8_t*)regs)[offset+i];
		uint8_t b = ((uint8_t*)&prev_regs)[offset+i];

		name_colours[i]
			= (mask & reg_by_offset[offset+i].mask)
			? colours[DBG_COLOUR_ACTIVE]
			: colours[DBG_COLOUR_PLAIN]
			;

		val_colours[i]
			= a == b
			? name_colours[i]
			: colours[DBG_COLOUR_CHANGED]
			;
	}

	printf(
		"\e[%dm%s\e[%dm%s\e[0m:\e[%dm%02x\e[%dm%02x\e[0m ",
		name_colours[1],
		reg_by_offset[offset+1].name,
		name_colours[0],
		reg_by_offset[offset].name,
		val_colours[1],
		((uint8_t*)regs)[offset+1],
		val_colours[0],
		((uint8_t*)regs)[offset]
	);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x2, -0x2c(%rbp)
jge 0xac0f
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
addq %rdx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x2d(%rbp)
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rax
addq %rax, %rcx
leaq 0xbec7(%rip), %rax      # 0x16a52
movb (%rax,%rcx), %al
movb %al, -0x2e(%rbp)
movl -0x4(%rbp), %eax
movq -0x18(%rbp), %rdx
movslq -0x2c(%rbp), %rcx
addq %rcx, %rdx
leaq 0xba2a(%rip), %rcx      # 0x165d0
shlq $0x4, %rdx
addq %rdx, %rcx
andl 0x8(%rcx), %eax
cmpl $0x0, %eax
je 0xabc0
movl 0xb159(%rip), %eax      # 0x15d14
movl %eax, -0x34(%rbp)
jmp 0xabc9
movl 0xb14a(%rip), %eax      # 0x15d10
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movslq -0x2c(%rbp), %rax
movl %ecx, -0x28(%rbp,%rax,4)
movzbl -0x2d(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
cmpl %ecx, %eax
jne 0xabed
movslq -0x2c(%rbp), %rax
movl -0x28(%rbp,%rax,4), %eax
movl %eax, -0x38(%rbp)
jmp 0xabf6
movl 0xb125(%rip), %eax      # 0x15d18
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %ecx
movslq -0x2c(%rbp), %rax
movl %ecx, -0x20(%rbp,%rax,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xab5a
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
leaq 0xb9af(%rip), %rax      # 0x165d0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rdi
leaq 0xb997(%rip), %rax      # 0x165d0
shlq $0x4, %rdi
addq %rdi, %rax
movq (%rax), %r8
movl -0x1c(%rbp), %r9d
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdi
movzbl 0x1(%rax,%rdi), %r11d
movl -0x20(%rbp), %r10d
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdi
movzbl (%rax,%rdi), %eax
leaq 0x632a(%rip), %rdi      # 0x10f96
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x5050
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/debug.c
// Function: debug_separator
void debug_separator(void){
	if(!cfg.debug_mode)
		return;

	puts("---------------+-----------------------------------------+----------------+-----");

	// XXX: not obvious that the function will do this...
	prev_op = 0;
	prev_len = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbc7d(%rip), %rax      # 0x16918
cmpl $0x0, (%rax)
jne 0xaca2
jmp 0xacbf
leaq 0x61ef(%rip), %rdi      # 0x10e98
callq 0x5110
movb $0x0, 0xbd9b(%rip)      # 0x16a50
movl $0x0, 0xbda1(%rip)      # 0x16a60
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/debug.c
// Function: debug_msg
void debug_msg(const char* fmt, ...){
	if(!cfg.debug_mode)
		return;

	va_list va;
	va_start(va, fmt);

	char msg[39];
	vsnprintf(msg, sizeof(msg), fmt, va);

	if(cfg.debug_mode == 2){
		printf("     \e[0;35m* * *     \e[0m+ \e[0;35m%-39s\e[0m +                +\n", msg);
	} else {
		printf("     * * *     + %-39s +                +\n", msg);
	}

	va_end(va);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0xad0e
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
movq %r9, -0xd8(%rbp)
movq %r8, -0xe0(%rbp)
movq %rcx, -0xe8(%rbp)
movq %rdx, -0xf0(%rbp)
movq %rsi, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0xbbdc(%rip), %rax      # 0x16918
cmpl $0x0, (%rax)
jne 0xad43
jmp 0xadb3
leaq -0x20(%rbp), %rax
leaq -0x100(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
leaq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq -0x20(%rbp), %rcx
movl $0x27, %esi
callq 0x53f0
leaq 0xbb94(%rip), %rax      # 0x16918
cmpl $0x2, (%rax)
jne 0xad9d
leaq -0x50(%rbp), %rsi
leaq 0x6155(%rip), %rdi      # 0x10ee9
movb $0x0, %al
callq 0x5050
jmp 0xadaf
leaq -0x50(%rbp), %rsi
leaq 0x6182(%rip), %rdi      # 0x10f2a
movb $0x0, %al
callq 0x5050
leaq -0x20(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/audio.c
// Function: hipass
float hipass(struct chan* c, float sample){
#if 1
	float out = sample - c->capacitor;
	c->capacitor = sample - out * charge_factor;
	return out;
#else
	return sample;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
movq -0x8(%rbp), %rax
subss 0x58(%rax), %xmm0
movss %xmm0, -0x10(%rbp)
movss -0xc(%rbp), %xmm1
movss -0x10(%rbp), %xmm0
movss 0xbc7e(%rip), %xmm2     # 0x16a70
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x58(%rax)
movss -0x10(%rbp), %xmm0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/audio.c
// Function: chan_enable
void chan_enable(int i, bool enable){
	chans[i].enabled = enable;

	uint8_t val = (mem[0xFF26] & 0x80)
		| (chans[3].enabled << 3)
		| (chans[2].enabled << 2)
		| (chans[1].enabled << 1)
		| (chans[0].enabled << 0);

	mem[0xFF26] = val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movl %edi, -0x4(%rbp)
andb $0x1, %al
movb %al, -0x5(%rbp)
movb -0x5(%rbp), %cl
movslq -0x4(%rbp), %rdx
leaq 0xbb23(%rip), %rax      # 0x16a80
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
andb $0x1, %cl
movb %cl, (%rax)
leaq 0xb9a0(%rip), %rax      # 0x16910
movq (%rax), %rax
movzbl 0xff26(%rax), %eax
andl $0x80, %eax
movb 0xbc4b(%rip), %cl       # 0x16bd0
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x3, %ecx
orl %ecx, %eax
movb 0xbbca(%rip), %cl       # 0x16b60
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x2, %ecx
orl %ecx, %eax
movb 0xbb49(%rip), %cl       # 0x16af0
andb $0x1, %cl
movzbl %cl, %ecx
shll %ecx
orl %ecx, %eax
movb 0xbac9(%rip), %cl       # 0x16a80
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x0, %ecx
orl %ecx, %eax
movb %al, -0x6(%rbp)
movb -0x6(%rbp), %cl
leaq 0xb941(%rip), %rax      # 0x16910
movq (%rax), %rax
movb %cl, 0xff26(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/audio.c
// Function: update_env
void update_env(struct chan* c){
	c->env.counter += c->env.inc;

	while(c->env.counter > 1.0f){
		if(c->env.step){
			c->volume += c->env.up ? 1 : -1;
			if(c->volume == 0 || c->volume == 15){
				c->env.inc = 0;
			}
			c->volume = MAX(0, MIN(15, c->volume));
		}
		c->env.counter -= 1.0f;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movss 0x3c(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x38(%rax), %xmm0
movss %xmm0, 0x38(%rax)
movq -0x8(%rbp), %rax
movss 0x38(%rax), %xmm0
movss 0x4ff4(%rip), %xmm1     # 0x10004
ucomiss %xmm1, %xmm0
jbe 0xb0e7
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0xb0c8
movq -0x8(%rbp), %rax
movb 0x34(%rax), %dl
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %eax
testb $0x1, %dl
cmovnel %eax, %ecx
movq -0x8(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xb05c
movq -0x8(%rbp), %rax
cmpl $0xf, 0x4(%rax)
jne 0xb068
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x3c(%rax)
movl $0x0, -0xc(%rbp)
movl $0xf, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0xb090
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xb096
movl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0xb0b2
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0xb0b8
movl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movss 0x38(%rax), %xmm0
movss 0x4f2b(%rip), %xmm1     # 0x10004
subss %xmm1, %xmm0
movss %xmm0, 0x38(%rax)
jmp 0xafff
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/audio.c
// Function: update_len
void update_len(struct chan* c){
	if(c->len.enabled){
		c->len.counter += c->len.inc;
		if(c->len.counter > 1.0f){
			chan_enable(c - chans, 0);
			c->len.counter = 0.0f;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x24(%rax)
je 0xb162
movq -0x8(%rbp), %rax
movss 0x2c(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x28(%rax), %xmm0
movss %xmm0, 0x28(%rax)
movq -0x8(%rbp), %rax
movss 0x28(%rax), %xmm0
movss 0x4ed6(%rip), %xmm1     # 0x10004
ucomiss %xmm1, %xmm0
jbe 0xb160
movq -0x8(%rbp), %rax
leaq 0xb942(%rip), %rcx      # 0x16a80
subq %rcx, %rax
movl $0x70, %ecx
cqto
idivq %rcx
movl %eax, %edi
xorl %esi, %esi
callq 0xaf40
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x28(%rax)
jmp 0xb162
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)