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

```asm
<printer_print>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%r14
  mov    %rcx,%r15
  mov    %r8,%r13
  mov    %r8,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    $0x80,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L57
L39:
  lea    D90(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D123(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L67
L86:
  mov    %rbp,%rcx
  mov    %r12,%rdx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fwrite@plt>
  cmp    %rax,%r12
  jne    L65
L24:
  mov    %rbp,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  jne    L26
  mov    $0x0,%eax
  call   <connect_to_server@plt>
  mov    %rax,%rbp
  mov    %rax,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D79(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rdx
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbx,%rdx
  lea    D74(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  test   %r15,%r15
  je     L34
  mov    %r15,%rdx
  lea    D77(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L34:
  mov    0x8(%rsp),%rdx
  lea    D9(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D103(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D34(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L12:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  lea    D121(%rip),%rdi
  call   <perror@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L39
L67:
  lea    D70(%rip),%rdi
  call   <perror@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L86
L65:
  lea    D48(%rip),%rdi
  call   <perror@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L24
L26:
  lea    D104(%rip),%rdi
  call   <perror@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L12
```

tool_calls: name: read_data
arguments: tag: D90
type: string
name: read_data
arguments: tag: D123
type: string
name: read_data
arguments: tag: D79
type: string
name: read_data
arguments: tag: D15
type: string
name: read_data
arguments: tag: D74
type: string
name: read_data
arguments: tag: D77
type: string
name: read_data
arguments: tag: D9
type: string
name: read_data
arguments: tag: D103
type: string
name: read_data
arguments: tag: D34
type: string
name: read_data
arguments: tag: D121
type: string
name: read_data
arguments: tag: D70
type: string
name: read_data
arguments: tag: D48
type: string
name: read_data
arguments: tag: D104
type: string

tool: D90: /tmp/print_job_

tool: D123: w

tool: D79: NEW


tool: D15: NAME:%s


tool: D74: FILE:%s


tool: D77: DESCRIPTION:%s


tool: D9: PRINTER:%s


tool: D103: PRINT


tool: D34: EXIT


tool: D121: malloc

tool: D70: fopen

tool: D48: fwrite

tool: D104: fclose

assistant: ```c
int printer_print(int *handle __attribute__((unused)), char *driver, char *job_name, char *description, char *data) {
  size_t datasize = strlen(data);
  char *tmpfile_name = malloc(128);
  if (tmpfile_name == NULL) {
    perror("malloc");
    abort();
  }
  strcpy(tmpfile_name, "/tmp/print_job_");
  strcat(tmpfile_name, job_name);
  FILE *tmpfile = fopen(tmpfile_name, "w");
  if (tmpfile == NULL) {
    perror("fopen");
    free(tmpfile_name);
    abort();
  }
  size_t count = fwrite(data, 1, datasize, tmpfile);
  if (count != datasize) {
    perror("fwrite");
    fclose(tmpfile);
    free(tmpfile_name);
    abort();
  }
  if (fclose(tmpfile)) {
    perror("fclose");
    fclose(tmpfile);
    free(tmpfile_name);
    return -1;
  }
  FILE *conn = connect_to_server();
  fprintf(conn, "NEW\n");
  fprintf(conn, "NAME:%s\n", job_name);
  fprintf(conn, "FILE:%s\n", tmpfile_name);
  if (description != NULL) {
    fprintf(conn, "DESCRIPTION:%s\n", description);
  }
  fprintf(conn, "PRINTER:%s\n", driver);
  fprintf(conn, "PRINT\n");
  fprintf(conn, "EXIT\n");
  free(tmpfile_name);
  fclose(conn);
  return 0;
}
```