// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xrle_encode_init
cram_codec *cram_xrle_encode_init(cram_stats *st,
                                  enum cram_encoding codec,
                                  enum cram_external_type option,
                                  void *dat,
                                  int version, varint_vec *vv) {
    cram_codec *c;

    if (!(c = malloc(sizeof(*c))))
        return NULL;

    c->codec  = E_XRLE;
    c->free   = cram_xrle_encode_free;
    if (option == E_LONG)
        c->encode = cram_xrle_encode_long;
    else if (option == E_INT)
        c->encode = cram_xrle_encode_int;
    else
        c->encode = cram_xrle_encode_char;
    c->store  = cram_xrle_encode_store;
    c->flush  = cram_xrle_encode_flush;

    cram_xrle_encoder *e = (cram_xrle_encoder *)dat;

    c->u.e_xrle.len_codec = cram_encoder_init(e->len_encoding, NULL,
                                              E_BYTE, e->len_dat,
                                              version, vv);
    c->u.e_xrle.lit_codec = cram_encoder_init(e->lit_encoding, NULL,
                                              E_BYTE, e->lit_dat,
                                              version, vv);
    c->u.e_xrle.cur_lit = -1;
    c->u.e_xrle.cur_len = -1;
    c->u.e_xrle.to_flush = NULL;
    c->u.e_xrle.to_flush_size = 0;

    memcpy(c->u.e_xrle.rep_score, e->rep_score, 256*sizeof(*c->u.e_xrle.rep_score));

    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl $0x880, %edi            # imm = 0x880
callq 0x4650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xe828f
movq $0x0, -0x8(%rbp)
jmp 0xe83cf
movq -0x38(%rbp), %rax
movl $0x34, (%rax)
movq -0x38(%rbp), %rax
leaq -0xd4(%rip), %rcx       # 0xe81d0
movq %rcx, 0x20(%rax)
cmpl $0x2, -0x18(%rbp)
jne 0xe82bf
movq -0x38(%rbp), %rax
leaq -0x249(%rip), %rcx      # 0xe8070
movq %rcx, 0x30(%rax)
jmp 0xe82e7
cmpl $0x1, -0x18(%rbp)
jne 0xe82d6
movq -0x38(%rbp), %rax
leaq -0x240(%rip), %rcx      # 0xe8090
movq %rcx, 0x30(%rax)
jmp 0xe82e5
movq -0x38(%rbp), %rax
leaq -0x231(%rip), %rcx      # 0xe80b0
movq %rcx, 0x30(%rax)
jmp 0xe82e7
movq -0x38(%rbp), %rax
leaq -0x562(%rip), %rcx      # 0xe7d90
movq %rcx, 0x38(%rax)
movq -0x38(%rbp), %rax
leaq -0x1051(%rip), %rcx     # 0xe72b0
movq %rcx, 0x48(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %edi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x3, %edx
callq 0xe5a20
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x3, %edx
callq 0xe5a20
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x38(%rbp), %rax
movl $0xffffffff, 0x8c(%rax) # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movl $0xffffffff, 0x88(%rax) # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movq $0x0, 0x490(%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x498(%rax)
movq -0x38(%rbp), %rdi
addq $0x60, %rdi
addq $0x30, %rdi
movq -0x40(%rbp), %rsi
addq $0x30, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x43b0
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)