ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的：

```asm
<make_multi_box2>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r10
  mov    %rdx,%r11
  mov    %rcx,%rbx
  mov    %r9d,%r12d
  lea    -0x1(%r8),%r9d
  mov    0x20(%rsp),%eax
  lea    -0x1(%rax),%ebp
  imul   0x28(%rsp),%ebp
  test   %r8d,%r8d
  je     L0
  mov    %rsi,%rcx
  mov    %r9d,%eax
  lea    0x8(%rsi,%rax,8),%r8
  lea    0x8(,%rax,8),%rsi
L12:
  mov    $0x0,%eax
L20:
  mov    (%rcx),%rdx
  movq   $0xffffffffffffffff,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L20
  add    $0x8,%rcx
  cmp    %r8,%rcx
  jne    L12
L0:
  movslq %ebp,%rcx
  cmp    %rcx,%rbx
  jbe    L5
  lea    -0x1(%r12),%eax
  lea    (%rdi,%rax,8),%r8
  lea    0x0(,%rcx,8),%rdx
  mov    %ebp,%ebp
  neg    %rbp
  lea    0x0(,%rbp,8),%rsi
L3:
  mov    (%rdi),%rax
  movsd  (%rax,%rdx,1),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  and    %r9d,%eax
  cltq
  lea    (%r10,%rax,8),%rbp
  mov    %rdx,%rax
  add    (%r8),%rax
  movsd  (%rax,%rsi,1),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  and    %r9d,%eax
  cltq
  mov    0x0(%rbp),%r12
  mov    (%r12,%rax,8),%r12
  mov    %r12,(%r11,%rdx,1)
  mov    0x0(%rbp),%rbp
  mov    %rcx,0x0(%rbp,%rax,8)
  add    $0x1,%rcx
  add    $0x8,%rdx
  cmp    %rcx,%rbx
  jne    L3
L5:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void make_multi_box2(double **ser, long **box, long *list, unsigned long l, unsigned int bs, unsigned int dim, unsigned int emb, unsigned int del, double eps) {
  int i, x, y;
  int ib = bs - 1;
  long back = (emb - 1) * del;
  for (x = 0; x < bs; x++)
    for (y = 0; y < bs; y++)
      box[x][y] = -1;
  for (i = back; i < l; i++) {
    x = (int)(ser[0][i] / eps) & ib;
    y = (int)(ser[dim - 1][i - back] / eps) & ib;
    list[i] = box[x][y];
    box[x][y] = i;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<make_multi_box2>:
  endbr64
  push   %r15
  lea    -0x1(%r8),%r15d
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    0x60(%rsp),%eax
  mov    %rdi,0x10(%rsp)
  mov    %r9d,0x1c(%rsp)
  sub    $0x1,%eax
  imul   0x68(%rsp),%eax
  movsd  %xmm0,(%rsp)
  mov    %eax,0x18(%rsp)
  test   %r8d,%r8d
  je     L4
  mov    %r15d,%eax
  mov    %rsi,%r14
  lea    0x8(%rsi,%rax,8),%rcx
  lea    0x8(,%rax,8),%r13
  mov    %rcx,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L16:
  mov    (%r14),%rdi
  mov    %r13,%rdx
  mov    $0xff,%esi
  add    $0x8,%r14
  call   <memset@plt>
  cmp    %r14,0x8(%rsp)
  jne    L16
L4:
  movslq 0x18(%rsp),%rax
  cmp    %rax,%rbp
  jbe    L0
  mov    0x1c(%rsp),%edx
  mov    0x10(%rsp),%r10
  lea    -0x1(%rdx),%esi
  mov    %eax,%edx
  mov    (%r10),%rdi
  mov    (%r10,%rsi,8),%rsi
  neg    %rdx
  lea    (%rsi,%rdx,8),%r8
  nopl   0x0(%rax)
L2:
  movsd  (%rdi,%rax,8),%xmm0
  movsd  (%rsp),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%esi
  movsd  (%r8,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  and    %r15d,%esi
  movslq %esi,%rsi
  mov    (%rbx,%rsi,8),%rsi
  cvttsd2si %xmm0,%edx
  and    %r15d,%edx
  movslq %edx,%rdx
  lea    (%rsi,%rdx,8),%rdx
  mov    (%rdx),%rsi
  mov    %rsi,(%r12,%rax,8)
  mov    %rax,(%rdx)
  add    $0x1,%rax
  cmp    %rax,%rbp
  jne    L2
L0:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void make_multi_box2(double **ser, long **box, long *list, unsigned long l, unsigned int bs, unsigned int dim, unsigned int emb, unsigned int del, double eps) {
  int i, x, y;
  int ib = bs - 1;
  long back = (emb - 1) * del;
  for (x = 0; x < bs; x++)
    for (y = 0; y < bs; y++)
      box[x][y] = -1;
  for (i = back; i < l; i++) {
    x = (int)(ser[0][i] / eps) & ib;
    y = (int)(ser[dim - 1][i - back] / eps) & ib;
    list[i] = box[x][y];
    box[x][y] = i;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<make_multi_box2>:
  endbr64
  push   %r15
  lea    -0x1(%r8),%r15d
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    0x60(%rsp),%eax
  mov    %rdi,0x10(%rsp)
  mov    %r9d,0x1c(%rsp)
  sub    $0x1,%eax
  imul   0x68(%rsp),%eax
  movsd  %xmm0,(%rsp)
  mov    %eax,0x18(%rsp)
  test   %r8d,%r8d
  je     L11
  mov    %r15d,%eax
  mov    %rsi,%r14
  lea    0x8(%rsi,%rax,8),%rcx
  lea    0x8(,%rax,8),%r13
  mov    %rcx,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L15:
  mov    (%r14),%rdi
  mov    %r13,%rdx
  mov    $0xff,%esi
  add    $0x8,%r14
  call   <memset@plt>
  cmp    %r14,0x8(%rsp)
  jne    L15
L11:
  movslq 0x18(%rsp),%rax
  cmp    %rax,%rbp
  jbe    L36
  mov    0x1c(%rsp),%edx
  mov    0x10(%rsp),%r10
  lea    -0x1(%rdx),%esi
  mov    %eax,%edx
  mov    (%r10),%rdi
  mov    (%r10,%rsi,8),%rsi
  neg    %rdx
  lea    (%rsi,%rdx,8),%r8
  nopl   0x0(%rax)
L1:
  movsd  (%rdi,%rax,8),%xmm0
  movsd  (%rsp),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%esi
  movsd  (%r8,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  and    %r15d,%esi
  movslq %esi,%rsi
  mov    (%rbx,%rsi,8),%rsi
  cvttsd2si %xmm0,%edx
  and    %r15d,%edx
  movslq %edx,%rdx
  lea    (%rsi,%rdx,8),%rdx
  mov    (%rdx),%rsi
  mov    %rsi,(%r12,%rax,8)
  mov    %rax,(%rdx)
  add    $0x1,%rax
  cmp    %rax,%rbp
  jne    L1
L36:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void make_multi_box2(double **ser, long **box, long *list, unsigned long l, unsigned int bs, unsigned int dim, unsigned int emb, unsigned int del, double eps) {
  int i, x, y;
  int ib = bs - 1;
  long back = (emb - 1) * del;
  for (x = 0; x < bs; x++)
    for (y = 0; y < bs; y++)
      box[x][y] = -1;
  for (i = back; i < l; i++) {
    x = (int)(ser[0][i] / eps) & ib;
    y = (int)(ser[dim - 1][i - back] / eps) & ib;
    list[i] = box[x][y];
    box[x][y] = i;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<uninitvar_atan>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    -0x1c(%rbp),%eax
  movd   %eax,%xmm0
  call   <atanf@plt>
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <atan@plt>
  push   -0x8(%rbp)
  push   -0x10(%rbp)
  call   <atanl@plt>
  add    $0x10,%rsp
  nop
  leave
  ret
```

