ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<ft_striter>:
  endbr64
  test   %rdi,%rdi
  je     L23
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L38
  cmpb   $0x0,(%rdi)
  mov    %rdi,%rbx
  je     L38
  nop
L4:
  mov    %rbx,%rdi
  add    $0x1,%rbx
  call   *%rbp
  cmpb   $0x0,(%rbx)
  jne    L4
L38:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L23:
  ret
```

assistant: ```c
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  if (s && f) {
    i = 0;
    while (s[i] != '\0') {
      f(&s[i]);
      i++;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<get_platform_ro_dir>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
const char *get_platform_ro_dir(void) {
  static char chunk[512];
  static const char *ro_dir = "";
  const char *src = ro_dir;
  while (*src) {
    char *dst = chunk;
    int skip = 0;
    do {
      *dst = *src;
      if (!*dst)
        break;
      if (*src++ == ',') {
        *dst = '\0';
        break;
      }
      dst += 1;
    } while (!(skip = dst == chunk + sizeof(chunk)));
    if (skip) {
      while (*src)
        if (*src++ == ',')
          break;
      continue;
    }
    if (probe_ro_dir(chunk))
      return chunk;
  }
  return NULL;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<get_platform_ro_dir>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
const char *get_platform_ro_dir(void) {
  static char chunk[512];
  static const char *ro_dir = "";
  const char *src = ro_dir;
  while (*src) {
    char *dst = chunk;
    int skip = 0;
    do {
      *dst = *src;
      if (!*dst)
        break;
      if (*src++ == ',') {
        *dst = '\0';
        break;
      }
      dst += 1;
    } while (!(skip = dst == chunk + sizeof(chunk)));
    if (skip) {
      while (*src)
        if (*src++ == ',')
          break;
      continue;
    }
    if (probe_ro_dir(chunk))
      return chunk;
  }
  return NULL;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<get_platform_ro_dir>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
const char *get_platform_ro_dir(void) {
  static char chunk[512];
  static const char *ro_dir = "";
  const char *src = ro_dir;
  while (*src) {
    char *dst = chunk;
    int skip = 0;
    do {
      *dst = *src;
      if (!*dst)
        break;
      if (*src++ == ',') {
        *dst = '\0';
        break;
      }
      dst += 1;
    } while (!(skip = dst == chunk + sizeof(chunk)));
    if (skip) {
      while (*src)
        if (*src++ == ',')
          break;
      continue;
    }
    if (probe_ro_dir(chunk))
      return chunk;
  }
  return NULL;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<rgb_order>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L5
L24:
  addl   $0x1,-0x4(%rbp)
L5:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x1c(%rbp)
  je     L8
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
L8:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int rgb_order(char *mode, char color) {
  int i = 0;
  while (*mode != color && *(++mode)) {
    ++i;
  }
  return i;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<rgb_order>:
  endbr64
  mov    %esi,%ecx
  mov    $0x0,%edx
  cmp    (%rdi),%sil
  je     L27
L10:
  add    $0x1,%rdi
  movzbl (%rdi),%eax
  test   %al,%al
  je     L27
  add    $0x1,%edx
  cmp    %cl,%al
  jne    L10
L27:
  mov    %edx,%eax
  ret
```

assistant: ```c
int rgb_order(char *mode, char color) {
  int i = 0;
  while (*mode != color && *(++mode)) {
    ++i;
  }
  return i;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<rgb_order>:
  endbr64
  mov    %esi,%edx
  xor    %r8d,%r8d
  cmp    (%rdi),%sil
  jne    L3
  jmp    L25
L13:
  add    $0x1,%r8d
  cmp    %dl,%al
  je     L25
L3:
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  test   %al,%al
  jne    L13
L25:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int rgb_order(char *mode, char color) {
  int i = 0;
  while (*mode != color && *(++mode)) {
    ++i;
  }
  return i;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<rgb_order>:
  endbr64
  mov    %esi,%edx
  xor    %r8d,%r8d
  cmp    (%rdi),%sil
  jne    L32
  jmp    L13
L17:
  add    $0x1,%r8d
  cmp    %dl,%al
  je     L13
L32:
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  test   %al,%al
  jne    L17
L13:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int rgb_order(char *mode, char color) {
  int i = 0;
  while (*mode != color && *(++mode)) {
    ++i;
  }
  return i;
}
```
user: Translate the below assembly code into C programming language:

```asm
<_keystore_display_volume_status>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <properties_get@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L4
  mov    $0x0,%eax
  jmp    L61
L4:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <str_list_split@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L43
L17:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L15
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
L15:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <_keystore_is_block_device@plt>
  test   %eax,%eax
  jne    L7
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x30(%rbp),%rdx
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x1c(%rbp)
L7:
  addl   $0x1,-0x20(%rbp)
L43:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L17
  cmpl   $0x0,-0x1c(%rbp)
  je     L66
  mov    $0xa,%edi
  call   <putchar@plt>
L66:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <str_list_free_string_array@plt>
  mov    -0x1c(%rbp),%eax
L61:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D3
type_infered: string
name: unpack_data
arguments: label: D11
type_infered: string

tool: D3: volumes

tool: D11: WARNING: The volume '%s' associated with key '%s' is not available


assistant: ```c
int _keystore_display_volume_status(struct properties *properties, const char *name) {
  int i, warning = 0;
  char **volume_list;
  char *volumes;
  char *ch;
  volumes = properties_get(properties, "volumes");
  if (volumes == NULL)
    return 0;
  volume_list = str_list_split(volumes);
  for (i = 0; volume_list[i] != NULL; i++) {
    ch = strchr(volume_list[i], ':');
    if (ch != NULL)
      *ch = '\0';
    if (!_keystore_is_block_device(volume_list[i])) {
      printf("WARNING: The volume '%s' associated with "
             "key '%s' is not available\n",
             volume_list[i], name);
      warning = 1;
    }
  }
  if (warning)
    printf("\n");
  free(volumes);
  str_list_free_string_array(volume_list);
  return warning;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<_keystore_display_volume_status>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%r13
  lea    D10(%rip),%rsi
  call   <properties_get@plt>
  mov    $0x0,%r12d
  test   %rax,%rax
  je     L86
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <str_list_split@plt>
  mov    %rax,%r14
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L29
  mov    %rax,%rbx
  lea    D6(%rip),%r15
  jmp    L71
L30:
  add    $0x8,%rbx
  mov    (%rbx),%rdi
  test   %rdi,%rdi
  je     L19
L71:
  mov    $0x3a,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L85
  movb   $0x0,(%rax)
L85:
  mov    (%rbx),%rdi
  call   <_keystore_is_block_device@plt>
  test   %eax,%eax
  jne    L30
  mov    %r13,%rdx
  mov    (%rbx),%rsi
  mov    %r15,%rdi
  call   <printf@plt>
  mov    $0x1,%r12d
  jmp    L30
L19:
  test   %r12d,%r12d
  jne    L93
L78:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <str_list_free_string_array@plt>
L86:
  mov    %r12d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L78
L29:
  mov    $0x0,%r12d
  jmp    L78
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D10
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D6
type_infered: string

tool: D10: volumes

tool: D6: WARNING: The volume '%s' associated with key '%s' is not available


assistant: ```c
int _keystore_display_volume_status(struct properties *properties, const char *name) {
  int i, warning = 0;
  char **volume_list;
  char *volumes;
  char *ch;
  volumes = properties_get(properties, "volumes");
  if (volumes == NULL)
    return 0;
  volume_list = str_list_split(volumes);
  for (i = 0; volume_list[i] != NULL; i++) {
    ch = strchr(volume_list[i], ':');
    if (ch != NULL)
      *ch = '\0';
    if (!_keystore_is_block_device(volume_list[i])) {
      printf("WARNING: The volume '%s' associated with "
             "key '%s' is not available\n",
             volume_list[i], name);
      warning = 1;
    }
  }
  if (warning)
    printf("\n");
  free(volumes);
  str_list_free_string_array(volume_list);
  return warning;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<_keystore_display_volume_status>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %rsi,%r12
  lea    D4(%rip),%rsi
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <properties_get@plt>
  test   %rax,%rax
  je     L60
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <str_list_split@plt>
  mov    (%rax),%rdi
  mov    %rax,%r14
  test   %rdi,%rdi
  je     L5
  mov    %rax,%rbx
  lea    D13(%rip),%r15
  jmp    L15
  nop
L32:
  mov    0x8(%rbx),%rdi
  add    $0x8,%rbx
  test   %rdi,%rdi
  je     L45
L15:
  mov    $0x3a,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L19
  movb   $0x0,(%rax)
L19:
  mov    (%rbx),%rdi
  call   <_keystore_is_block_device@plt>
  test   %eax,%eax
  jne    L32
  mov    (%rbx),%rsi
  mov    %r15,%rdi
  mov    %r12,%rdx
  add    $0x8,%rbx
  mov    $0x1,%r13d
  call   <printf@plt>
  mov    (%rbx),%rdi
  test   %rdi,%rdi
  jne    L15
L45:
  test   %r13d,%r13d
  jne    L8
L5:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <str_list_free_string_array@plt>
L60:
  add    $0x8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L8:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <str_list_free_string_array@plt>
  jmp    L60
```

tool_calls: name: retrieve_data
arguments: data_tag: D4
type: string
name: retrieve_data
arguments: data_tag: D13
type: string

tool: D4: volumes

tool: D13: WARNING: The volume '%s' associated with key '%s' is not available


assistant: ```c
int _keystore_display_volume_status(struct properties *properties, const char *name) {
  int i, warning = 0;
  char **volume_list;
  char *volumes;
  char *ch;
  volumes = properties_get(properties, "volumes");
  if (volumes == NULL)
    return 0;
  volume_list = str_list_split(volumes);
  for (i = 0; volume_list[i] != NULL; i++) {
    ch = strchr(volume_list[i], ':');
    if (ch != NULL)
      *ch = '\0';
    if (!_keystore_is_block_device(volume_list[i])) {
      printf("WARNING: The volume '%s' associated with "
             "key '%s' is not available\n",
             volume_list[i], name);
      warning = 1;
    }
  }
  if (warning)
    printf("\n");
  free(volumes);
  str_list_free_string_array(volume_list);
  return warning;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_keystore_display_volume_status>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %rsi,%r12
  lea    D17(%rip),%rsi
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <properties_get@plt>
  test   %rax,%rax
  je     L59
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <str_list_split@plt>
  mov    (%rax),%rdi
  mov    %rax,%r14
  test   %rdi,%rdi
  je     L7
  mov    %rax,%rbx
  lea    D0(%rip),%r15
  nopl   0x0(%rax)
L28:
  mov    $0x3a,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L57
  movb   $0x0,(%rax)
L57:
  mov    (%rbx),%rdi
  call   <_keystore_is_block_device@plt>
  test   %eax,%eax
  je     L11
  mov    0x8(%rbx),%rdi
  add    $0x8,%rbx
  test   %rdi,%rdi
  jne    L28
  test   %r13d,%r13d
  jne    L6
L7:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <str_list_free_string_array@plt>
L59:
  add    $0x8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L11:
  mov    (%rbx),%rsi
  mov    %r15,%rdi
  mov    %r12,%rdx
  add    $0x8,%rbx
  call   <printf@plt>
  mov    (%rbx),%rdi
  test   %rdi,%rdi
  je     L6
  mov    $0x1,%r13d
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L6:
  mov    $0xa,%edi
  mov    $0x1,%r13d
  call   <putchar@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <str_list_free_string_array@plt>
  jmp    L59
```

tool_calls: name: retrieve_data
arguments: data_tag: D17
type_guessed: string
name: retrieve_data
arguments: data_tag: D0
type_guessed: string

tool: D17: volumes

tool: D0: WARNING: The volume '%s' associated with key '%s' is not available


assistant: ```c
int _keystore_display_volume_status(struct properties *properties, const char *name) {
  int i, warning = 0;
  char **volume_list;
  char *volumes;
  char *ch;
  volumes = properties_get(properties, "volumes");
  if (volumes == NULL)
    return 0;
  volume_list = str_list_split(volumes);
  for (i = 0; volume_list[i] != NULL; i++) {
    ch = strchr(volume_list[i], ':');
    if (ch != NULL)
      *ch = '\0';
    if (!_keystore_is_block_device(volume_list[i])) {
      printf("WARNING: The volume '%s' associated with "
             "key '%s' is not available\n",
             volume_list[i], name);
      warning = 1;
    }
  }
  if (warning)
    printf("\n");
  free(volumes);
  str_list_free_string_array(volume_list);
  return warning;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<voca3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%edi
  call   <textbackground@plt>
  mov    $0xe,%edi
  call   <textcolor@plt>
  mov    $0x5,%esi
  mov    $0x13,%edi
  call   <gotoxy@plt>
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D8
type_guessed: string

tool: D8: C.E.C.y.T No. 3 "Estanislao Ramirez Ruiz"

assistant: ```c
void voca3(void) {
  textbackground(0);
  textcolor(14);
  gotoxy(19, 5);
  printf("C.E.C.y.T No. 3 \"Estanislao Ramirez Ruiz\"");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<voca3>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <textbackground@plt>
  mov    $0xe,%edi
  call   <textcolor@plt>
  mov    $0x5,%esi
  mov    $0x13,%edi
  call   <gotoxy@plt>
  lea    D9(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type_infered: string

tool: D9: C.E.C.y.T No. 3 "Estanislao Ramirez Ruiz"

assistant: ```c
void voca3(void) {
  textbackground(0);
  textcolor(14);
  gotoxy(19, 5);
  printf("C.E.C.y.T No. 3 \"Estanislao Ramirez Ruiz\"");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<voca3>:
  endbr64
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <textbackground@plt>
  mov    $0xe,%edi
  call   <textcolor@plt>
  mov    $0x13,%edi
  mov    $0x5,%esi
  call   <gotoxy@plt>
  lea    D5(%rip),%rdi
  add    $0x8,%rsp
  jmp    1080 <printf@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D5
type: string

tool: D5: C.E.C.y.T No. 3 "Estanislao Ramirez Ruiz"

assistant: ```c
void voca3(void) {
  textbackground(0);
  textcolor(14);
  gotoxy(19, 5);
  printf("C.E.C.y.T No. 3 \"Estanislao Ramirez Ruiz\"");
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<voca3>:
  endbr64
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <textbackground@plt>
  mov    $0xe,%edi
  call   <textcolor@plt>
  mov    $0x13,%edi
  mov    $0x5,%esi
  call   <gotoxy@plt>
  lea    D6(%rip),%rdi
  add    $0x8,%rsp
  jmp    1080 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D6
type: string

tool: D6: C.E.C.y.T No. 3 "Estanislao Ramirez Ruiz"

assistant: ```c
void voca3(void) {
  textbackground(0);
  textcolor(14);
  gotoxy(19, 5);
  printf("C.E.C.y.T No. 3 \"Estanislao Ramirez Ruiz\"");
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<checktimespec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x3b9ac9ff,%eax
  jle    L38
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%ecx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x44b82fa1,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1c,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,0x4(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  imul   $0x44b82fa1,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1c,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x3b9aca00,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
  jmp    L30
L38:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L30
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  neg    %eax
  mov    %eax,%edx
  movslq %edx,%rax
  imul   $0x44b82fa1,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1c,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x3b9aca00,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L14
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%ecx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x44b82fa1,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1c,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,0x4(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L30
L14:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x44b82fa1,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1c,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    $0x1,%eax
  cltq
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,0x4(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  imul   $0x3b9aca00,%eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
L30:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void checktimespec(struct timespec *arg) {
  long tominus;
  if (arg->tv_nsec >= 1000000000) {
    arg->tv_sec += (arg->tv_nsec / 1000000000);
    arg->tv_nsec %= 1000000000;
  } else if (arg->tv_nsec < 0) {
    if ((-(arg->tv_nsec)) % 1000000000 == 0) {
      arg->tv_sec -= ((-(arg->tv_nsec)) / 1000000000);
      arg->tv_nsec = 0;
    } else {
      tominus = (((-(arg->tv_nsec)) / 1000000000) + 1);
      arg->tv_sec -= tominus;
      arg->tv_nsec += tominus * 1000000000;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<checktimespec>:
  endbr64
  mov    %rdi,%rax
  mov    (%rdi),%edx
  cmp    $0x3b9ac9ff,%edx
  jle    L11
  movslq %edx,%rcx
  imul   $0x44b82fa1,%rcx,%rcx
  sar    $0x3c,%rcx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  add    %ecx,0x4(%rdi)
  imul   $0x3b9aca00,%ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,(%rdi)
  ret
L11:
  test   %edx,%edx
  js     L14
L29:
  ret
L14:
  mov    %edx,%esi
  neg    %esi
  movslq %esi,%rcx
  imul   $0x44b82fa1,%rcx,%rcx
  sar    $0x3c,%rcx
  mov    %esi,%edi
  sar    $0x1f,%edi
  sub    %edi,%ecx
  imul   $0x3b9aca00,%ecx,%ecx
  cmp    %ecx,%esi
  jne    L37
  movslq %edx,%rcx
  imul   $0x44b82fa1,%rcx,%rcx
  sar    $0x3c,%rcx
  sar    $0x1f,%edx
  sub    %edx,%ecx
  add    %ecx,0x4(%rax)
  movl   $0x0,(%rax)
  ret
L37:
  movslq %edx,%rsi
  imul   $0x44b82fa1,%rsi,%rsi
  sar    $0x3c,%rsi
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %esi,%ecx
  add    $0x1,%ecx
  sub    %ecx,0x4(%rax)
  imul   $0x3b9aca00,%ecx,%ecx
  add    %edx,%ecx
  mov    %ecx,(%rax)
  jmp    L29
```

assistant: ```c
void checktimespec(struct timespec *arg) {
  long tominus;
  if (arg->tv_nsec >= 1000000000) {
    arg->tv_sec += (arg->tv_nsec / 1000000000);
    arg->tv_nsec %= 1000000000;
  } else if (arg->tv_nsec < 0) {
    if ((-(arg->tv_nsec)) % 1000000000 == 0) {
      arg->tv_sec -= ((-(arg->tv_nsec)) / 1000000000);
      arg->tv_nsec = 0;
    } else {
      tominus = (((-(arg->tv_nsec)) / 1000000000) + 1);
      arg->tv_sec -= tominus;
      arg->tv_nsec += tominus * 1000000000;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<checktimespec>:
  endbr64
  mov    (%rdi),%edx
  mov    %rdi,%rax
  cmp    $0x3b9ac9ff,%edx
  jle    L1
  movslq %edx,%rcx
  mov    %edx,%esi
  imul   $0x44b82fa1,%rcx,%rcx
  sar    $0x1f,%esi
  sar    $0x3c,%rcx
  sub    %esi,%ecx
  add    %ecx,0x4(%rdi)
  imul   $0x3b9aca00,%ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,(%rdi)
  ret
  nopl   0x0(%rax)
L1:
  test   %edx,%edx
  js     L17
  ret
  nopl   (%rax)
L17:
  imul   $0xc5d16393,%edx,%ecx
  mov    0x4(%rdi),%esi
  ror    $0x9,%ecx
  cmp    $0x4,%ecx
  ja     L0
  movslq %edx,%rcx
  sar    $0x1f,%edx
  movl   $0x0,(%rdi)
  imul   $0x44b82fa1,%rcx,%rcx
  sar    $0x3c,%rcx
  sub    %edx,%ecx
  lea    (%rcx,%rsi,1),%edx
  mov    %edx,0x4(%rdi)
  ret
  nopl   0x0(%rax)
L0:
  movslq %edx,%rdi
  mov    %edx,%ecx
  imul   $0x44b82fa1,%rdi,%rdi
  sar    $0x1f,%ecx
  sar    $0x3c,%rdi
  sub    %edi,%ecx
  add    $0x1,%ecx
  sub    %ecx,%esi
  imul   $0x3b9aca00,%ecx,%ecx
  mov    %esi,0x4(%rax)
  add    %edx,%ecx
  mov    %ecx,(%rax)
  ret
```

assistant: ```c
void checktimespec(struct timespec *arg) {
  long tominus;
  if (arg->tv_nsec >= 1000000000) {
    arg->tv_sec += (arg->tv_nsec / 1000000000);
    arg->tv_nsec %= 1000000000;
  } else if (arg->tv_nsec < 0) {
    if ((-(arg->tv_nsec)) % 1000000000 == 0) {
      arg->tv_sec -= ((-(arg->tv_nsec)) / 1000000000);
      arg->tv_nsec = 0;
    } else {
      tominus = (((-(arg->tv_nsec)) / 1000000000) + 1);
      arg->tv_sec -= tominus;
      arg->tv_nsec += tominus * 1000000000;
    }
  }
}
```