// File: /workspace/github_c_makefile_star2_O0/mgrosvenor[P]evec/./evec.h
// Function: evgrow
void* _evgrow(void* vec)
{
    ifp(!vec,
        EV_FAIL("Cannot grow an empty vector!\n");
    );

    evhd_t* hdr = EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return NULL;
    );


    const size_t storage_bytes      = hdr->slt_size * hdr->slt_count;
    const size_t new_storage_bytes  = hdr->slt_count ? storage_bytes * EV_GROWTH_FACTOR :
                                      EV_INIT_COUNT * hdr->slt_size;
    const size_t full_bytes         = EV_HDR_BYTES + new_storage_bytes;

    hdr = realloc(hdr, full_bytes);
    if (!hdr){
        EV_FAIL("No memory to grow vector up to %" PRId64 "B\n", full_bytes);
        return NULL;
    }

    memset((char*)hdr + EV_HDR_BYTES + storage_bytes, 0x00, new_storage_bytes - storage_bytes);

    hdr->slt_count  = hdr->slt_count ? hdr->slt_count * EV_GROWTH_FACTOR : EV_INIT_COUNT;

    void *vec_start = (char*)hdr + EV_HDR_BYTES;

    return vec_start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x17d0
movl $0x2, %edi
movl $0x212, %esi            # imm = 0x212
leaq 0x28b4(%rip), %rdx      # 0x4068
leaq 0x2a2a(%rip), %rcx      # 0x41e5
leaq 0x2a2b(%rip), %r8       # 0x41ed
leaq 0x299c(%rip), %r9       # 0x4165
movb $0x0, %al
callq 0x13d0
movq -0x10(%rbp), %rax
addq $-0x30, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1510
cmpl $0x0, %eax
je 0x1824
movl $0x2, %edi
movl $0x217, %esi            # imm = 0x217
leaq 0x286d(%rip), %rdx      # 0x4068
leaq 0x29e3(%rip), %rcx      # 0x41e5
leaq 0x2a02(%rip), %r8       # 0x420b
leaq 0x2955(%rip), %r9       # 0x4165
movb $0x0, %al
callq 0x13d0
movq $0x0, -0x8(%rbp)
jmp 0x192e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
imulq 0x18(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1851
movq -0x20(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
jmp 0x1861
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x10d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x18cc
movq -0x30(%rbp), %r9
movl $0x2, %edi
movl $0x223, %esi            # imm = 0x223
leaq 0x27c6(%rip), %rdx      # 0x4068
leaq 0x293c(%rip), %rcx      # 0x41e5
leaq 0x2977(%rip), %r8       # 0x4227
leaq 0x28ae(%rip), %rax      # 0x4165
movq %rax, (%rsp)
movb $0x0, %al
callq 0x13d0
movq $0x0, -0x8(%rbp)
jmp 0x192e
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
addq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
subq -0x20(%rbp), %rdx
xorl %esi, %esi
callq 0x1070
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1903
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
shlq %rax
movq %rax, -0x48(%rbp)
jmp 0x190e
movl $0x8, %eax
movq %rax, -0x48(%rbp)
jmp 0x190e
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)