ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<createFile>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  lea    D15(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D28(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D12(%rip),%rdi
  pop    %rbp
  jmp    1080 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D15
datatype: string
name: extract_symbolic_data
arguments: data_tag: D28
datatype: string
name: extract_symbolic_data
arguments: data_tag: D12
datatype: string

tool: D15: start createFile() Function


tool: D28: w+b

tool: D12: end createFile() Function


assistant: ```c
void createFile(char *pValidFilePath) {
  printf("start createFile() Function\n");
  FILE *TheFile;
  TheFile = fopen(pValidFilePath, "w+b");
  fclose(TheFile);
  printf("end createFile() Function\n");
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<allTasksStop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x1,%edi
  call   <StopTask@plt>
  mov    $0x2,%edi
  call   <StopTask@plt>
  mov    $0x3,%edi
  call   <StopTask@plt>
  mov    $0x4,%edi
  call   <StopTask@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void allTasksStop() {
  StopTask(1);
  StopTask(2);
  StopTask(3);
  StopTask(4);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<allTasksStop>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <StopTask@plt>
  mov    $0x2,%edi
  call   <StopTask@plt>
  mov    $0x3,%edi
  call   <StopTask@plt>
  mov    $0x4,%edi
  call   <StopTask@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void allTasksStop() {
  StopTask(1);
  StopTask(2);
  StopTask(3);
  StopTask(4);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<allTasksStop>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <StopTask@plt>
  mov    $0x2,%edi
  call   <StopTask@plt>
  mov    $0x3,%edi
  call   <StopTask@plt>
  mov    $0x4,%edi
  add    $0x8,%rsp
  jmp    1050 <StopTask@plt>
```

assistant: ```c
void allTasksStop() {
  StopTask(1);
  StopTask(2);
  StopTask(3);
  StopTask(4);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<generateBinarySearch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x740,%rsp
  mov    %edi,-0x2734(%rbp)
  mov    %esi,-0x2738(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x2738(%rbp),%edx
  mov    -0x2734(%rbp),%ecx
  lea    -0x2720(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <getTimeForBinarySearch@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x2724(%rbp)
  mov    -0x2724(%rbp),%eax
  movd   %eax,%xmm0
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D5
data_type: string

tool: D5: %-10.4f

assistant: ```c
void generateBinarySearch(int left, int right) {
  int arr[2500], value;
  float time;
  time = getTimeForBinarySearch(arr, left, right);
  printf("%-10.4f", time);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<generateBinarySearch>:
  endbr64
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x728,%rsp
  mov    %esi,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x2718(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %edi,%esi
  mov    %rax,%rdi
  call   <getTimeForBinarySearch@plt>
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    0x2718(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x2728,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D7
type: string

tool: D7: %-10.4f

assistant: ```c
void generateBinarySearch(int left, int right) {
  int arr[2500], value;
  float time;
  time = getTimeForBinarySearch(arr, left, right);
  printf("%-10.4f", time);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<generateBinarySearch>:
  endbr64
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x728,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2718(%rsp)
  xor    %eax,%eax
  mov    %edi,%r8d
  mov    %esi,%edx
  mov    %rsp,%rdi
  mov    %r8d,%esi
  call   <getTimeForBinarySearch@plt>
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    0x2718(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x2728,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
type_infered: string

tool: D9: %-10.4f

assistant: ```c
void generateBinarySearch(int left, int right) {
  int arr[2500], value;
  float time;
  time = getTimeForBinarySearch(arr, left, right);
  printf("%-10.4f", time);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<generateBinarySearch>:
  endbr64
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x728,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2718(%rsp)
  xor    %eax,%eax
  mov    %edi,%r8d
  mov    %esi,%edx
  mov    %rsp,%rdi
  mov    %r8d,%esi
  call   <getTimeForBinarySearch@plt>
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    0x2718(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x2728,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
type: string

tool: D2: %-10.4f

assistant: ```c
void generateBinarySearch(int left, int right) {
  int arr[2500], value;
  float time;
  time = getTimeForBinarySearch(arr, left, right);
  printf("%-10.4f", time);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<print_time>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  cmpq   $0x3e7,-0x28(%rbp)
  ja     L0
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L36
L0:
  mov    -0x28(%rbp),%rax
  shr    $0x3,%rax
  movabs $0x20c49ba5e353f7cf,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x4,%rax
  mov    %rax,-0x18(%rbp)
  cmpq   $0x3b,-0x18(%rbp)
  ja     L17
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L36
L17:
  mov    -0x18(%rbp),%rax
  movabs $0x8888888888888889,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x5,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x5,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x18(%rbp)
  cmpq   $0x3b,-0x10(%rbp)
  ja     L11
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L36
L11:
  mov    -0x10(%rbp),%rax
  movabs $0x8888888888888889,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x5,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x5,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L36:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D4
type: string
name: disassemble_data
arguments: tag: D3
type: string
name: disassemble_data
arguments: tag: D38
type: string
name: disassemble_data
arguments: tag: D32
type: string

tool: D4: %lu milliseconds


tool: D3: %lu seconds


tool: D38: %lu minutes, %lu seconds


tool: D32: %lu hours, %lu minutes


assistant: ```c
void print_time(unsigned long millis) {
  unsigned long seconds;
  unsigned long minutes;
  unsigned long hours;
  if (millis < 1000) {
    printf("%lu milliseconds\n", millis);
    return;
  }
  seconds = millis / 1000;
  if (seconds < 60) {
    printf("%lu seconds\n", seconds);
    return;
  }
  minutes = seconds / 60;
  seconds %= 60;
  if (minutes < 60) {
    printf("%lu minutes, %lu seconds\n", minutes, seconds);
    return;
  }
  hours = minutes / 60;
  minutes %= 60;
  printf("%lu hours, %lu minutes\n", hours, minutes);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<print_time>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x3e7,%rdi
  jbe    L4
  mov    %rdi,%rdx
  shr    $0x3,%rdx
  movabs $0x20c49ba5e353f7cf,%rcx
  mov    %rdx,%rax
  mul    %rcx
  mov    %rdx,%rcx
  shr    $0x4,%rcx
  cmp    $0xea5f,%rdi
  jbe    L14
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rdx,%rsi
  shr    $0x5,%rsi
  cmp    $0x36ee7f,%rdi
  jbe    L56
  movabs $0x8888888888888889,%rdx
  mov    %rsi,%rax
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x5,%rax
  mov    %rax,%rcx
  shl    $0x4,%rcx
  sub    %rax,%rcx
  shl    $0x2,%rcx
  sub    %rcx,%rsi
  mov    %rsi,%rdx
  mov    %rax,%rsi
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L23:
  add    $0x8,%rsp
  ret
L4:
  mov    %rdi,%rsi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L23
L14:
  mov    %rcx,%rsi
  lea    D30(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L23
L56:
  mov    %rsi,%rax
  shl    $0x4,%rax
  sub    %rsi,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L23
```

tool_calls: name: parse_data
arguments: label: D1
datatype: string
name: parse_data
arguments: label: D34
datatype: string
name: parse_data
arguments: label: D30
datatype: string
name: parse_data
arguments: label: D9
datatype: string

tool: D1: %lu hours, %lu minutes


tool: D34: %lu milliseconds


tool: D30: %lu seconds


tool: D9: %lu minutes, %lu seconds


assistant: ```c
void print_time(unsigned long millis) {
  unsigned long seconds;
  unsigned long minutes;
  unsigned long hours;
  if (millis < 1000) {
    printf("%lu milliseconds\n", millis);
    return;
  }
  seconds = millis / 1000;
  if (seconds < 60) {
    printf("%lu seconds\n", seconds);
    return;
  }
  minutes = seconds / 60;
  seconds %= 60;
  if (minutes < 60) {
    printf("%lu minutes, %lu seconds\n", minutes, seconds);
    return;
  }
  hours = minutes / 60;
  minutes %= 60;
  printf("%lu hours, %lu minutes\n", hours, minutes);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<print_time>:
  endbr64
  cmp    $0x3e7,%rdi
  jbe    L19
  movabs $0x20c49ba5e353f7cf,%rcx
  mov    %rdi,%rdx
  shr    $0x3,%rdx
  mov    %rdx,%rax
  mul    %rcx
  shr    $0x4,%rdx
  mov    %rdx,%r8
  cmp    $0xea5f,%rdi
  jbe    L12
  movabs $0x8888888888888889,%rcx
  mov    %rdx,%rax
  mul    %rcx
  mov    %rdx,%rsi
  shr    $0x5,%rsi
  mov    %rsi,%rax
  cmp    $0x36ee7f,%rdi
  jbe    L14
  mul    %rcx
  lea    D19(%rip),%rdi
  shr    $0x5,%rdx
  mov    %rdx,%rax
  mov    %rdx,%r8
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rsi
  xor    %eax,%eax
  mov    %rsi,%rdx
  mov    %r8,%rsi
  jmp    1050 <printf@plt>
  xchg   %ax,%ax
L14:
  shl    $0x4,%rax
  mov    %r8,%rdx
  lea    D31(%rip),%rdi
  sub    %rsi,%rax
  shl    $0x2,%rax
  sub    %rax,%rdx
  xor    %eax,%eax
  jmp    1050 <printf@plt>
  nop
L19:
  mov    %rdi,%rsi
  xor    %eax,%eax
  lea    D2(%rip),%rdi
  jmp    1050 <printf@plt>
  nopl   0x0(%rax)
L12:
  mov    %rdx,%rsi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  jmp    1050 <printf@plt>
```

tool_calls: name: unpack_data
arguments: tag: D19
data_type: string
name: unpack_data
arguments: tag: D31
data_type: string
name: unpack_data
arguments: tag: D2
data_type: string
name: unpack_data
arguments: tag: D24
data_type: string

tool: D19: %lu hours, %lu minutes


tool: D31: %lu minutes, %lu seconds


tool: D2: %lu milliseconds


tool: D24: %lu seconds


assistant: ```c
void print_time(unsigned long millis) {
  unsigned long seconds;
  unsigned long minutes;
  unsigned long hours;
  if (millis < 1000) {
    printf("%lu milliseconds\n", millis);
    return;
  }
  seconds = millis / 1000;
  if (seconds < 60) {
    printf("%lu seconds\n", seconds);
    return;
  }
  minutes = seconds / 60;
  seconds %= 60;
  if (minutes < 60) {
    printf("%lu minutes, %lu seconds\n", minutes, seconds);
    return;
  }
  hours = minutes / 60;
  minutes %= 60;
  printf("%lu hours, %lu minutes\n", hours, minutes);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<print_time>:
  endbr64
  cmp    $0x3e7,%rdi
  jbe    L17
  movabs $0x20c49ba5e353f7cf,%rcx
  mov    %rdi,%rdx
  shr    $0x3,%rdx
  mov    %rdx,%rax
  mul    %rcx
  shr    $0x4,%rdx
  mov    %rdx,%r8
  cmp    $0xea5f,%rdi
  jbe    L28
  movabs $0x8888888888888889,%rcx
  mov    %rdx,%rax
  mul    %rcx
  mov    %rdx,%rsi
  shr    $0x5,%rsi
  mov    %rsi,%rax
  cmp    $0x36ee7f,%rdi
  jbe    L21
  mul    %rcx
  lea    D34(%rip),%rdi
  shr    $0x5,%rdx
  mov    %rdx,%rax
  mov    %rdx,%r8
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rsi
  xor    %eax,%eax
  mov    %rsi,%rdx
  mov    %r8,%rsi
  jmp    1050 <printf@plt>
  xchg   %ax,%ax
L21:
  shl    $0x4,%rax
  mov    %r8,%rdx
  lea    D22(%rip),%rdi
  sub    %rsi,%rax
  shl    $0x2,%rax
  sub    %rax,%rdx
  xor    %eax,%eax
  jmp    1050 <printf@plt>
  nop
L17:
  mov    %rdi,%rsi
  xor    %eax,%eax
  lea    D31(%rip),%rdi
  jmp    1050 <printf@plt>
  nopl   0x0(%rax)
L28:
  mov    %rdx,%rsi
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: data_tag: D34
data_type: string
name: read_data
arguments: data_tag: D22
data_type: string
name: read_data
arguments: data_tag: D31
data_type: string
name: read_data
arguments: data_tag: D8
data_type: string

tool: D34: %lu hours, %lu minutes


tool: D22: %lu minutes, %lu seconds


tool: D31: %lu milliseconds


tool: D8: %lu seconds


assistant: ```c
void print_time(unsigned long millis) {
  unsigned long seconds;
  unsigned long minutes;
  unsigned long hours;
  if (millis < 1000) {
    printf("%lu milliseconds\n", millis);
    return;
  }
  seconds = millis / 1000;
  if (seconds < 60) {
    printf("%lu seconds\n", seconds);
    return;
  }
  minutes = seconds / 60;
  seconds %= 60;
  if (minutes < 60) {
    printf("%lu minutes, %lu seconds\n", minutes, seconds);
    return;
  }
  hours = minutes / 60;
  minutes %= 60;
  printf("%lu hours, %lu minutes\n", hours, minutes);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<_tsarray_new_of_len>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <ulong_fits_in_long@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <tsarray_new@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L23
  mov    $0x0,%eax
  jmp    L12
L23:
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <tsarray_resize@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L36
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <tsarray_free@plt>
  mov    $0x0,%eax
  jmp    L12
L36:
  mov    -0x8(%rbp),%rax
L12:
  leave
  ret
```

assistant: ```c
struct _tsarray_priv *_tsarray_new_of_len(size_t obj_size, unsigned long len) {
  assert(ulong_fits_in_long(len));
  struct _tsarray_priv *priv = (struct _tsarray_priv *)tsarray_new(obj_size);
  int retval;
  if (__builtin_expect(!!(priv == NULL), 0))
    return NULL;
  retval = tsarray_resize(priv, len);
  if (__builtin_expect(!!(retval != 0), 0)) {
    tsarray_free((struct _tsarray_pub *)priv);
    return NULL;
  }
  return priv;
}
```
user: What is the c source code of the assembly code below?

```asm
<_tsarray_new_of_len>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rsi,%rdi
  call   <ulong_fits_in_long@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    %rbx,%rdi
  call   <tsarray_new@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%esi
  call   <__builtin_expect@plt>
  mov    $0x0,%r12d
  test   %rax,%rax
  jne    L1
  mov    %rbx,%r12
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <tsarray_resize@plt>
  test   %eax,%eax
  setne  %dil
  movzbl %dil,%edi
  mov    $0x0,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L8
L1:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L8:
  mov    %rbx,%rdi
  call   <tsarray_free@plt>
  mov    $0x0,%r12d
  jmp    L1
```

assistant: ```c
struct _tsarray_priv *_tsarray_new_of_len(size_t obj_size, unsigned long len) {
  assert(ulong_fits_in_long(len));
  struct _tsarray_priv *priv = (struct _tsarray_priv *)tsarray_new(obj_size);
  int retval;
  if (__builtin_expect(!!(priv == NULL), 0))
    return NULL;
  retval = tsarray_resize(priv, len);
  if (__builtin_expect(!!(retval != 0), 0)) {
    tsarray_free((struct _tsarray_pub *)priv);
    return NULL;
  }
  return priv;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<_tsarray_new_of_len>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  call   <ulong_fits_in_long@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    %r12,%rdi
  call   <tsarray_new@plt>
  xor    %edi,%edi
  test   %rax,%rax
  mov    %rax,%rbx
  sete   %dil
  xor    %esi,%esi
  xor    %r12d,%r12d
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L14
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    %rbx,%r12
  call   <tsarray_resize@plt>
  xor    %edi,%edi
  test   %eax,%eax
  setne  %dil
  xor    %esi,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L5
L14:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %rbx,%rdi
  xor    %r12d,%r12d
  call   <tsarray_free@plt>
  jmp    L14
```

assistant: ```c
struct _tsarray_priv *_tsarray_new_of_len(size_t obj_size, unsigned long len) {
  assert(ulong_fits_in_long(len));
  struct _tsarray_priv *priv = (struct _tsarray_priv *)tsarray_new(obj_size);
  int retval;
  if (__builtin_expect(!!(priv == NULL), 0))
    return NULL;
  retval = tsarray_resize(priv, len);
  if (__builtin_expect(!!(retval != 0), 0)) {
    tsarray_free((struct _tsarray_pub *)priv);
    return NULL;
  }
  return priv;
}
```
user: What is the c source code of the assembly code below:

```asm
<_tsarray_new_of_len>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  call   <ulong_fits_in_long@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    %r12,%rdi
  call   <tsarray_new@plt>
  xor    %edi,%edi
  test   %rax,%rax
  mov    %rax,%rbx
  sete   %dil
  xor    %esi,%esi
  xor    %r12d,%r12d
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L23
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    %rbx,%r12
  call   <tsarray_resize@plt>
  xor    %edi,%edi
  test   %eax,%eax
  setne  %dil
  xor    %esi,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L12
L23:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L12:
  mov    %rbx,%rdi
  xor    %r12d,%r12d
  call   <tsarray_free@plt>
  jmp    L23
```

assistant: ```c
struct _tsarray_priv *_tsarray_new_of_len(size_t obj_size, unsigned long len) {
  assert(ulong_fits_in_long(len));
  struct _tsarray_priv *priv = (struct _tsarray_priv *)tsarray_new(obj_size);
  int retval;
  if (__builtin_expect(!!(priv == NULL), 0))
    return NULL;
  retval = tsarray_resize(priv, len);
  if (__builtin_expect(!!(retval != 0), 0)) {
    tsarray_free((struct _tsarray_pub *)priv);
    return NULL;
  }
  return priv;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<modnamchk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xffffff80,%eax
  test   %eax,%eax
  jne    L6
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L6
  mov    $0x0,%eax
  jmp    L11
L34:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xffffff80,%eax
  test   %eax,%eax
  jne    L15
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L41
L15:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L41
  mov    $0x0,%eax
  jmp    L11
L41:
  addq   $0x1,-0x8(%rbp)
L6:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L34
  mov    $0x1,%eax
L11:
  leave
  ret
```

assistant: ```c
int modnamchk(s)
char *s;
{
  if ((isascii(*s) && isdigit(*s)))
    return (0);
  for (; *s; s++)
    if (!(isascii(*s) && isalnum(*s)) && *s != '_')
      return (0);
  return (1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<modnamchk>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%ebx
  test   %bl,%bl
  js     L81
  movsbl %bl,%edx
  sub    $0x30,%edx
  mov    $0x0,%eax
  cmp    $0x9,%edx
  jbe    L63
  test   %bl,%bl
  jne    L81
  mov    $0x1,%eax
  jmp    L63
L49:
  cmp    $0x5f,%bl
  jne    L14
L25:
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  je     L18
L81:
  test   %bl,%bl
  js     L49
  movsbl %bl,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L25
  jmp    L49
L18:
  mov    $0x1,%eax
L63:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L14:
  mov    $0x0,%eax
  jmp    L63
```

assistant: ```c
int modnamchk(s)
char *s;
{
  if ((isascii(*s) && isdigit(*s)))
    return (0);
  for (; *s; s++)
    if (!(isascii(*s) && isalnum(*s)) && *s != '_')
      return (0);
  return (1);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<modnamchk>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%ebx
  test   %bl,%bl
  js     L47
  movsbl %bl,%edx
  xor    %eax,%eax
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L43
  mov    %rdi,%rbp
  test   %bl,%bl
  jne    L10
  jmp    L71
  nopw   0x0(%rax,%rax,1)
L14:
  movsbl %bl,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L50
  cmp    $0x5f,%bl
  jne    L43
L50:
  movzbl 0x1(%rbp),%ebx
  add    $0x1,%rbp
  test   %bl,%bl
  je     L71
L10:
  test   %bl,%bl
  jns    L14
L47:
  xor    %eax,%eax
L43:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L71:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int modnamchk(s)
char *s;
{
  if ((isascii(*s) && isdigit(*s)))
    return (0);
  for (; *s; s++)
    if (!(isascii(*s) && isalnum(*s)) && *s != '_')
      return (0);
  return (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<modnamchk>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%ebx
  test   %bl,%bl
  js     L54
  movsbl %bl,%edx
  xor    %eax,%eax
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L68
  mov    %rdi,%rbp
  test   %bl,%bl
  jne    L3
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L71:
  movsbl %bl,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L5
  cmp    $0x5f,%bl
  jne    L68
L5:
  movzbl 0x1(%rbp),%ebx
  add    $0x1,%rbp
  test   %bl,%bl
  je     L10
L3:
  test   %bl,%bl
  jns    L71
L54:
  xor    %eax,%eax
L68:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L10:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int modnamchk(s)
char *s;
{
  if ((isascii(*s) && isdigit(*s)))
    return (0);
  for (; *s; s++)
    if (!(isascii(*s) && isalnum(*s)) && *s != '_')
      return (0);
  return (1);
}
```