assistant: ```c
void uninitvar_atan(void) {
  float f;
  (void)atanf(f);
  double d;
  (void)atan(d);
  long double ld;
  (void)atanl(ld);
}
```
user: What is the c source code of the assembly code below:

```asm
<uninitvar_atan>:
  endbr64
  sub    $0x8,%rsp
  pxor   %xmm0,%xmm0
  call   <atanf@plt>
  pxor   %xmm0,%xmm0
  call   <atan@plt>
  push   $0x0
  push   $0x0
  call   <atanl@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
void uninitvar_atan(void) {
  float f;
  (void)atanf(f);
  double d;
  (void)atan(d);
  long double ld;
  (void)atanl(ld);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<uninitvar_atan>:
  endbr64
  sub    $0x8,%rsp
  pxor   %xmm0,%xmm0
  call   <atanf@plt>
  pxor   %xmm0,%xmm0
  call   <atan@plt>
  push   $0x0
  push   $0x0
  call   <atanl@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
void uninitvar_atan(void) {
  float f;
  (void)atanf(f);
  double d;
  (void)atan(d);
  long double ld;
  (void)atanl(ld);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<uninitvar_atan>:
  endbr64
  sub    $0x8,%rsp
  pxor   %xmm0,%xmm0
  call   <atanf@plt>
  pxor   %xmm0,%xmm0
  call   <atan@plt>
  push   $0x0
  push   $0x0
  call   <atanl@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
void uninitvar_atan(void) {
  float f;
  (void)atanf(f);
  double d;
  (void)atan(d);
  long double ld;
  (void)atanl(ld);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<bh_align_free>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L9
  cmpq   $0x0,-0x8(%rbp)
  je     L9
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x8(%rbp)
L9:
  movq   $0x0,-0x8(%rbp)
  nop
  leave
  ret
```

