LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: handle_stream_status
static void handle_stream_status(uint8_t *p_tlv)
{
    uint16_t i_wanted_channelid = ecmg_find_channelid(p_tlv, 0);
    uint16_t i_streamid = ecmg_find_streamid(p_tlv, 0);
    stream_t *p_stream;

    if (i_wanted_channelid != i_channelid) {
        send_channel_error(i_wanted_channelid, 0x6);
        exit(EXIT_FAILURE);
    }

    if ((p_stream = find_stream(i_streamid)) == NULL) {
        send_stream_error(i_streamid, 0x7);
        exit(EXIT_FAILURE);
    }

    if (i_version >= 2 && tlv_count_param(p_tlv, ECMG_PARAM_ECMID) != 1) {
        send_stream_error(i_streamid, 0x10);
        exit(EXIT_FAILURE);
    }

    p_stream->b_init = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2a50
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2e40
movw %ax, -0xc(%rbp)
movzwl -0xa(%rbp), %eax
movzwl 0x5163(%rip), %ecx      # 0x70b8
cmpl %ecx, %eax
je 0x1f71
movl $0x6, %esi
movzwl -0xa(%rbp), %edi
callq 0x18f0
movl $0x1, %edi
callq 0x10f0
movzwl -0xc(%rbp), %edi
callq 0x2ed0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x1f9c
movl $0x7, %esi
movzwl -0xc(%rbp), %edi
callq 0x2f50
movl $0x1, %edi
callq 0x10f0
movzbl 0x50f5(%rip), %eax      # 0x7098
cmpl $0x2, %eax
jl 0x1fd6
movq -0x8(%rbp), %rdi
movl $0x19, %esi
callq 0x29e0
movzwl %ax, %eax
cmpl $0x1, %eax
je 0x1fd6
movl $0x10, %esi
movzwl -0xc(%rbp), %edi
callq 0x2f50
movl $0x1, %edi
callq 0x10f0
movq -0x18(%rbp), %rax
movb $0x0, 0x6(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: handle_stream_test
static void handle_stream_test(uint8_t *p_tlv)
{
    uint16_t i_wanted_channelid = ecmg_find_channelid(p_tlv, 0);
    uint16_t i_streamid = ecmg_find_streamid(p_tlv, 0);
    stream_t *p_stream;

    if (i_wanted_channelid != i_channelid) {
        send_channel_error(i_wanted_channelid, 0x6);
        exit(EXIT_FAILURE);
    }

    if ((p_stream = find_stream(i_streamid)) == NULL) {
        send_stream_error(i_streamid, 0x7);
        exit(EXIT_FAILURE);
    }

    fprintf(stderr, "stream test received\n");
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2a50
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2e40
movw %ax, -0xc(%rbp)
movzwl -0xa(%rbp), %eax
movzwl 0x5093(%rip), %ecx      # 0x70b8
cmpl %ecx, %eax
je 0x2041
movl $0x6, %esi
movzwl -0xa(%rbp), %edi
callq 0x18f0
movl $0x1, %edi
callq 0x10f0
movzwl -0xc(%rbp), %edi
callq 0x2ed0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x206c
movl $0x7, %esi
movzwl -0xc(%rbp), %edi
callq 0x2f50
movl $0x1, %edi
callq 0x10f0
movq 0x4f85(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2141(%rip), %rsi      # 0x41be
movb $0x0, %al
callq 0x1080
movl $0x1, %edi
callq 0x10f0
nop
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: handle_ecm
static void handle_ecm(uint8_t *p_tlv)
{
    uint16_t i_wanted_channelid = ecmg_find_channelid(p_tlv, 0);
    uint16_t i_streamid = ecmg_find_streamid(p_tlv, 0);
    stream_t *p_stream;
    uint16_t i_cp_number;
    uint8_t *p_ecm;
    uint16_t i_ecm_length;

    if (i_wanted_channelid != i_channelid) {
        send_channel_error(i_wanted_channelid, 0x6);
        return;
    }

    if ((p_stream = find_stream(i_streamid)) == NULL) {
        send_stream_error(i_streamid, 0x7);
        return;
    }

    i_cp_number = ecmg_find_cpnumber(p_tlv, 0);
    if (i_cp_number != p_stream->i_cp_number)
        fprintf(stderr, "late ECM packet\n");

    if (i_sectiontspkt != 0) return;
    p_ecm = tlv_find_data(p_tlv, ECMG_PARAM_ECM, 0, &i_ecm_length);

    if (i_ecm_length < PSI_HEADER_SIZE) {
        fprintf(stderr, "too short ECM (%hu)\n", i_ecm_length);
        return;
    }
    if (i_ecm_length != psi_get_length(p_ecm) + PSI_HEADER_SIZE) {
        fprintf(stderr, "ECM size mismatch\n");
        return;
    }
    if (!psi_validate(p_ecm))
        fprintf(stderr, "invalid PSI section\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2a50
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2e40
movw %ax, -0xc(%rbp)
movzwl -0xa(%rbp), %eax
movzwl 0x4f73(%rip), %ecx      # 0x70b8
cmpl %ecx, %eax
je 0x215c
movl $0x6, %esi
movzwl -0xa(%rbp), %edi
callq 0x18f0
jmp 0x2268
movzwl -0xc(%rbp), %edi
callq 0x2ed0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x2182
movl $0x7, %esi
movzwl -0xc(%rbp), %edi
callq 0x2f50
jmp 0x2268
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3150
movw %ax, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x4(%rcx), %ecx
cmpl %ecx, %eax
je 0x21b9
movq 0x4e50(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2060(%rip), %rsi      # 0x4212
movb $0x0, %al
callq 0x1080
movzbl 0x4f04(%rip), %eax      # 0x70c4
cmpl $0x0, %eax
je 0x21ca
jmp 0x2268
movq -0x8(%rbp), %rdi
movl $0x15, %esi
xorl %edx, %edx
leaq -0x2a(%rbp), %rcx
callq 0x31e0
movq %rax, -0x28(%rbp)
movzwl -0x2a(%rbp), %eax
cmpl $0x3, %eax
jge 0x2209
movq 0x4e06(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movzwl -0x2a(%rbp), %edx
leaq 0x2023(%rip), %rsi      # 0x4223
movb $0x0, %al
callq 0x1080
jmp 0x2268
movzwl -0x2a(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3240
movw %ax, %cx
movl -0x30(%rbp), %eax
movzwl %cx, %ecx
addl $0x3, %ecx
cmpl %ecx, %eax
je 0x2243
movq 0x4dc8(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x1ffe(%rip), %rsi      # 0x4238
movb $0x0, %al
callq 0x1080
jmp 0x2268
movq -0x28(%rbp), %rdi
callq 0x3270
testb $0x1, %al
jne 0x2268
movq 0x4da1(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x1fea(%rip), %rsi      # 0x424b
movb $0x0, %al
callq 0x1080
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: create_stream
static void create_stream(void)
{
    stream_t *p_stream = malloc(sizeof(stream_t));
    pp_streams = realloc(pp_streams, ++i_nb_streams * sizeof(stream_t *));
    pp_streams[i_nb_streams - 1] = p_stream;
    p_stream->i_streamid = i_nb_streams;
    p_stream->i_ecmid = i_nb_streams;
    p_stream->i_cp_number = UINT8_MAX;
    p_stream->b_init = true;

    send_stream_setup(p_stream);

    fprintf(stderr, "starting new stream id=0x%hx\n", p_stream->i_streamid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x8, %edi
callq 0x10c0
movq %rax, -0x8(%rbp)
movq 0x4e3b(%rip), %rdi      # 0x70c8
movl 0x4e2d(%rip), %eax      # 0x70c0
addl $0x1, %eax
movl %eax, 0x4e24(%rip)      # 0x70c0
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x10d0
movq %rax, 0x4e19(%rip)      # 0x70c8
movq -0x8(%rbp), %rdx
movq 0x4e0e(%rip), %rax      # 0x70c8
movl 0x4e00(%rip), %ecx      # 0x70c0
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x4df0(%rip), %eax      # 0x70c0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl 0x4de0(%rip), %eax      # 0x70c0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rax
movw $0xff, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x6(%rax)
movq -0x8(%rbp), %rdi
callq 0x32f0
movq 0x4ceb(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movzwl (%rax), %edx
leaq 0x1f42(%rip), %rsi      # 0x4260
movb $0x0, %al
callq 0x1080
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: check_cw
static void check_cw(void)
{
    int i_turn = i_last_time % i_period;
    int i;

    for (i = 0; i < i_nb_streams; i++)
        if (!pp_streams[i]->b_init && (i % i_period) == i_turn)
            send_cw(pp_streams[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x4d71(%rip), %rax      # 0x70b0
movslq 0x4d66(%rip), %rcx      # 0x70ac
cqto
idivq %rcx
movl %edx, %eax
movl %eax, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x4d60(%rip), %eax      # 0x70c0
jge 0x23a7
movq 0x4d5f(%rip), %rax      # 0x70c8
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
testb $0x1, 0x6(%rax)
jne 0x239a
movl -0x8(%rbp), %eax
cltd
idivl 0x4d2b(%rip)            # 0x70ac
cmpl -0x4(%rbp), %edx
jne 0x239a
movq 0x4d3b(%rip), %rax      # 0x70c8
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x35b0
jmp 0x239c
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2357
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/mpeg/psi/psi.h
// Function: psi_validate
static inline bool psi_validate(const uint8_t *p_section)
{
    if (psi_get_syntax(p_section)
         && (psi_get_length(p_section) < PSI_HEADER_SIZE_SYNTAX1
                                            - PSI_HEADER_SIZE + PSI_CRC_SIZE))
        return false;

    /* only do the CRC check when it is strictly necessary */

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x32c0
testb $0x1, %al
jne 0x328b
jmp 0x32a2
movq -0x10(%rbp), %rdi
callq 0x3240
movzwl %ax, %eax
cmpl $0x9, %eax
jge 0x32a2
movb $0x0, -0x1(%rbp)
jmp 0x32a6
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: send_stream_setup
static void send_stream_setup(stream_t *p_stream)
{
    uint8_t p_tlv_h[MAX_TLV_SIZE];
    uint8_t *p_tlv = tlvh_get_tlv(p_tlv_h);
    uint8_t *p_tlv_n;

    tlvh_set_version(p_tlv_h, i_version);
    ecmg_init(p_tlv);
    tlv_set_type(p_tlv, ECMG_TYPE_STREAM_SETUP);
    /* length will be written at the end */
    tlv_set_length(p_tlv, MAX_TLV_SIZE - TLV_HEADER_SIZE - TLVH_HEADER_SIZE);

    ecmg_append_channelid(p_tlv, i_channelid);
    ecmg_append_streamid(p_tlv, p_stream->i_streamid);
    if (i_version >= 2)
        ecmg_append_ecmid(p_tlv, p_stream->i_ecmid);
    ecmg_append_nomcpdur(p_tlv, i_period * 10);

    p_tlv_n = tlv_find_param(p_tlv, TLV_PARAM_EMPTY, 0);
    tlv_set_length(p_tlv, p_tlv_n - p_tlv - TLV_HEADER_SIZE);
    write_wrapper(p_tlv_h, p_tlv_n - p_tlv_h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movq %rdi, -0x8(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x18a0
movq %rax, -0x418(%rbp)
leaq -0x410(%rbp), %rdi
movzbl 0x3d78(%rip), %esi      # 0x7098
callq 0x23b0
movq -0x418(%rbp), %rdi
callq 0x23d0
movq -0x418(%rbp), %rdi
movl $0x101, %esi            # imm = 0x101
callq 0x23f0
movq -0x418(%rbp), %rdi
movl $0x3f7, %esi            # imm = 0x3F7
callq 0x2430
movq -0x418(%rbp), %rdi
movzwl 0x3d57(%rip), %esi      # 0x70b8
callq 0x2470
movq -0x418(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl (%rax), %esi
callq 0x3080
movzbl 0x3d18(%rip), %eax      # 0x7098
cmpl $0x2, %eax
jl 0x3399
movq -0x418(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x3410
movq -0x418(%rbp), %rdi
imull $0xa, 0x3d05(%rip), %eax # 0x70ac
movzwl %ax, %esi
callq 0x34e0
movq -0x418(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2600
movq %rax, -0x420(%rbp)
movq -0x418(%rbp), %rdi
movq -0x420(%rbp), %rax
movq -0x418(%rbp), %rcx
subq %rcx, %rax
subq $0x4, %rax
movzwl %ax, %esi
callq 0x2430
leaq -0x410(%rbp), %rdi
movq -0x420(%rbp), %rsi
leaq -0x410(%rbp), %rax
subq %rax, %rsi
callq 0x12e0
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: send_cw
static void send_cw(stream_t *p_stream)
{
    uint8_t p_tlv_h[MAX_TLV_SIZE];
    uint8_t *p_tlv = tlvh_get_tlv(p_tlv_h);
    uint8_t *p_tlv_n;
    int i;

    tlvh_set_version(p_tlv_h, i_version);
    ecmg_init(p_tlv);
    tlv_set_type(p_tlv, ECMG_TYPE_CW);
    /* length will be written at the end */
    tlv_set_length(p_tlv, MAX_TLV_SIZE);

    ecmg_append_channelid(p_tlv, i_channelid);
    ecmg_append_streamid(p_tlv, p_stream->i_streamid);
    ecmg_append_cpnumber(p_tlv, p_stream->i_cp_number);

    for (i = 1; i <= i_nb_cw; i++) {
        uint8_t p_cw[8 + 2];
        uint8_t *pi_cw = ecmgcw_get_cw(p_cw);
        uint32_t i_rand;

        ecmgcw_set_cpnum(p_cw,
                         p_stream->i_cp_number + i - (i_nb_cw - i_lead_cw));

        i_rand = rand();
        memcpy(pi_cw, &i_rand, 4);
        i_rand = rand();
        memcpy(pi_cw + 4, &i_rand, 4);

        tlv_append_data(p_tlv, ECMG_PARAM_CPCWCOMB, p_cw, 8 + 2);
    }

    p_tlv_n = tlv_find_param(p_tlv, TLV_PARAM_EMPTY, 0);
    tlv_set_length(p_tlv, p_tlv_n - p_tlv - TLV_HEADER_SIZE);
    write_wrapper(p_tlv_h, p_tlv_n - p_tlv_h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x18a0
movq %rax, -0x418(%rbp)
leaq -0x410(%rbp), %rdi
movzbl 0x3ab8(%rip), %esi      # 0x7098
callq 0x23b0
movq -0x418(%rbp), %rdi
callq 0x23d0
movq -0x418(%rbp), %rdi
movl $0x201, %esi            # imm = 0x201
callq 0x23f0
movq -0x418(%rbp), %rdi
movl $0x3fc, %esi            # imm = 0x3FC
callq 0x2430
movq -0x418(%rbp), %rdi
movzwl 0x3a97(%rip), %esi      # 0x70b8
callq 0x2470
movq -0x418(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl (%rax), %esi
callq 0x3080
movq -0x418(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %esi
callq 0x3780
movl $0x1, -0x424(%rbp)
movl -0x424(%rbp), %eax
movzbl 0x3a61(%rip), %ecx      # 0x70c5
cmpl %ecx, %eax
jg 0x3714
leaq -0x42e(%rbp), %rdi
callq 0x3850
movq %rax, -0x438(%rbp)
leaq -0x42e(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %eax
addl -0x424(%rbp), %eax
movzbl 0x3a2a(%rip), %ecx      # 0x70c5
movzbl 0x3a24(%rip), %edx      # 0x70c6
subl %edx, %ecx
subl %ecx, %eax
movzwl %ax, %esi
callq 0x3870
callq 0x1100
movl %eax, -0x43c(%rbp)
movq -0x438(%rbp), %rax
movl -0x43c(%rbp), %ecx
movl %ecx, (%rax)
callq 0x1100
movl %eax, -0x43c(%rbp)
movq -0x438(%rbp), %rax
movl -0x43c(%rbp), %ecx
movl %ecx, 0x4(%rax)
movq -0x418(%rbp), %rdi
leaq -0x42e(%rbp), %rdx
movl $0x14, %esi
movl $0xa, %ecx
callq 0x38b0
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x3657
movq -0x418(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2600
movq %rax, -0x420(%rbp)
movq -0x418(%rbp), %rdi
movq -0x420(%rbp), %rax
movq -0x418(%rbp), %rcx
subq %rcx, %rax
subq $0x4, %rax
movzwl %ax, %esi
callq 0x2430
leaq -0x410(%rbp), %rdi
movq -0x420(%rbp), %rsi
leaq -0x410(%rbp), %rax
subq %rax, %rsi
callq 0x12e0
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/luac.c
// Function: main
int main(int argc, char* argv[])
{
 lua_State* L;
 struct Smain s;
 int i=doargs(argc,argv);
 argc-=i; argv+=i;
 if (argc<=0) usage("no input files given");
 L=lua_open();
 if (L==NULL) fatal("not enough memory for state");
 s.argc=argc;
 s.argv=argv;
 if (lua_cpcall(L,pmain,&s)!=0) fatal(lua_tostring(L,-1));
 lua_close(L);
 return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x2460
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x8(%rbp)
jg 0x23e7
leaq 0x1bc22(%rip), %rdi     # 0x1e004
callq 0x2710
callq 0x18f70
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2403
leaq 0x1bc1b(%rip), %rdi     # 0x1e019
callq 0x27a0
movl -0x8(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x3c4(%rip), %rsi       # 0x27e0
leaq -0x28(%rbp), %rdx
callq 0x5860
cmpl $0x0, %eax
je 0x2444
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x44e0
movq %rax, %rdi
callq 0x27a0
movq -0x18(%rbp), %rdi
callq 0x10ec0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/luac.c
// Function: usage
static void usage(const char* message)
{
 if (*message=='-')
  fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message);
 else
  fprintf(stderr,"%s: %s\n",progname,message);
 fprintf(stderr,
 "usage: %s [options] [filenames].\n"
 "Available options are:\n"
 "  -        process stdin\n"
 "  -l       list\n"
 "  -o name  output to file " LUA_QL("name") " (default is \"%s\")\n"
 "  -p       parse only\n"
 "  -s       strip debug information\n"
 "  -v       show version information\n"
 "  --       stop handling options\n",
 progname,Output);
 exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x274d
movq 0x238c9(%rip), %rax     # 0x25ff8
movq (%rax), %rdi
movq 0x23a1f(%rip), %rdx     # 0x26158
movq -0x8(%rbp), %rcx
leaq 0x1b957(%rip), %rsi     # 0x1e09b
movb $0x0, %al
callq 0x2170
jmp 0x2770
movq 0x238a4(%rip), %rax     # 0x25ff8
movq (%rax), %rdi
movq 0x239fa(%rip), %rdx     # 0x26158
movq -0x8(%rbp), %rcx
leaq 0x1ba9d(%rip), %rsi     # 0x1e206
movb $0x0, %al
callq 0x2170
movq 0x23881(%rip), %rax     # 0x25ff8
movq (%rax), %rdi
movq 0x239d7(%rip), %rdx     # 0x26158
leaq 0x1b931(%rip), %rsi     # 0x1e0b9
leaq 0x239dd(%rip), %rcx     # 0x2616c
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/luac.c
// Function: pmain
static int pmain(lua_State* L)
{
 struct Smain* s = (struct Smain*)lua_touserdata(L, 1);
 int argc=s->argc;
 char** argv=s->argv;
 const Proto* f;
 int i;
 if (!lua_checkstack(L,argc)) fatal("too many input files");
 for (i=0; i<argc; i++)
 {
  const char* filename=IS("-") ? NULL : argv[i];
  if (luaL_loadfile(L,filename)!=0) fatal(lua_tostring(L,-1));
 }
 f=combine(L,argc);
 if (listing) luaU_print(f,listing>1);
 if (dumping)
 {
  FILE* D= (output==NULL) ? stdout : fopen(output,"wb");
  if (D==NULL) cannot("open");
  lua_lock(L);
  luaU_dump(L,f,writer,D,stripping);
  lua_unlock(L);
  if (ferror(D)) cannot("write");
  if (fclose(D)) cannot("close");
 }
 return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x46e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3850
cmpl $0x0, %eax
jne 0x2830
leaq 0x1b9a1(%rip), %rdi     # 0x1e1cc
callq 0x27a0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x28b5
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1ce01(%rip), %rsi     # 0x1f653
callq 0x2160
cmpl $0x0, %eax
jne 0x2864
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x2874
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x18a80
cmpl $0x0, %eax
je 0x28a8
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x44e0
movq %rax, %rdi
callq 0x27a0
jmp 0x28aa
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2837
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x29a0
movq %rax, -0x28(%rbp)
cmpl $0x0, 0x238b0(%rip)     # 0x2617c
je 0x28e6
movq -0x28(%rbp), %rdi
cmpl $0x1, 0x238a3(%rip)     # 0x2617c
setg %al
andb $0x1, %al
movzbl %al, %esi
callq 0x2cb0
cmpl $0x0, 0x2387b(%rip)     # 0x26168
je 0x2994
cmpq $0x0, 0x23865(%rip)     # 0x26160
jne 0x290d
movq 0x236cc(%rip), %rax     # 0x25fd0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x2924
movq 0x2384c(%rip), %rdi     # 0x26160
leaq 0x1b8c6(%rip), %rsi     # 0x1e1e1
callq 0x21e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x293f
leaq 0x1ca01(%rip), %rdi     # 0x1f33b
callq 0x2be0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x40(%rbp), %rcx
movl 0x2382e(%rip), %r8d     # 0x26180
leaq 0x2f7(%rip), %rdx       # 0x2c50
callq 0x96e0
movq -0x40(%rbp), %rdi
callq 0x2080
cmpl $0x0, %eax
je 0x2978
leaq 0x1b871(%rip), %rdi     # 0x1e1e4
callq 0x2be0
movq -0x40(%rbp), %rdi
callq 0x20d0
cmpl $0x0, %eax
je 0x2992
leaq 0x1b85d(%rip), %rdi     # 0x1e1ea
callq 0x2be0
jmp 0x2994
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/print.c
// Function: luaU_print
void PrintFunction(const Proto* f, int full)
{
 int i,n=f->sizep;
 PrintHeader(f);
 PrintCode(f);
 if (full)
 {
  PrintConstants(f);
  PrintLocals(f);
  PrintUpvalues(f);
 }
 for (i=0; i<n; i++) PrintFunction(f->p[i],full);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2d40
movq -0x8(%rbp), %rdi
callq 0x2f60
cmpl $0x0, -0xc(%rbp)
je 0x2cfc
movq -0x8(%rbp), %rdi
callq 0x3410
movq -0x8(%rbp), %rdi
callq 0x3490
movq -0x8(%rbp), %rdi
callq 0x3540
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2d2e
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0xc(%rbp), %esi
callq 0x2cb0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2d03
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/print.c
// Function: PrintConstants
static void PrintConstants(const Proto* f)
{
 int i,n=f->sizek;
 printf("constants (%d) for %p:\n",n,VOID(f));
 for (i=0; i<n; i++)
 {
  printf("\t%d\t",i+1);
  PrintConstant(f,i);
  printf("\n");
 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rdx
leaq 0x1b0f3(%rip), %rdi     # 0x1e527
movb $0x0, %al
callq 0x2100
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3483
movl -0xc(%rbp), %esi
addl $0x1, %esi
leaq 0x1b059(%rip), %rdi     # 0x1e4b0
movb $0x0, %al
callq 0x2100
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x35c0
leaq 0x1ac46(%rip), %rdi     # 0x1e0b7
movb $0x0, %al
callq 0x2100
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3442
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/print.c
// Function: PrintLocals
static void PrintLocals(const Proto* f)
{
 int i,n=f->sizelocvars;
 printf("locals (%d) for %p:\n",n,VOID(f));
 for (i=0; i<n; i++)
 {
  printf("\t%d\t%s\t%d\t%d\n",
  i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1);
 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rdx
leaq 0x1b08b(%rip), %rdi     # 0x1e53f
movb $0x0, %al
callq 0x2100
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3534
movl -0xc(%rbp), %esi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
addq $0x18, %rdx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rdi
shlq $0x4, %rdi
addq %rdi, %rax
movl 0xc(%rax), %r8d
addl $0x1, %r8d
leaq 0x1b032(%rip), %rdi     # 0x1e554
movb $0x0, %al
callq 0x2100
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x34c2
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/print.c
// Function: PrintUpvalues
static void PrintUpvalues(const Proto* f)
{
 int i,n=f->sizeupvalues;
 printf("upvalues (%d) for %p:\n",n,VOID(f));
 if (f->upvalues==NULL) return;
 for (i=0; i<n; i++)
 {
  printf("\t%d\t%s\n",i,getstr(f->upvalues[i]));
 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rdx
leaq 0x1affe(%rip), %rdi     # 0x1e562
movb $0x0, %al
callq 0x2100
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x3578
jmp 0x35b7
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x35b7
movl -0xc(%rbp), %esi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq $0x18, %rdx
leaq 0x1afd4(%rip), %rdi     # 0x1e579
movb $0x0, %al
callq 0x2100
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x357f
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/lua/src/print.c
// Function: PrintString
static void PrintString(const TString* ts)
{
 const char* s=getstr(ts);
 size_t i,n=ts->tsv.len;
 putchar('"');
 for (i=0; i<n; i++)
 {
  int c=s[i];
  switch (c)
  {
   case '"': printf("\\\""); break;
   case '\\': printf("\\\\"); break;
   case '\a': printf("\\a"); break;
   case '\b': printf("\\b"); break;
   case '\f': printf("\\f"); break;
   case '\n': printf("\\n"); break;
   case '\r': printf("\\r"); break;
   case '\t': printf("\\t"); break;
   case '\v': printf("\\v"); break;
   default:	if (isprint((unsigned char)c))
   			putchar(c);
		else
			printf("\\%03u",(unsigned char)c);
  }
 }
 putchar('"');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x22, %edi
callq 0x2040
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x37ea
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $-0x7, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x55, %eax
ja 0x3798
movq -0x30(%rbp), %rax
leaq 0x1abc1(%rip), %rcx     # 0x1e2b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1ae03(%rip), %rdi     # 0x1e506
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1adf3(%rip), %rdi     # 0x1e509
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1ade3(%rip), %rdi     # 0x1e50c
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1add3(%rip), %rdi     # 0x1e50f
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1adc3(%rip), %rdi     # 0x1e512
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1adb6(%rip), %rdi     # 0x1e515
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1ada9(%rip), %rdi     # 0x1e518
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1ad9c(%rip), %rdi     # 0x1e51b
movb $0x0, %al
callq 0x2100
jmp 0x37d7
leaq 0x1ad8f(%rip), %rdi     # 0x1e51e
movb $0x0, %al
callq 0x2100
jmp 0x37d7
callq 0x2280
movq (%rax), %rax
movl -0x24(%rbp), %ecx
movzbl %cl, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x37c1
movl -0x24(%rbp), %edi
callq 0x2040
jmp 0x37d5
movl -0x24(%rbp), %eax
movzbl %al, %esi
leaq 0x1ad53(%rip), %rdi     # 0x1e521
movb $0x0, %al
callq 0x2100
jmp 0x37d7
jmp 0x37d9
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x36b6
movl $0x22, %edi
callq 0x2040
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha256_Update
void pbkdf2_hmac_sha256_Update(PBKDF2_HMAC_SHA256_CTX *pctx,
                               uint32_t iterations) {
  for (uint32_t i = pctx->first; i < iterations; i++) {
    sha256_Transform(pctx->idig, pctx->g, pctx->g);
    sha256_Transform(pctx->odig, pctx->g, pctx->g);
    for (uint32_t j = 0; j < SHA256_DIGEST_LENGTH / sizeof(uint32_t); j++) {
      pctx->f[j] ^= pctx->g[j];
    }
  }
  pctx->first = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movsbl 0xa0(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x849d
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movq -0x8(%rbp), %rdx
addq $0x60, %rdx
callq 0x97c0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movq -0x8(%rbp), %rdx
addq $0x60, %rdx
callq 0x97c0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0x8, %rax
jae 0x8490
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl 0x60(%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
xorl 0x40(%rax,%rcx,4), %edx
movl %edx, 0x40(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8462
jmp 0x8492
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x841d
movq -0x8(%rbp), %rax
movb $0x0, 0xa0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha256_Final
void pbkdf2_hmac_sha256_Final(PBKDF2_HMAC_SHA256_CTX *pctx, uint8_t *key) {
#if BYTE_ORDER == LITTLE_ENDIAN
  for (uint32_t k = 0; k < SHA256_DIGEST_LENGTH / sizeof(uint32_t); k++) {
    REVERSE32(pctx->f[k], pctx->f[k]);
  }
#endif
  memcpy(key, pctx->f, SHA256_DIGEST_LENGTH);
  memzero(pctx, sizeof(PBKDF2_HMAC_SHA256_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0x8, %rax
jae 0x852c
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl 0x40(%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
shrl $0x10, %eax
movl -0x18(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movabsq $0xff00ff00, %rcx       # imm = 0xFF00FF00
andq %rcx, %rax
shrq $0x8, %rax
movl -0x18(%rbp), %ecx
andq $0xff00ff, %rcx         # imm = 0xFF00FF
shlq $0x8, %rcx
orq %rcx, %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x40(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x84c7
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rdx
movq %rdx, (%rax)
movq 0x48(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x58(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movl $0xa4, %esi
callq 0x81c0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha256
void pbkdf2_hmac_sha256(const uint8_t *pass, int passlen, const uint8_t *salt,
                        int saltlen, uint32_t iterations, uint8_t *key,
                        int keylen) {
  uint32_t last_block_size = keylen % SHA256_DIGEST_LENGTH;
  uint32_t blocks_count = keylen / SHA256_DIGEST_LENGTH;
  if (last_block_size) {
    blocks_count++;
  } else {
    last_block_size = SHA256_DIGEST_LENGTH;
  }
  for (uint32_t blocknr = 1; blocknr <= blocks_count; blocknr++) {
    PBKDF2_HMAC_SHA256_CTX pctx;
    pbkdf2_hmac_sha256_Init(&pctx, pass, passlen, salt, saltlen, blocknr);
    pbkdf2_hmac_sha256_Update(&pctx, iterations);
    uint8_t digest[SHA256_DIGEST_LENGTH];
    pbkdf2_hmac_sha256_Final(&pctx, digest);
    uint32_t key_offset = (blocknr - 1) * SHA256_DIGEST_LENGTH;
    if (blocknr < blocks_count) {
      memcpy(key + key_offset, digest, SHA256_DIGEST_LENGTH);
    } else {
      memcpy(key + key_offset, digest, last_block_size);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl 0x10(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %edx, -0x2c(%rbp)
movl 0x10(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x85c1
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x85c8
movl $0x20, -0x2c(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
ja 0x869c
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
movl -0x34(%rbp), %r9d
leaq -0xd8(%rbp), %rdi
callq 0x81f0
movl -0x20(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x8400
leaq -0x100(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x84b0
movl -0x34(%rbp), %eax
subl $0x1, %eax
shll $0x5, %eax
movl %eax, -0x104(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x866e
movq -0x28(%rbp), %rax
movl -0x104(%rbp), %ecx
movq -0x100(%rbp), %rdx
movq %rdx, (%rax,%rcx)
movq -0xf8(%rbp), %rdx
movq %rdx, 0x8(%rax,%rcx)
movq -0xf0(%rbp), %rdx
movq %rdx, 0x10(%rax,%rcx)
movq -0xe8(%rbp), %rdx
movq %rdx, 0x18(%rax,%rcx)
jmp 0x868c
movq -0x28(%rbp), %rdi
movl -0x104(%rbp), %eax
addq %rax, %rdi
leaq -0x100(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, %edx
callq 0x8090
jmp 0x868e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x85cf
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha512_Update
void pbkdf2_hmac_sha512_Update(PBKDF2_HMAC_SHA512_CTX *pctx,
                               uint32_t iterations) {
  for (uint32_t i = pctx->first; i < iterations; i++) {
    sha512_Transform(pctx->idig, pctx->g, pctx->g);
    sha512_Transform(pctx->odig, pctx->g, pctx->g);
    for (uint32_t j = 0; j < SHA512_DIGEST_LENGTH / sizeof(uint64_t); j++) {
      pctx->f[j] ^= pctx->g[j];
    }
  }
  pctx->first = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x140(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x89cc
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x8(%rbp), %rsi
addq $0xc0, %rsi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
callq 0xa2b0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xc0, %rsi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
callq 0xa2b0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0x8, %rax
jae 0x89bc
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movq 0xc0(%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
xorq 0x80(%rax,%rcx,8), %rdx
movq %rdx, 0x80(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8982
jmp 0x89be
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x892d
movq -0x8(%rbp), %rax
movb $0x0, 0x140(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha512_Final
void pbkdf2_hmac_sha512_Final(PBKDF2_HMAC_SHA512_CTX *pctx, uint8_t *key) {
#if BYTE_ORDER == LITTLE_ENDIAN
  for (uint32_t k = 0; k < SHA512_DIGEST_LENGTH / sizeof(uint64_t); k++) {
    REVERSE64(pctx->f[k], pctx->f[k]);
  }
#endif
  memcpy(key, pctx->f, SHA512_DIGEST_LENGTH);
  memzero(pctx, sizeof(PBKDF2_HMAC_SHA512_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0x8, %rax
jae 0x8a9d
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movq 0x80(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x20, %rax
movq -0x20(%rbp), %rcx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movabsq $-0xff00ff00ff0100, %rax # imm = 0xFF00FF00FF00FF00
andq -0x20(%rbp), %rax
shrq $0x8, %rax
movabsq $0xff00ff00ff00ff, %rcx # imm = 0xFF00FF00FF00FF
andq -0x20(%rbp), %rcx
shlq $0x8, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movabsq $-0xffff00010000, %rdx  # imm = 0xFFFF0000FFFF0000
andq -0x20(%rbp), %rdx
shrq $0x10, %rdx
movabsq $0xffff0000ffff, %rax   # imm = 0xFFFF0000FFFF
andq -0x20(%rbp), %rax
shlq $0x10, %rax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movq %rdx, 0x80(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x89f7
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x80, %rsi
movl $0x40, %edx
callq 0x8090
movq -0x8(%rbp), %rdi
movl $0x148, %esi            # imm = 0x148
callq 0x81c0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/pbkdf2.c
// Function: pbkdf2_hmac_sha512
void pbkdf2_hmac_sha512(const uint8_t *pass, int passlen, const uint8_t *salt,
                        int saltlen, uint32_t iterations, uint8_t *key,
                        int keylen) {
  uint32_t last_block_size = keylen % SHA512_DIGEST_LENGTH;
  uint32_t blocks_count = keylen / SHA512_DIGEST_LENGTH;
  if (last_block_size) {
    blocks_count++;
  } else {
    last_block_size = SHA512_DIGEST_LENGTH;
  }
  for (uint32_t blocknr = 1; blocknr <= blocks_count; blocknr++) {
    PBKDF2_HMAC_SHA512_CTX pctx;
    pbkdf2_hmac_sha512_Init(&pctx, pass, passlen, salt, saltlen, blocknr);
    pbkdf2_hmac_sha512_Update(&pctx, iterations);
    uint8_t digest[SHA512_DIGEST_LENGTH];
    pbkdf2_hmac_sha512_Final(&pctx, digest);
    uint32_t key_offset = (blocknr - 1) * SHA512_DIGEST_LENGTH;
    if (blocknr < blocks_count) {
      memcpy(key + key_offset, digest, SHA512_DIGEST_LENGTH);
    } else {
      memcpy(key + key_offset, digest, last_block_size);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl 0x10(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, -0x2c(%rbp)
movl 0x10(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x8b21
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8b28
movl $0x40, -0x2c(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
ja 0x8be1
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
movl -0x34(%rbp), %r9d
leaq -0x180(%rbp), %rdi
callq 0x86b0
movl -0x20(%rbp), %esi
leaq -0x180(%rbp), %rdi
callq 0x8910
leaq -0x1c0(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x89e0
movl -0x34(%rbp), %eax
subl $0x1, %eax
shll $0x6, %eax
movl %eax, -0x1c4(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x8bb3
movq -0x28(%rbp), %rdi
movl -0x1c4(%rbp), %eax
addq %rax, %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x40, %edx
callq 0x8090
jmp 0x8bd1
movq -0x28(%rbp), %rdi
movl -0x1c4(%rbp), %eax
addq %rax, %rdi
leaq -0x1c0(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, %edx
callq 0x8090
jmp 0x8bd3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x8b2f
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha1_End
char *sha1_End(SHA1_CTX* context, char buffer[]) {
	sha2_byte	digest[SHA1_DIGEST_LENGTH], *d = digest;
	int		i;

	if (buffer != (char*)0) {
		sha1_Final(context, digest);

		for (i = 0; i < SHA1_DIGEST_LENGTH; i++) {
			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
			*buffer++ = sha2_hex_digits[*d & 0x0f];
			d++;
		}
		*buffer = (char)0;
	} else {
		memzero(context, sizeof(SHA1_CTX));
	}
	memzero(digest, SHA1_DIGEST_LENGTH);
	return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9683
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9360
movl $0x0, -0x3c(%rbp)
cmpl $0x14, -0x3c(%rbp)
jge 0x967a
movq 0xea5c(%rip), %rax      # 0x18070
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq 0xea2e(%rip), %rax      # 0x18070
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9607
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
jmp 0x9691
movq -0x8(%rbp), %rdi
movl $0x60, %esi
callq 0x81c0
leaq -0x30(%rbp), %rdi
movl $0x14, %esi
callq 0x81c0
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha1_Raw
void sha1_Raw(const sha2_byte* data, size_t len, uint8_t digest[SHA1_DIGEST_LENGTH]) {
	SHA1_CTX	context;
	sha1_Init(&context);
	sha1_Update(&context, data, len);
	sha1_Final(&context, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x8bf0
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x90d0
movq -0x18(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x9360
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha256_Init
void sha256_Init(SHA256_CTX* context) {
	if (context == (SHA256_CTX*)0) {
		return;
	}
	MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH);
	memzero(context->buffer, SHA256_BLOCK_LENGTH);
	context->bitcount = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9765
jmp 0x97b2
movq -0x8(%rbp), %rax
movq 0x58c0(%rip), %rcx      # 0xf030
movq %rcx, (%rax)
movq 0x58be(%rip), %rcx      # 0xf038
movq %rcx, 0x8(%rax)
movq 0x58bb(%rip), %rcx      # 0xf040
movq %rcx, 0x10(%rax)
movq 0x58b8(%rip), %rcx      # 0xf048
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movl $0x40, %esi
callq 0x81c0
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha256_End
char *sha256_End(SHA256_CTX* context, char buffer[]) {
	sha2_byte	digest[SHA256_DIGEST_LENGTH], *d = digest;
	int		i;

	if (buffer != (char*)0) {
		sha256_Final(context, digest);

		for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
			*buffer++ = sha2_hex_digits[*d & 0x0f];
			d++;
		}
		*buffer = (char)0;
	} else {
		memzero(context, sizeof(SHA256_CTX));
	}
	memzero(digest, SHA256_DIGEST_LENGTH);
	return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa183
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9e60
movl $0x0, -0x3c(%rbp)
cmpl $0x20, -0x3c(%rbp)
jge 0xa17a
movq 0xdf5c(%rip), %rax      # 0x18070
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq 0xdf2e(%rip), %rax      # 0x18070
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xa107
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
jmp 0xa191
movq -0x8(%rbp), %rdi
movl $0x68, %esi
callq 0x81c0
leaq -0x30(%rbp), %rdi
movl $0x20, %esi
callq 0x81c0
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha256_Raw
void sha256_Raw(const sha2_byte* data, size_t len, uint8_t digest[SHA256_DIGEST_LENGTH]) {
	SHA256_CTX	context;
	sha256_Init(&context);
	sha256_Update(&context, data, len);
	sha256_Final(&context, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9750
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x9bd0
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x9e60
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha256_Data
char* sha256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) {
	SHA256_CTX	context;

	sha256_Init(&context);
	sha256_Update(&context, data, len);
	return sha256_End(&context, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9750
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x9bd0
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xa0d0
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_Init
void sha512_Init(SHA512_CTX* context) {
	if (context == (SHA512_CTX*)0) {
		return;
	}
	MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH);
	memzero(context->buffer, SHA512_BLOCK_LENGTH);
	context->bitcount[0] = context->bitcount[1] =  0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xa265
jmp 0xa2a4
movq -0x8(%rbp), %rdi
leaq 0x4de0(%rip), %rsi      # 0xf050
movl $0x40, %edx
callq 0x8090
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movl $0x80, %esi
callq 0x81c0
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_Final
void sha512_Final(SHA512_CTX* context, sha2_byte digest[]) {
	/* If no digest buffer is passed, we don't bother doing this: */
	if (digest != (sha2_byte*)0) {
		sha512_Last(context);

		/* Save the hash data for output: */
#if BYTE_ORDER == LITTLE_ENDIAN
		/* Convert FROM host byte order */
		for (int j = 0; j < 8; j++) {
			REVERSE64(context->state[j],context->state[j]);
		}
#endif
		MEMCPY_BCOPY(digest, context->state, SHA512_DIGEST_LENGTH);
	}

	/* Zero out state data */
	memzero(context, sizeof(SHA512_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xac2a
movq -0x8(%rbp), %rdi
callq 0xac40
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0xac18
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x20, %rax
movq -0x20(%rbp), %rcx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movabsq $-0xff00ff00ff0100, %rax # imm = 0xFF00FF00FF00FF00
andq -0x20(%rbp), %rax
shrq $0x8, %rax
movabsq $0xff00ff00ff00ff, %rcx # imm = 0xFF00FF00FF00FF
andq -0x20(%rbp), %rcx
shlq $0x8, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movabsq $-0xffff00010000, %rdx  # imm = 0xFFFF0000FFFF0000
andq -0x20(%rbp), %rdx
shrq $0x10, %rdx
movabsq $0xffff0000ffff, %rax   # imm = 0xFFFF0000FFFF
andq -0x20(%rbp), %rax
shlq $0x10, %rax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xab7b
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x8090
movq -0x8(%rbp), %rdi
movl $0xd0, %esi
callq 0x81c0
addq $0x20, %rsp
popq %rbp
retq
nop