// File: /workspace/github_c_makefile_star2_O0/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: rjust
static
int rjust(STRING** self, size_t s, char c)
{
    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((*self)->size(*self) >= s)
        return 0;

    if (c == '\0')
        c = ' ';
    if (reallocate_memory(self, s + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memmove((*self)->c_str(*self) + s - (*self)->size(*self),
                (*self)->c_str(*self),
                (*self)->size(*self));
        memset((*self)->c_str(*self), c, s - (*self)->size(*self));
        *((*self)->c_str(*self) + s) = '\0';
        (*self)->length = s;
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xa0(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
cmpl $0x0, %eax
je 0xc703
leaq 0xab50(%rip), %rax      # 0x17248
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
jmp 0xc871
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
cmpq -0x18(%rbp), %rax
jb 0xc729
movl $0x0, -0x4(%rbp)
jmp 0xc87d
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0xc736
movb $0x20, -0x19(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0xf100
cmpl $0x0, %eax
jge 0xc75e
leaq 0xaaf5(%rip), %rax      # 0x17248
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
jmp 0xc871
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
addq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq %rax, %rdx
movq -0x48(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x2310
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq %rax, -0x28(%rbp)
movsbl -0x19(%rbp), %eax
movb %al, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movb -0x1a(%rbp), %al
subq %rcx, %rdx
movzbl %al, %esi
callq 0x2050
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0xc87d
leaq 0xa9d0(%rip), %rax      # 0x17248
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)