ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<GenericInterface_RestoreRomSettings>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x1,%ebx
  mov    %rsp,%rbp
  lea    D3(%rip),%r12
  lea    D6(%rip),%r13
  jmp    L18
L21:
  mov    $0x0,%esi
  mov    %ebx,%edi
  call   <ExpansionRom_SetActiveState@plt>
L29:
  add    $0x1,%ebx
  cmp    $0x11,%ebx
  je     L36
L18:
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetString@plt>
  test   %rax,%rax
  je     L29
  cmpb   $0x0,(%rax)
  je     L29
  mov    %rax,%rsi
  mov    %ebx,%edi
  call   <GenericInterface_LoadRom@plt>
  test   %rax,%rax
  je     L29
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetInt@plt>
  test   %eax,%eax
  je     L21
  mov    $0x1,%esi
  mov    %ebx,%edi
  call   <ExpansionRom_SetActiveState@plt>
  jmp    L29
L36:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D3
type: string
name: read_data
arguments: tag: D6
type: string

tool: D3: sRom%2d

tool: D6: iRom%2dActive

assistant: ```c
void GenericInterface_RestoreRomSettings(void) {
  int i;
  for (i = 1; i < 17; i++) {
    char SettingsKey[32];
    char *pCurrentRomFilename;
    sprintf(SettingsKey, "sRom%2d", i);
    pCurrentRomFilename = Settings_GetString(SettingsKey);
    if (pCurrentRomFilename != 0) {
      if (strlen(pCurrentRomFilename) != 0) {
        if (GenericInterface_LoadRom(i, pCurrentRomFilename)) {
          int ActiveFlag;
          sprintf(SettingsKey, "iRom%2dActive", i);
          ActiveFlag = Settings_GetInt(SettingsKey);
          if (ActiveFlag != 0) {
            ExpansionRom_SetActiveState(i, (1 == 1));
          } else {
            ExpansionRom_SetActiveState(i, (1 == 0));
          }
        }
      }
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<GenericInterface_RestoreRomSettings>:
  endbr64
  push   %r13
  lea    D15(%rip),%r13
  push   %r12
  lea    D14(%rip),%r12
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  jmp    L48
  cs nopw 0x0(%rax,%rax,1)
L0:
  add    $0x1,%ebx
  cmp    $0x11,%ebx
  je     L75
L48:
  mov    %rbp,%rdi
  mov    %ebx,%edx
  mov    %r12,%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetString@plt>
  test   %rax,%rax
  je     L0
  cmpb   $0x0,(%rax)
  je     L0
  mov    %rax,%rsi
  mov    %ebx,%edi
  call   <GenericInterface_LoadRom@plt>
  test   %rax,%rax
  je     L0
  mov    %rbp,%rdi
  mov    %ebx,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetInt@plt>
  test   %eax,%eax
  je     L58
  mov    %ebx,%edi
  mov    $0x1,%esi
  add    $0x1,%ebx
  call   <ExpansionRom_SetActiveState@plt>
  cmp    $0x11,%ebx
  jne    L48
  nopl   0x0(%rax,%rax,1)
L75:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  xor    %esi,%esi
  mov    %ebx,%edi
  call   <ExpansionRom_SetActiveState@plt>
  jmp    L0
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D15
datatype: string
name: disassemble_data
arguments: data_label: D14
datatype: string

tool: D15: iRom%2dActive

tool: D14: sRom%2d

assistant: ```c
void GenericInterface_RestoreRomSettings(void) {
  int i;
  for (i = 1; i < 17; i++) {
    char SettingsKey[32];
    char *pCurrentRomFilename;
    sprintf(SettingsKey, "sRom%2d", i);
    pCurrentRomFilename = Settings_GetString(SettingsKey);
    if (pCurrentRomFilename != 0) {
      if (strlen(pCurrentRomFilename) != 0) {
        if (GenericInterface_LoadRom(i, pCurrentRomFilename)) {
          int ActiveFlag;
          sprintf(SettingsKey, "iRom%2dActive", i);
          ActiveFlag = Settings_GetInt(SettingsKey);
          if (ActiveFlag != 0) {
            ExpansionRom_SetActiveState(i, (1 == 1));
          } else {
            ExpansionRom_SetActiveState(i, (1 == 0));
          }
        }
      }
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<GenericInterface_RestoreRomSettings>:
  endbr64
  push   %r13
  lea    D2(%rip),%r13
  push   %r12
  lea    D11(%rip),%r12
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  jmp    L55
  cs nopw 0x0(%rax,%rax,1)
L73:
  add    $0x1,%ebx
  cmp    $0x11,%ebx
  je     L23
L55:
  mov    %rbp,%rdi
  mov    %ebx,%edx
  mov    %r12,%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetString@plt>
  test   %rax,%rax
  je     L73
  cmpb   $0x0,(%rax)
  je     L73
  mov    %rax,%rsi
  mov    %ebx,%edi
  call   <GenericInterface_LoadRom@plt>
  test   %rax,%rax
  je     L73
  mov    %rbp,%rdi
  mov    %ebx,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <Settings_GetInt@plt>
  test   %eax,%eax
  je     L42
  mov    %ebx,%edi
  mov    $0x1,%esi
  add    $0x1,%ebx
  call   <ExpansionRom_SetActiveState@plt>
  cmp    $0x11,%ebx
  jne    L55
  nopl   0x0(%rax,%rax,1)
L23:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L47
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  xor    %esi,%esi
  mov    %ebx,%edi
  call   <ExpansionRom_SetActiveState@plt>
  jmp    L73
L47:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D2
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D11
type_guessed: string

tool: D2: iRom%2dActive

tool: D11: sRom%2d

assistant: ```c
void GenericInterface_RestoreRomSettings(void) {
  int i;
  for (i = 1; i < 17; i++) {
    char SettingsKey[32];
    char *pCurrentRomFilename;
    sprintf(SettingsKey, "sRom%2d", i);
    pCurrentRomFilename = Settings_GetString(SettingsKey);
    if (pCurrentRomFilename != 0) {
      if (strlen(pCurrentRomFilename) != 0) {
        if (GenericInterface_LoadRom(i, pCurrentRomFilename)) {
          int ActiveFlag;
          sprintf(SettingsKey, "iRom%2dActive", i);
          ActiveFlag = Settings_GetInt(SettingsKey);
          if (ActiveFlag != 0) {
            ExpansionRom_SetActiveState(i, (1 == 1));
          } else {
            ExpansionRom_SetActiveState(i, (1 == 0));
          }
        }
      }
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<run_vector_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0xc(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <daxpy@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <multiply@plt>
  leave
  ret
```

assistant: ```c
int run_vector_c(void *data, int n) {
  daxpy(data, n, n);
  return multiply(data, n);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<run_vector_c>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %esi,%edx
  call   <daxpy@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <multiply@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int run_vector_c(void *data, int n) {
  daxpy(data, n, n);
  return multiply(data, n);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<run_vector_c>:
  endbr64
  push   %r12
  mov    %esi,%edx
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  sub    $0x8,%rsp
  call   <daxpy@plt>
  add    $0x8,%rsp
  mov    %ebp,%esi
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <multiply@plt>
```

assistant: ```c
int run_vector_c(void *data, int n) {
  daxpy(data, n, n);
  return multiply(data, n);
}
```
user: Translate the below assembly code into C programming language:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D8
data_type: string
name: unpack_data
arguments: data_tag: D47
data_type: string
name: unpack_data
arguments: data_tag: D38
data_type: string
name: unpack_data
arguments: data_tag: D31
data_type: string
name: unpack_data
arguments: data_tag: D12
data_type: string
name: unpack_data
arguments: data_tag: D59
data_type: string

tool: D8: Usage: %s (get|send) [<host>] [<port>]


tool: D47: Examples:

tool: D38: %s send 192.168.0.2


tool: D31: %s send 192.168.0.2 2706


tool: D12: %s get


tool: D59: %s get 2706


assistant: ```c
void usage(char *cmd) {
  printf("Usage: %s (get|send) [<host>] [<port>]\n", cmd);
  printf("Examples:\n");
  printf("%s send 192.168.0.2\n", cmd);
  printf("%s send 192.168.0.2 2706\n", cmd);
  printf("%s get\n", cmd);
  printf("%s get 2706\n", cmd);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<usage>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D34(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rsi
  lea    D30(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D38(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  pop    %rbx
  ret
```

tool_calls: name: read_data
arguments: label: D11
type_guessed: string
name: read_data
arguments: label: D34
type_guessed: string
name: read_data
arguments: label: D30
type_guessed: string
name: read_data
arguments: label: D38
type_guessed: string
name: read_data
arguments: label: D37
type_guessed: string
name: read_data
arguments: label: D40
type_guessed: string

tool: D11: Usage: %s (get|send) [<host>] [<port>]


tool: D34: Examples:

tool: D30: %s send 192.168.0.2


tool: D38: %s send 192.168.0.2 2706


tool: D37: %s get


tool: D40: %s get 2706


assistant: ```c
void usage(char *cmd) {
  printf("Usage: %s (get|send) [<host>] [<port>]\n", cmd);
  printf("Examples:\n");
  printf("%s send 192.168.0.2\n", cmd);
  printf("%s send 192.168.0.2 2706\n", cmd);
  printf("%s get\n", cmd);
  printf("%s get 2706\n", cmd);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  mov    %rdi,%rbp
  xor    %eax,%eax
  lea    D35(%rip),%rdi
  call   <printf@plt>
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  jmp    1070 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D35
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D16
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D59
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D47
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D20
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D1
type_guessed: string

tool: D35: Usage: %s (get|send) [<host>] [<port>]


tool: D16: Examples:

tool: D59: %s send 192.168.0.2


tool: D47: %s send 192.168.0.2 2706


tool: D20: %s get


tool: D1: %s get 2706


assistant: ```c
void usage(char *cmd) {
  printf("Usage: %s (get|send) [<host>] [<port>]\n", cmd);
  printf("Examples:\n");
  printf("%s send 192.168.0.2\n", cmd);
  printf("%s send 192.168.0.2 2706\n", cmd);
  printf("%s get\n", cmd);
  printf("%s get 2706\n", cmd);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  mov    %rdi,%rbp
  xor    %eax,%eax
  lea    D41(%rip),%rdi
  call   <printf@plt>
  lea    D1(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D37(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  jmp    1070 <printf@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D41
type_guessed: string
name: parse_data
arguments: data_tag: D1
type_guessed: string
name: parse_data
arguments: data_tag: D36
type_guessed: string
name: parse_data
arguments: data_tag: D59
type_guessed: string
name: parse_data
arguments: data_tag: D33
type_guessed: string
name: parse_data
arguments: data_tag: D37
type_guessed: string

tool: D41: Usage: %s (get|send) [<host>] [<port>]


tool: D1: Examples:

tool: D36: %s send 192.168.0.2


tool: D59: %s send 192.168.0.2 2706


tool: D33: %s get


tool: D37: %s get 2706


assistant: ```c
void usage(char *cmd) {
  printf("Usage: %s (get|send) [<host>] [<port>]\n", cmd);
  printf("Examples:\n");
  printf("%s send 192.168.0.2\n", cmd);
  printf("%s send 192.168.0.2 2706\n", cmd);
  printf("%s get\n", cmd);
  printf("%s get 2706\n", cmd);
}
```
user: Translate the below assembly code into C programming language:

```asm
<index_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L25
L48:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x8(%rbp)
L25:
  cmpl   $0x100,-0x8(%rbp)
  jle    L48
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
L14:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jg     L51
  addl   $0x1,-0x8(%rbp)
  jmp    L21
L51:
  addl   $0x1,-0xc(%rbp)
L21:
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jg     L47
  jmp    L14
L47:
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void index_table(struct ebt_mac_wormhash *wh) {
  int ipool, itable;
  int c;
  for (itable = 0; itable <= 256; itable++) {
    wh->table[itable] = wh->poolsize;
  }
  ipool = 0;
  itable = 0;
  while (1) {
    wh->table[itable] = ipool;
    c = ((const unsigned char *)wh->pool[ipool].cmp)[7];
    if (itable <= c) {
      itable++;
    } else {
      ipool++;
    }
    if (ipool > wh->poolsize)
      break;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<index_table>:
  endbr64
  mov    $0x0,%eax
L39:
  mov    0x8(%rdi),%ecx
  mov    (%rdi),%rdx
  mov    %ecx,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    $0x404,%rax
  jne    L39
  mov    $0x0,%ecx
  mov    $0x0,%eax
  jmp    L21
L18:
  add    $0x1,%eax
L38:
  cmp    %eax,0x8(%rdi)
  jl     L11
L21:
  movslq %ecx,%rdx
  mov    (%rdi),%rsi
  mov    %eax,(%rsi,%rdx,4)
  movslq %eax,%rdx
  mov    0x10(%rdi),%rsi
  mov    (%rsi,%rdx,8),%rdx
  movzbl 0x7(%rdx),%edx
  cmp    %edx,%ecx
  jg     L18
  add    $0x1,%ecx
  jmp    L38
L11:
  ret
```

assistant: ```c
void index_table(struct ebt_mac_wormhash *wh) {
  int ipool, itable;
  int c;
  for (itable = 0; itable <= 256; itable++) {
    wh->table[itable] = wh->poolsize;
  }
  ipool = 0;
  itable = 0;
  while (1) {
    wh->table[itable] = ipool;
    c = ((const unsigned char *)wh->pool[ipool].cmp)[7];
    if (itable <= c) {
      itable++;
    } else {
      ipool++;
    }
    if (ipool > wh->poolsize)
      break;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<index_table>:
  endbr64
  mov    (%rdi),%rsi
  mov    %rsi,%rax
  lea    0x404(%rsi),%rcx
  nopl   0x0(%rax)
L48:
  mov    0x8(%rdi),%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L48
  mov    0x10(%rdi),%r8
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L24
  nopl   0x0(%rax)
L46:
  add    $0x1,%edx
  cmp    %eax,0x8(%rdi)
  jl     L25
L24:
  movslq %edx,%rcx
  mov    %eax,(%rsi,%rcx,4)
  movslq %eax,%rcx
  mov    (%r8,%rcx,8),%rcx
  movzbl 0x7(%rcx),%ecx
  cmp    %ecx,%edx
  jle    L46
  add    $0x1,%eax
  cmp    %eax,0x8(%rdi)
  jge    L24
L25:
  ret
```

assistant: ```c
void index_table(struct ebt_mac_wormhash *wh) {
  int ipool, itable;
  int c;
  for (itable = 0; itable <= 256; itable++) {
    wh->table[itable] = wh->poolsize;
  }
  ipool = 0;
  itable = 0;
  while (1) {
    wh->table[itable] = ipool;
    c = ((const unsigned char *)wh->pool[ipool].cmp)[7];
    if (itable <= c) {
      itable++;
    } else {
      ipool++;
    }
    if (ipool > wh->poolsize)
      break;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<index_table>:
  endbr64
  mov    (%rdi),%rcx
  mov    %rdi,%rdx
  lea    0x8(%rdx),%rax
  lea    0x404(%rcx),%rdi
  cmp    %rax,%rdi
  jbe    L53
  lea    0xc(%rdx),%rax
  cmp    %rax,%rcx
  jb     L10
L53:
  movd   0x8(%rdx),%xmm1
  mov    %rcx,%rax
  lea    0x400(%rcx),%rsi
  pshufd $0x0,%xmm1,%xmm0
  nopw   0x0(%rax,%rax,1)
L98:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rsi
  jne    L98
  mov    0x8(%rdx),%eax
  mov    %eax,0x400(%rcx)
L60:
  mov    0x10(%rdx),%r10
  xor    %esi,%esi
  xor    %eax,%eax
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  nopl   0x0(%rax,%rax,1)
L82:
  mov    (%r10,%r8,8),%rdi
  mov    %eax,(%rcx,%r9,4)
  movzbl 0x7(%rdi),%edi
  cmp    %esi,%edi
  jl     L86
L11:
  add    $0x1,%esi
  cmp    %eax,0x8(%rdx)
  jl     L6
  mov    (%r10,%r8,8),%rdi
  movslq %esi,%r9
  mov    %eax,(%rcx,%r9,4)
  movzbl 0x7(%rdi),%edi
  cmp    %esi,%edi
  jge    L11
L86:
  add    $0x1,%eax
  cmp    0x8(%rdx),%eax
  jg     L6
  movslq %eax,%r8
  jmp    L82
L6:
  ret
L10:
  mov    %rcx,%rax
  nopl   0x0(%rax)
L80:
  mov    0x8(%rdx),%esi
  add    $0x4,%rax
  mov    %esi,-0x4(%rax)
  cmp    %rdi,%rax
  jne    L80
  jmp    L60
```

assistant: ```c
void index_table(struct ebt_mac_wormhash *wh) {
  int ipool, itable;
  int c;
  for (itable = 0; itable <= 256; itable++) {
    wh->table[itable] = wh->poolsize;
  }
  ipool = 0;
  itable = 0;
  while (1) {
    wh->table[itable] = ipool;
    c = ((const unsigned char *)wh->pool[ipool].cmp)[7];
    if (itable <= c) {
      itable++;
    } else {
      ipool++;
    }
    if (ipool > wh->poolsize)
      break;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    $0x0,%eax
  call   <getch@plt>
  movss  D45(%rip),%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  D45(%rip),%xmm0
  movss  %xmm0,-0x8(%rbp)
  jmp    L18
L5:
  movss  -0xc(%rbp),%xmm0
  divss  -0x8(%rbp),%xmm0
  movss  -0x4(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  movss  -0xc(%rbp),%xmm1
  movss  D8(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0x8(%rbp),%xmm1
  movss  D45(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
L18:
  movss  D9(%rip),%xmm0
  comiss -0x8(%rbp),%xmm0
  jae    L5
  pxor   %xmm2,%xmm2
  cvtss2sd -0x4(%rbp),%xmm2
  movq   %xmm2,%rax
  movq   %rax,%xmm0
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D28
type_guessed: string
name: read_data
arguments: data_label: D45
type_guessed: byte[4]
name: read_data
arguments: data_label: D8
type_guessed: byte[4]
name: read_data
arguments: data_label: D9
type_guessed: byte[4]
name: read_data
arguments: data_label: D51
type_guessed: string

tool: D28: Vamos calcular uma sequencia legal!

(Sequencia do Tipo: 1/1 + 3/2 + 5/3 + 7/4 + ... + 99/50)


tool: {"D45": [0x00,0x00,0x80,0x3f]}

tool: {"D8": [0x00,0x00,0x00,0x40]}

tool: {"D9": [0x00,0x00,0x48,0x42]}

tool: D51: A soma e: %.4f


assistant: ```c
int main() {
  float dividendo, divisor, soma;
  printf("Vamos calcular uma sequencia legal!\n\n(Sequencia do Tipo: 1/1 + 3/2 + 5/3 + 7/4 + ... + 99/50)\n\n");
  soma = 0.0;
  getch();
  dividendo = 1;
  for (divisor = 1; divisor <= 50; divisor++) {
    soma = soma + (dividendo / divisor);
    dividendo += 2;
  }
  printf("A soma e: %.4f\n", soma);
  getch();
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    $0x32,%eax
  pxor   %xmm0,%xmm0
  movss  D31(%rip),%xmm1
  movaps %xmm1,%xmm2
  movss  D16(%rip),%xmm5
  movaps %xmm1,%xmm4
L9:
  movaps %xmm2,%xmm3
  divss  %xmm1,%xmm3
  addss  %xmm3,%xmm0
  addss  %xmm5,%xmm2
  addss  %xmm4,%xmm1
  sub    $0x1,%eax
  jne    L9
  cvtss2sd %xmm0,%xmm0
  lea    D22(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D3
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D31
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_tag: D16
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_tag: D22
type_guessed: string

tool: D3: Vamos calcular uma sequencia legal!

(Sequencia do Tipo: 1/1 + 3/2 + 5/3 + 7/4 + ... + 99/50)


tool: {"D31": [0x00,0x00,0x80,0x3f]}

tool: {"D16": [0x00,0x00,0x00,0x40]}

tool: D22: A soma e: %.4f


assistant: ```c
int main() {
  float dividendo, divisor, soma;
  printf("Vamos calcular uma sequencia legal!\n\n(Sequencia do Tipo: 1/1 + 3/2 + 5/3 + 7/4 + ... + 99/50)\n\n");
  soma = 0.0;
  getch();
  dividendo = 1;
  for (divisor = 1; divisor <= 50; divisor++) {
    soma = soma + (dividendo / divisor);
    dividendo += 2;
  }
  printf("A soma e: %.4f\n", soma);
  getch();
  return 0;
}
```