user: What is the c source code of the assembly code below?

```asm
<make_edit_script>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %ecx,-0x48(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x1,-0x28(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  je     L114
  mov    $0x30,%eax
  jmp    L132
L114:
  mov    $0x31,%eax
L132:
  mov    %al,-0x2d(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x48(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  orb    $0x80,-0x2d(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl -0x2d(%rbp),%edx
  mov    %dl,(%rax)
  movl   $0x0,-0x1c(%rbp)
  jmp    L61
L120:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L62
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L74
L62:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L19
  movl   $0x0,-0x20(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L32
  movl   $0x1,-0x24(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <to_octal_str@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x69,(%rax)
  movl   $0x0,-0x18(%rbp)
  jmp    L37
L105:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
L37:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L105
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L32:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  jmp    L74
L19:
  movl   $0x0,-0x24(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jne    L93
  movl   $0x1,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <to_octal_str@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x73,(%rax)
  movl   $0x0,-0x14(%rbp)
  jmp    L10
L24:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x14(%rbp)
L10:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L93:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
L74:
  addl   $0x1,-0x1c(%rbp)
L61:
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jl     L120
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *make_edit_script(char *str, char *ref, bool dir, int length) {
  int last_edit = 0, current = 1;
  char *edit_script, *octal, direction = dir ? '0' : '1';
  bool insert_open = false, subdel_open = false;
  edit_script = malloc(3 * length * sizeof(*edit_script));
  assert(edit_script);
  direction |= ((char)0x80);
  edit_script[0] = direction;
  for (int i = 0; i < length; i++) {
    if (str[i] == ref[i]) {
      insert_open = false;
      subdel_open = false;
    } else {
      if (ref[i] == '-') {
        subdel_open = false;
        if (!insert_open) {
          insert_open = true;
          octal = to_octal_str(i - last_edit);
          edit_script[current++] = 'i';
          for (int j = 0; octal[j] != '\0'; j++)
            edit_script[current++] = octal[j];
          last_edit = i;
          free(octal);
        }
        edit_script[current++] = str[i];
      } else {
        insert_open = false;
        if (!subdel_open) {
          subdel_open = true;
          octal = to_octal_str(i - last_edit);
          edit_script[current++] = 's';
          for (int j = 0; octal[j] != '\0'; j++)
            edit_script[current++] = octal[j];
          last_edit = i;
          free(octal);
        }
        edit_script[current++] = str[i];
      }
    }
  }
  edit_script = realloc(edit_script, (current + 1) * sizeof(*edit_script));
  assert(edit_script);
  edit_script[current] = '\0';
  return edit_script;
}
```