user: Please show me the C implementation that matches the assembly code listed below:

```asm
<translate_with_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x150,%rsp
  mov    %rdi,-0x138(%rbp)
  mov    %rsi,-0x140(%rbp)
  mov    %rdx,-0x148(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x120(%rbp)
  movq   $0x0,-0x118(%rbp)
  cmpq   $0x0,-0x138(%rbp)
  je     L62
  cmpq   $0x0,-0x140(%rbp)
  je     L62
  cmpq   $0x0,-0x148(%rbp)
  je     L62
  mov    -0x140(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x124(%rbp)
  mov    -0x138(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L183
  cmpl   $0x0,-0x124(%rbp)
  je     L183
  mov    -0x148(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L183
  mov    -0x148(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x124(%rbp)
  jne    L166
  movl   $0x0,-0x128(%rbp)
  jmp    L134
L65:
  mov    -0x128(%rbp),%eax
  mov    %eax,%edx
  mov    -0x128(%rbp),%eax
  cltq
  mov    %dl,-0x110(%rbp,%rax,1)
  addl   $0x1,-0x128(%rbp)
L134:
  cmpl   $0xff,-0x128(%rbp)
  jle    L65
  movl   $0x0,-0x128(%rbp)
  jmp    L165
L72:
  mov    -0x128(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x148(%rbp),%rax
  add    %rax,%rdx
  mov    -0x128(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x140(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  movzbl (%rdx),%edx
  cltq
  mov    %dl,-0x110(%rbp,%rax,1)
  addl   $0x1,-0x128(%rbp)
L165:
  mov    -0x128(%rbp),%eax
  cmp    -0x124(%rbp),%eax
  jl     L72
  mov    -0x138(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <pl_cpy@plt>
  mov    %rax,-0x120(%rbp)
  cmpq   $0x0,-0x120(%rbp)
  je     L164
  movl   $0x0,-0x128(%rbp)
  jmp    L12
L67:
  mov    -0x128(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x120(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x128(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x120(%rbp),%rdx
  add    %rcx,%rdx
  cltq
  movzbl -0x110(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x128(%rbp)
L12:
  mov    -0x120(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x128(%rbp)
  jl     L67
  mov    -0x120(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  mov    -0x118(%rbp),%rax
  jmp    L148
L62:
  nop
  jmp    L189
L183:
  nop
  jmp    L189
L166:
  nop
  jmp    L189
L164:
  nop
L189:
  mov    -0x120(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x118(%rbp),%rax
L148:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L172
  call   <__stack_chk_fail@plt>
L172:
  leave
  ret
```

assistant: ```c
char *translate_with_table(char *string, unsigned char *table, char *deletechars) {
  char *tmp = NULL, *ret_val = NULL;
  char swap_table[256];
  int i;
  if (string == NULL || table == NULL || deletechars == NULL) {
    goto error_exit;
  }
  int table_size = strlen((char *)table);
  if (strlen(string) == 0 || table_size == 0 || strlen(deletechars) == 0) {
    goto error_exit;
  }
  if (table_size != strlen(deletechars)) {
    goto error_exit;
  }
  for (i = 0; i < 256; i++) {
    swap_table[i] = i;
  }
  for (i = 0; i < table_size; i++) {
    swap_table[(int)table[i]] = deletechars[i];
  }
  tmp = pl_cpy(string, NULL);
  if (tmp == NULL) {
    goto error_exit;
  }
  for (i = 0; i < strlen(tmp); i++) {
    tmp[i] = swap_table[(int)tmp[i]];
  }
  ret_val = tmp;
  return ret_val;
error_exit:
  free(tmp);
  return ret_val;
}
```