ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<write_all>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdx,%rdx
  je     L8
  mov    %edi,%r12d
  mov    %rsi,%r13
  mov    %rdx,%rbx
  mov    $0x0,%ebp
  jmp    L59
L36:
  movslq %eax,%rdx
  sub    %rdx,%rbx
  add    %eax,%ebp
L25:
  test   %rbx,%rbx
  je     L22
L59:
  movslq %ebp,%rsi
  add    %r13,%rsi
  mov    %rbx,%rdx
  mov    %r12d,%edi
  call   <write@plt>
  test   %eax,%eax
  jns    L36
  mov    D1(%rip),%rcx
  mov    D7(%rip),%rdx
  mov    (%rdx),%rdi
  cmp    %rdi,(%rcx)
  je     L25
  test   %ebp,%ebp
  cmovle %eax,%ebp
L22:
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  mov    $0x0,%ebp
  jmp    L22
```

assistant: ```c
ssize_t write_all(int fd, const void *buf, size_t count) {
  ssize_t written = 0;
  if (count == 11) {
  }
  while (count > 0) {
    ssize_t ret;
    ret = write(fd, (const unsigned char *)buf + written, count);
    if (ret < 0) {
      if (errno == EINTR) {
        continue;
      }
      return written > 0 ? written : ret;
    }
    count -= ret;
    written += ret;
  }
  return written;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<write_all>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdx,%rdx
  je     L59
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  xor    %r14d,%r14d
  xor    %r13d,%r13d
L29:
  lea    (%r12,%r13,1),%rsi
  mov    %rbx,%rdx
  mov    %ebp,%edi
  call   <write@plt>
  test   %eax,%eax
  js     L5
  movslq %eax,%rdx
  add    %eax,%r14d
  sub    %rdx,%rbx
  je     L54
  movslq %r14d,%r13
  jmp    L29
  nopl   0x0(%rax)
L5:
  mov    D17(%rip),%rdx
  mov    D7(%rip),%rcx
  mov    (%rdx),%rdi
  cmp    %rdi,(%rcx)
  je     L29
  test   %r14d,%r14d
  cmove  %eax,%r14d
L54:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L59:
  xor    %r14d,%r14d
  jmp    L54
```

assistant: ```c
ssize_t write_all(int fd, const void *buf, size_t count) {
  ssize_t written = 0;
  if (count == 11) {
  }
  while (count > 0) {
    ssize_t ret;
    ret = write(fd, (const unsigned char *)buf + written, count);
    if (ret < 0) {
      if (errno == EINTR) {
        continue;
      }
      return written > 0 ? written : ret;
    }
    count -= ret;
    written += ret;
  }
  return written;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<write_all>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdx,%rdx
  je     L46
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  xor    %r14d,%r14d
  xor    %r13d,%r13d
L36:
  lea    (%r12,%r13,1),%rsi
  mov    %rbx,%rdx
  mov    %ebp,%edi
  call   <write@plt>
  test   %eax,%eax
  js     L50
  movslq %eax,%rdx
  add    %eax,%r14d
  sub    %rdx,%rbx
  je     L53
  movslq %r14d,%r13
  jmp    L36
  nopl   0x0(%rax)
L50:
  mov    D4(%rip),%rdx
  mov    D0(%rip),%rcx
  mov    (%rdx),%rdi
  cmp    %rdi,(%rcx)
  je     L36
  test   %r14d,%r14d
  cmove  %eax,%r14d
L53:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L46:
  xor    %r14d,%r14d
  jmp    L53
```

assistant: ```c
ssize_t write_all(int fd, const void *buf, size_t count) {
  ssize_t written = 0;
  if (count == 11) {
  }
  while (count > 0) {
    ssize_t ret;
    ret = write(fd, (const unsigned char *)buf + written, count);
    if (ret < 0) {
      if (errno == EINTR) {
        continue;
      }
      return written > 0 ? written : ret;
    }
    count -= ret;
    written += ret;
  }
  return written;
}
```
user: Converte this assembly snippet into its equivalent C code:

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

tool_calls: name: read_data
arguments: data_label: D5
type_infered: string

tool: D5: Hello from distroless!

assistant: ```c
int main() {
  printf("Hello from distroless!");
  return 0;
}
```
user: What is the c source code of the assembly code below:

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

tool_calls: name: disassemble_data
arguments: label: D5
data_type: string

tool: D5: Hello from distroless!

assistant: ```c
int main() {
  printf("Hello from distroless!");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

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

tool_calls: name: retrieve_data
arguments: tag: D5
type_infered: string

tool: D5: Hello from distroless!

assistant: ```c
int main() {
  printf("Hello from distroless!");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

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

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

tool: D4: Hello from distroless!

assistant: ```c
int main() {
  printf("Hello from distroless!");
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D6(%rip),%xmm0
  mov    $0x64,%esi
  lea    D61(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%esi
  lea    D50(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x78,%esi
  lea    D33(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%esi
  lea    D16(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%esi
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%esi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D6
type_infered: f64
name: disassemble_data
arguments: data_label: D61
type_infered: string
name: disassemble_data
arguments: data_label: D50
type_infered: string
name: disassemble_data
arguments: data_label: D33
type_infered: string
name: disassemble_data
arguments: data_label: D16
type_infered: string
name: disassemble_data
arguments: data_label: D45
type_infered: string
name: disassemble_data
arguments: data_label: D19
type_infered: string

tool: D6: 1.2

tool: D61: You have %d bugs at the imaginary rate of %f. 


tool: D50: The entire universe has %ld bugs. 


tool: D33: You are expected to have %f bugs. 


tool: D16: That is only a %e portion of the universe. 


tool: D45: nul_byte: %c. 


tool: D19: Which means you should care %d%%. 


assistant: ```c
int main(int argc, char *argv[]) {
  int bugs = 100;
  double bug_rate = 1.2;
  printf("You have %d bugs at the imaginary rate of %f. \n", bugs, bug_rate);
  unsigned long universe_of_defects = 1024L * 1024L * 1024L * 1024L * 1024L * 1024L;
  printf("The entire universe has %ld bugs. \n", universe_of_defects);
  double expected_bugs = bugs * bug_rate;
  printf("You are expected to have %f bugs. \n", expected_bugs);
  double part_of_universe = expected_bugs / universe_of_defects;
  printf("That is only a %e portion of the universe. \n", part_of_universe);
  char nul_byte = '\0';
  printf("nul_byte: %c. \n", nul_byte);
  int care_percentage = bugs * nul_byte;
  printf("Which means you should care %d%%. \n", care_percentage);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%esi
  mov    $0x1,%eax
  movsd  D25(%rip),%xmm0
  lea    D68(%rip),%rdi
  call   <printf@plt>
  xor    %esi,%esi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x78,%esi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D52(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D54(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D25
type_infered: f64
name: disassemble_data
arguments: data_tag: D68
type_infered: string
name: disassemble_data
arguments: data_tag: D47
type_infered: string
name: disassemble_data
arguments: data_tag: D11
type_infered: string
name: disassemble_data
arguments: data_tag: D0
type_infered: string
name: disassemble_data
arguments: data_tag: D52
type_infered: string
name: disassemble_data
arguments: data_tag: D54
type_infered: string

tool: D25: 1.2

tool: D68: You have %d bugs at the imaginary rate of %f. 


tool: D47: The entire universe has %ld bugs. 


tool: D11: You are expected to have %f bugs. 


tool: D0: That is only a %e portion of the universe. 


tool: D52: nul_byte: %c. 


tool: D54: Which means you should care %d%%. 


assistant: ```c
int main(int argc, char *argv[]) {
  int bugs = 100;
  double bug_rate = 1.2;
  printf("You have %d bugs at the imaginary rate of %f. \n", bugs, bug_rate);
  unsigned long universe_of_defects = 1024L * 1024L * 1024L * 1024L * 1024L * 1024L;
  printf("The entire universe has %ld bugs. \n", universe_of_defects);
  double expected_bugs = bugs * bug_rate;
  printf("You are expected to have %f bugs. \n", expected_bugs);
  double part_of_universe = expected_bugs / universe_of_defects;
  printf("That is only a %e portion of the universe. \n", part_of_universe);
  char nul_byte = '\0';
  printf("nul_byte: %c. \n", nul_byte);
  int care_percentage = bugs * nul_byte;
  printf("Which means you should care %d%%. \n", care_percentage);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%esi
  mov    $0x1,%eax
  movsd  D5(%rip),%xmm0
  lea    D39(%rip),%rdi
  call   <printf@plt>
  xor    %esi,%esi
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x78,%esi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_label: D5
type_infered: f64
name: read_data
arguments: data_label: D39
type_infered: string
name: read_data
arguments: data_label: D55
type_infered: string
name: read_data
arguments: data_label: D36
type_infered: string
name: read_data
arguments: data_label: D69
type_infered: string
name: read_data
arguments: data_label: D66
type_infered: string
name: read_data
arguments: data_label: D20
type_infered: string

tool: D5: 1.2

tool: D39: You have %d bugs at the imaginary rate of %f. 


tool: D55: The entire universe has %ld bugs. 


tool: D36: You are expected to have %f bugs. 


tool: D69: That is only a %e portion of the universe. 


tool: D66: nul_byte: %c. 


tool: D20: Which means you should care %d%%. 


assistant: ```c
int main(int argc, char *argv[]) {
  int bugs = 100;
  double bug_rate = 1.2;
  printf("You have %d bugs at the imaginary rate of %f. \n", bugs, bug_rate);
  unsigned long universe_of_defects = 1024L * 1024L * 1024L * 1024L * 1024L * 1024L;
  printf("The entire universe has %ld bugs. \n", universe_of_defects);
  double expected_bugs = bugs * bug_rate;
  printf("You are expected to have %f bugs. \n", expected_bugs);
  double part_of_universe = expected_bugs / universe_of_defects;
  printf("That is only a %e portion of the universe. \n", part_of_universe);
  char nul_byte = '\0';
  printf("nul_byte: %c. \n", nul_byte);
  int care_percentage = bugs * nul_byte;
  printf("Which means you should care %d%%. \n", care_percentage);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strsplit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,0x10(%rsp)
  call   <strdup@plt>
  mov    %rax,%r13
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  mov    %rax,(%rsp)
  mov    $0x0,%ebp
  jmp    L56
L66:
  mov    (%rsp),%rcx
  lea    (%rax,%rcx,1),%r13
  add    $0x1,%rbp
L56:
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L66
  lea    0x1(%rbp),%r15
  mov    %r15,0x18(%rsp)
  mov    %rbx,%rdi
  call   <strdup@plt>
  mov    %rax,%rbp
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  lea    0x0(,%r15,8),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L58
  mov    $0x0,%r13d
  test   %r14,%r14
  je     L58
L36:
  mov    %r13d,%r15d
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L18
  mov    %rbx,%r15
  sub    %rbp,%r15
  mov    %r15d,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strncpy@plt>
  movb   $0x0,(%r14,%r15,1)
  mov    %r14,%rdi
  call   <strdup@plt>
  mov    0x8(%rsp),%rdx
  mov    %rax,(%rdx,%r13,8)
  mov    (%rsp),%rax
  lea    (%rbx,%rax,1),%rbp
  add    $0x1,%r13
  jmp    L36
L18:
  cmpb   $0x0,0x0(%rbp)
  jne    L25
L94:
  movslq %r15d,%r15
  mov    0x8(%rsp),%rax
  movq   $0x0,(%rax,%r15,8)
  mov    0x10(%rsp),%rax
  mov    0x18(%rsp),%rcx
  mov    %rcx,(%rax)
L37:
  mov    %r14,%rdi
  call   <free@plt>
L63:
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  lea    0x1(%r13),%ebx
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  movslq %r13d,%rax
  mov    0x8(%rsp),%rcx
  mov    %rdx,(%rcx,%rax,8)
  mov    %ebx,%r15d
  jmp    L94
L58:
  mov    0x10(%rsp),%rax
  movq   $0x0,(%rax)
  test   %r14,%r14
  je     L63
  jmp    L37
```

assistant: ```c
char **strsplit(char *str, const char delims[], size_t *len) {
  char *save, *tok;
  char **result = '\0';
  char *tmp = strdup(str);
  size_t delims_size = strlen(delims);
  size_t count = 0;
  size_t sub_count = 0;
  int i = 0;
  while ((tmp = strstr(tmp, delims)) != NULL) {
    tmp += delims_size;
    count++;
  }
  count++;
  tmp = strdup(str);
  save = malloc(sizeof(char) * strlen(str));
  result = malloc(sizeof(char *) * count);
  if (result && save) {
    while ((tok = strstr(tmp, delims)) != NULL) {
      strncpy(save, tmp, (tok - tmp));
      save[(tok - tmp)] = '\0';
      result[i++] = strdup(save);
      tok += delims_size;
      tmp = tok;
    }
    if (tmp && tmp[0] != '\0') {
      result[i++] = strdup(tmp);
    }
    result[i] = '\0';
    *len = count;
  } else {
    *len = 0;
  }
  if (save)
    free(save);
  return result;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<strsplit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  mov    %rdx,0x28(%rsp)
  call   <strdup@plt>
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <strlen@plt>
  movslq %eax,%r13
  jmp    L41
  nopl   0x0(%rax)
L15:
  lea    (%rax,%r13,1),%r14
L41:
  mov    %rbp,%rsi
  mov    %r14,%rdi
  add    $0x1,%rbx
  call   <strstr@plt>
  test   %rax,%rax
  jne    L15
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <strlen@plt>
  mov    %eax,%edi
  call   <malloc@plt>
  lea    0x0(,%rbx,8),%edi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %rax,%r14
  test   %rax,%rax
  je     L92
  test   %r12,%r12
  je     L92
  movl   $0x0,0x1c(%rsp)
  jmp    L65
  nopl   (%rax)
L43:
  mov    %rcx,%r9
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    %rcx,0x10(%rsp)
  sub    %r15,%r9
  add    $0x8,%r14
  mov    %r9d,%edx
  mov    %r9,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%r9
  mov    %r12,%rdi
  addl   $0x1,0x1c(%rsp)
  movb   $0x0,(%r12,%r9,1)
  call   <strdup@plt>
  mov    0x10(%rsp),%rcx
  mov    %rax,-0x8(%r14)
  lea    (%rcx,%r13,1),%r15
L65:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strstr@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  jne    L43
  cmpb   $0x0,(%r15)
  jne    L53
L22:
  mov    0x20(%rsp),%rax
  movslq 0x1c(%rsp),%r15
  movq   $0x0,(%rax,%r15,8)
  mov    0x28(%rsp),%rax
  mov    %rbx,(%rax)
L17:
  mov    %r12,%rdi
  call   <free@plt>
L48:
  mov    0x20(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L92:
  mov    0x28(%rsp),%rax
  movq   $0x0,(%rax)
  test   %r12,%r12
  je     L48
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L53:
  mov    %r15,%rdi
  addl   $0x1,0x1c(%rsp)
  call   <strdup@plt>
  mov    %rax,(%r14)
  jmp    L22
```

assistant: ```c
char **strsplit(char *str, const char delims[], size_t *len) {
  char *save, *tok;
  char **result = '\0';
  char *tmp = strdup(str);
  size_t delims_size = strlen(delims);
  size_t count = 0;
  size_t sub_count = 0;
  int i = 0;
  while ((tmp = strstr(tmp, delims)) != NULL) {
    tmp += delims_size;
    count++;
  }
  count++;
  tmp = strdup(str);
  save = malloc(sizeof(char) * strlen(str));
  result = malloc(sizeof(char *) * count);
  if (result && save) {
    while ((tok = strstr(tmp, delims)) != NULL) {
      strncpy(save, tmp, (tok - tmp));
      save[(tok - tmp)] = '\0';
      result[i++] = strdup(save);
      tok += delims_size;
      tmp = tok;
    }
    if (tmp && tmp[0] != '\0') {
      result[i++] = strdup(tmp);
    }
    result[i] = '\0';
    *len = count;
  } else {
    *len = 0;
  }
  if (save)
    free(save);
  return result;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strsplit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  mov    %rdx,0x28(%rsp)
  call   <strdup@plt>
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <strlen@plt>
  movslq %eax,%r13
  jmp    L27
  nopl   0x0(%rax)
L81:
  lea    (%rax,%r13,1),%r14
L27:
  mov    %rbp,%rsi
  mov    %r14,%rdi
  add    $0x1,%rbx
  call   <strstr@plt>
  test   %rax,%rax
  jne    L81
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <strlen@plt>
  mov    %eax,%edi
  call   <malloc@plt>
  lea    0x0(,%rbx,8),%edi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %rax,%r14
  test   %rax,%rax
  je     L61
  test   %r12,%r12
  je     L61
  movl   $0x0,0x1c(%rsp)
  jmp    L15
  nopl   (%rax)
L38:
  mov    %rcx,%r9
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    %rcx,0x10(%rsp)
  sub    %r15,%r9
  add    $0x8,%r14
  mov    %r9d,%edx
  mov    %r9,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%r9
  mov    %r12,%rdi
  addl   $0x1,0x1c(%rsp)
  movb   $0x0,(%r12,%r9,1)
  call   <strdup@plt>
  mov    0x10(%rsp),%rcx
  mov    %rax,-0x8(%r14)
  lea    (%rcx,%r13,1),%r15
L15:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strstr@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  jne    L38
  cmpb   $0x0,(%r15)
  jne    L83
L8:
  mov    0x20(%rsp),%rax
  movslq 0x1c(%rsp),%r15
  movq   $0x0,(%rax,%r15,8)
  mov    0x28(%rsp),%rax
  mov    %rbx,(%rax)
L94:
  mov    %r12,%rdi
  call   <free@plt>
L14:
  mov    0x20(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L61:
  mov    0x28(%rsp),%rax
  movq   $0x0,(%rax)
  test   %r12,%r12
  je     L14
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L83:
  mov    %r15,%rdi
  addl   $0x1,0x1c(%rsp)
  call   <strdup@plt>
  mov    %rax,(%r14)
  jmp    L8
```

assistant: ```c
char **strsplit(char *str, const char delims[], size_t *len) {
  char *save, *tok;
  char **result = '\0';
  char *tmp = strdup(str);
  size_t delims_size = strlen(delims);
  size_t count = 0;
  size_t sub_count = 0;
  int i = 0;
  while ((tmp = strstr(tmp, delims)) != NULL) {
    tmp += delims_size;
    count++;
  }
  count++;
  tmp = strdup(str);
  save = malloc(sizeof(char) * strlen(str));
  result = malloc(sizeof(char *) * count);
  if (result && save) {
    while ((tok = strstr(tmp, delims)) != NULL) {
      strncpy(save, tmp, (tok - tmp));
      save[(tok - tmp)] = '\0';
      result[i++] = strdup(save);
      tok += delims_size;
      tmp = tok;
    }
    if (tmp && tmp[0] != '\0') {
      result[i++] = strdup(tmp);
    }
    result[i] = '\0';
    *len = count;
  } else {
    *len = 0;
  }
  if (save)
    free(save);
  return result;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<do_rumble>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xf0,%rsp
  mov    %edi,-0xd4(%rbp)
  mov    %esi,-0xd8(%rbp)
  mov    %edx,-0xdc(%rbp)
  mov    %ecx,-0xe0(%rbp)
  mov    %r8d,-0xe4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x152,%eax
  movabs $0x1027ff1e000000,%rdx
  mov    %rax,-0xc0(%rbp)
  mov    %rdx,-0xb8(%rbp)
  movabs $0x27ff32001027ff32,%rax
  movabs $0x32001027ff320010,%rdx
  mov    %rax,-0xb0(%rbp)
  mov    %rdx,-0xa8(%rbp)
  movl   $0x0,-0xa0(%rbp)
  movb   $0x0,-0x9c(%rbp)
  movabs $0x1814121008040200,%rax
  mov    %rax,-0xcb(%rbp)
  movw   $0x1c1a,-0xc3(%rbp)
  movb   $0x1e,-0xc1(%rbp)
  mov    -0xdc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xdc(%rbp)
  mov    -0xe0(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xe0(%rbp)
  mov    -0xe4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xe4(%rbp)
  cmpl   $0xff,-0xdc(%rbp)
  jle    L68
  movl   $0xff,-0xdc(%rbp)
  jmp    L82
L68:
  cmpl   $0x0,-0xdc(%rbp)
  jns    L82
  movl   $0x0,-0xdc(%rbp)
L82:
  cmpl   $0xff,-0xe0(%rbp)
  jle    L51
  movl   $0xff,-0xe0(%rbp)
  jmp    L37
L51:
  cmpl   $0x0,-0xe0(%rbp)
  jns    L37
  movl   $0x0,-0xe0(%rbp)
L37:
  cmpl   $0xff,-0xe4(%rbp)
  jle    L11
  movl   $0xff,-0xe4(%rbp)
  jmp    L28
L11:
  cmpl   $0x3,-0xe4(%rbp)
  jg     L28
  movl   $0x4,-0xe4(%rbp)
L28:
  mov    -0xe4(%rbp),%eax
  mov    %al,-0xbb(%rbp)
  movzbl -0xbb(%rbp),%eax
  mov    %al,-0xbd(%rbp)
  mov    -0xdc(%rbp),%eax
  mov    %al,-0xbc(%rbp)
  mov    -0xe0(%rbp),%eax
  mov    %al,-0xba(%rbp)
  mov    -0xd8(%rbp),%eax
  cltq
  movzbl -0xcb(%rbp,%rax,1),%eax
  mov    %al,-0xb5(%rbp)
  lea    -0xc0(%rbp),%rsi
  mov    -0xd4(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x25,%edx
  mov    %eax,%edi
  call   <send@plt>
  lea    -0x90(%rbp),%rsi
  mov    -0xd4(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x80,%edx
  mov    %eax,%edi
  call   <recv@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  leave
  ret
```

assistant: ```c
void do_rumble(int csk, int led_n, int weak, int strong, int timeout) {
  unsigned char buf[128];
  unsigned char setrumble[] = {0x52, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0xff, 0x27, 0x10, 0x00, 0x32, 0xff, 0x27, 0x10, 0x00, 0x32, 0xff, 0x27, 0x10, 0x00, 0x32, 0xff, 0x27, 0x10, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00};
  const unsigned char ledpattern[11] = {0x00, 0x02, 0x04, 0x08, 0x10, 0x12, 0x14, 0x18, 0x1A, 0x1C, 0x1E};
  weak *= 10;
  strong *= 10;
  timeout *= 10;
  if (weak > 0xff)
    weak = 0xff;
  else if (weak < 0)
    weak = 0;
  if (strong > 0xff)
    strong = 0xff;
  else if (strong < 0)
    strong = 0;
  if (timeout > 0xff)
    timeout = 0xff;
  else if (timeout < 4)
    timeout = 4;
  setrumble[3] = setrumble[5] = timeout;
  setrumble[4] = weak;
  setrumble[6] = strong;
  setrumble[11] = ledpattern[led_n];
  send(csk, setrumble, sizeof(setrumble), 0);
  recv(csk, buf, sizeof(buf), 0);
}
```