ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<spec_count>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L17
L20:
  cmpb   $0x5f,-0x5(%rbp)
  je     L17
  addl   $0x1,-0x4(%rbp)
L17:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x5(%rbp)
  cmpb   $0x0,-0x5(%rbp)
  jne    L20
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int spec_count(char *spec) {
  int cnt = 0;
  char typ;
  while ((typ = *spec++))
    if (typ != '_')
      cnt++;
  return cnt;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<spec_count>:
  endbr64
  lea    0x1(%rdi),%rdx
  movzbl (%rdi),%eax
  test   %al,%al
  je     L8
  mov    $0x0,%ecx
L19:
  cmp    $0x5f,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,%ecx
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L19
L16:
  mov    %ecx,%eax
  ret
L8:
  mov    $0x0,%ecx
  jmp    L16
```

assistant: ```c
int spec_count(char *spec) {
  int cnt = 0;
  char typ;
  while ((typ = *spec++))
    if (typ != '_')
      cnt++;
  return cnt;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<spec_count>:
  endbr64
  movzbl (%rdi),%eax
  lea    0x1(%rdi),%rdx
  xor    %r8d,%r8d
  test   %al,%al
  je     L18
  nopw   0x0(%rax,%rax,1)
L7:
  cmp    $0x5f,%al
  setne  %al
  add    $0x1,%rdx
  movzbl %al,%eax
  add    %eax,%r8d
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L7
L18:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int spec_count(char *spec) {
  int cnt = 0;
  char typ;
  while ((typ = *spec++))
    if (typ != '_')
      cnt++;
  return cnt;
}
```
user: What is the c source code of the assembly code below:

```asm
<spec_count>:
  endbr64
  movzbl (%rdi),%eax
  lea    0x1(%rdi),%rdx
  xor    %r8d,%r8d
  test   %al,%al
  je     L6
  nopw   0x0(%rax,%rax,1)
L4:
  cmp    $0x5f,%al
  setne  %al
  add    $0x1,%rdx
  movzbl %al,%eax
  add    %eax,%r8d
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L4
L6:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int spec_count(char *spec) {
  int cnt = 0;
  char typ;
  while ((typ = *spec++))
    if (typ != '_')
      cnt++;
  return cnt;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<swapu16_cond>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %esi,-0x18(%rbp)
  mov    %ax,-0x14(%rbp)
  movzwl -0x14(%rbp),%eax
  mov    %ax,-0x2(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  je     L3
  movzwl -0x14(%rbp),%eax
  rol    $0x8,%ax
  mov    %ax,-0x2(%rbp)
L3:
  movzwl -0x2(%rbp),%eax
  mov    %eax,%edi
  call   <foou16@plt>
  leave
  ret
```

assistant: ```c
unsigned short swapu16_cond(unsigned short x, int y) {
  unsigned short z = x;
  if (y)
    z = __builtin_bswap16(x);
  return foou16(z);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<swapu16_cond>:
  endbr64
  sub    $0x8,%rsp
  mov    %edi,%eax
  rol    $0x8,%ax
  test   %esi,%esi
  cmovne %eax,%edi
  movzwl %di,%edi
  call   <foou16@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
unsigned short swapu16_cond(unsigned short x, int y) {
  unsigned short z = x;
  if (y)
    z = __builtin_bswap16(x);
  return foou16(z);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<swapu16_cond>:
  endbr64
  mov    %edi,%eax
  rol    $0x8,%ax
  test   %esi,%esi
  cmovne %eax,%edi
  movzwl %di,%edi
  jmp    1050 <foou16@plt>
```

assistant: ```c
unsigned short swapu16_cond(unsigned short x, int y) {
  unsigned short z = x;
  if (y)
    z = __builtin_bswap16(x);
  return foou16(z);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<draw_hist>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    $0x400,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    $0x20000,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  lea    0x40(%r13),%rcx
  lea    0x4040(%r13),%r9
  mov    $0x0,%r8d
  mov    $0x0,%esi
  mov    $0x0,%r10d
  jmp    L94
L19:
  mov    %r8d,%edi
  shl    $0x8,%edi
  lea    0xfff(%rdi),%eax
  cmovns %edi,%eax
  sar    $0xc,%eax
  cltq
  mov    %edx,(%rbx,%rax,4)
  cmp    %edx,%esi
  cmovl  %edx,%esi
  add    $0x10,%r8
  add    $0x40,%rcx
  cmp    %r9,%rcx
  je     L12
L94:
  lea    -0x40(%rcx),%rax
  mov    %r10d,%edx
L15:
  add    (%rax),%edx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L15
  jmp    L19
L12:
  test   %r12d,%r12d
  cmovne %r12d,%esi
  mov    %rbp,%r8
  mov    $0x0,%edi
  jmp    L65
L91:
  movw   $0x0,(%rcx)
L33:
  add    $0x1,%edx
  add    $0x200,%rcx
  cmp    $0x100,%edx
  je     L36
L99:
  cmp    %edx,%eax
  jl     L91
  movw   $0xfff,(%rcx)
  jmp    L33
L36:
  add    $0x1,%rdi
  add    $0x2,%r8
  cmp    $0x100,%rdi
  je     L93
L65:
  mov    (%rbx,%rdi,4),%edx
  mov    %edx,%eax
  shl    $0x8,%eax
  sub    %edx,%eax
  cltd
  idiv   %esi
  mov    %r8,%rcx
  mov    $0x0,%edx
  jmp    L99
L93:
  mov    $0x20000,%edx
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <put_image@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D5
type_infered: string

tool: D5: hist.img

assistant: ```c
void draw_hist(int *bin, int max) {
  int i, j, sum, amax, ncol = 256, nrow = 256, *sbin;
  short int *hist;
  sbin = (int *)malloc(ncol * sizeof(int));
  hist = (short int *)malloc(ncol * nrow * sizeof(short int));
  amax = 0;
  for (i = 0; i < 4096; i += (4096 / ncol)) {
    sum = 0;
    for (j = 0; j < (4096 / ncol); ++j)
      sum += *(bin + i + j);
    *(sbin + i * ncol / 4096) = sum;
    if (sum > amax)
      amax = sum;
  }
  if (max != 0)
    amax = max;
  for (i = 0; i < ncol; ++i) {
    for (j = 0; j < nrow; ++j) {
      if (j <= (*(sbin + i) * (nrow - 1) / amax))
        *(hist + i + ncol * j) = 4096 - 1;
      else
        *(hist + i + ncol * j) = 0;
    }
  }
  put_image((unsigned char *)hist, "hist.img", 2 * ncol * nrow);
  free(hist);
  free(sbin);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<draw_hist>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x400,%edi
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    $0x20000,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  lea    0x40(%rbx),%rcx
  xor    %esi,%esi
  xor    %r9d,%r9d
  mov    %rax,%r12
  lea    0x4040(%rbx),%rdi
L19:
  lea    -0x40(%rcx),%rax
  xor    %edx,%edx
  nopl   0x0(%rax)
L36:
  add    (%rax),%edx
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L36
  mov    %esi,%eax
  shl    $0x8,%eax
  sar    $0xc,%eax
  cmp    %edx,%r9d
  cmovl  %edx,%r9d
  cltq
  add    $0x40,%rcx
  add    $0x10,%rsi
  mov    %edx,0x0(%rbp,%rax,4)
  cmp    %rcx,%rdi
  jne    L19
  test   %r13d,%r13d
  mov    %r12,%r11
  mov    $0xfff,%r8d
  cmovne %r13d,%r9d
  xor    %r10d,%r10d
  xor    %edi,%edi
L27:
  mov    0x0(%rbp,%r10,4),%edx
  mov    %r11,%rcx
  mov    %edx,%eax
  shl    $0x8,%eax
  sub    %edx,%eax
  cltd
  idiv   %r9d
  xor    %edx,%edx
  nop
L28:
  cmp    %edx,%eax
  mov    %edi,%esi
  cmovge %r8d,%esi
  add    $0x1,%edx
  add    $0x200,%rcx
  mov    %si,-0x200(%rcx)
  cmp    $0x100,%edx
  jne    L28
  add    $0x1,%r10
  add    $0x2,%r11
  cmp    $0x100,%r10
  jne    L27
  mov    %r12,%rdi
  mov    $0x20000,%edx
  lea    D9(%rip),%rsi
  xor    %eax,%eax
  call   <put_image@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <free@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D9
datatype: string

tool: D9: hist.img

assistant: ```c
void draw_hist(int *bin, int max) {
  int i, j, sum, amax, ncol = 256, nrow = 256, *sbin;
  short int *hist;
  sbin = (int *)malloc(ncol * sizeof(int));
  hist = (short int *)malloc(ncol * nrow * sizeof(short int));
  amax = 0;
  for (i = 0; i < 4096; i += (4096 / ncol)) {
    sum = 0;
    for (j = 0; j < (4096 / ncol); ++j)
      sum += *(bin + i + j);
    *(sbin + i * ncol / 4096) = sum;
    if (sum > amax)
      amax = sum;
  }
  if (max != 0)
    amax = max;
  for (i = 0; i < ncol; ++i) {
    for (j = 0; j < nrow; ++j) {
      if (j <= (*(sbin + i) * (nrow - 1) / amax))
        *(hist + i + ncol * j) = 4096 - 1;
      else
        *(hist + i + ncol * j) = 0;
    }
  }
  put_image((unsigned char *)hist, "hist.img", 2 * ncol * nrow);
  free(hist);
  free(sbin);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<draw_hist>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    $0x400,%edi
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    $0x20000,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %r12,%rdx
  xor    %ecx,%ecx
  xor    %esi,%esi
  mov    %rax,%r13
L13:
  mov    0x4(%rdx),%eax
  mov    %ecx,%r8d
  add    (%rdx),%eax
  add    0x8(%rdx),%eax
  add    0xc(%rdx),%eax
  sar    $0xc,%r8d
  add    0x10(%rdx),%eax
  add    0x14(%rdx),%eax
  movslq %r8d,%r8
  add    0x18(%rdx),%eax
  add    0x1c(%rdx),%eax
  add    0x20(%rdx),%eax
  add    0x24(%rdx),%eax
  add    0x28(%rdx),%eax
  add    0x2c(%rdx),%eax
  add    0x30(%rdx),%eax
  add    0x34(%rdx),%eax
  add    0x38(%rdx),%eax
  add    0x3c(%rdx),%eax
  cmp    %eax,%esi
  mov    %eax,0x0(%rbp,%r8,4)
  cmovl  %eax,%esi
  add    $0x1000,%ecx
  add    $0x40,%rdx
  cmp    $0x100000,%ecx
  jne    L13
  test   %ebx,%ebx
  mov    %r13,%r9
  cmovne %ebx,%esi
  xor    %r8d,%r8d
L46:
  mov    0x0(%rbp,%r8,4),%edx
  mov    %r9,%rcx
  mov    %edx,%eax
  shl    $0x8,%eax
  sub    %edx,%eax
  cltd
  idiv   %esi
  xor    %edx,%edx
  nopl   0x0(%rax,%rax,1)
L7:
  cmp    %eax,%edx
  jle    L54
  xor    %r10d,%r10d
  add    $0x1,%edx
  add    $0x200,%rcx
  mov    %r10w,-0x200(%rcx)
  cmp    $0x100,%edx
  jne    L7
L53:
  add    $0x1,%r8
  add    $0x2,%r9
  cmp    $0x100,%r8
  jne    L46
  mov    %r13,%rdi
  mov    $0x20000,%edx
  lea    D9(%rip),%rsi
  xor    %eax,%eax
  call   <put_image@plt>
  mov    %r13,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <free@plt>
  nopw   0x0(%rax,%rax,1)
L54:
  mov    $0xfff,%edi
  add    $0x1,%edx
  add    $0x200,%rcx
  mov    %di,-0x200(%rcx)
  cmp    $0x100,%edx
  jne    L7
  jmp    L53
```

tool_calls: name: parse_data
arguments: data_tag: D9
datatype: string

tool: D9: hist.img

assistant: ```c
void draw_hist(int *bin, int max) {
  int i, j, sum, amax, ncol = 256, nrow = 256, *sbin;
  short int *hist;
  sbin = (int *)malloc(ncol * sizeof(int));
  hist = (short int *)malloc(ncol * nrow * sizeof(short int));
  amax = 0;
  for (i = 0; i < 4096; i += (4096 / ncol)) {
    sum = 0;
    for (j = 0; j < (4096 / ncol); ++j)
      sum += *(bin + i + j);
    *(sbin + i * ncol / 4096) = sum;
    if (sum > amax)
      amax = sum;
  }
  if (max != 0)
    amax = max;
  for (i = 0; i < ncol; ++i) {
    for (j = 0; j < nrow; ++j) {
      if (j <= (*(sbin + i) * (nrow - 1) / amax))
        *(hist + i + ncol * j) = 4096 - 1;
      else
        *(hist + i + ncol * j) = 0;
    }
  }
  put_image((unsigned char *)hist, "hist.img", 2 * ncol * nrow);
  free(hist);
  free(sbin);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<read_some>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    $0x50,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rcx
  mov    -0x14(%rbp),%eax
  mov    $0x50,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L1
  mov    $0x0,%eax
  jmp    L10
L1:
  mov    -0x8(%rbp),%rax
L10:
  leave
  ret
```

assistant: ```c
char *read_some(int connfd) {
  char *feedback = malloc(80 * sizeof(char));
  int n = read(connfd, feedback, 80);
  if (n == 0) {
    return NULL;
  }
  return feedback;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<read_some>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    $0x50,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    $0x50,%edx
  mov    %rax,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  test   %eax,%eax
  mov    $0x0,%eax
  cmove  %rax,%rbx
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char *read_some(int connfd) {
  char *feedback = malloc(80 * sizeof(char));
  int n = read(connfd, feedback, 80);
  if (n == 0) {
    return NULL;
  }
  return feedback;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<read_some>:
  endbr64
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  mov    $0x50,%edi
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    $0x50,%edx
  mov    %rax,%rsi
  mov    %rax,%r12
  call   <read@plt>
  test   %eax,%eax
  mov    $0x0,%eax
  cmove  %rax,%r12
  add    $0x8,%rsp
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *read_some(int connfd) {
  char *feedback = malloc(80 * sizeof(char));
  int n = read(connfd, feedback, 80);
  if (n == 0) {
    return NULL;
  }
  return feedback;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<read_some>:
  endbr64
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  mov    $0x50,%edi
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    $0x50,%edx
  mov    %rax,%rsi
  mov    %rax,%r12
  call   <read@plt>
  test   %eax,%eax
  mov    $0x0,%eax
  cmove  %rax,%r12
  add    $0x8,%rsp
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *read_some(int connfd) {
  char *feedback = malloc(80 * sizeof(char));
  int n = read(connfd, feedback, 80);
  if (n == 0) {
    return NULL;
  }
  return feedback;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<f11_2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  subl   $0x1,-0x4(%rbp)
  mov    $0x0,%eax
  call   <clang_analyzer_warnIfReached@plt>
  nop
  leave
  ret
```

assistant: ```c
void f11_2(void) {
  int x;
  x--;
  clang_analyzer_warnIfReached();
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<f11_2>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <clang_analyzer_warnIfReached@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void f11_2(void) {
  int x;
  x--;
  clang_analyzer_warnIfReached();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<f11_2>:
  endbr64
  xor    %eax,%eax
  jmp    1050 <clang_analyzer_warnIfReached@plt>
```

assistant: ```c
void f11_2(void) {
  int x;
  x--;
  clang_analyzer_warnIfReached();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<_conf_apply_element>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L25
  mov    -0x10(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L25
  cmpq   $0x0,-0x20(%rbp)
  je     L1
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L1
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <err_setlogfile@plt>
  mov    $0x0,%eax
  call   <err_getdest@plt>
  or     $0x4,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
  jmp    L25
L1:
  mov    $0x0,%eax
  call   <err_getdest@plt>
  and    $0xfffffffb,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
L25:
  mov    -0x8(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L41
  mov    -0x10(%rbp),%rax
  lea    D31(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L41
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <err_setlevel@plt>
L41:
  mov    -0x8(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L87
  mov    -0x10(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L87
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <err_settruncate@plt>
L87:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D46
type_infered: string
name: read_data
arguments: label: D22
type_infered: string
name: read_data
arguments: label: D31
type_infered: string
name: read_data
arguments: label: D6
type_infered: string

tool: D46: general

tool: D22: logfile

tool: D31: debuglevel

tool: D6: truncate

assistant: ```c
void _conf_apply_element(char *section, char *key, char *cold, char *cnew) {
  if ((strcmp(section, "general") == 0) && (strcmp(key, "logfile") == 0)) {
    if ((cnew) && strlen(cnew)) {
      err_setlogfile(cnew);
      err_setdest(err_getdest() | 4);
    } else {
      err_setdest(err_getdest() & ~4);
    }
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "debuglevel") == 0)) {
    err_setlevel(atoi(cnew));
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "truncate") == 0)) {
    err_settruncate(atoi(cnew));
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<_conf_apply_element>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rcx,%r12
  lea    D52(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L86
L117:
  lea    D52(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L21
L82:
  lea    D52(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L7
L9:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L86:
  lea    D59(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L117
  test   %r12,%r12
  je     L2
  cmpb   $0x0,(%r12)
  jne    L19
L2:
  mov    $0x0,%eax
  call   <err_getdest@plt>
  and    $0xfffffffb,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
  jmp    L117
L19:
  mov    %r12,%rdi
  call   <err_setlogfile@plt>
  mov    $0x0,%eax
  call   <err_getdest@plt>
  or     $0x4,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
  jmp    L117
L21:
  lea    D8(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L82
  mov    %r12,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <err_setlevel@plt>
  jmp    L82
L7:
  lea    D46(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L9
  mov    %r12,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <err_settruncate@plt>
  jmp    L9
```

tool_calls: name: parse_data
arguments: data_label: D52
type: string
name: parse_data
arguments: data_label: D59
type: string
name: parse_data
arguments: data_label: D8
type: string
name: parse_data
arguments: data_label: D46
type: string

tool: D52: general

tool: D59: logfile

tool: D8: debuglevel

tool: D46: truncate

assistant: ```c
void _conf_apply_element(char *section, char *key, char *cold, char *cnew) {
  if ((strcmp(section, "general") == 0) && (strcmp(key, "logfile") == 0)) {
    if ((cnew) && strlen(cnew)) {
      err_setlogfile(cnew);
      err_setdest(err_getdest() | 4);
    } else {
      err_setdest(err_getdest() & ~4);
    }
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "debuglevel") == 0)) {
    err_setlevel(atoi(cnew));
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "truncate") == 0)) {
    err_settruncate(atoi(cnew));
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_conf_apply_element>:
  endbr64
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  lea    D35(%rip),%r12
  push   %rbp
  mov    %r12,%rsi
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strcmp@plt>
  test   %rax,%rax
  je     L11
L89:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L55
L90:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L19
L96:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L11:
  lea    D11(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L89
  test   %r14,%r14
  je     L57
  cmpb   $0x0,(%r14)
  jne    L28
L57:
  xor    %eax,%eax
  call   <err_getdest@plt>
  and    $0xfffffffb,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L90
  nopl   0x0(%rax)
L55:
  lea    D8(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L90
  mov    %r14,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <err_setlevel@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L96
  nop
L19:
  lea    D27(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L96
  mov    %r14,%rdi
  call   <atoi@plt>
  add    $0x8,%rsp
  pop    %rbp
  mov    %eax,%edi
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1110 <err_settruncate@plt>
  nopw   0x0(%rax,%rax,1)
L28:
  mov    %r14,%rdi
  call   <err_setlogfile@plt>
  xor    %eax,%eax
  call   <err_getdest@plt>
  or     $0x4,%eax
  mov    %eax,%edi
  call   <err_setdest@plt>
  jmp    L89
```

tool_calls: name: parse_data
arguments: label: D35
type_guessed: string
name: parse_data
arguments: label: D11
type_guessed: string
name: parse_data
arguments: label: D8
type_guessed: string
name: parse_data
arguments: label: D27
type_guessed: string

tool: D35: general

tool: D11: logfile

tool: D8: debuglevel

tool: D27: truncate

assistant: ```c
void _conf_apply_element(char *section, char *key, char *cold, char *cnew) {
  if ((strcmp(section, "general") == 0) && (strcmp(key, "logfile") == 0)) {
    if ((cnew) && strlen(cnew)) {
      err_setlogfile(cnew);
      err_setdest(err_getdest() | 4);
    } else {
      err_setdest(err_getdest() & ~4);
    }
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "debuglevel") == 0)) {
    err_setlevel(atoi(cnew));
  }
  if ((strcmp(section, "general") == 0) && (strcmp(key, "truncate") == 0)) {
    err_settruncate(atoi(cnew));
  }
}
```