// File: /workspace/github_c_makefile_star2_O0/alexgirao[P]aimant/str.c
// Function: str_shiftr
void str_shiftr(struct str *s, int start, int end, int n, int pad)
{
  int i, window_size;
  char *ss;

  if (start < 0) {
    start = s->len + start;
  }

  if (end < 0) {
    end = s->len + end;
  }

  assert(n >= 0);
  assert(start >= 0);
  assert(start <= s->len);

  window_size = end - start;

  assert(end >= 0);
  assert(start <= end);
  assert(n <= window_size);

  if (end > s->len) {
    /* end is exclusive, so its len compatible
     */
    str_alloc(s, end);
    s->len = end;
  }
  ss = s->s + start;
  bcopyr(ss + n, window_size - n, ss);

  for (i=0; i<n; i++) {
    ss[i] = pad;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0xf12c
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0xf13f
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xf147
jmp 0xf166
leaq 0x120a(%rip), %rdi      # 0x10358
leaq 0x32c3(%rip), %rsi      # 0x12418
movl $0x1c4, %edx            # imm = 0x1C4
leaq 0x3415(%rip), %rcx      # 0x12576
callq 0x21a0
cmpl $0x0, -0xc(%rbp)
jl 0xf16e
jmp 0xf18d
leaq 0x3433(%rip), %rdi      # 0x125a8
leaq 0x329c(%rip), %rsi      # 0x12418
movl $0x1c5, %edx            # imm = 0x1C5
leaq 0x33ee(%rip), %rcx      # 0x12576
callq 0x21a0
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0xf19b
jmp 0xf1ba
leaq 0x3411(%rip), %rdi      # 0x125b3
leaq 0x326f(%rip), %rsi      # 0x12418
movl $0x1c6, %edx            # imm = 0x1C6
leaq 0x33c1(%rip), %rcx      # 0x12576
callq 0x21a0
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0xf1cb
jmp 0xf1ea
leaq 0x33f1(%rip), %rdi      # 0x125c3
leaq 0x323f(%rip), %rsi      # 0x12418
movl $0x1ca, %edx            # imm = 0x1CA
leaq 0x3391(%rip), %rcx      # 0x12576
callq 0x21a0
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jg 0xf1f4
jmp 0xf213
leaq 0x33d1(%rip), %rdi      # 0x125cc
leaq 0x3216(%rip), %rsi      # 0x12418
movl $0x1cb, %edx            # imm = 0x1CB
leaq 0x3368(%rip), %rcx      # 0x12576
callq 0x21a0
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jg 0xf21d
jmp 0xf23c
leaq 0x33b5(%rip), %rdi      # 0x125d9
leaq 0x31ed(%rip), %rsi      # 0x12418
movl $0x1cc, %edx            # imm = 0x1CC
leaq 0x333f(%rip), %rcx      # 0x12576
callq 0x21a0
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0xf25e
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xe370
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movl -0x20(%rbp), %esi
subl -0x14(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0xf2c0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xf2b4
movl -0x18(%rbp), %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xf291
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)