ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<xilinxcorelib_a_2786250493_0543512595_sub_616253073571835568_3745213680167319624>:
  endbr64
  cmp    $0x3,%dl
  je     L0
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  push   %rbp
  lea    0x7970(%rdi),%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    0x79a8(%rdi),%rax
  mov    0xcf9c(%rdi),%edx
  mov    0x4828(%rdi),%rsi
  mov    0x38(%rax),%rdi
  call   <memcpy@plt>
  mov    0xcf9c(%rbx),%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  mov    $0x64,%ecx
  call   <xsi_driver_first_trans_delta@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  mov    $0x64,%edx
  pop    %rbx
  mov    $0x64,%esi
  pop    %rbp
  jmp    1090 <xsi_driver_intertial_reject@plt>
```

assistant: ```c
void xilinxcorelib_a_2786250493_0543512595_sub_616253073571835568_3745213680167319624(char *t0, char *t1, unsigned char t2) {
  char t4[8];
  char *t5;
  unsigned char t6;
  char *t7;
  char *t8;
  char *t9;
  char *t10;
  char *t11;
  char *t12;
  char *t13;
  char *t14;
  unsigned int t15;
  char *t16;
  char *t17;
  unsigned int t18;
  unsigned int t19;
  char *t20;
LAB0:
  t5 = (t4 + 4U);
  *((unsigned char *)t5) = t2;
  t6 = (t2 == (unsigned char)3);
  if (t6 != 0)
    goto LAB2;
LAB4:
LAB3:
LAB1:
  return;
LAB2:
  t7 = (t0 + 18472U);
  t8 = *((char **)t7);
  t7 = (t0 + 31088);
  t9 = (t7 + 56U);
  t10 = *((char **)t9);
  t11 = (t10 + 56U);
  t12 = *((char **)t11);
  t13 = (t0 + 53136U);
  t14 = (t13 + 12U);
  t15 = *((unsigned int *)t14);
  t15 = (t15 * 1U);
  memcpy(t12, t8, t15);
  t16 = (t0 + 53136U);
  t17 = (t16 + 12U);
  t18 = *((unsigned int *)t17);
  t19 = (1U * t18);
  xsi_driver_first_trans_delta(t7, 0U, t19, 100LL);
  t20 = (t0 + 31088);
  xsi_driver_intertial_reject(t20, 100LL, 100LL);
  goto LAB3;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<utime>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x40(%rbp)
  je     L25
  mov    -0x40(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x28(%rbp)
  movq   $0x0,-0x30(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L1
L25:
  mov    D8(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    D8(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
L1:
  mov    D27(%rip),%rax
  mov    (%rax),%eax
  lea    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <utimensat@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
int utime(const char *path, const struct utimbuf *times) {
  struct timespec ts[2];
  if (times) {
    ts[0].tv_sec = times->actime;
    ts[0].tv_nsec = 0;
    ts[1].tv_sec = times->modtime;
    ts[1].tv_nsec = 0;
  } else {
    ts[0].tv_nsec = UTIME_NOW;
    ts[1].tv_nsec = UTIME_NOW;
  }
  return utimensat(AT_FDCWD, path, ts, 0);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<utime>:
  endbr64
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L25
  mov    0x4(%rsi),%eax
  mov    %eax,0x8(%rsp)
  movq   $0x0,(%rsp)
  mov    (%rsi),%eax
  mov    %eax,0x18(%rsp)
  mov    $0x0,%eax
L5:
  mov    %rax,0x10(%rsp)
  mov    %rsp,%rdx
  mov    $0x0,%ecx
  mov    %rdi,%rsi
  mov    D1(%rip),%rax
  mov    (%rax),%edi
  call   <utimensat@plt>
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x38,%rsp
  ret
L25:
  mov    D5(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,(%rsp)
  jmp    L5
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int utime(const char *path, const struct utimbuf *times) {
  struct timespec ts[2];
  if (times) {
    ts[0].tv_sec = times->actime;
    ts[0].tv_nsec = 0;
    ts[1].tv_sec = times->modtime;
    ts[1].tv_nsec = 0;
  } else {
    ts[0].tv_nsec = UTIME_NOW;
    ts[1].tv_nsec = UTIME_NOW;
  }
  return utimensat(AT_FDCWD, path, ts, 0);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<utime>:
  endbr64
  sub    $0x38,%rsp
  mov    %rdi,%r8
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L14
  mov    0x4(%rsi),%eax
  movq   $0x0,(%rsp)
  mov    %eax,0x8(%rsp)
  mov    (%rsi),%eax
  mov    %eax,0x18(%rsp)
  xor    %eax,%eax
L28:
  mov    %rax,0x10(%rsp)
  mov    %rsp,%rdx
  xor    %ecx,%ecx
  mov    %r8,%rsi
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <utimensat@plt>
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L10
  add    $0x38,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L14:
  mov    D5(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,(%rsp)
  jmp    L28
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int utime(const char *path, const struct utimbuf *times) {
  struct timespec ts[2];
  if (times) {
    ts[0].tv_sec = times->actime;
    ts[0].tv_nsec = 0;
    ts[1].tv_sec = times->modtime;
    ts[1].tv_nsec = 0;
  } else {
    ts[0].tv_nsec = UTIME_NOW;
    ts[1].tv_nsec = UTIME_NOW;
  }
  return utimensat(AT_FDCWD, path, ts, 0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<utime>:
  endbr64
  sub    $0x38,%rsp
  mov    %rdi,%r8
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L21
  mov    0x4(%rsi),%eax
  mov    %eax,0x8(%rsp)
  mov    (%rsi),%eax
  mov    %eax,0x18(%rsp)
  xor    %eax,%eax
L11:
  mov    %rax,0x10(%rsp)
  mov    %rsp,%rdx
  xor    %ecx,%ecx
  mov    %r8,%rsi
  mov    %rax,(%rsp)
  mov    D10(%rip),%rax
  mov    (%rax),%edi
  call   <utimensat@plt>
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x38,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  mov    D0(%rip),%rax
  mov    (%rax),%rax
  jmp    L11
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int utime(const char *path, const struct utimbuf *times) {
  struct timespec ts[2];
  if (times) {
    ts[0].tv_sec = times->actime;
    ts[0].tv_nsec = 0;
    ts[1].tv_sec = times->modtime;
    ts[1].tv_nsec = 0;
  } else {
    ts[0].tv_nsec = UTIME_NOW;
    ts[1].tv_nsec = UTIME_NOW;
  }
  return utimensat(AT_FDCWD, path, ts, 0);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<configDoc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <codeln@plt>
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <codeln@plt>
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <codeln@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D8
datatype: string
name: parse_data
arguments: tag: D25
datatype: string
name: parse_data
arguments: tag: D3
datatype: string

tool: D8: {"xov.ctl_biased_fb", CFG_FLOAT, "0.5821", "This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D25: {"xov.ctl_biased_fb2", CFG_FLOAT, "0.999", "The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D3: {"xov.ctl_sagtobias", CFG_FLOAT, "0.1880", "This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.", INCOMPLETE_DOC},

assistant: ```c
void configDoc(int i, void *vp) {
  codeln("{\"xov.ctl_biased_fb\", CFG_FLOAT, \"0.5821\", \"This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_biased_fb2\", CFG_FLOAT, \"0.999\", \"The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_sagtobias\", CFG_FLOAT, \"0.1880\", \"This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.\", INCOMPLETE_DOC},");
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<configDoc>:
  endbr64
  sub    $0x8,%rsp
  lea    D10(%rip),%rdi
  call   <codeln@plt>
  lea    D5(%rip),%rdi
  call   <codeln@plt>
  lea    D3(%rip),%rdi
  call   <codeln@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D10
type: string
name: extract_symbolic_data
arguments: data_label: D5
type: string
name: extract_symbolic_data
arguments: data_label: D3
type: string

tool: D10: {"xov.ctl_biased_fb", CFG_FLOAT, "0.5821", "This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D5: {"xov.ctl_biased_fb2", CFG_FLOAT, "0.999", "The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D3: {"xov.ctl_sagtobias", CFG_FLOAT, "0.1880", "This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.", INCOMPLETE_DOC},

assistant: ```c
void configDoc(int i, void *vp) {
  codeln("{\"xov.ctl_biased_fb\", CFG_FLOAT, \"0.5821\", \"This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_biased_fb2\", CFG_FLOAT, \"0.999\", \"The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_sagtobias\", CFG_FLOAT, \"0.1880\", \"This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.\", INCOMPLETE_DOC},");
}
```
user: Translate the below assembly code into C programming language:

```asm
<configDoc>:
  endbr64
  sub    $0x8,%rsp
  lea    D18(%rip),%rdi
  call   <codeln@plt>
  lea    D23(%rip),%rdi
  call   <codeln@plt>
  lea    D26(%rip),%rdi
  add    $0x8,%rsp
  jmp    1050 <codeln@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D18
datatype: string
name: extract_symbolic_data
arguments: label: D23
datatype: string
name: extract_symbolic_data
arguments: label: D26
datatype: string

tool: D18: {"xov.ctl_biased_fb", CFG_FLOAT, "0.5821", "This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D23: {"xov.ctl_biased_fb2", CFG_FLOAT, "0.999", "The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D26: {"xov.ctl_sagtobias", CFG_FLOAT, "0.1880", "This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.", INCOMPLETE_DOC},

assistant: ```c
void configDoc(int i, void *vp) {
  codeln("{\"xov.ctl_biased_fb\", CFG_FLOAT, \"0.5821\", \"This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_biased_fb2\", CFG_FLOAT, \"0.999\", \"The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_sagtobias\", CFG_FLOAT, \"0.1880\", \"This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.\", INCOMPLETE_DOC},");
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<configDoc>:
  endbr64
  sub    $0x8,%rsp
  lea    D28(%rip),%rdi
  call   <codeln@plt>
  lea    D10(%rip),%rdi
  call   <codeln@plt>
  lea    D19(%rip),%rdi
  add    $0x8,%rsp
  jmp    1050 <codeln@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D28
type_infered: string
name: disassemble_data
arguments: data_tag: D10
type_infered: string
name: disassemble_data
arguments: data_tag: D19
type_infered: string

tool: D28: {"xov.ctl_biased_fb", CFG_FLOAT, "0.5821", "This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D10: {"xov.ctl_biased_fb2", CFG_FLOAT, "0.999", "The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.", INCOMPLETE_DOC},

tool: D19: {"xov.ctl_sagtobias", CFG_FLOAT, "0.1880", "This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.", INCOMPLETE_DOC},

assistant: ```c
void configDoc(int i, void *vp) {
  codeln("{\"xov.ctl_biased_fb\", CFG_FLOAT, \"0.5821\", \"This parameter behaves somewhat like an analogue tone control for bass mounted before the overdrive stage. Unity is somewhere around the value 0.6, lesser values takes away bass and lowers the volume while higher values gives more bass and more signal into the overdrive. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_biased_fb2\", CFG_FLOAT, \"0.999\", \"The fb2 parameter has the same function as fb1 but controls the signal after the overdrive stage. Together the two parameters are useful in that they can reduce the amount of bass going into the overdrive and then recover it on the other side. Must be less than 1.0.\", INCOMPLETE_DOC},");
  codeln("{\"xov.ctl_sagtobias\", CFG_FLOAT, \"0.1880\", \"This parameter is part of an attempt to recreate an artefact called 'power sag'. When a power amplifier is under heavy load the voltage drops and alters the operating parameters of the unit, usually towards more and other kinds of distortion. The sagfb parameter controls the rate of recovery from the sag effect when the load is lifted. Must be less than 1.0.\", INCOMPLETE_DOC},");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x1388,%edi
  call   <usleep@plt>
  mov    $0x0,%eax
  call   <bar@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void foo(void) {
  usleep(5000);
  bar();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<foo>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1388,%edi
  call   <usleep@plt>
  mov    $0x0,%eax
  call   <bar@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void foo(void) {
  usleep(5000);
  bar();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<foo>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1388,%edi
  call   <usleep@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1060 <bar@plt>
```

assistant: ```c
void foo(void) {
  usleep(5000);
  bar();
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<get_filename>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L27
  cmpq   $0x0,-0x28(%rbp)
  je     L27
  cmpl   $0x0,-0x2c(%rbp)
  je     L27
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L27:
  mov    -0x2c(%rbp),%eax
  lea    0x20(%rax),%ecx
  mov    -0x2c(%rbp),%edi
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <low_get_string@plt>
  leave
  ret
```

assistant: ```c
int get_filename(char **str, FILE *f, const char *prefix, unsigned pfxlen) {
  char *buf = malloc(pfxlen + 32);
  if (buf && prefix && pfxlen)
    memcpy(buf, prefix, pfxlen);
  return low_get_string(str, f, buf, pfxlen + 32, pfxlen);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_filename>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  mov    %rdx,%r12
  mov    %ecx,%ebx
  lea    0x20(%rcx),%r15d
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r12,%r12
  setne  %dl
  test   %ebx,%ebx
  setne  %al
  test   %al,%dl
  je     L3
  test   %rbp,%rbp
  jne    L23
L3:
  mov    %ebx,%r8d
  mov    %r15d,%ecx
  mov    %rbp,%rdx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <low_get_string@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  jmp    L3
```

assistant: ```c
int get_filename(char **str, FILE *f, const char *prefix, unsigned pfxlen) {
  char *buf = malloc(pfxlen + 32);
  if (buf && prefix && pfxlen)
    memcpy(buf, prefix, pfxlen);
  return low_get_string(str, f, buf, pfxlen + 32, pfxlen);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_filename>:
  endbr64
  push   %r15
  lea    0x20(%rcx),%r15d
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rdi,%r13
  mov    %r15d,%edi
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  test   %rbp,%rbp
  setne  %dl
  test   %ebx,%ebx
  mov    %rax,%r12
  setne  %al
  test   %al,%dl
  je     L18
  test   %r12,%r12
  jne    L22
L18:
  add    $0x8,%rsp
  mov    %ebx,%r8d
  mov    %r15d,%ecx
  mov    %r12,%rdx
  pop    %rbx
  mov    %r14,%rsi
  pop    %rbp
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <low_get_string@plt>
  nopw   0x0(%rax,%rax,1)
L22:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  jmp    L18
```

assistant: ```c
int get_filename(char **str, FILE *f, const char *prefix, unsigned pfxlen) {
  char *buf = malloc(pfxlen + 32);
  if (buf && prefix && pfxlen)
    memcpy(buf, prefix, pfxlen);
  return low_get_string(str, f, buf, pfxlen + 32, pfxlen);
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_filename>:
  endbr64
  push   %r15
  lea    0x20(%rcx),%r15d
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rdi,%r13
  mov    %r15d,%edi
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  test   %rbp,%rbp
  setne  %dl
  test   %ebx,%ebx
  mov    %rax,%r12
  setne  %al
  test   %al,%dl
  je     L8
  test   %r12,%r12
  jne    L4
L8:
  add    $0x8,%rsp
  mov    %ebx,%r8d
  mov    %r15d,%ecx
  mov    %r12,%rdx
  pop    %rbx
  mov    %r14,%rsi
  pop    %rbp
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <low_get_string@plt>
  nopw   0x0(%rax,%rax,1)
L4:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  jmp    L8
```

assistant: ```c
int get_filename(char **str, FILE *f, const char *prefix, unsigned pfxlen) {
  char *buf = malloc(pfxlen + 32);
  if (buf && prefix && pfxlen)
    memcpy(buf, prefix, pfxlen);
  return low_get_string(str, f, buf, pfxlen + 32, pfxlen);
}
```