// File: chhylp123[P]hifiasm/Assembly.cpp
// Function: push_cigar(Compressed_Cigar_record*, long long, Cigar_record*)
inline void push_cigar(Compressed_Cigar_record* records, long long ID, Cigar_record* input)
{
    if (input->length > records[ID].size)
    {
        records[ID].size = input->length;
        records[ID].record = (uint32_t*)realloc(records[ID].record, records[ID].size*sizeof(uint32_t));     
    }
    records[ID].length = input->length;
    memcpy(records[ID].record, input->record, input->length*sizeof(uint32_t));

    if (input->lost_base_length > records[ID].lost_base_size)
    {
        records[ID].lost_base_size = input->lost_base_length;
        records[ID].lost_base = (char*)realloc(records[ID].lost_base, records[ID].lost_base_size);
    }
    records[ID].lost_base_length = input->lost_base_length;
    memcpy(records[ID].lost_base, input->lost_base, input->lost_base_length);

    records[ID].new_length = input->new_read_length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x1c924
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
shlq $0x2, %rdx
callq 0x2180
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rcx
movl 0x1c(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x1c9d3
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, %esi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
callq 0x2180
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)