LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: parse_bin
void parse_bin(char *hexstr, char *fmt, ...)
{
	va_list args;
	char *origstr;
	char *binstr;
	unsigned long width = 0;

	binstr = to_binstr(hexstr);
	origstr = binstr;

	va_start(args, fmt);

	while (binstr && fmt && *fmt != '\0') {
		if (isdigit(*fmt)) {
			char *rest;

			errno = 0;
			width = strtoul(fmt, &rest, 10);
			if (width == ULONG_MAX && errno != 0)
				fprintf(stderr, "strtoul()");
			fmt = rest;
		} else if (*fmt == 'u') {
			unsigned int *u = va_arg(args, unsigned int *);

			if (u)
				bin_to_unsigned(u, binstr, width);
			binstr += width;
			width = 0;
			fmt++;
		} else if (*fmt == 'r') {
			binstr += width;
			width = 0;
			fmt++;
		} else if (*fmt == 'a') {
			char *c = va_arg(args, char *);

			if (c)
				bin_to_ascii(c, binstr, width);
			binstr += width;
			width = 0;
			fmt++;
		} else {
			fmt++;
		}
	}

	va_end(args);
	free(origstr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x8b70
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 0x8913
movq %rax, %rbx
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x8cdb
leaq 0x18(%rsp), %r15
movq %rbx, %r13
xorl %ebp, %ebp
movsbq (%r14), %r12
testq %r12, %r12
je 0x8cdb
callq 0x3260
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r12,2)
jne 0x8c13
cmpb $0x61, %r12b
je 0x8c65
movzbl %r12b, %eax
cmpl $0x72, %eax
je 0x8cc5
cmpl $0x75, %eax
jne 0x8c7e
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x8ca5
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x8cb3
callq 0x3050
movq %rax, %r12
movl $0x0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x3200
movq %rax, %rbp
cmpq $-0x1, %rax
jne 0x8c5e
cmpl $0x0, (%r12)
je 0x8c5e
movq 0xe3a8(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
movl $0x1, %esi
leaq 0x9295(%rip), %rdx      # 0x11eec
xorl %eax, %eax
callq 0x3240
movq 0x18(%rsp), %r14
jmp 0x8ccd
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x8c83
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x8c91
incq %r14
jmp 0x8ccd
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8cc5
movq %r13, %rsi
movl %ebp, %edx
callq 0x8a41
jmp 0x8cc5
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8cc5
movq %r13, %rsi
movl %ebp, %edx
callq 0x89d6
addq %rbp, %r13
incq %r14
xorl %ebp, %ebp
testq %r13, %r13
je 0x8cdb
testq %r14, %r14
jne 0x8bb6
movq %rbx, %rdi
callq 0x3030
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: speed_class_name
char speed_class_name(unsigned char id)
{
	switch (id) {
	case 0x00: return '?';
	case 0x08: return 'A';
	case 0x0a: return 'B';
	case 0x0f: return 'C';
	case 0x14: return 'D';
	case 0x1e: return 'E';
	case 0x28: return 'F';
	case 0x32: return 'G';
	case 0x3c: return 'H';
	case 0x46: return 'J';
	case 0x50: return 'K';
	case 0x64: return 'M';
	case 0x78: return 'O';
	case 0x8c: return 'R';
	case 0xa0: return 'T';
	default: return '?';
	}
}

// Assembly:
movb $0x3f, %al
cmpl $0x3b, %edi
jg 0xaf2b
cmpl $0x13, %edi
jle 0xaf45
cmpl $0x27, %edi
jg 0xaf69
cmpl $0x14, %edi
je 0xaf89
cmpl $0x1e, %edi
jne 0xaf94
movb $0x45, %al
retq
cmpl $0x63, %edi
jle 0xaf57
cmpl $0x8b, %edi
jg 0xaf76
cmpl $0x64, %edi
je 0xaf8c
cmpl $0x78, %edi
jne 0xaf94
movb $0x4f, %al
retq
cmpl $0x8, %edi
je 0xaf95
cmpl $0xa, %edi
je 0xaf9b
cmpl $0xf, %edi
jne 0xaf94
movb $0x43, %al
retq
cmpl $0x3c, %edi
je 0xaf98
cmpl $0x46, %edi
je 0xaf9e
cmpl $0x50, %edi
jne 0xaf94
movb $0x4b, %al
retq
cmpl $0x28, %edi
je 0xaf8f
cmpl $0x32, %edi
jne 0xaf94
movb $0x47, %al
retq
cmpl $0x8c, %edi
je 0xaf92
cmpl $0xa0, %edi
jne 0xaf94
movb $0x54, %al
retq
movb $0x44, %al
retq
movb $0x4d, %al
retq
movb $0x46, %al
retq
movb $0x52, %al
retq
movb $0x41, %al
retq
movb $0x48, %al
retq
movb $0x42, %al
retq
movb $0x4a, %al
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: print_info
void print_info(struct config *config, char *type,
	char *cid, char *csd, char *scr, char *ext_csd)
{
	printf("type: '%s'\n", type);

	if (!strcmp(type, "SD") && cid)
		print_sd_cid(config, cid);
	else if (!strcmp(type, "MMC") && cid)
		print_mmc_cid(config, cid);

	if (!strcmp(type, "SD") && scr)
		print_sd_scr(config, scr);

	if (!strcmp(type, "MMC") && csd)
		print_mmc_csd(config, csd);
	else if (!strcmp(type, "SD") && csd)
		print_sd_csd(config, csd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8111(%rip), %rsi      # 0x13460
movl $0x1, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x31c0
cmpb $0x53, (%r15)
jne 0xb388
cmpb $0x44, 0x1(%r15)
jne 0xb388
testq %r13, %r13
setne %bpl
je 0xb38f
cmpb $0x0, 0x2(%r15)
jne 0xb38f
movq %r14, %rdi
movq %r13, %rsi
callq 0x8cf5
jmp 0xb3b2
testq %r13, %r13
setne %bpl
leaq 0x804f(%rip), %rsi      # 0x133e5
movq %r15, %rdi
callq 0x3150
testb %bpl, %bpl
je 0xb3b2
testl %eax, %eax
jne 0xb3b2
movq %r14, %rdi
movq %r13, %rsi
callq 0x8f54
cmpb $0x53, (%r15)
jne 0xb3d6
cmpb $0x44, 0x1(%r15)
jne 0xb3d6
testq %r12, %r12
je 0xb3d6
cmpb $0x0, 0x2(%r15)
jne 0xb3d6
movq %r14, %rdi
movq %r12, %rsi
callq 0xafe8
leaq 0x8008(%rip), %rsi      # 0x133e5
movq %r15, %rdi
callq 0x3150
testq %rbx, %rbx
je 0xb407
testl %eax, %eax
jne 0xb407
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa048
cmpb $0x53, (%r15)
jne 0xb439
cmpb $0x44, 0x1(%r15)
jne 0xb439
testq %rbx, %rbx
je 0xb439
cmpb $0x0, 0x2(%r15)
jne 0xb439
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x91e3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: lsmmc_main
int lsmmc_main(struct config *config, int argc, char **argv)
{
	int ret;

	memset(config, 0, sizeof(*config));
	config->mmc_ids = calloc(IDS_MAX, sizeof(char *));
	config->sd_ids = calloc(IDS_MAX, sizeof(char *));
	if (!config->mmc_ids || !config->sd_ids) {
		fprintf(stderr, "Could not allocate memory for lsmmc.\n");
		return -1;
	}

	ret = parse_opts(argc, argv, config);
	if (ret)
		return ret;

	return parse_ids(config);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x50(%rdi)
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0x3140
movq %rax, %r15
movq %rax, 0x20(%rbx)
movl $0x100, %edi            # imm = 0x100
movl $0x8, %esi
callq 0x3140
movq %rax, 0x28(%rbx)
testq %r15, %r15
setne %cl
testq %rax, %rax
setne %al
testb %al, %cl
jne 0xb70e
movq 0xb8fa(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
leaq 0x7e53(%rip), %rdx      # 0x13553
movl $0x1, %esi
xorl %eax, %eax
callq 0x3240
jmp 0xb71f
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x8599
testl %eax, %eax
je 0xb72f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8693
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: do_read_csd
int do_read_csd(int argc, char **argv)
{
	struct config config;
	int ret;

	if (argc != 2 && argc != 3) {
		fprintf(stderr, "Usage: Print CSD data from <device path>.\n");
		exit(1);
	}

	ret = lsmmc_main(&config, argc, argv);
	if (ret)
		goto out;

	if (config.dir)
		ret = process_dir(&config, CSD);

out:
	lsmmc_free(&config);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rdx
movl %edi, %esi
leal -0x4(%rsi), %eax
cmpl $-0x3, %eax
jbe 0xb7c2
leaq 0x8(%rsp), %rdi
callq 0xb689
movl %eax, %ebx
testl %eax, %eax
jne 0xb79c
cmpq $0x0, 0x10(%rsp)
je 0xb79c
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xb448
movl %eax, %ebx
movq 0x28(%rsp), %rdi
callq 0x3030
movq 0x30(%rsp), %rdi
callq 0x3030
movq 0x10(%rsp), %rdi
callq 0x3030
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
retq
movq 0xb827(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
leaq 0x7da6(%rip), %rdx      # 0x13579
movl $0x1, %esi
xorl %eax, %eax
callq 0x3240
movl $0x1, %edi
callq 0x3220
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/lsmmc.c
// Function: do_read_cid
int do_read_cid(int argc, char **argv)
{
	struct config config;
	int ret;

	if (argc != 2 && argc != 3) {
		fprintf(stderr, "Usage: Print CID data from <device path>.\n");
		exit(1);
	}

	ret = lsmmc_main(&config, argc, argv);
	if (ret)
		goto out;

	if (config.dir)
		ret = process_dir(&config, CID);

out:
	lsmmc_free(&config);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rdx
movl %edi, %esi
leal -0x4(%rsi), %eax
cmpl $-0x3, %eax
jbe 0xb847
leaq 0x8(%rsp), %rdi
callq 0xb689
movl %eax, %ebx
testl %eax, %eax
jne 0xb821
cmpq $0x0, 0x10(%rsp)
je 0xb821
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xb448
movl %eax, %ebx
movq 0x28(%rsp), %rdi
callq 0x3030
movq 0x30(%rsp), %rdi
callq 0x3030
movq 0x10(%rsp), %rdi
callq 0x3030
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
retq
movq 0xb7a2(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
leaq 0x7d4c(%rip), %rdx      # 0x135a4
movl $0x1, %esi
xorl %eax, %eax
callq 0x3240
movl $0x1, %edi
callq 0x3220
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha224_init
void hmac_sha224_init(hmac_sha224_ctx *ctx, const unsigned char *key,
                      unsigned int key_size)
{
    unsigned int fill;
    unsigned int num;

    const unsigned char *key_used;
    unsigned char key_temp[SHA224_DIGEST_SIZE];
    int i;

    if (key_size == SHA224_BLOCK_SIZE) {
        key_used = key;
        num = SHA224_BLOCK_SIZE;
    } else {
        if (key_size > SHA224_BLOCK_SIZE){
            num = SHA224_DIGEST_SIZE;
            sha224(key, key_size, key_temp);
            key_used = key_temp;
        } else { /* key_size > SHA224_BLOCK_SIZE */
            key_used = key;
            num = key_size;
        }
        fill = SHA224_BLOCK_SIZE - num;

        memset(ctx->block_ipad + num, 0x36, fill);
        memset(ctx->block_opad + num, 0x5c, fill);
    }

    for (i = 0; i < (int) num; i++) {
        ctx->block_ipad[i] = key_used[i] ^ 0x36;
        ctx->block_opad[i] = key_used[i] ^ 0x5c;
    }

    sha224_init(&ctx->ctx_inside);
    sha224_update(&ctx->ctx_inside, ctx->block_ipad, SHA224_BLOCK_SIZE);

    sha224_init(&ctx->ctx_outside);
    sha224_update(&ctx->ctx_outside, ctx->block_opad,
                  SHA224_BLOCK_SIZE);

    /* for hmac_reinit */
    memcpy(&ctx->ctx_inside_reinit, &ctx->ctx_inside,
           sizeof(sha224_ctx));
    memcpy(&ctx->ctx_outside_reinit, &ctx->ctx_outside,
           sizeof(sha224_ctx));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x40, %eax
cmpl $0x40, %edx
je 0xb972
movl %edx, %ebp
jbe 0xb930
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xcc0c
movl $0x1c, %ebp
movq %r15, %r14
movl $0x40, %r15d
subl %ebp, %r15d
movl %ebp, %r12d
leaq (%rbx,%r12), %rdi
addq $0x2a0, %rdi            # imm = 0x2A0
movl $0x36, %esi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r12), %rdi
addq $0x2e0, %rdi            # imm = 0x2E0
movl $0x5c, %esi
movq %r15, %rdx
callq 0x30e0
movl %ebp, %eax
testl %ebp, %ebp
je 0xb99a
movl %eax, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
xorb $0x36, %dl
movb %dl, 0x2a0(%rbx,%rcx)
movb (%r14,%rcx), %dl
xorb $0x5c, %dl
movb %dl, 0x2e0(%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0xb976
movq %rbx, %rdi
callq 0xcc64
leaq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
movl $0x40, %edx
callq 0xcc89
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0xcc64
leaq 0x2e0(%rbx), %rsi
movq %r14, %rdi
movl $0x40, %edx
callq 0xcc89
leaq 0x150(%rbx), %rdi
movl $0xa8, %edx
movq %rbx, %rsi
callq 0x3190
addq $0x1f8, %rbx            # imm = 0x1F8
movl $0xa8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3190
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha224_final
void hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac,
                       unsigned int mac_size)
{
    unsigned char digest_inside[SHA224_DIGEST_SIZE];
    unsigned char mac_temp[SHA224_DIGEST_SIZE];

    sha224_final(&ctx->ctx_inside, digest_inside);
    sha224_update(&ctx->ctx_outside, digest_inside, SHA224_DIGEST_SIZE);
    sha224_final(&ctx->ctx_outside, mac_temp);
    memcpy(mac, mac_temp, mac_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0xcd32
addq $0xa8, %r15
movq %r15, %rdi
movq %r12, %rsi
movl $0x1c, %edx
callq 0xcc89
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xcd32
movl %ebx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3190
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha256_init
void hmac_sha256_init(hmac_sha256_ctx *ctx, const unsigned char *key,
                      unsigned int key_size)
{
    unsigned int fill;
    unsigned int num;

    const unsigned char *key_used;
    unsigned char key_temp[SHA256_DIGEST_SIZE];
    int i;

    if (key_size == SHA256_BLOCK_SIZE) {
        key_used = key;
        num = SHA256_BLOCK_SIZE;
    } else {
        if (key_size > SHA256_BLOCK_SIZE){
            num = SHA256_DIGEST_SIZE;
            sha256(key, key_size, key_temp);
            key_used = key_temp;
        } else { /* key_size > SHA256_BLOCK_SIZE */
            key_used = key;
            num = key_size;
        }
        fill = SHA256_BLOCK_SIZE - num;

        memset(ctx->block_ipad + num, 0x36, fill);
        memset(ctx->block_opad + num, 0x5c, fill);
    }

    for (i = 0; i < (int) num; i++) {
        ctx->block_ipad[i] = key_used[i] ^ 0x36;
        ctx->block_opad[i] = key_used[i] ^ 0x5c;
    }

    sha256_init(&ctx->ctx_inside);
    sha256_update(&ctx->ctx_inside, ctx->block_ipad, SHA256_BLOCK_SIZE);

    sha256_init(&ctx->ctx_outside);
    sha256_update(&ctx->ctx_outside, ctx->block_opad,
                  SHA256_BLOCK_SIZE);

    /* for hmac_reinit */
    memcpy(&ctx->ctx_inside_reinit, &ctx->ctx_inside,
           sizeof(sha256_ctx));
    memcpy(&ctx->ctx_outside_reinit, &ctx->ctx_outside,
           sizeof(sha256_ctx));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x40, %eax
cmpl $0x40, %edx
je 0xbb73
movl %edx, %ebp
jbe 0xbb31
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xc305
movl $0x20, %ebp
movq %r15, %r14
movl $0x40, %r15d
subl %ebp, %r15d
movl %ebp, %r12d
leaq (%rbx,%r12), %rdi
addq $0x2a0, %rdi            # imm = 0x2A0
movl $0x36, %esi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r12), %rdi
addq $0x2e0, %rdi            # imm = 0x2E0
movl $0x5c, %esi
movq %r15, %rdx
callq 0x30e0
movl %ebp, %eax
testl %ebp, %ebp
je 0xbb9b
movl %eax, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
xorb $0x36, %dl
movb %dl, 0x2a0(%rbx,%rcx)
movb (%r14,%rcx), %dl
xorb $0x5c, %dl
movb %dl, 0x2e0(%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0xbb77
movq %rbx, %rdi
callq 0xc35d
leaq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
movl $0x40, %edx
callq 0xc382
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0xc35d
leaq 0x2e0(%rbx), %rsi
movq %r14, %rdi
movl $0x40, %edx
callq 0xc382
leaq 0x150(%rbx), %rdi
movl $0xa8, %edx
movq %rbx, %rsi
callq 0x3190
addq $0x1f8, %rbx            # imm = 0x1F8
movl $0xa8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3190
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha256_final
void hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
                       unsigned int mac_size)
{
    unsigned char digest_inside[SHA256_DIGEST_SIZE];
    unsigned char mac_temp[SHA256_DIGEST_SIZE];

    sha256_final(&ctx->ctx_inside, digest_inside);
    sha256_update(&ctx->ctx_outside, digest_inside, SHA256_DIGEST_SIZE);
    sha256_final(&ctx->ctx_outside, mac_temp);
    memcpy(mac, mac_temp, mac_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0xc42b
addq $0xa8, %r15
movq %r15, %rdi
movq %r12, %rsi
movl $0x20, %edx
callq 0xc382
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xc42b
movl %ebx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3190
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha384_init
void hmac_sha384_init(hmac_sha384_ctx *ctx, const unsigned char *key,
                      unsigned int key_size)
{
    unsigned int fill;
    unsigned int num;

    const unsigned char *key_used;
    unsigned char key_temp[SHA384_DIGEST_SIZE];
    int i;

    if (key_size == SHA384_BLOCK_SIZE) {
        key_used = key;
        num = SHA384_BLOCK_SIZE;
    } else {
        if (key_size > SHA384_BLOCK_SIZE){
            num = SHA384_DIGEST_SIZE;
            sha384(key, key_size, key_temp);
            key_used = key_temp;
        } else { /* key_size > SHA384_BLOCK_SIZE */
            key_used = key;
            num = key_size;
        }
        fill = SHA384_BLOCK_SIZE - num;

        memset(ctx->block_ipad + num, 0x36, fill);
        memset(ctx->block_opad + num, 0x5c, fill);
    }

    for (i = 0; i < (int) num; i++) {
        ctx->block_ipad[i] = key_used[i] ^ 0x36;
        ctx->block_opad[i] = key_used[i] ^ 0x5c;
    }

    sha384_init(&ctx->ctx_inside);
    sha384_update(&ctx->ctx_inside, ctx->block_ipad, SHA384_BLOCK_SIZE);

    sha384_init(&ctx->ctx_outside);
    sha384_update(&ctx->ctx_outside, ctx->block_opad,
                  SHA384_BLOCK_SIZE);

    /* for hmac_reinit */
    memcpy(&ctx->ctx_inside_reinit, &ctx->ctx_inside,
           sizeof(sha384_ctx));
    memcpy(&ctx->ctx_outside_reinit, &ctx->ctx_outside,
           sizeof(sha384_ctx));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x80, %eax
cmpl $0x80, %edx
je 0xbd77
movl %edx, %ebp
jbe 0xbd35
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xc99f
movl $0x30, %ebp
movq %r15, %r14
movl $0x80, %r15d
subl %ebp, %r15d
movl %ebp, %r12d
leaq (%rbx,%r12), %rdi
addq $0x520, %rdi            # imm = 0x520
movl $0x36, %esi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r12), %rdi
addq $0x5a0, %rdi            # imm = 0x5A0
movl $0x5c, %esi
movq %r15, %rdx
callq 0x30e0
movl %ebp, %eax
testl %ebp, %ebp
je 0xbd9f
movl %eax, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
xorb $0x36, %dl
movb %dl, 0x520(%rbx,%rcx)
movb (%r14,%rcx), %dl
xorb $0x5c, %dl
movb %dl, 0x5a0(%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0xbd7b
movq %rbx, %rdi
callq 0xca15
leaq 0x520(%rbx), %rsi
movq %rbx, %rdi
movl $0x80, %edx
callq 0xca3c
leaq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0xca15
leaq 0x5a0(%rbx), %rsi
movq %r14, %rdi
movl $0x80, %edx
callq 0xca3c
leaq 0x290(%rbx), %rdi
movl $0x148, %edx            # imm = 0x148
movq %rbx, %rsi
callq 0x3190
addq $0x3d8, %rbx            # imm = 0x3D8
movl $0x148, %edx            # imm = 0x148
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3190
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha384_final
void hmac_sha384_final(hmac_sha384_ctx *ctx, unsigned char *mac,
                       unsigned int mac_size)
{
    unsigned char digest_inside[SHA384_DIGEST_SIZE];
    unsigned char mac_temp[SHA384_DIGEST_SIZE];

    sha384_final(&ctx->ctx_inside, digest_inside);
    sha384_update(&ctx->ctx_outside, digest_inside, SHA384_DIGEST_SIZE);
    sha384_final(&ctx->ctx_outside, mac_temp);
    memcpy(mac, mac_temp, mac_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0xcaeb
addq $0x148, %r15            # imm = 0x148
movq %r15, %rdi
movq %r12, %rsi
movl $0x30, %edx
callq 0xca3c
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xcaeb
movl %ebx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3190
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha512_init
void hmac_sha512_init(hmac_sha512_ctx *ctx, const unsigned char *key,
                      unsigned int key_size)
{
    unsigned int fill;
    unsigned int num;

    const unsigned char *key_used;
    unsigned char key_temp[SHA512_DIGEST_SIZE];
    int i;

    if (key_size == SHA512_BLOCK_SIZE) {
        key_used = key;
        num = SHA512_BLOCK_SIZE;
    } else {
        if (key_size > SHA512_BLOCK_SIZE){
            num = SHA512_DIGEST_SIZE;
            sha512(key, key_size, key_temp);
            key_used = key_temp;
        } else { /* key_size > SHA512_BLOCK_SIZE */
            key_used = key;
            num = key_size;
        }
        fill = SHA512_BLOCK_SIZE - num;

        memset(ctx->block_ipad + num, 0x36, fill);
        memset(ctx->block_opad + num, 0x5c, fill);
    }

    for (i = 0; i < (int) num; i++) {
        ctx->block_ipad[i] = key_used[i] ^ 0x36;
        ctx->block_opad[i] = key_used[i] ^ 0x5c;
    }

    sha512_init(&ctx->ctx_inside);
    sha512_update(&ctx->ctx_inside, ctx->block_ipad, SHA512_BLOCK_SIZE);

    sha512_init(&ctx->ctx_outside);
    sha512_update(&ctx->ctx_outside, ctx->block_opad,
                  SHA512_BLOCK_SIZE);

    /* for hmac_reinit */
    memcpy(&ctx->ctx_inside_reinit, &ctx->ctx_inside,
           sizeof(sha512_ctx));
    memcpy(&ctx->ctx_outside_reinit, &ctx->ctx_outside,
           sizeof(sha512_ctx));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x80, %eax
cmpl $0x80, %edx
je 0xbf7b
movl %edx, %ebp
jbe 0xbf39
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xc732
movl $0x40, %ebp
movq %r15, %r14
movl $0x80, %r15d
subl %ebp, %r15d
movl %ebp, %r12d
leaq (%rbx,%r12), %rdi
addq $0x520, %rdi            # imm = 0x520
movl $0x36, %esi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r12), %rdi
addq $0x5a0, %rdi            # imm = 0x5A0
movl $0x5c, %esi
movq %r15, %rdx
callq 0x30e0
movl %ebp, %eax
testl %ebp, %ebp
je 0xbfa3
movl %eax, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
xorb $0x36, %dl
movb %dl, 0x520(%rbx,%rcx)
movb (%r14,%rcx), %dl
xorb $0x5c, %dl
movb %dl, 0x5a0(%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0xbf7f
movq %rbx, %rdi
callq 0xc7a8
leaq 0x520(%rbx), %rsi
movq %rbx, %rdi
movl $0x80, %edx
callq 0xc7cf
leaq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0xc7a8
leaq 0x5a0(%rbx), %rsi
movq %r14, %rdi
movl $0x80, %edx
callq 0xc7cf
leaq 0x290(%rbx), %rdi
movl $0x148, %edx            # imm = 0x148
movq %rbx, %rsi
callq 0x3190
addq $0x3d8, %rbx            # imm = 0x3D8
movl $0x148, %edx            # imm = 0x148
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3190
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/blasphemy[P]mmc-utils/3rdparty/hmac_sha/hmac_sha2.c
// Function: hmac_sha512_final
void hmac_sha512_final(hmac_sha512_ctx *ctx, unsigned char *mac,
                       unsigned int mac_size)
{
    unsigned char digest_inside[SHA512_DIGEST_SIZE];
    unsigned char mac_temp[SHA512_DIGEST_SIZE];

    sha512_final(&ctx->ctx_inside, digest_inside);
    sha512_update(&ctx->ctx_outside, digest_inside, SHA512_DIGEST_SIZE);
    sha512_final(&ctx->ctx_outside, mac_temp);
    memcpy(mac, mac_temp, mac_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40(%rsp), %r12
movq %r12, %rsi
callq 0xc87e
addq $0x148, %r15            # imm = 0x148
movq %r15, %rdi
movq %r12, %rsi
movl $0x40, %edx
callq 0xc7cf
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xc87e
movl %ebx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3190
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test_khash.c
// Function: show_usage
static void show_usage(FILE *out, char *prog) {
    fprintf(out, "Usage : %s [-t <test>] [-i <file>]\n", prog);
    fprintf(out, " Options:\n");
    fprintf(out, "  -t <TEST>   Test to run (str2int, benchmark)\n");
    fprintf(out, "  -i <FILE>   Optional input file for benchmark\n");
    fprintf(out, "  -n <INT>    Number of items to add\n");
    fprintf(out, "  -f <FRAC>   Fraction to delete and re-insert\n");
    fprintf(out, "  -d          Dump hash table stats\n");
    fprintf(out, "  -h          Show this help\n");
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0xfb0(%rip), %rsi       # 0x30cc
xorl %eax, %eax
callq 0x1110
leaq 0xfc6(%rip), %rdi       # 0x30f0
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0xfb8(%rip), %rdi       # 0x30fb
movl $0x2f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0xfcf(%rip), %rdi       # 0x312b
movl $0x30, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0xfe7(%rip), %rdi       # 0x315c
movl $0x25, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0xff4(%rip), %rdi       # 0x3182
movl $0x2f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0x100b(%rip), %rdi      # 0x31b2
movl $0x24, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1190
leaq 0x1017(%rip), %rdi      # 0x31d7
movl $0x1d, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test_khash.c
// Function: add_str2int_entry
static int add_str2int_entry(khash_t(str2int) *h, char *key, khint_t val) {
    int ret = 0;
    khint_t k = kh_put(str2int, h, key, &ret);

    if (ret != 1 && ret != 2) {
        fprintf(stderr, "Unexpected return from kh_put(%s) : %d\n", key, ret);
        return -1;
    }
    kh_val(h, k) = val;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq %r15, %rdx
callq 0x261c
movl (%r15), %ecx
leal -0x3(%rcx), %edx
cmpl $-0x3, %edx
jbe 0x2217
movq 0x20(%r14), %rcx
movl %eax, %eax
movl %ebp, (%rcx,%rax,4)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2dc2(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0xfcd(%rip), %rsi       # 0x31f5
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x220c
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/ay38910.h
// Function: ay38910_init
void ay38910_init(ay38910_t* ay, const ay38910_desc_t* desc) {
    CHIPS_ASSERT(ay && desc);
    CHIPS_ASSERT(desc->tick_hz > 0);
    CHIPS_ASSERT(desc->sound_hz > 0);
    memset(ay, 0, sizeof(*ay));
    /* note: input and output callbacks are optional */
    ay->in_cb = desc->in_cb;
    ay->out_cb = desc->out_cb;
    ay->user_data = desc->user_data;
    ay->type = desc->type;
    ay->noise.rng = 1;
    ay->sample_period = (desc->tick_hz * AY38910_FIXEDPOINT_SCALE) / desc->sound_hz;
    ay->sample_counter = ay->sample_period;
    ay->mag = desc->magnitude;
    _ay38910_update_values(ay);
    _ay38910_restart_env_shape(ay);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3343
movq %rsi, %r14
testq %rsi, %rsi
je 0x3343
cmpl $0x0, 0x4(%r14)
jle 0x3362
cmpl $0x0, 0x8(%r14)
jle 0x3381
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x8a0, %edx            # imm = 0x8A0
xorl %esi, %esi
callq 0x30d0
movq 0x10(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x18(%rbx)
movl (%r14), %eax
movl %eax, (%rbx)
movl $0x1, 0x6c(%rbx)
movl 0x4(%r14), %eax
shll $0x4, %eax
cltd
idivl 0x8(%r14)
movl %eax, 0x88(%rbx)
movl %eax, 0x8c(%rbx)
movss 0xc(%r14), %xmm0
movss %xmm0, 0x90(%rbx)
movq %rbx, %rdi
callq 0x33a0
movb %r15b, 0x78(%rbx)
movb %r15b, 0x7a(%rbx)
movb 0x32(%rbx), %al
andb $0x9, %al
cmpb $0x8, %al
setne 0x79(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10846(%rip), %rdi     # 0x13b90
leaq 0x1084a(%rip), %rsi     # 0x13b9b
leaq 0x10851(%rip), %rcx     # 0x13ba9
movl $0x191, %edx            # imm = 0x191
callq 0x30b0
leaq 0x10877(%rip), %rdi     # 0x13be0
leaq 0x1082b(%rip), %rsi     # 0x13b9b
leaq 0x10832(%rip), %rcx     # 0x13ba9
movl $0x192, %edx            # imm = 0x192
callq 0x30b0
leaq 0x1086a(%rip), %rdi     # 0x13bf2
leaq 0x1080c(%rip), %rsi     # 0x13b9b
leaq 0x10813(%rip), %rcx     # 0x13ba9
movl $0x193, %edx            # imm = 0x193
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/ay38910.h
// Function: ay38910_reset
void ay38910_reset(ay38910_t* ay) {
    CHIPS_ASSERT(ay);
    ay->addr = 0;
    ay->tick = 0;
    for (int i = 0; i < AY38910_NUM_REGISTERS; i++) {
        ay->reg[i] = 0;
    }
    _ay38910_update_values(ay);
    _ay38910_restart_env_shape(ay);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3453
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x0, 0x2d(%rdi)
callq 0x33a0
xorl %eax, %eax
movb %al, 0x78(%rbx)
movb %al, 0x7a(%rbx)
movb 0x32(%rbx), %al
andb $0x9, %al
cmpb $0x8, %al
setne 0x79(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x107ab(%rip), %rdi     # 0x13c05
leaq 0x1073a(%rip), %rsi     # 0x13b9b
leaq 0x107a0(%rip), %rcx     # 0x13c08
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/beeper.h
// Function: beeper_init
void beeper_init(beeper_t* b, int tick_hz, int sound_hz, float magnitude) {
    CHIPS_ASSERT(b);
    CHIPS_ASSERT((tick_hz > 0) && (sound_hz > 0));
    memset(b, 0, sizeof(*b));
    b->period = (tick_hz * BEEPER_FIXEDPOINT_SCALE) / sound_hz;
    b->counter = b->period;
    b->mag = magnitude;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x380d
movl %esi, %r15d
movss %xmm0, -0x1c(%rbp)
testl %esi, %esi
jle 0x382c
movl %edx, %r14d
testl %edx, %edx
jle 0x382c
movq %rdi, %rbx
movl $0x81c, %edx            # imm = 0x81C
xorl %esi, %esi
callq 0x30d0
shll $0x4, %r15d
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x4(%rbx)
movl %eax, 0x8(%rbx)
movss -0x1c(%rbp), %xmm0
movss %xmm0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x108ee(%rip), %rdi     # 0x14102
leaq 0x1040d(%rip), %rsi     # 0x13c28
leaq 0x10413(%rip), %rcx     # 0x13c35
movl $0x4c, %edx
callq 0x30b0
leaq 0x10430(%rip), %rdi     # 0x13c63
leaq 0x103ee(%rip), %rsi     # 0x13c28
leaq 0x103f4(%rip), %rcx     # 0x13c35
movl $0x4d, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/beeper.h
// Function: beeper_reset
void beeper_reset(beeper_t* b) {
    CHIPS_ASSERT(b);
    b->state = 0;
    b->counter = b->period;
    b->sample = 0;
}

// Assembly:
testq %rdi, %rdi
je 0x385e
xorl %eax, %eax
movl %eax, (%rdi)
movl 0x4(%rdi), %ecx
movl %ecx, 0x8(%rdi)
movl %eax, 0x10(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x10899(%rip), %rdi     # 0x14102
leaq 0x103b8(%rip), %rsi     # 0x13c28
leaq 0x1040c(%rip), %rcx     # 0x13c83
movl $0x55, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/clk.h
// Function: clk_ticks_to_run
uint32_t clk_ticks_to_run(clk_t* clk, uint32_t micro_seconds) {
    CHIPS_ASSERT(clk && (micro_seconds > 0));
    int ticks = (int) ((clk->freq_hz * micro_seconds) / 1000000);
    clk->ticks_to_run = ticks - clk->overrun_ticks;
    if (clk->ticks_to_run < 1) {
        clk->ticks_to_run = 1;
    }
    return clk->ticks_to_run;
}

// Assembly:
testq %rdi, %rdi
je 0x3979
testl %esi, %esi
je 0x3979
movl %esi, %eax
imulq (%rdi), %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rcx
shrq $0x3f, %rcx
shrq $0x12, %rdx
addl %edx, %ecx
subl 0xc(%rdi), %ecx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
movl %eax, 0x8(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1035d(%rip), %rdi     # 0x13ce1
leaq 0x1032b(%rip), %rsi     # 0x13cb6
leaq 0x1036a(%rip), %rcx     # 0x13cfc
movl $0x84, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_register_modifier
void kbd_register_modifier(kbd_t* kbd, int layer, int column, int line) {
    CHIPS_ASSERT(kbd);
    CHIPS_ASSERT((column >= 0) && (column < KBD_MAX_COLUMNS));
    CHIPS_ASSERT((line >= 0) && (line < KBD_MAX_LINES));
    CHIPS_ASSERT((layer >= 0) && (layer < KBD_MAX_MOD_KEYS));
    kbd->mod_masks[layer] = (1<<(layer+KBD_MAX_COLUMNS+KBD_MAX_LINES)) | (1<<(column+KBD_MAX_LINES)) | (1<<line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3a40
cmpl $0xc, %edx
jae 0x3a5f
movl %ecx, %eax
cmpl $0xc, %ecx
jae 0x3a7e
cmpl $0x4, %esi
jae 0x3a9d
movl $0x1000000, %r8d        # imm = 0x1000000
movl %esi, %ecx
shll %cl, %r8d
movl $0x1000, %r9d           # imm = 0x1000
movl %edx, %ecx
shll %cl, %r9d
orl %r8d, %r9d
btsl %eax, %r9d
movl %esi, %eax
movl %r9d, 0x410(%rdi,%rax,4)
popq %rbp
retq
leaq 0x102e2(%rip), %rdi     # 0x13d29
leaq 0x102df(%rip), %rsi     # 0x13d2d
leaq 0x102fe(%rip), %rcx     # 0x13d53
movl $0xbc, %edx
callq 0x30b0
leaq 0x10320(%rip), %rdi     # 0x13d86
leaq 0x102c0(%rip), %rsi     # 0x13d2d
leaq 0x102df(%rip), %rcx     # 0x13d53
movl $0xbd, %edx
callq 0x30b0
leaq 0x10322(%rip), %rdi     # 0x13da7
leaq 0x102a1(%rip), %rsi     # 0x13d2d
leaq 0x102c0(%rip), %rcx     # 0x13d53
movl $0xbe, %edx
callq 0x30b0
leaq 0x10320(%rip), %rdi     # 0x13dc4
leaq 0x10282(%rip), %rsi     # 0x13d2d
leaq 0x102a1(%rip), %rcx     # 0x13d53
movl $0xbf, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_register_modifier_line
void kbd_register_modifier_line(kbd_t* kbd, int layer, int line) {
    CHIPS_ASSERT(kbd);
    CHIPS_ASSERT((line >= 0) && (line < KBD_MAX_LINES));
    CHIPS_ASSERT((layer >= 0) && (layer < KBD_MAX_MOD_KEYS));
    kbd->mod_masks[layer] = (1<<(layer+KBD_MAX_COLUMNS+KBD_MAX_LINES)) | (1<<line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3ae6
cmpl $0xc, %edx
jae 0x3b05
cmpl $0x4, %esi
jae 0x3b24
movl $0x1000000, %eax        # imm = 0x1000000
movl %esi, %ecx
shll %cl, %eax
btsl %edx, %eax
movl %esi, %ecx
movl %eax, 0x410(%rdi,%rcx,4)
popq %rbp
retq
leaq 0x1023c(%rip), %rdi     # 0x13d29
leaq 0x10239(%rip), %rsi     # 0x13d2d
leaq 0x102e7(%rip), %rcx     # 0x13de2
movl $0xc4, %edx
callq 0x30b0
leaq 0x1029b(%rip), %rdi     # 0x13da7
leaq 0x1021a(%rip), %rsi     # 0x13d2d
leaq 0x102c8(%rip), %rcx     # 0x13de2
movl $0xc5, %edx
callq 0x30b0
leaq 0x10299(%rip), %rdi     # 0x13dc4
leaq 0x101fb(%rip), %rsi     # 0x13d2d
leaq 0x102a9(%rip), %rcx     # 0x13de2
movl $0xc6, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_register_modifier_column
void kbd_register_modifier_column(kbd_t* kbd, int layer, int column) {
    CHIPS_ASSERT(kbd);
    CHIPS_ASSERT((column >= 0) && (column < KBD_MAX_COLUMNS));
    CHIPS_ASSERT((layer >= 0) && (layer < KBD_MAX_MOD_KEYS));
    kbd->mod_masks[layer] = (1<<(layer+KBD_MAX_COLUMNS+KBD_MAX_LINES)) | (1<<(column+KBD_MAX_LINES));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3b79
cmpl $0xc, %edx
jae 0x3b98
cmpl $0x4, %esi
jae 0x3bb7
movl $0x1000000, %eax        # imm = 0x1000000
movl %esi, %ecx
shll %cl, %eax
movl $0x1000, %r8d           # imm = 0x1000
movl %edx, %ecx
shll %cl, %r8d
orl %eax, %r8d
movl %esi, %eax
movl %r8d, 0x410(%rdi,%rax,4)
popq %rbp
retq
leaq 0x101a9(%rip), %rdi     # 0x13d29
leaq 0x101a6(%rip), %rsi     # 0x13d2d
leaq 0x10287(%rip), %rcx     # 0x13e15
movl $0xcb, %edx
callq 0x30b0
leaq 0x101e7(%rip), %rdi     # 0x13d86
leaq 0x10187(%rip), %rsi     # 0x13d2d
leaq 0x10268(%rip), %rcx     # 0x13e15
movl $0xcc, %edx
callq 0x30b0
leaq 0x10206(%rip), %rdi     # 0x13dc4
leaq 0x10168(%rip), %rsi     # 0x13d2d
leaq 0x10249(%rip), %rcx     # 0x13e15
movl $0xcd, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_register_key
void kbd_register_key(kbd_t* kbd, int key, int column, int line, int mod_mask) {
    CHIPS_ASSERT(kbd);
    CHIPS_ASSERT((key >= 0) && (key < KBD_MAX_KEYS));
    CHIPS_ASSERT((column >= 0) && (column < KBD_MAX_COLUMNS));
    CHIPS_ASSERT((line >= 0) && (line < KBD_MAX_LINES));
    kbd->key_masks[key] = (mod_mask << (KBD_MAX_COLUMNS+KBD_MAX_LINES)) | (1<<(column+KBD_MAX_LINES)) | (1<<line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3c12
cmpl $0x100, %esi            # imm = 0x100
jae 0x3c31
cmpl $0xc, %edx
jae 0x3c50
movl %ecx, %eax
cmpl $0xc, %ecx
jae 0x3c6f
shll $0x18, %r8d
movl $0x1000, %r9d           # imm = 0x1000
movl %edx, %ecx
shll %cl, %r9d
btsl %eax, %r9d
orl %r8d, %r9d
movl %esi, %eax
movl %r9d, 0x10(%rdi,%rax,4)
popq %rbp
retq
leaq 0x10110(%rip), %rdi     # 0x13d29
leaq 0x1010d(%rip), %rsi     # 0x13d2d
leaq 0x10223(%rip), %rcx     # 0x13e4a
movl $0xd2, %edx
callq 0x30b0
leaq 0x1026f(%rip), %rdi     # 0x13ea7
leaq 0x100ee(%rip), %rsi     # 0x13d2d
leaq 0x10204(%rip), %rcx     # 0x13e4a
movl $0xd3, %edx
callq 0x30b0
leaq 0x1012f(%rip), %rdi     # 0x13d86
leaq 0x100cf(%rip), %rsi     # 0x13d2d
leaq 0x101e5(%rip), %rcx     # 0x13e4a
movl $0xd4, %edx
callq 0x30b0
leaq 0x10131(%rip), %rdi     # 0x13da7
leaq 0x100b0(%rip), %rsi     # 0x13d2d
leaq 0x101c6(%rip), %rcx     # 0x13e4a
movl $0xd5, %edx
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_update
void kbd_update(kbd_t* kbd, uint32_t frame_time_us) {
    CHIPS_ASSERT(kbd);
    kbd->cur_time += frame_time_us;
    /* check for sticky keys that should be released */
    for (int i = 0; i < KBD_MAX_PRESSED_KEYS; i++) {
        key_state_t* k = &kbd->key_buffer[i];
        if (k->released) {
            /* properly handle cur_time wraparound */
            if ((kbd->cur_time < k->pressed_time) ||
                (kbd->cur_time > (k->pressed_time + kbd->sticky_time))) {
                k->mask = 0;
                k->key = 0;
                k->pressed_time = 0;
                k->released = false;
            }
        }
    }
    _kbd_update_scanout_masks(kbd);
}

// Assembly:
testq %rdi, %rdi
je 0x3cdc
movl %esi, %eax
addq (%rdi), %rax
movq %rax, (%rdi)
movl $0x430, %ecx            # imm = 0x430
xorps %xmm0, %xmm0
cmpb $0x1, (%rdi,%rcx)
jne 0x3ccd
movq -0x8(%rdi,%rcx), %rdx
cmpq %rdx, %rax
jb 0x3cbe
movl 0x8(%rdi), %esi
addq %rsi, %rdx
cmpq %rdx, %rax
jbe 0x3ccd
leaq (%rdi,%rcx), %rdx
addq $-0x10, %rdx
movups %xmm0, (%rdx)
movb $0x0, 0x10(%rdx)
addq $0x18, %rcx
cmpq $0x490, %rcx            # imm = 0x490
je 0x3cff
jmp 0x3ca3
pushq %rbp
movq %rsp, %rbp
leaq 0x10042(%rip), %rdi     # 0x13d29
leaq 0x1003f(%rip), %rsi     # 0x13d2d
leaq 0x10188(%rip), %rcx     # 0x13e7d
movl $0x139, %edx            # imm = 0x139
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_update_scanout_masks
static void _kbd_update_scanout_masks(kbd_t* kbd) {
    for (int line = 0; line < KBD_MAX_LINES; line++) {
        kbd->scanout_column_masks[line] = _kbd_test_columns(kbd, (1<<line));
    }
    for (int col = 0; col < KBD_MAX_COLUMNS; col++) {
        kbd->scanout_line_masks[col] = _kbd_test_lines(kbd, (1<<col));
    }
    kbd->cur_column_mask = 0;
    kbd->cur_scanout_line_mask = 0;
    kbd->cur_line_mask = 0;
    kbd->cur_scanout_column_mask = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x420(%rdi), %rax
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %esi
shll %cl, %esi
xorl %r8d, %r8d
notl %esi
xorl %r9d, %r9d
leaq (%r8,%r8,2), %r10
movl 0x4(%rax,%r10,8), %r10d
testl %r10d, %r10d
je 0x3d8c
movl %r10d, %r11d
andl %esi, %r11d
movl %r10d, %ebx
shrl $0xc, %ebx
andl $0xfff, %ebx            # imm = 0xFFF
testl $0xfff, %r11d           # imm = 0xFFF
cmovnel %edx, %ebx
orl %ebx, %r9d
andl $0xf000000, %r10d       # imm = 0xF000000
je 0x3d8c
xorl %r11d, %r11d
movl 0x410(%rdi,%r11,4), %ebx
testl %r10d, %ebx
je 0x3d83
movl %ebx, %r14d
andl $0xfff, %r14d           # imm = 0xFFF
je 0x3d77
testl %esi, %r14d
jne 0x3d83
shrl $0xc, %ebx
andl $0xfff, %ebx            # imm = 0xFFF
orl %ebx, %r9d
incq %r11
cmpq $0x4, %r11
jne 0x3d59
incq %r8
cmpq $0x4, %r8
jne 0x3d20
movw %r9w, 0x480(%rdi,%rcx,2)
incq %rcx
cmpq $0xc, %rcx
jne 0x3d11
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %esi
shll %cl, %esi
xorl %r8d, %r8d
notl %esi
xorl %r9d, %r9d
leaq (%r8,%r8,2), %r10
movl 0x4(%rax,%r10,8), %r10d
testl %r10d, %r10d
je 0x3e32
movl %r10d, %r11d
shrl $0xc, %r11d
andl %esi, %r11d
movl %r10d, %ebx
andl $0xfff, %ebx            # imm = 0xFFF
testl $0xfff, %r11d           # imm = 0xFFF
cmovnel %edx, %ebx
orl %ebx, %r9d
andl $0xf000000, %r10d       # imm = 0xF000000
je 0x3e32
xorl %r11d, %r11d
movl 0x410(%rdi,%r11,4), %ebx
testl %r10d, %ebx
je 0x3e29
testl $0xfff000, %ebx         # imm = 0xFFF000
je 0x3e26
movl %ebx, %r14d
shrl $0xc, %r14d
andl %esi, %r14d
testl $0xfff, %r14d           # imm = 0xFFF
jne 0x3e29
andl $0xfff, %ebx            # imm = 0xFFF
orl %ebx, %r9d
incq %r11
cmpq $0x4, %r11
jne 0x3df8
incq %r8
cmpq $0x4, %r8
jne 0x3dbe
movw %r9w, 0x498(%rdi,%rcx,2)
incq %rcx
cmpq $0xc, %rcx
jne 0x3daf
movq $0x0, 0x4b0(%rdi)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_key_down
void kbd_key_down(kbd_t* kbd, int key) {
    CHIPS_ASSERT(kbd && (key >= 0) && (key < KBD_MAX_KEYS));
    /* first check if the key is already in the key buffer,
       if yes, just update its pressed-frame and return,
       otherwise find a new, free keybuffer slot
    */
    for (int i = 0; i < KBD_MAX_PRESSED_KEYS; i++) {
        key_state_t* k = &kbd->key_buffer[i];
        if (k->key == key) {
            k->pressed_time = kbd->cur_time;
            _kbd_update_scanout_masks(kbd);
            return;
        }
    }
    for (int i = 0; i < KBD_MAX_PRESSED_KEYS; i++) {
        key_state_t* k = &kbd->key_buffer[i];
        if (0 == k->mask) {
            k->key = key;
            k->mask = kbd->key_masks[key];
            k->pressed_time = kbd->cur_time;
            k->released = false;
            _kbd_update_scanout_masks(kbd);
            return;
        }
    }
}

// Assembly:
testq %rdi, %rdi
je 0x3ec9
cmpl $0xff, %esi
ja 0x3ec9
movl $0x428, %eax            # imm = 0x428
cmpl %esi, -0x8(%rdi,%rax)
je 0x3e9e
addq $0x18, %rax
cmpq $0x488, %rax            # imm = 0x488
jne 0x3e73
movl $0x420, %eax            # imm = 0x420
cmpl $0x0, 0x4(%rdi,%rax)
je 0x3eaa
addq $0x18, %rax
cmpq $0x480, %rax            # imm = 0x480
jne 0x3e8a
retq
movq (%rdi), %rcx
movq %rcx, (%rdi,%rax)
jmp 0x3cff
movl %esi, (%rdi,%rax)
movl %esi, %ecx
movl 0x10(%rdi,%rcx,4), %ecx
movl %ecx, 0x4(%rdi,%rax)
movq (%rdi), %rcx
movq %rcx, 0x8(%rdi,%rax)
movb $0x0, 0x10(%rdi,%rax)
jmp 0x3cff
pushq %rbp
movq %rsp, %rbp
leaq 0xffcc(%rip), %rdi      # 0x13ea0
leaq 0xfe52(%rip), %rsi      # 0x13d2d
leaq 0xffe1(%rip), %rcx      # 0x13ec3
movl $0x14d, %edx            # imm = 0x14D
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_key_up
void kbd_key_up(kbd_t* kbd, int key) {
    CHIPS_ASSERT(kbd && (key >= 0) && (key < KBD_MAX_KEYS));
    /* find the key in the keybuffer, just set released_frame */
    for (int i = 0; i < KBD_MAX_PRESSED_KEYS; i++) {
        key_state_t* k = &kbd->key_buffer[i];
        if (key == k->key) {
            k->released = true;
        }
    }
    _kbd_update_scanout_masks(kbd);
}

// Assembly:
testq %rdi, %rdi
je 0x3f1a
cmpl $0xff, %esi
ja 0x3f1a
movl $0x430, %eax            # imm = 0x430
cmpl %esi, -0x10(%rdi,%rax)
jne 0x3f08
movb $0x1, (%rdi,%rax)
addq $0x18, %rax
cmpq $0x490, %rax            # imm = 0x490
je 0x3cff
jmp 0x3efe
pushq %rbp
movq %rsp, %rbp
leaq 0xff7b(%rip), %rdi      # 0x13ea0
leaq 0xfe01(%rip), %rsi      # 0x13d2d
leaq 0xffb0(%rip), %rcx      # 0x13ee3
movl $0x168, %edx            # imm = 0x168
callq 0x30b0
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_test_lines
uint16_t kbd_test_lines(kbd_t* kbd, uint16_t column_mask) {
    if (column_mask != kbd->cur_column_mask) {
        kbd->cur_column_mask = column_mask;
        kbd->cur_scanout_line_mask = 0;
        for (int col = 0; col < KBD_MAX_COLUMNS; col++) {
            if (column_mask & (1<<col)) {
                kbd->cur_scanout_line_mask |= kbd->scanout_line_masks[col];
            }
        }
    }
    return kbd->cur_scanout_line_mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpw %si, 0x4b0(%rdi)
jne 0x3f53
movzwl 0x4b2(%rdi), %eax
jmp 0x3f84
movw %si, 0x4b0(%rdi)
movw $0x0, 0x4b2(%rdi)
xorl %eax, %eax
xorl %ecx, %ecx
btl %ecx, %esi
jae 0x3f7b
orw 0x498(%rdi,%rcx,2), %ax
movw %ax, 0x4b2(%rdi)
incq %rcx
cmpq $0xc, %rcx
jne 0x3f67
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/kbd.h
// Function: kbd_test_columns
uint16_t kbd_test_columns(kbd_t* kbd, uint16_t line_mask) {
    if (line_mask != kbd->cur_line_mask) {
        kbd->cur_line_mask = line_mask;
        kbd->cur_scanout_column_mask = 0;
        for (int line = 0; line < KBD_MAX_COLUMNS; line++) {
            if (line_mask & (1<<line)) {
                kbd->cur_scanout_column_mask |= kbd->scanout_column_masks[line];
            }
        }
    }
    return kbd->cur_scanout_column_mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpw %si, 0x4b4(%rdi)
jne 0x3f9c
movzwl 0x4b6(%rdi), %eax
jmp 0x3fcd
movw %si, 0x4b4(%rdi)
movw $0x0, 0x4b6(%rdi)
xorl %eax, %eax
xorl %ecx, %ecx
btl %ecx, %esi
jae 0x3fc4
orw 0x480(%rdi,%rcx,2), %ax
movw %ax, 0x4b6(%rdi)
incq %rcx
cmpq $0xc, %rcx
jne 0x3fb0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/leiradel[P]zx48k-libretro/src/mem.h
// Function: mem_init
void mem_init(mem_t* m) {
    CHIPS_ASSERT(m);
    memset(m, 0, sizeof(*m));
    memset(&m->unmapped_page, 0xFF, sizeof(m->unmapped_page));
    mem_unmap_all(m);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x40c1
movq %rdi, %rbx
movl $0x1c00, %edx           # imm = 0x1C00
xorl %esi, %esi
callq 0x30d0
leaq 0x1400(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movl $0xff, %esi
callq 0x30d0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3100
leaq 0xfe39(%rip), %rdi      # 0x13f01
leaq 0xfe34(%rip), %rsi      # 0x13f03
leaq 0xfe37(%rip), %rcx      # 0x13f0d
movl $0x10e, %edx            # imm = 0x10E
callq 0x30b0