assistant: ```c
void bh_align_free(void *buf) {
  if (buf != NULL) {
    {
      if (buf) {
        free(buf);
        (buf) = NULL;
      }
    };
  }
  buf = NULL;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<bh_align_free>:
  endbr64
  test   %rdi,%rdi
  je     L1
  sub    $0x8,%rsp
  call   <free@plt>
  add    $0x8,%rsp
  ret
L1:
  ret
```

assistant: ```c
void bh_align_free(void *buf) {
  if (buf != NULL) {
    {
      if (buf) {
        free(buf);
        (buf) = NULL;
      }
    };
  }
  buf = NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<bh_align_free>:
  endbr64
  test   %rdi,%rdi
  je     L5
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L5:
  ret
```

assistant: ```c
void bh_align_free(void *buf) {
  if (buf != NULL) {
    {
      if (buf) {
        free(buf);
        (buf) = NULL;
      }
    };
  }
  buf = NULL;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<bh_align_free>:
  endbr64
  test   %rdi,%rdi
  je     L1
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L1:
  ret
```

assistant: ```c
void bh_align_free(void *buf) {
  if (buf != NULL) {
    {
      if (buf) {
        free(buf);
        (buf) = NULL;
      }
    };
  }
  buf = NULL;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<hdoip_cli_read_ram>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <hoic_read_ram@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int hdoip_cli_read_ram(int fd, int fdr, char **argv, int argc) {
  hoic_read_ram(fd, argv[0]);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<hdoip_cli_read_ram>:
  endbr64
  sub    $0x8,%rsp
  mov    (%rdx),%rsi
  call   <hoic_read_ram@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int hdoip_cli_read_ram(int fd, int fdr, char **argv, int argc) {
  hoic_read_ram(fd, argv[0]);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<hdoip_cli_read_ram>:
  endbr64
  sub    $0x8,%rsp
  mov    (%rdx),%rsi
  call   <hoic_read_ram@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int hdoip_cli_read_ram(int fd, int fdr, char **argv, int argc) {
  hoic_read_ram(fd, argv[0]);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<hdoip_cli_read_ram>:
  endbr64
  sub    $0x8,%rsp
  mov    (%rdx),%rsi
  call   <hoic_read_ram@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int hdoip_cli_read_ram(int fd, int fdr, char **argv, int argc) {
  hoic_read_ram(fd, argv[0]);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<error>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %esi,%ecx
  mov    %edx,%eax
  mov    %edi,%edx
  mov    %dl,-0x4(%rbp)
  mov    %ecx,%edx
  mov    %dx,-0x8(%rbp)
  mov    %ax,-0xc(%rbp)
  mov    $0x45,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x6f,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movzwl -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <print_word@plt>
  mov    $0x2f,%edi
  call   <LCD_WriteChar@plt>
  movzwl -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <print_word@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
L0:
  jmp    L0
```

assistant: ```c
void error(char Pass, unsigned short int data, unsigned short int result) {
  LCD_WriteChar('E');
  LCD_WriteChar('r');
  LCD_WriteChar('r');
  LCD_WriteChar('o');
  LCD_WriteChar('r');
  LCD_WriteChar(' ');
  LCD_WriteChar(Pass);
  LCD_WriteChar(' ');
  print_word(data);
  LCD_WriteChar('/');
  print_word(result);
  LCD_WriteChar(' ');
  while (1)
    ;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<error>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %edx,%ebx
  mov    $0x45,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x6f,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movsbl %r12b,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bp,%edi
  call   <print_word@plt>
  mov    $0x2f,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bx,%edi
  call   <print_word@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
L7:
  jmp    L7
```

