LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xafc8
leaq 0x8(%rsp), %rdi
callq 0xaeaf
movl %eax, %ebx
testl %eax, %eax
jne 0xafb6
cmpq $0x0, 0x10(%rsp)
je 0xafb6
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xac78
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0xaf5d
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
retq
movq 0xd021(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x85e0(%rip), %rdx      # 0x135b9
pushq $0x1
popq %rbx
movl %ebx, %esi
xorl %eax, %eax
callq 0x3250
movl %ebx, %edi
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/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 0xb036
leaq 0x8(%rsp), %rdi
callq 0xaeaf
movl %eax, %ebx
testl %eax, %eax
jne 0xb024
cmpq $0x0, 0x10(%rsp)
je 0xb024
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xac78
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0xaf5d
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
retq
movq 0xcfb3(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x859d(%rip), %rdx      # 0x135e4
pushq $0x1
popq %rbx
movl %ebx, %esi
xorl %eax, %eax
callq 0x3250
movl %ebx, %edi
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x40, %edx
jne 0xb0eb
pushq $0x40
popq %r13
jmp 0xb139
jbe 0xb103
movq %rsp, %r15
movq %r14, %rdi
movl %edx, %esi
movq %r15, %rdx
callq 0xc319
pushq $0x1c
popq %rdx
movq %r15, %r14
pushq $0x40
popq %r15
subl %edx, %r15d
movl %edx, %r13d
leaq (%rbx,%r13), %rdi
addq $0x2a0, %rdi            # imm = 0x2A0
pushq $0x36
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r13), %rdi
addq $0x2e0, %rdi            # imm = 0x2E0
pushq $0x5c
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq 0x2a0(%rbx), %r12
leaq 0x2e0(%rbx), %r15
xorl %eax, %eax
cmpq %rax, %r13
je 0xb16f
movb (%r14,%rax), %cl
xorb $0x36, %cl
movb %cl, 0x2a0(%rbx,%rax)
movb (%r14,%rax), %cl
xorb $0x5c, %cl
movb %cl, 0x2e0(%rbx,%rax)
incq %rax
jmp 0xb149
movq %rbx, %rdi
callq 0xc35f
pushq $0x40
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0xc383
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0xc35f
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0xc383
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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc428
addq $0xa8, %r15
pushq $0x1c
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc383
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xc428
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_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x40, %edx
jne 0xb2e2
pushq $0x40
popq %r13
jmp 0xb330
jbe 0xb2fa
movq %rsp, %r15
movq %r14, %rdi
movl %edx, %esi
movq %r15, %rdx
callq 0xbaa1
pushq $0x20
popq %rdx
movq %r15, %r14
pushq $0x40
popq %r15
subl %edx, %r15d
movl %edx, %r13d
leaq (%rbx,%r13), %rdi
addq $0x2a0, %rdi            # imm = 0x2A0
pushq $0x36
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r13), %rdi
addq $0x2e0, %rdi            # imm = 0x2E0
pushq $0x5c
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq 0x2a0(%rbx), %r12
leaq 0x2e0(%rbx), %r15
xorl %eax, %eax
cmpq %rax, %r13
je 0xb366
movb (%r14,%rax), %cl
xorb $0x36, %cl
movb %cl, 0x2a0(%rbx,%rax)
movb (%r14,%rax), %cl
xorb $0x5c, %cl
movb %cl, 0x2e0(%rbx,%rax)
incq %rax
jmp 0xb340
movq %rbx, %rdi
callq 0xbae7
pushq $0x40
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0xbb0b
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0xbae7
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0xbb0b
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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xbbb0
addq $0xa8, %r15
pushq $0x20
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xbb0b
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xbbb0
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_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x80, %r13d
cmpl $0x80, %edx
je 0xb52b
jbe 0xb4f3
movq %rsp, %r15
movq %r14, %rdi
movl %edx, %esi
movq %r15, %rdx
callq 0xc0dd
pushq $0x30
popq %rdx
movq %r15, %r14
movl $0x80, %r15d
subl %edx, %r15d
movl %edx, %r13d
leaq (%rbx,%r13), %rdi
addq $0x520, %rdi            # imm = 0x520
pushq $0x36
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r13), %rdi
addq $0x5a0, %rdi            # imm = 0x5A0
pushq $0x5c
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq 0x520(%rbx), %r12
leaq 0x5a0(%rbx), %r15
xorl %eax, %eax
cmpq %rax, %r13
je 0xb561
movb (%r14,%rax), %cl
xorb $0x36, %cl
movb %cl, 0x520(%rbx,%rax)
movb (%r14,%rax), %cl
xorb $0x5c, %cl
movb %cl, 0x5a0(%rbx,%rax)
incq %rax
jmp 0xb53b
movq %rbx, %rdi
callq 0xc123
movq %rbx, %rdi
movq %r12, %rsi
movl $0x80, %edx
callq 0xc149
leaq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0xc123
movq %r14, %rdi
movq %r15, %rsi
movl $0x80, %edx
callq 0xc149
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 %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc1f6
addq $0x148, %r15            # imm = 0x148
pushq $0x30
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc149
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xc1f6
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_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x80, %r13d
cmpl $0x80, %edx
je 0xb728
jbe 0xb6f0
movq %rsp, %r15
movq %r14, %rdi
movl %edx, %esi
movq %r15, %rdx
callq 0xbea1
pushq $0x40
popq %rdx
movq %r15, %r14
movl $0x80, %r15d
subl %edx, %r15d
movl %edx, %r13d
leaq (%rbx,%r13), %rdi
addq $0x520, %rdi            # imm = 0x520
pushq $0x36
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq (%rbx,%r13), %rdi
addq $0x5a0, %rdi            # imm = 0x5A0
pushq $0x5c
popq %rsi
movq %r15, %rdx
callq 0x30e0
leaq 0x520(%rbx), %r12
leaq 0x5a0(%rbx), %r15
xorl %eax, %eax
cmpq %rax, %r13
je 0xb75e
movb (%r14,%rax), %cl
xorb $0x36, %cl
movb %cl, 0x520(%rbx,%rax)
movb (%r14,%rax), %cl
xorb $0x5c, %cl
movb %cl, 0x5a0(%rbx,%rax)
incq %rax
jmp 0xb738
movq %rbx, %rdi
callq 0xbee7
movq %rbx, %rdi
movq %r12, %rsi
movl $0x80, %edx
callq 0xbf0d
leaq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0xbee7
movq %r14, %rdi
movq %r15, %rsi
movl $0x80, %edx
callq 0xbf0d
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 %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xbfba
addq $0x148, %r15            # imm = 0x148
pushq $0x40
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xbf0d
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xbfba
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_O2/samtools[P]htslib/test/test_khash.c
// Function: make_keys
char * make_keys(size_t num, size_t kl) {
    size_t i;
    char *keys;

    if (num > MAX_ENTRIES) return NULL;
    keys = malloc(kl * num);
    if (!keys) {
        perror(NULL);
        return NULL;
    }
    for (i = 0; i < num; i++) {
        if (snprintf(keys + kl * i, kl, "test%zu", i) >= kl) {
            free(keys);
            return NULL;
        }
    }

    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x5f5e0ff, %rdi        # imm = 0x5F5E0FF
ja 0x1303
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
imulq %r15, %rdi
callq 0x10f0
testq %rax, %rax
je 0x1317
movq %rax, %rbx
leaq 0x1d93(%rip), %r12      # 0x3064
movq %rax, %r13
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x1305
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1140
cltq
incq %rbp
addq %r14, %r13
cmpq %r14, %rax
jb 0x12d6
movq %rbx, %rdi
callq 0x10e0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1090
jmp 0x1305
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x1438(%rip), %rsi      # 0x30d4
xorl %eax, %eax
callq 0x1110
leaq 0x144e(%rip), %rdi      # 0x30f8
pushq $0xa
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x1440(%rip), %rdi      # 0x3103
pushq $0x2f
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x1457(%rip), %rdi      # 0x3133
pushq $0x30
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x1473(%rip), %rdi      # 0x3164
pushq $0x25
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x1484(%rip), %rdi      # 0x318a
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x149f(%rip), %rdi      # 0x31ba
pushq $0x24
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x14af(%rip), %rdi      # 0x31df
pushq $0x1d
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O2/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
andl $0x0, (%r15)
movq %r15, %rdx
callq 0x201a
movl (%r15), %ecx
leal -0x3(%rcx), %edx
cmpl $-0x3, %edx
jbe 0x1d8f
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 0x324a(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x145d(%rip), %rsi      # 0x31fd
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
pushq $-0x1
popq %rax
jmp 0x1d84
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_khash.c
// Function: check_str2int_entry
static int check_str2int_entry(khash_t(str2int) *h, char *key, khint_t val,
                               uint8_t is_deleted) {
    khint_t k = kh_get(str2int, h, key);
    if (is_deleted) {
        if (k < kh_end(h)) {
            fprintf(stderr, "Found deleted entry %s in hash table\n", key);
            return -1;
        } else {
            return 0;
        }
    }

    if (k >= kh_end(h)) {
        fprintf(stderr, "Couldn't find %s in hash table\n", key);
        return -1;
    }
    if (strcmp(kh_key(h, k), key) != 0) {
        fprintf(stderr, "Wrong key in hash table, expected %s got %s\n",
                key, kh_key(h, k));
        return -1;
    }
    if (kh_val(h, k) != val) {
        fprintf(stderr, "Wrong value in hash table, expected %u got %u\n",
                val, kh_val(h, k));
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x249c
movl (%r14), %ecx
testl %r15d, %r15d
je 0x1de6
cmpl %ecx, %eax
jae 0x1e10
movq 0x3206(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1441(%rip), %rsi      # 0x3225
jmp 0x1e2c
cmpl %ecx, %eax
jae 0x1e1b
movq 0x18(%r14), %rcx
movl %eax, %r12d
movq (%rcx,%r12,8), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1100
testl %eax, %eax
jne 0x1e38
movq 0x20(%r14), %rax
movl (%rax,%r12,4), %ecx
cmpl %ebp, %ecx
jne 0x1e58
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x31be(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x141f(%rip), %rsi      # 0x324b
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
jmp 0x1e72
movq 0x31a1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1422(%rip), %rsi      # 0x326b
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1110
jmp 0x1e72
movq 0x3181(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x142f(%rip), %rsi      # 0x3298
movl %ebp, %edx
xorl %eax, %eax
callq 0x1110
pushq $-0x1
popq %rax
jmp 0x1e12
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_khash.c
// Function: write_stats_str2int
static void write_stats_str2int(khash_t(str2int) *h) {
    khint_t empty = 0, deleted = 0, hist_size = 0, *hist = NULL;

    if (kh_stats(str2int, h, &empty, &deleted, &hist_size, &hist) == 0) {
        khint_t i;
        printf("n_buckets = %u\n",
                kh_n_buckets(h));
        printf("empty     = %u\n", empty);
        printf("deleted   = %u\n", deleted);
        for (i = 0; i < hist_size; i++) {
            printf("dist[ %8u ] = %u\n", i, hist[i]);
        }
        free(hist);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl (%rdi), %r15d
andl $0x0, 0x4(%rsp)
andl $0x0, (%rsp)
pushq $0x1
popq %rdi
pushq $0x4
popq %rsi
callq 0x1070
testq %rax, %rax
je 0x1fdd
movq %rax, %rbx
leal -0x1(%r15), %ebp
xorl %r13d, %r13d
movq %rsp, %rdx
xorl %r12d, %r12d
movl %r15d, %eax
cmpq %rax, %r13
jae 0x1f6b
movq 0x10(%r14), %rax
movq %r13, %rcx
shrq $0x4, %rcx
movl (%rax,%rcx,4), %eax
leal (,%r13,2), %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x1f09
testb $0x1, %al
jne 0x1f0e
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rdi
callq 0x2482
decl %r15d
andl %eax, %r15d
pushq $0x1
popq %rax
movl %r15d, %ecx
cmpq %rcx, %r13
je 0x1f15
addl %eax, %r15d
andl %ebp, %r15d
incl %eax
jmp 0x1ef7
movq %rdx, %rax
jmp 0x1f5e
leaq 0x4(%rsp), %rax
jmp 0x1f5e
leal -0x1(%rax), %r15d
cmpl %r15d, %r12d
jbe 0x1f23
movq %rsp, %rdx
jmp 0x1f57
movl %eax, %esi
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x1160
testq %rax, %rax
je 0x1fc7
incl %r12d
movq %rsp, %rdx
cmpl %r15d, %r12d
ja 0x1f51
movl %r12d, %ecx
andl $0x0, (%rax,%rcx,4)
incl %r12d
jmp 0x1f40
movq %rax, %rbx
movl %r15d, %r12d
movl %r15d, %eax
leaq (%rbx,%rax,4), %rax
incl (%rax)
incq %r13
movl (%r14), %r15d
jmp 0x1eb5
incl %r12d
leaq 0x1352(%rip), %rdi      # 0x32c7
movl %r15d, %esi
xorl %eax, %eax
callq 0x1030
movl (%rsp), %esi
leaq 0x134e(%rip), %rdi      # 0x32d7
xorl %eax, %eax
callq 0x1030
movl 0x4(%rsp), %esi
leaq 0x134c(%rip), %rdi      # 0x32e7
xorl %eax, %eax
callq 0x1030
leaq 0x134e(%rip), %r14      # 0x32f7
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x1fc7
movl (%rbx,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1030
incq %r15
jmp 0x1fac
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x33c3
movq %rsi, %r14
testq %rsi, %rsi
je 0x33c3
cmpl $0x0, 0x4(%r14)
jle 0x33e2
cmpl $0x0, 0x8(%r14)
jle 0x3401
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x8a0, %edx            # imm = 0x8A0
xorl %esi, %esi
callq 0x3100
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 0x3420
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 0x107d6(%rip), %rdi     # 0x13ba0
leaq 0x107da(%rip), %rsi     # 0x13bab
leaq 0x107e1(%rip), %rcx     # 0x13bb9
movl $0x191, %edx            # imm = 0x191
callq 0x30d0
leaq 0x10807(%rip), %rdi     # 0x13bf0
leaq 0x107bb(%rip), %rsi     # 0x13bab
leaq 0x107c2(%rip), %rcx     # 0x13bb9
movl $0x192, %edx            # imm = 0x192
callq 0x30d0
leaq 0x107fa(%rip), %rdi     # 0x13c02
leaq 0x1079c(%rip), %rsi     # 0x13bab
leaq 0x107a3(%rip), %rcx     # 0x13bb9
movl $0x193, %edx            # imm = 0x193
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/leiradel[P]zx48k-libretro/src/ay38910.h
// Function: ay38910_update_values
static void _ay38910_update_values(ay38910_t* ay) {
    for (int i = 0; i < AY38910_NUM_CHANNELS; i++) {
        ay38910_tone_t* chn = &ay->tone[i];
        /* "...Note also that due to the design technique used in the Tone Period
           count-down, the lowest period value is 000000000001 (divide by 1)
           and the highest period value is 111111111111 (divide by 4095)
        */
        chn->period = (ay->reg[2*i+1]<<8)|(ay->reg[2*i]);
        if (0 == chn->period) {
            chn->period = 1;
        }
        /* a set 'enable bit' actually means 'disabled' */
        chn->tone_disable = (ay->enable>>i) & 1;
        chn->noise_disable = (ay->enable>>(3+i)) & 1;
    }
    /* noise generator values */
    ay->noise.period = ay->period_noise;
    if (ay->noise.period == 0) {
        ay->noise.period = 1;
    }
    /* envelope generator values */
    ay->env.period = (ay->period_env_coarse<<8)|ay->period_env_fine;
    if (ay->env.period == 0) {
        ay->env.period = 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x2c(%rdi), %eax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x346f
movzwl 0x25(%rdi,%rdx,2), %esi
cmpw $0x1, %si
adcl $0x0, %esi
movw %si, 0x38(%rdi,%rcx)
xorl %esi, %esi
btl %edx, %eax
setb %sil
movl %esi, 0x40(%rdi,%rcx)
leal 0x3(%rdx), %esi
movzbl %sil, %esi
xorl %r8d, %r8d
btl %esi, %eax
setb %r8b
movl %r8d, 0x44(%rdi,%rcx)
incq %rdx
addq $0x10, %rcx
jmp 0x342c
movzbl 0x2b(%rdi), %eax
cmpb $0x1, %al
adcl $0x0, %eax
movzbl %al, %eax
movw %ax, 0x68(%rdi)
movzwl 0x30(%rdi), %eax
cmpw $0x1, %ax
adcl $0x0, %eax
movw %ax, 0x74(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x34da
movq %rdi, %rbx
movb $0x0, 0x24(%rdi)
andl $0x0, 0x20(%rdi)
pushq $0x25
popq %rax
cmpq $0x35, %rax
je 0x34b8
movb $0x0, (%rbx,%rax)
incq %rax
jmp 0x34a9
movq %rbx, %rdi
callq 0x3420
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 0x10734(%rip), %rdi     # 0x13c15
leaq 0x106c3(%rip), %rsi     # 0x13bab
leaq 0x10729(%rip), %rcx     # 0x13c18
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x388f
movl %esi, %r15d
movss %xmm0, -0x1c(%rbp)
testl %esi, %esi
jle 0x38a8
movl %edx, %r14d
testl %edx, %edx
jle 0x38a8
movq %rdi, %rbx
movl $0x81c, %edx            # imm = 0x81C
xorl %esi, %esi
callq 0x3100
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 0x1087c(%rip), %rdi     # 0x14112
leaq 0x1039b(%rip), %rsi     # 0x13c38
leaq 0x103a1(%rip), %rcx     # 0x13c45
pushq $0x4c
jmp 0x38bf
leaq 0x103c4(%rip), %rdi     # 0x13c73
leaq 0x10382(%rip), %rsi     # 0x13c38
leaq 0x10388(%rip), %rcx     # 0x13c45
pushq $0x4d
popq %rdx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x38d8
andl $0x0, (%rdi)
movl 0x4(%rdi), %eax
movl %eax, 0x8(%rdi)
andl $0x0, 0x10(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1082f(%rip), %rdi     # 0x14112
leaq 0x1034e(%rip), %rsi     # 0x13c38
leaq 0x103a2(%rip), %rcx     # 0x13c93
pushq $0x55
popq %rdx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/leiradel[P]zx48k-libretro/src/beeper.h
// Function: beeper_tick
bool beeper_tick(beeper_t* bp) {
    /* generate a new sample? */
    bp->counter -= BEEPER_FIXEDPOINT_SCALE;
    if (bp->counter <= 0) {
        bp->counter += bp->period;
        bp->sample = _beeper_dcadjust(bp, (float)bp->state) * bp->mag;
        return true;
    }
    return false;
}

// Assembly:
movl 0x8(%rdi), %eax
leal -0x10(%rax), %ecx
movl %ecx, 0x8(%rdi)
cmpl $0x10, %eax
jg 0x3954
pushq %rbp
movq %rsp, %rbp
addl 0x4(%rdi), %ecx
movl %ecx, 0x8(%rdi)
cvtsi2ssl (%rdi), %xmm0
movl 0x18(%rdi), %ecx
movss 0x14(%rdi), %xmm1
subss 0x1c(%rdi,%rcx,4), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x14(%rdi)
movss %xmm0, 0x1c(%rdi,%rcx,4)
incl %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movl %ecx, 0x18(%rdi)
mulss 0xf6bb(%rip), %xmm1     # 0x13000
addss %xmm0, %xmm1
mulss 0xc(%rdi), %xmm1
movss %xmm1, 0x10(%rdi)
popq %rbp
cmpl $0x11, %eax
setl %al
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x39d0
testl %esi, %esi
je 0x39d0
movl %esi, %eax
imulq (%rdi), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
subl 0xc(%rdi), %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovll %ecx, %eax
movl %eax, 0x8(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x10316(%rip), %rdi     # 0x13cf1
leaq 0x102e4(%rip), %rsi     # 0x13cc6
leaq 0x10323(%rip), %rcx     # 0x13d0c
movl $0x84, %edx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3a97
cmpl $0xc, %edx
jae 0x3ab6
movl %ecx, %eax
cmpl $0xc, %ecx
jae 0x3ad5
cmpl $0x4, %esi
jae 0x3af4
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 0x1029b(%rip), %rdi     # 0x13d39
leaq 0x10298(%rip), %rsi     # 0x13d3d
leaq 0x102b7(%rip), %rcx     # 0x13d63
movl $0xbc, %edx
callq 0x30d0
leaq 0x102d9(%rip), %rdi     # 0x13d96
leaq 0x10279(%rip), %rsi     # 0x13d3d
leaq 0x10298(%rip), %rcx     # 0x13d63
movl $0xbd, %edx
callq 0x30d0
leaq 0x102db(%rip), %rdi     # 0x13db7
leaq 0x1025a(%rip), %rsi     # 0x13d3d
leaq 0x10279(%rip), %rcx     # 0x13d63
movl $0xbe, %edx
callq 0x30d0
leaq 0x102d9(%rip), %rdi     # 0x13dd4
leaq 0x1023b(%rip), %rsi     # 0x13d3d
leaq 0x1025a(%rip), %rcx     # 0x13d63
movl $0xbf, %edx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3b3d
cmpl $0xc, %edx
jae 0x3b5c
cmpl $0x4, %esi
jae 0x3b7b
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 0x101f5(%rip), %rdi     # 0x13d39
leaq 0x101f2(%rip), %rsi     # 0x13d3d
leaq 0x102a0(%rip), %rcx     # 0x13df2
movl $0xc4, %edx
callq 0x30d0
leaq 0x10254(%rip), %rdi     # 0x13db7
leaq 0x101d3(%rip), %rsi     # 0x13d3d
leaq 0x10281(%rip), %rcx     # 0x13df2
movl $0xc5, %edx
callq 0x30d0
leaq 0x10252(%rip), %rdi     # 0x13dd4
leaq 0x101b4(%rip), %rsi     # 0x13d3d
leaq 0x10262(%rip), %rcx     # 0x13df2
movl $0xc6, %edx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3bd0
cmpl $0xc, %edx
jae 0x3bef
cmpl $0x4, %esi
jae 0x3c0e
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 0x10162(%rip), %rdi     # 0x13d39
leaq 0x1015f(%rip), %rsi     # 0x13d3d
leaq 0x10240(%rip), %rcx     # 0x13e25
movl $0xcb, %edx
callq 0x30d0
leaq 0x101a0(%rip), %rdi     # 0x13d96
leaq 0x10140(%rip), %rsi     # 0x13d3d
leaq 0x10221(%rip), %rcx     # 0x13e25
movl $0xcc, %edx
callq 0x30d0
leaq 0x101bf(%rip), %rdi     # 0x13dd4
leaq 0x10121(%rip), %rsi     # 0x13d3d
leaq 0x10202(%rip), %rcx     # 0x13e25
movl $0xcd, %edx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3c69
cmpl $0x100, %esi            # imm = 0x100
jae 0x3c88
cmpl $0xc, %edx
jae 0x3ca7
movl %ecx, %eax
cmpl $0xc, %ecx
jae 0x3cc6
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 0x100c9(%rip), %rdi     # 0x13d39
leaq 0x100c6(%rip), %rsi     # 0x13d3d
leaq 0x101dc(%rip), %rcx     # 0x13e5a
movl $0xd2, %edx
callq 0x30d0
leaq 0x10228(%rip), %rdi     # 0x13eb7
leaq 0x100a7(%rip), %rsi     # 0x13d3d
leaq 0x101bd(%rip), %rcx     # 0x13e5a
movl $0xd3, %edx
callq 0x30d0
leaq 0x100e8(%rip), %rdi     # 0x13d96
leaq 0x10088(%rip), %rsi     # 0x13d3d
leaq 0x1019e(%rip), %rcx     # 0x13e5a
movl $0xd4, %edx
callq 0x30d0
leaq 0x100ea(%rip), %rdi     # 0x13db7
leaq 0x10069(%rip), %rsi     # 0x13d3d
leaq 0x1017f(%rip), %rcx     # 0x13e5a
movl $0xd5, %edx
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3d33
movl %esi, %eax
addq (%rdi), %rax
movq %rax, (%rdi)
movl $0x430, %ecx            # imm = 0x430
xorps %xmm0, %xmm0
cmpq $0x490, %rcx            # imm = 0x490
je 0x3d56
cmpb $0x1, (%rdi,%rcx)
jne 0x3d2d
movq -0x8(%rdi,%rcx), %rdx
cmpq %rdx, %rax
jb 0x3d1e
movl 0x8(%rdi), %esi
addq %rsi, %rdx
cmpq %rdx, %rax
jbe 0x3d2d
leaq (%rdi,%rcx), %rdx
addq $-0x10, %rdx
movups %xmm0, (%rdx)
movb $0x0, 0x10(%rdx)
addq $0x18, %rcx
jmp 0x3cfa
pushq %rbp
movq %rsp, %rbp
leaq 0xfffb(%rip), %rdi      # 0x13d39
leaq 0xfff8(%rip), %rsi      # 0x13d3d
leaq 0x10141(%rip), %rcx     # 0x13e8d
movl $0x139, %edx            # imm = 0x139
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
leaq 0x420(%rdi), %rax
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
cmpq $0xc, %rcx
je 0x3e14
movl %edx, %r8d
shll %cl, %r8d
xorl %r9d, %r9d
notl %r8d
xorl %r10d, %r10d
cmpq $0x4, %r9
je 0x3e03
imulq $0x18, %r9, %r11
movl 0x4(%rax,%r11), %r11d
testl %r11d, %r11d
je 0x3dfe
movl %r11d, %ebx
andl %r8d, %ebx
movl %r11d, %r14d
shrl $0xc, %r14d
andl $0xfff, %r14d           # imm = 0xFFF
testw $0xfff, %bx             # imm = 0xFFF
cmovnel %esi, %r14d
orl %r14d, %r10d
andl $0xf000000, %r11d       # imm = 0xF000000
je 0x3dfe
xorl %ebx, %ebx
cmpq $0x4, %rbx
je 0x3dfe
movl 0x410(%rdi,%rbx,4), %r14d
testl %r11d, %r14d
je 0x3df9
movl %r14d, %r15d
andl $0xfff, %r15d           # imm = 0xFFF
je 0x3deb
testl %r8d, %r15d
jne 0x3df9
shrl $0xc, %r14d
andl $0xfff, %r14d           # imm = 0xFFF
orl %r14d, %r10d
incq %rbx
jmp 0x3dc7
incq %r9
jmp 0x3d88
movw %r10w, 0x480(%rdi,%rcx,2)
incq %rcx
jmp 0x3d6f
xorl %esi, %esi
xorl %ecx, %ecx
cmpq $0xc, %rcx
je 0x3ec2
movl %edx, %r8d
shll %cl, %r8d
xorl %r9d, %r9d
notl %r8d
xorl %r10d, %r10d
cmpq $0x4, %r9
je 0x3eb1
imulq $0x18, %r9, %r11
movl 0x4(%rax,%r11), %r11d
testl %r11d, %r11d
je 0x3eac
movl %r11d, %ebx
shrl $0xc, %ebx
andl %r8d, %ebx
movl %r11d, %r14d
andl $0xfff, %r14d           # imm = 0xFFF
testw $0xfff, %bx             # imm = 0xFFF
cmovnel %esi, %r14d
orl %r14d, %r10d
andl $0xf000000, %r11d       # imm = 0xF000000
je 0x3eac
xorl %ebx, %ebx
cmpq $0x4, %rbx
je 0x3eac
movl 0x410(%rdi,%rbx,4), %r14d
testl %r11d, %r14d
je 0x3ea7
testl $0xfff000, %r14d        # imm = 0xFFF000
je 0x3ea4
movl %r14d, %r15d
shrl $0xc, %r15d
andl %r8d, %r15d
testw $0xfff, %r15w           # imm = 0xFFF
jne 0x3ea7
andl $0xfff, %r14d           # imm = 0xFFF
orl %r14d, %r10d
incq %rbx
jmp 0x3e6f
incq %r9
jmp 0x3e31
movw %r10w, 0x498(%rdi,%rcx,2)
incq %rcx
jmp 0x3e18
andq $0x0, 0x4b0(%rdi)
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3f40
cmpl $0xff, %esi
ja 0x3f40
movl $0x420, %eax            # imm = 0x420
leaq 0x18(%rax), %rcx
cmpq $0x498, %rcx            # imm = 0x498
je 0x3f05
cmpl %esi, (%rdi,%rax)
movq %rcx, %rax
jne 0x3ee3
movq (%rdi), %rax
movq %rax, -0x10(%rdi,%rcx)
jmp 0x3d56
movl $0x408, %ecx            # imm = 0x408
leaq 0x18(%rcx), %rax
cmpq $0x480, %rax            # imm = 0x480
je 0x3f3f
cmpl $0x0, 0x1c(%rdi,%rcx)
movq %rax, %rcx
jne 0x3f0a
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 0x3d56
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xff65(%rip), %rdi      # 0x13eb0
leaq 0xfdeb(%rip), %rsi      # 0x13d3d
leaq 0xff7a(%rip), %rcx      # 0x13ed3
movl $0x14d, %edx            # imm = 0x14D
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3f91
cmpl $0xff, %esi
ja 0x3f91
movl $0x430, %eax            # imm = 0x430
cmpq $0x490, %rax            # imm = 0x490
je 0x3d56
cmpl %esi, -0x10(%rdi,%rax)
jne 0x3f8b
movb $0x1, (%rdi,%rax)
addq $0x18, %rax
jmp 0x3f75
pushq %rbp
movq %rsp, %rbp
leaq 0xff14(%rip), %rdi      # 0x13eb0
leaq 0xfd9a(%rip), %rsi      # 0x13d3d
leaq 0xff49(%rip), %rcx      # 0x13ef3
movl $0x168, %edx            # imm = 0x168
callq 0x30d0
// File: /workspace/github_c_makefile_star2_O2/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 0x3fca
movzwl 0x4b2(%rdi), %eax
popq %rbp
retq
movw %si, 0x4b0(%rdi)
andw $0x0, 0x4b2(%rdi)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0xc, %rcx
je 0x3fc8
btl %ecx, %esi
jae 0x3ff7
orw 0x498(%rdi,%rcx,2), %ax
movw %ax, 0x4b2(%rdi)
incq %rcx
jmp 0x3fdd
// File: /workspace/github_c_makefile_star2_O2/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 0x4012
movzwl 0x4b6(%rdi), %eax
popq %rbp
retq
movw %si, 0x4b4(%rdi)
andw $0x0, 0x4b6(%rdi)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0xc, %rcx
je 0x4010
btl %ecx, %esi
jae 0x403f
orw 0x480(%rdi,%rcx,2), %ax
movw %ax, 0x4b6(%rdi)
incq %rcx
jmp 0x4025
// File: /workspace/github_c_makefile_star2_O2/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 0x40b2
movq %rdi, %rbx
movl $0x1c00, %edx           # imm = 0x1C00
xorl %esi, %esi
callq 0x3100
leaq 0x1400(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movl $0xff, %esi
callq 0x3100
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3130
leaq 0xfe58(%rip), %rdi      # 0x13f11
leaq 0xfe53(%rip), %rsi      # 0x13f13
leaq 0xfe56(%rip), %rcx      # 0x13f1d
movl $0x10e, %edx            # imm = 0x10E
callq 0x30d0