ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<hexdmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <clear@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L19
L47:
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x25(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x25(%rbp),%edx
  mov    %dl,-0x20(%rbp,%rax,1)
  subl   $0x1,-0x3c(%rbp)
  addl   $0x1,-0x24(%rbp)
  cmpl   $0x10,-0x24(%rbp)
  jne    L19
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <hprint@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <vprint@plt>
  movl   $0x0,-0x24(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <clear@plt>
L19:
  cmpl   $0x0,-0x3c(%rbp)
  jg     L47
  cmpl   $0x0,-0x24(%rbp)
  je     L37
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <hprint@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <vprint@plt>
L37:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D8
type: string

tool: D8: base address: %x     length: %d


assistant: ```c
void hexdmp(char *ptr, int length) {
  char hex[16];
  char ch;
  int count;
  printf("base address: %x     length: %d\n", ptr, length);
  clear(hex);
  count = 0;
  while (length > 0) {
    ch = *ptr++;
    hex[count] = ch;
    length--;
    count++;
    if (count == 16) {
      hprint(hex);
      vprint(hex);
      count = 0;
      clear(hex);
    }
  };
  if (count) {
    hprint(hex);
    vprint(hex);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<hexdmp>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %esi,%edx
  mov    %rdi,%rsi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    %rsp,%rdi
  mov    $0x0,%eax
  call   <clear@plt>
  test   %r12d,%r12d
  jle    L54
  lea    0x1(%rbp),%rbx
  movzbl 0x0(%rbp),%eax
  mov    %al,(%rsp)
  mov    %r12d,%r12d
  add    %r12,%rbp
  mov    $0x1,%eax
  mov    %rsp,%r12
  jmp    L12
L56:
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <hprint@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <vprint@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <clear@plt>
  mov    $0x0,%eax
L12:
  cmp    %rbx,%rbp
  je     L57
  add    $0x1,%rbx
  movslq %eax,%rdx
  movzbl -0x1(%rbx),%ecx
  mov    %cl,(%rsp,%rdx,1)
  add    $0x1,%eax
  cmp    $0x10,%eax
  jne    L12
  jmp    L56
L57:
  test   %eax,%eax
  jne    L62
L54:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L62:
  mov    %rsp,%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <hprint@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <vprint@plt>
  jmp    L54
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D0
type: string

tool: D0: base address: %x     length: %d


assistant: ```c
void hexdmp(char *ptr, int length) {
  char hex[16];
  char ch;
  int count;
  printf("base address: %x     length: %d\n", ptr, length);
  clear(hex);
  count = 0;
  while (length > 0) {
    ch = *ptr++;
    hex[count] = ch;
    length--;
    count++;
    if (count == 16) {
      hprint(hex);
      vprint(hex);
      count = 0;
      clear(hex);
    }
  };
  if (count) {
    hprint(hex);
    vprint(hex);
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hexdmp>:
  endbr64
  push   %r13
  push   %r12
  movslq %esi,%r12
  mov    %rdi,%rsi
  push   %rbp
  mov    %r12d,%edx
  mov    %rdi,%rbp
  lea    D4(%rip),%rdi
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <clear@plt>
  test   %r12d,%r12d
  jle    L8
  movzbl 0x0(%rbp),%eax
  lea    0x1(%rbp),%rbx
  add    %r12,%rbp
  mov    %al,(%rsp)
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L3:
  cmp    %rbx,%rbp
  je     L46
L2:
  movzbl (%rbx),%ecx
  movslq %eax,%rdx
  add    $0x1,%eax
  add    $0x1,%rbx
  mov    %cl,(%rsp,%rdx,1)
  cmp    $0x10,%eax
  jne    L3
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <hprint@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <vprint@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <clear@plt>
  xor    %eax,%eax
  cmp    %rbx,%rbp
  jne    L2
L46:
  test   %eax,%eax
  jne    L4
L8:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L4:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <hprint@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <vprint@plt>
  jmp    L8
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D4
datatype: string

tool: D4: base address: %x     length: %d


assistant: ```c
void hexdmp(char *ptr, int length) {
  char hex[16];
  char ch;
  int count;
  printf("base address: %x     length: %d\n", ptr, length);
  clear(hex);
  count = 0;
  while (length > 0) {
    ch = *ptr++;
    hex[count] = ch;
    length--;
    count++;
    if (count == 16) {
      hprint(hex);
      vprint(hex);
      count = 0;
      clear(hex);
    }
  };
  if (count) {
    hprint(hex);
    vprint(hex);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<hexdmp>:
  endbr64
  push   %r13
  mov    %esi,%edx
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    %rdi,%rsi
  lea    D1(%rip),%rdi
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <clear@plt>
  test   %ebp,%ebp
  jle    L4
  movzbl 0x0(%r13),%eax
  lea    0x1(%r13),%rbx
  mov    %al,(%rsp)
  cmp    $0x1,%ebp
  je     L47
  lea    -0x2(%rbp),%eax
  lea    0x2(%r13,%rax,1),%rbp
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L62:
  movzbl (%rbx),%ecx
  movslq %eax,%rdx
  add    $0x1,%eax
  add    $0x1,%rbx
  mov    %cl,(%rsp,%rdx,1)
  cmp    $0x10,%eax
  je     L38
  cmp    %rbp,%rbx
  jne    L62
L47:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <hprint@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <vprint@plt>
L4:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L38:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <hprint@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <vprint@plt>
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <clear@plt>
  cmp    %rbp,%rbx
  je     L4
  xor    %eax,%eax
  jmp    L62
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D1
type_infered: string

tool: D1: base address: %x     length: %d


assistant: ```c
void hexdmp(char *ptr, int length) {
  char hex[16];
  char ch;
  int count;
  printf("base address: %x     length: %d\n", ptr, length);
  clear(hex);
  count = 0;
  while (length > 0) {
    ch = *ptr++;
    hex[count] = ch;
    length--;
    count++;
    if (count == 16) {
      hprint(hex);
      vprint(hex);
      count = 0;
      clear(hex);
    }
  };
  if (count) {
    hprint(hex);
    vprint(hex);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<outer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    0x10(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  lea    -0x30(%rbp),%rax
  add    $0x4,%rax
  lea    -0x30(%rbp),%rdx
  movl   $0xfa1e0ff3,(%rax)
  movw   $0xbb49,0x4(%rax)
  lea    -0x84(%rip),%rcx        # 1179 <inner.0>
  mov    %rcx,0x6(%rax)
  movw   $0xba49,0xe(%rax)
  mov    %rdx,0x10(%rax)
  movl   $0x90e3ff49,0x18(%rax)
  mov    $0xa,%eax
  mov    %eax,-0x30(%rbp)
  lea    -0x30(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <other@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

assistant: ```c
void outer(void) {
  int a = 10;
  void inner(void) {
    sleep(100000);
    printf("outer's a is %d\n", a);
  }
  other(inner);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<outer>:
  endbr64
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    %rsp,%rax
  lea    0x4(%rsp),%rdi
  movl   $0xfa1e0ff3,0x4(%rsp)
  movw   $0xbb49,0x8(%rsp)
  lea    -0x6c(%rip),%rdx        # 1179 <inner.0>
  mov    %rdx,0xa(%rsp)
  movw   $0xba49,0x12(%rsp)
  mov    %rax,0x14(%rsp)
  movl   $0x90e3ff49,0x1c(%rsp)
  movl   $0xa,(%rsp)
  mov    $0x0,%eax
  call   <other@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x38,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void outer(void) {
  int a = 10;
  void inner(void) {
    sleep(100000);
    printf("outer's a is %d\n", a);
  }
  other(inner);
}
```
user: Translate the below assembly code into C programming language:

```asm
<outer>:
  endbr64
  sub    $0x38,%rsp
  mov    $0xffffbb49,%edx
  mov    $0xffffba49,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rax
  mov    %dx,0x8(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %rax,0x20(%rsp)
  mov    %rsp,%rax
  lea    -0x70(%rip),%rdx        # 1180 <inner.0>
  mov    %rax,0x14(%rsp)
  xor    %eax,%eax
  movl   $0xfa1e0ff3,0x4(%rsp)
  mov    %rdx,0xa(%rsp)
  mov    %cx,0x12(%rsp)
  movl   $0x90e3ff49,0x1c(%rsp)
  movl   $0xa,(%rsp)
  call   <other@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x38,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void outer(void) {
  int a = 10;
  void inner(void) {
    sleep(100000);
    printf("outer's a is %d\n", a);
  }
  other(inner);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<outer>:
  endbr64
  sub    $0x38,%rsp
  mov    $0xffffbb49,%edx
  mov    $0xffffba49,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rax
  mov    %dx,0x8(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %rax,0x20(%rsp)
  mov    %rsp,%rax
  lea    -0x70(%rip),%rdx        # 1180 <inner.0>
  mov    %rax,0x14(%rsp)
  xor    %eax,%eax
  movl   $0xfa1e0ff3,0x4(%rsp)
  mov    %rdx,0xa(%rsp)
  mov    %cx,0x12(%rsp)
  movl   $0x90e3ff49,0x1c(%rsp)
  movl   $0xa,(%rsp)
  call   <other@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x38,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void outer(void) {
  int a = 10;
  void inner(void) {
    sleep(100000);
    printf("outer's a is %d\n", a);
  }
  other(inner);
}
```
user: Translate the below assembly code into C programming language:

```asm
<initShmBuffer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  cmpl   $0xffffffff,-0x14(%rbp)
  je     L0
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <shmat@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  jmp    L17
L0:
  mov    $0x0,%eax
L17:
  leave
  ret
```

assistant: ```c
char *initShmBuffer(int shmID) {
  char *buffer;
  if (shmID != -1) {
    buffer = (char *)shmat(shmID, 0, SHM_RND);
    return buffer;
  } else {
    return NULL;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<initShmBuffer>:
  endbr64
  mov    $0x0,%eax
  cmp    $0xffffffff,%edi
  je     L3
  sub    $0x8,%rsp
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  call   <shmat@plt>
  add    $0x8,%rsp
  ret
L3:
  ret
```

assistant: ```c
char *initShmBuffer(int shmID) {
  char *buffer;
  if (shmID != -1) {
    buffer = (char *)shmat(shmID, 0, SHM_RND);
    return buffer;
  } else {
    return NULL;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<initShmBuffer>:
  endbr64
  cmp    $0xffffffff,%edi
  je     L3
  mov    D3(%rip),%rax
  xor    %esi,%esi
  mov    (%rax),%edx
  jmp    1050 <shmat@plt>
  nopl   0x0(%rax)
L3:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *initShmBuffer(int shmID) {
  char *buffer;
  if (shmID != -1) {
    buffer = (char *)shmat(shmID, 0, SHM_RND);
    return buffer;
  } else {
    return NULL;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<initShmBuffer>:
  endbr64
  cmp    $0xffffffff,%edi
  je     L5
  mov    D7(%rip),%rax
  xor    %esi,%esi
  mov    (%rax),%edx
  jmp    1050 <shmat@plt>
  nopl   0x0(%rax)
L5:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *initShmBuffer(int shmID) {
  char *buffer;
  if (shmID != -1) {
    buffer = (char *)shmat(shmID, 0, SHM_RND);
    return buffer;
  } else {
    return NULL;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fn_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
type_infered: string

tool: D3: fn_c() called


assistant: ```c
int fn_c() {
  printf("fn_c() called\n");
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<fn_c>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: label: D3
datatype: string

tool: D3: fn_c() called


assistant: ```c
int fn_c() {
  printf("fn_c() called\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fn_c>:
  endbr64
  sub    $0x8,%rsp
  lea    D9(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
data_type: string

tool: D9: fn_c() called


assistant: ```c
int fn_c() {
  printf("fn_c() called\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fn_c>:
  endbr64
  sub    $0x8,%rsp
  lea    D1(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: tag: D1
datatype: string

tool: D1: fn_c() called


assistant: ```c
int fn_c() {
  printf("fn_c() called\n");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ILibWebServer_Digest_ParseAuthenticationHeader2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    $0x1,%ecx
  lea    D2(%rip),%rdx
  mov    %rax,%rdi
  call   <ILibString_IndexOf@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L1
  mov    $0x1,%eax
  jmp    L46
L1:
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x4(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <ILibTrimString@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x1c(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <ILibTrimString@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x27,%al
  je     L2
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L9
L2:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  subl   $0x1,-0x8(%rbp)
L9:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x27,%al
  je     L30
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L20
L30:
  subl   $0x1,-0x8(%rbp)
L20:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
L46:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D2
data_type: string

tool: D2: =

assistant: ```c
int ILibWebServer_Digest_ParseAuthenticationHeader2(char *value, int valueLen, char **token, char **tokenValue) {
  int len;
  int i = ILibString_IndexOf(value, valueLen, "=", 1);
  if (i < 0) {
    return (1);
  }
  *token = value;
  len = ILibTrimString(token, i);
  (*token)[len] = 0;
  *tokenValue = value + i + 1;
  len = valueLen - (i + 1);
  len = ILibTrimString(tokenValue, len);
  if ((*tokenValue)[0] == '\'' || (*tokenValue)[0] == '\"') {
    *tokenValue += 1;
    len -= 1;
  }
  if ((*tokenValue)[len - 1] == '\'' || (*tokenValue)[len - 1] == '\"') {
    len -= 1;
  }
  (*tokenValue)[len] = 0;
  return (0);
}
```
user: What is the c source code of the assembly code below?

```asm
<ILibWebServer_Digest_ParseAuthenticationHeader2>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r13
  mov    %esi,%ebp
  mov    %rdx,%r14
  mov    %rcx,%r12
  mov    $0x1,%ecx
  lea    D2(%rip),%rdx
  call   <ILibString_IndexOf@plt>
  mov    %eax,%ebx
  mov    $0x1,%eax
  test   %ebx,%ebx
  js     L61
  mov    %r13,(%r14)
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <ILibTrimString@plt>
  cltq
  mov    (%r14),%rdx
  movb   $0x0,(%rdx,%rax,1)
  movslq %ebx,%rax
  lea    0x1(%r13,%rax,1),%rax
  mov    %rax,(%r12)
  add    $0x1,%ebx
  mov    %ebp,%esi
  sub    %ebx,%esi
  mov    %r12,%rdi
  call   <ILibTrimString@plt>
  mov    (%r12),%rdx
  movzbl (%rdx),%ecx
  cmp    $0x27,%cl
  je     L26
  cmp    $0x22,%cl
  je     L26
L11:
  mov    (%r12),%rdx
  movslq %eax,%rcx
  movzbl -0x1(%rdx,%rcx,1),%ecx
  cmp    $0x27,%cl
  je     L21
  cmp    $0x22,%cl
  je     L21
L54:
  cltq
  movb   $0x0,(%rdx,%rax,1)
  mov    $0x0,%eax
L61:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L26:
  add    $0x1,%rdx
  mov    %rdx,(%r12)
  sub    $0x1,%eax
  jmp    L11
L21:
  sub    $0x1,%eax
  jmp    L54
```

tool_calls: name: parse_data
arguments: label: D2
type_guessed: string

tool: D2: =

assistant: ```c
int ILibWebServer_Digest_ParseAuthenticationHeader2(char *value, int valueLen, char **token, char **tokenValue) {
  int len;
  int i = ILibString_IndexOf(value, valueLen, "=", 1);
  if (i < 0) {
    return (1);
  }
  *token = value;
  len = ILibTrimString(token, i);
  (*token)[len] = 0;
  *tokenValue = value + i + 1;
  len = valueLen - (i + 1);
  len = ILibTrimString(tokenValue, len);
  if ((*tokenValue)[0] == '\'' || (*tokenValue)[0] == '\"') {
    *tokenValue += 1;
    len -= 1;
  }
  if ((*tokenValue)[len - 1] == '\'' || (*tokenValue)[len - 1] == '\"') {
    len -= 1;
  }
  (*tokenValue)[len] = 0;
  return (0);
}
```
user: Translate the below assembly code into C programming language:

```asm
<ILibWebServer_Digest_ParseAuthenticationHeader2>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  lea    D3(%rip),%rdx
  push   %r13
  mov    %rcx,%r13
  mov    $0x1,%ecx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  call   <ILibString_IndexOf@plt>
  mov    %eax,%ebx
  mov    $0x1,%eax
  test   %ebx,%ebx
  js     L24
  mov    %r12,(%r14)
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <ILibTrimString@plt>
  mov    (%r14),%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  cltq
  movb   $0x0,(%rdx,%rax,1)
  movslq %ebx,%rax
  add    $0x1,%ebx
  lea    0x1(%r12,%rax,1),%rax
  sub    %ebx,%esi
  mov    %rax,0x0(%r13)
  call   <ILibTrimString@plt>
  mov    0x0(%r13),%rdx
  movzbl (%rdx),%ecx
  cmp    $0x27,%cl
  je     L36
  cmp    $0x22,%cl
  je     L36
L43:
  cltq
  movzbl -0x1(%rdx,%rax,1),%esi
  lea    -0x1(%rax),%rcx
  cmp    $0x27,%sil
  je     L4
  cmp    $0x22,%sil
  cmovne %rax,%rcx
L4:
  movb   $0x0,(%rdx,%rcx,1)
  xor    %eax,%eax
L24:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L36:
  add    $0x1,%rdx
  sub    $0x1,%eax
  mov    %rdx,0x0(%r13)
  jmp    L43
```

tool_calls: name: read_data
arguments: tag: D3
data_type: string

tool: D3: =

assistant: ```c
int ILibWebServer_Digest_ParseAuthenticationHeader2(char *value, int valueLen, char **token, char **tokenValue) {
  int len;
  int i = ILibString_IndexOf(value, valueLen, "=", 1);
  if (i < 0) {
    return (1);
  }
  *token = value;
  len = ILibTrimString(token, i);
  (*token)[len] = 0;
  *tokenValue = value + i + 1;
  len = valueLen - (i + 1);
  len = ILibTrimString(tokenValue, len);
  if ((*tokenValue)[0] == '\'' || (*tokenValue)[0] == '\"') {
    *tokenValue += 1;
    len -= 1;
  }
  if ((*tokenValue)[len - 1] == '\'' || (*tokenValue)[len - 1] == '\"') {
    len -= 1;
  }
  (*tokenValue)[len] = 0;
  return (0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ILibWebServer_Digest_ParseAuthenticationHeader2>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  lea    D7(%rip),%rdx
  push   %r13
  mov    %rcx,%r13
  mov    $0x1,%ecx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  call   <ILibString_IndexOf@plt>
  mov    %eax,%ebx
  mov    $0x1,%eax
  test   %ebx,%ebx
  js     L34
  mov    %r12,(%r14)
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <ILibTrimString@plt>
  mov    (%r14),%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  cltq
  movb   $0x0,(%rdx,%rax,1)
  movslq %ebx,%rax
  add    $0x1,%ebx
  lea    0x1(%r12,%rax,1),%rax
  sub    %ebx,%esi
  mov    %rax,0x0(%r13)
  call   <ILibTrimString@plt>
  mov    0x0(%r13),%rdx
  movzbl (%rdx),%ecx
  cmp    $0x27,%cl
  je     L10
  cmp    $0x22,%cl
  je     L10
L2:
  cltq
  movzbl -0x1(%rdx,%rax,1),%esi
  lea    -0x1(%rax),%rcx
  cmp    $0x27,%sil
  je     L8
  cmp    $0x22,%sil
  cmovne %rax,%rcx
L8:
  movb   $0x0,(%rdx,%rcx,1)
  xor    %eax,%eax
L34:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L10:
  add    $0x1,%rdx
  sub    $0x1,%eax
  mov    %rdx,0x0(%r13)
  jmp    L2
```

tool_calls: name: unpack_data
arguments: data_label: D7
type: string

tool: D7: =

assistant: ```c
int ILibWebServer_Digest_ParseAuthenticationHeader2(char *value, int valueLen, char **token, char **tokenValue) {
  int len;
  int i = ILibString_IndexOf(value, valueLen, "=", 1);
  if (i < 0) {
    return (1);
  }
  *token = value;
  len = ILibTrimString(token, i);
  (*token)[len] = 0;
  *tokenValue = value + i + 1;
  len = valueLen - (i + 1);
  len = ILibTrimString(tokenValue, len);
  if ((*tokenValue)[0] == '\'' || (*tokenValue)[0] == '\"') {
    *tokenValue += 1;
    len -= 1;
  }
  if ((*tokenValue)[len - 1] == '\'' || (*tokenValue)[len - 1] == '\"') {
    len -= 1;
  }
  (*tokenValue)[len] = 0;
  return (0);
}
```