assistant: ```c
void error(char Pass, unsigned short int data, unsigned short int result) {
  LCD_WriteChar('E');
  LCD_WriteChar('r');
  LCD_WriteChar('r');
  LCD_WriteChar('o');
  LCD_WriteChar('r');
  LCD_WriteChar(' ');
  LCD_WriteChar(Pass);
  LCD_WriteChar(' ');
  print_word(data);
  LCD_WriteChar('/');
  print_word(result);
  LCD_WriteChar(' ');
  while (1)
    ;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<error>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    $0x45,%edi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edx,%ebx
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x6f,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movsbl %r12b,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bp,%edi
  call   <print_word@plt>
  mov    $0x2f,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bx,%edi
  call   <print_word@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
L6:
  jmp    L6
```

assistant: ```c
void error(char Pass, unsigned short int data, unsigned short int result) {
  LCD_WriteChar('E');
  LCD_WriteChar('r');
  LCD_WriteChar('r');
  LCD_WriteChar('o');
  LCD_WriteChar('r');
  LCD_WriteChar(' ');
  LCD_WriteChar(Pass);
  LCD_WriteChar(' ');
  print_word(data);
  LCD_WriteChar('/');
  print_word(result);
  LCD_WriteChar(' ');
  while (1)
    ;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<error>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    $0x45,%edi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edx,%ebx
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x6f,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x72,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movsbl %r12b,%edi
  call   <LCD_WriteChar@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bp,%edi
  call   <print_word@plt>
  mov    $0x2f,%edi
  call   <LCD_WriteChar@plt>
  movzwl %bx,%edi
  call   <print_word@plt>
  mov    $0x20,%edi
  call   <LCD_WriteChar@plt>
L8:
  jmp    L8
```

assistant: ```c
void error(char Pass, unsigned short int data, unsigned short int result) {
  LCD_WriteChar('E');
  LCD_WriteChar('r');
  LCD_WriteChar('r');
  LCD_WriteChar('o');
  LCD_WriteChar('r');
  LCD_WriteChar(' ');
  LCD_WriteChar(Pass);
  LCD_WriteChar(' ');
  print_word(data);
  LCD_WriteChar('/');
  print_word(result);
  LCD_WriteChar(' ');
  while (1)
    ;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<write_escaped_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x22,%edi
  call   <putc@plt>
  jmp    L78
L41:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  cmpb   $0x9,-0x9(%rbp)
  jne    L107
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x74,%edi
  call   <putc@plt>
  jmp    L78
L107:
  cmpb   $0xa,-0x9(%rbp)
  jne    L55
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x6e,%edi
  call   <putc@plt>
  jmp    L78
L55:
  cmpb   $0xd,-0x9(%rbp)
  jne    L90
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x72,%edi
  call   <putc@plt>
  jmp    L78
L90:
  cmpb   $0xc,-0x9(%rbp)
  jne    L1
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x66,%edi
  call   <putc@plt>
  jmp    L78
L1:
  cmpb   $0x5c,-0x9(%rbp)
  je     L86
  cmpb   $0x22,-0x9(%rbp)
  jne    L73
L86:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  movzbl -0x9(%rbp),%eax
  movsbl %al,%eax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <putc@plt>
  jmp    L78
L73:
  movzbl -0x9(%rbp),%eax
  movsbl %al,%eax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <putc@plt>
L78:
  mov    -0x20(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L41
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x22,%edi
  call   <putc@plt>
  nop
  leave
  ret
```

assistant: ```c
void write_escaped_string(FILE *fp, const char *str) {
  const char *str_limit = str + strlen(str);
  putc('"', fp);
  while (str < str_limit) {
    unsigned char c = (unsigned char)*str++;
    if (c == '\t') {
      putc('\\', fp);
      putc('t', fp);
    } else if (c == '\n') {
      putc('\\', fp);
      putc('n', fp);
    } else if (c == '\r') {
      putc('\\', fp);
      putc('r', fp);
    } else if (c == '\f') {
      putc('\\', fp);
      putc('f', fp);
    } else if (c == '\\' || c == '"') {
      putc('\\', fp);
      putc(c, fp);
    } else
      putc(c, fp);
  }
  putc('"', fp);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<write_escaped_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rsi,%rdi
  call   <strlen@plt>
  movslq %eax,%r13
  add    %rbp,%r13
  mov    %r12,%rsi
  mov    $0x22,%edi
  call   <putc@plt>
  cmp    %r13,%rbp
  jb     L129
L22:
  mov    %r12,%rsi
  mov    $0x22,%edi
  call   <putc@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L49:
  mov    %r12,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %r12,%rsi
  mov    $0x74,%edi
  call   <putc@plt>
L28:
  cmp    %rbp,%r13
  je     L22
L129:
  add    $0x1,%rbp
  movzbl -0x1(%rbp),%ebx
  cmp    $0x9,%bl
  je     L49
  cmp    $0xa,%bl
  je     L70
  cmp    $0xd,%bl
  je     L1
  cmp    $0xc,%bl
  je     L115
  cmp    $0x5c,%bl
  je     L118
  cmp    $0x22,%bl
  je     L118
  movsbl %bl,%edi
  mov    %r12,%rsi
  call   <putc@plt>
  jmp    L28
L70:
  mov    %r12,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %r12,%rsi
  mov    $0x6e,%edi
  call   <putc@plt>
  jmp    L28
L1:
  mov    %r12,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %r12,%rsi
  mov    $0x72,%edi
  call   <putc@plt>
  jmp    L28
L115:
  mov    %r12,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %r12,%rsi
  mov    $0x66,%edi
  call   <putc@plt>
  jmp    L28
L118:
  mov    %r12,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  movsbl %bl,%edi
  mov    %r12,%rsi
  call   <putc@plt>
  jmp    L28
```

assistant: ```c
void write_escaped_string(FILE *fp, const char *str) {
  const char *str_limit = str + strlen(str);
  putc('"', fp);
  while (str < str_limit) {
    unsigned char c = (unsigned char)*str++;
    if (c == '\t') {
      putc('\\', fp);
      putc('t', fp);
    } else if (c == '\n') {
      putc('\\', fp);
      putc('n', fp);
    } else if (c == '\r') {
      putc('\\', fp);
      putc('r', fp);
    } else if (c == '\f') {
      putc('\\', fp);
      putc('f', fp);
    } else if (c == '\\' || c == '"') {
      putc('\\', fp);
      putc(c, fp);
    } else
      putc(c, fp);
  }
  putc('"', fp);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<write_escaped_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    $0x22,%edi
  movslq %eax,%r12
  add    %rbx,%r12
  call   <putc@plt>
  cmp    %r12,%rbx
  jb     L2
  jmp    L109
  cs nopw 0x0(%rax,%rax,1)
L124:
  cmp    $0xa,%al
  je     L9
  cmp    $0xd,%al
  je     L118
  cmp    $0xc,%al
  je     L71
  movsbl %al,%r13d
  mov    %rbp,%rsi
  cmp    $0x5c,%al
  je     L0
  cmp    $0x22,%al
  je     L0
  mov    %r13d,%edi
  call   <putc@plt>
L43:
  cmp    %rbx,%r12
  je     L109
L2:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x9,%al
  jne    L124
  mov    %rbp,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %rbp,%rsi
  mov    $0x74,%edi
  call   <putc@plt>
  cmp    %rbx,%r12
  jne    L2
L109:
  add    $0x8,%rsp
  mov    %rbp,%rsi
  mov    $0x22,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <putc@plt>
  nopl   (%rax)
L0:
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <putc@plt>
  jmp    L43
  nop
L9:
  mov    %rbp,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %rbp,%rsi
  mov    $0x6e,%edi
  call   <putc@plt>
  jmp    L43
  nopl   0x0(%rax)
L118:
  mov    %rbp,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %rbp,%rsi
  mov    $0x72,%edi
  call   <putc@plt>
  jmp    L43
  nop
L71:
  mov    %rbp,%rsi
  mov    $0x5c,%edi
  call   <putc@plt>
  mov    %rbp,%rsi
  mov    $0x66,%edi
  call   <putc@plt>
  jmp    L43
```

assistant: ```c
void write_escaped_string(FILE *fp, const char *str) {
  const char *str_limit = str + strlen(str);
  putc('"', fp);
  while (str < str_limit) {
    unsigned char c = (unsigned char)*str++;
    if (c == '\t') {
      putc('\\', fp);
      putc('t', fp);
    } else if (c == '\n') {
      putc('\\', fp);
      putc('n', fp);
    } else if (c == '\r') {
      putc('\\', fp);
      putc('r', fp);
    } else if (c == '\f') {
      putc('\\', fp);
      putc('f', fp);
    } else if (c == '\\' || c == '"') {
      putc('\\', fp);
      putc(c, fp);
    } else
      putc(c, fp);
  }
  putc('"', fp);
}
```