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

```asm
<mat4f_rotateQuatVec_new>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <mat3f_rotateQuatVec_new@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <mat4f_from_mat3f@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x38,%rsp
  pop    %rbp
  pop    %r12
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void mat4f_rotateQuatVec_new(float matrix[16], const float quat[4]) {
  float tmpMat[9];
  mat3f_rotateQuatVec_new(tmpMat, quat);
  mat4f_from_mat3f(matrix, tmpMat);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<strstruct>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  jmp    L113
L90:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <_is_auto_type_starting_letter@plt>
  test   %eax,%eax
  je     L19
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L11
L78:
  addq   $0x1,-0x20(%rbp)
L11:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <_is_auto_type_allowed_letter@plt>
  test   %eax,%eax
  jne    L78
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L83
L119:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%ebx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,%ebx
  jne    L53
  mov    -0x48(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L53
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L53
  cmpq   $0x0,-0x50(%rbp)
  je     L40
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x1,(%rax)
L40:
  mov    -0x38(%rbp),%rax
  jmp    L112
L53:
  addq   $0x8,-0x18(%rbp)
  addl   $0x1,-0x24(%rbp)
L83:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L119
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L113
L19:
  addq   $0x1,-0x38(%rbp)
L113:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L90
  mov    $0x0,%eax
L112:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strstruct(char *line, char **auto_types, int *length, char *found_auto_types) {
  assert(line);
  assert(auto_types);
  assert(length);
  while (*line) {
    if (_is_auto_type_starting_letter(*line)) {
      char *end = line;
      char **compare = auto_types;
      int found = 0;
      while (_is_auto_type_allowed_letter(*end))
        end++;
      *length = end - line;
      while (*compare) {
        if (*length == (signed)strlen(*compare) && !strncmp(line, *compare, *length)) {
          if (*(line + *length) == ' ') {
            if (found_auto_types)
              found_auto_types[found] = 1;
            return line;
          }
        }
        compare++;
        found++;
      }
      line = end;
    } else
      line++;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<strstruct>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  mov    %rdx,%rbx
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    $0x0,%eax
  call   <assert@plt>
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  movzbl 0x0(%r13),%edi
  test   %dil,%dil
  jne    L43
  mov    $0x0,%eax
  jmp    L120
L69:
  add    $0x1,%r12
L95:
  movsbl (%r12),%edi
  mov    $0x0,%eax
  call   <_is_auto_type_allowed_letter@plt>
  test   %eax,%eax
  jne    L69
  mov    %r12,%rax
  sub    %r13,%rax
  mov    %eax,%r15d
  mov    0x10(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    (%r14),%rbp
  test   %rbp,%rbp
  je     L79
  mov    $0x0,%ebx
  cltq
  mov    %rax,0x8(%rsp)
  jmp    L75
L84:
  mov    %r13,%r12
  jmp    L95
L62:
  add    $0x1,%rbx
  mov    (%r14,%rbx,8),%rbp
  test   %rbp,%rbp
  je     L29
L75:
  mov    %ebx,0x4(%rsp)
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %eax,%r15d
  jne    L62
  mov    0x8(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L62
  mov    0x8(%rsp),%rax
  cmpb   $0x20,0x0(%r13,%rax,1)
  jne    L62
  mov    %r13,%rax
  mov    0x18(%rsp),%rcx
  test   %rcx,%rcx
  je     L120
  movslq %ebx,%rax
  movb   $0x1,(%rcx,%rax,1)
  mov    %r13,%rax
  jmp    L120
L29:
  mov    %r12,%r13
L142:
  movzbl 0x0(%r13),%edi
  test   %dil,%dil
  je     L8
L43:
  movsbl %dil,%edi
  mov    $0x0,%eax
  call   <_is_auto_type_starting_letter@plt>
  test   %eax,%eax
  jne    L84
  add    $0x1,%r13
  jmp    L142
L79:
  mov    %r12,%r13
  jmp    L142
L8:
  mov    $0x0,%eax
L120:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *strstruct(char *line, char **auto_types, int *length, char *found_auto_types) {
  assert(line);
  assert(auto_types);
  assert(length);
  while (*line) {
    if (_is_auto_type_starting_letter(*line)) {
      char *end = line;
      char **compare = auto_types;
      int found = 0;
      while (_is_auto_type_allowed_letter(*end))
        end++;
      *length = end - line;
      while (*compare) {
        if (*length == (signed)strlen(*compare) && !strncmp(line, *compare, *length)) {
          if (*(line + *length) == ' ') {
            if (found_auto_types)
              found_auto_types[found] = 1;
            return line;
          }
        }
        compare++;
        found++;
      }
      line = end;
    } else
      line++;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strstruct>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  call   <assert@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <assert@plt>
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <assert@plt>
L111:
  movsbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L123
L40:
  xor    %eax,%eax
  call   <_is_auto_type_starting_letter@plt>
  test   %eax,%eax
  jne    L110
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  test   %dil,%dil
  jne    L40
L123:
  xor    %eax,%eax
L63:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L110:
  mov    %rbp,%rbx
  jmp    L21
  nopl   (%rax)
L48:
  add    $0x1,%rbx
L21:
  movsbl (%rbx),%edi
  xor    %eax,%eax
  call   <_is_auto_type_allowed_letter@plt>
  test   %eax,%eax
  jne    L48
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rax
  mov    (%r12),%r13
  sub    %rbp,%rax
  mov    %eax,0x4(%rsp)
  mov    %eax,(%rsi)
  test   %r13,%r13
  je     L45
  cltq
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L118:
  add    $0x1,%r15
  mov    (%r12,%r15,8),%r13
  test   %r13,%r13
  je     L45
L67:
  mov    %r13,%rdi
  movslq %r15d,%r14
  call   <strlen@plt>
  cmp    %eax,0x4(%rsp)
  jne    L118
  mov    0x8(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L118
  mov    0x8(%rsp),%rax
  cmpb   $0x20,0x0(%rbp,%rax,1)
  jne    L118
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rax
  test   %rsi,%rsi
  je     L63
  movb   $0x1,(%rsi,%r14,1)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L45:
  mov    %rbx,%rbp
  jmp    L111
```

assistant: ```c
char *strstruct(char *line, char **auto_types, int *length, char *found_auto_types) {
  assert(line);
  assert(auto_types);
  assert(length);
  while (*line) {
    if (_is_auto_type_starting_letter(*line)) {
      char *end = line;
      char **compare = auto_types;
      int found = 0;
      while (_is_auto_type_allowed_letter(*end))
        end++;
      *length = end - line;
      while (*compare) {
        if (*length == (signed)strlen(*compare) && !strncmp(line, *compare, *length)) {
          if (*(line + *length) == ' ') {
            if (found_auto_types)
              found_auto_types[found] = 1;
            return line;
          }
        }
        compare++;
        found++;
      }
      line = end;
    } else
      line++;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strstruct>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  call   <assert@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <assert@plt>
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <assert@plt>
L15:
  movsbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L53
L12:
  xor    %eax,%eax
  call   <_is_auto_type_starting_letter@plt>
  test   %eax,%eax
  jne    L103
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  test   %dil,%dil
  jne    L12
L53:
  xor    %eax,%eax
L115:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L103:
  mov    %rbp,%rbx
  jmp    L71
  nopl   (%rax)
L31:
  add    $0x1,%rbx
L71:
  movsbl (%rbx),%edi
  xor    %eax,%eax
  call   <_is_auto_type_allowed_letter@plt>
  test   %eax,%eax
  jne    L31
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rax
  mov    (%r12),%r13
  sub    %rbp,%rax
  mov    %eax,0x4(%rsp)
  mov    %eax,(%rsi)
  test   %r13,%r13
  je     L43
  cltq
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  jmp    L56
  nopl   0x0(%rax,%rax,1)
L52:
  add    $0x1,%r15
  mov    (%r12,%r15,8),%r13
  test   %r13,%r13
  je     L43
L56:
  mov    %r13,%rdi
  movslq %r15d,%r14
  call   <strlen@plt>
  cmp    %eax,0x4(%rsp)
  jne    L52
  mov    0x8(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L52
  mov    0x8(%rsp),%rax
  cmpb   $0x20,0x0(%rbp,%rax,1)
  jne    L52
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rax
  test   %rsi,%rsi
  je     L115
  movb   $0x1,(%rsi,%r14,1)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L43:
  mov    %rbx,%rbp
  jmp    L15
```

assistant: ```c
char *strstruct(char *line, char **auto_types, int *length, char *found_auto_types) {
  assert(line);
  assert(auto_types);
  assert(length);
  while (*line) {
    if (_is_auto_type_starting_letter(*line)) {
      char *end = line;
      char **compare = auto_types;
      int found = 0;
      while (_is_auto_type_allowed_letter(*end))
        end++;
      *length = end - line;
      while (*compare) {
        if (*length == (signed)strlen(*compare) && !strncmp(line, *compare, *length)) {
          if (*(line + *length) == ' ') {
            if (found_auto_types)
              found_auto_types[found] = 1;
            return line;
          }
        }
        compare++;
        found++;
      }
      line = end;
    } else
      line++;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<cpusettoull>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L25
L19:
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <CPU_ISSET_S@plt>
  test   %rax,%rax
  je     L2
  mov    -0xc(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  or     %rax,-0x8(%rbp)
L2:
  addl   $0x1,-0xc(%rbp)
L25:
  mov    -0xc(%rbp),%eax
  cmp    $0x3f,%eax
  jbe    L19
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned long long int cpusettoull(cpu_set_t *bits, size_t sz) {
  unsigned long long mask = 0;
  int i;
  for (i = 0; i < sizeof(mask) * 8; ++i) {
    if (CPU_ISSET_S(i, sz, bits)) {
      mask |= (1ull) << i;
    }
  }
  return mask;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<cpusettoull>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    $0x0,%ebx
  mov    $0x0,%r14d
  mov    $0x1,%r13d
L1:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <CPU_ISSET_S@plt>
  mov    %rax,%rdx
  mov    %r14,%rsi
  mov    %r13,%rax
  mov    %ebx,%ecx
  shl    %cl,%rax
  or     %r14,%rax
  test   %rdx,%rdx
  cmovne %rax,%rsi
  mov    %rsi,%r14
  add    $0x1,%ebx
  cmp    $0x40,%ebx
  jne    L1
  mov    %rsi,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
unsigned long long int cpusettoull(cpu_set_t *bits, size_t sz) {
  unsigned long long mask = 0;
  int i;
  for (i = 0; i < sizeof(mask) * 8; ++i) {
    if (CPU_ISSET_S(i, sz, bits)) {
      mask |= (1ull) << i;
    }
  }
  return mask;
}
```
user: Translate the below assembly code into C programming language:

```asm
<cpusettoull>:
  endbr64
  push   %r14
  mov    $0x1,%r14d
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  xchg   %ax,%ax
L9:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13d,%edi
  call   <CPU_ISSET_S@plt>
  mov    %r13d,%ecx
  mov    %r14,%rsi
  mov    %r12,%rdx
  shl    %cl,%rsi
  or     %rsi,%r12
  test   %rax,%rax
  cmove  %rdx,%r12
  add    $0x1,%r13d
  cmp    $0x40,%r13d
  jne    L9
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
unsigned long long int cpusettoull(cpu_set_t *bits, size_t sz) {
  unsigned long long mask = 0;
  int i;
  for (i = 0; i < sizeof(mask) * 8; ++i) {
    if (CPU_ISSET_S(i, sz, bits)) {
      mask |= (1ull) << i;
    }
  }
  return mask;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<cpusettoull>:
  endbr64
  push   %r14
  mov    $0x1,%r14d
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  xchg   %ax,%ax
L4:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13d,%edi
  call   <CPU_ISSET_S@plt>
  mov    %r13d,%ecx
  mov    %r14,%rsi
  mov    %r12,%rdx
  shl    %cl,%rsi
  or     %rsi,%r12
  test   %rax,%rax
  cmove  %rdx,%r12
  add    $0x1,%r13d
  cmp    $0x40,%r13d
  jne    L4
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
unsigned long long int cpusettoull(cpu_set_t *bits, size_t sz) {
  unsigned long long mask = 0;
  int i;
  for (i = 0; i < sizeof(mask) * 8; ++i) {
    if (CPU_ISSET_S(i, sz, bits)) {
      mask |= (1ull) << i;
    }
  }
  return mask;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<write_eeprom>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L10
L14:
  mov    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_trans_len@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rsi
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <write_eeprom_page@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L19
  mov    -0x14(%rbp),%eax
  jmp    L4
L19:
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  add    %rax,-0x38(%rbp)
  mov    -0x8(%rbp),%rax
  add    %rax,-0x30(%rbp)
  mov    -0x8(%rbp),%rax
  sub    %rax,-0x10(%rbp)
L10:
  cmpq   $0x0,-0x10(%rbp)
  jg     L14
  mov    $0x0,%eax
L4:
  leave
  ret
```

assistant: ```c
int write_eeprom(int fd, uint16_t offset, uint8_t *buf, uint16_t count) {
  uint16_t len = count;
  int rc = 0;
  while (len > 0) {
    uint16_t this_trans_len = get_trans_len(offset, len);
    rc = write_eeprom_page(fd, offset, buf, this_trans_len);
    if (rc < 0)
      return rc;
    buf += this_trans_len;
    offset += this_trans_len;
    len -= this_trans_len;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<write_eeprom>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r14d
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %rcx,%rbp
  test   %rcx,%rcx
  jle    L36
L4:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <get_trans_len@plt>
  mov    %rax,%rbx
  mov    %rax,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <write_eeprom_page@plt>
  test   %eax,%eax
  js     L35
  lea    0x0(%r13,%rbx,4),%r13
  add    %rbx,%r12
  sub    %rbx,%rbp
  test   %rbp,%rbp
  jg     L4
  mov    $0x0,%eax
L35:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L36:
  mov    $0x0,%eax
  jmp    L35
```

assistant: ```c
int write_eeprom(int fd, uint16_t offset, uint8_t *buf, uint16_t count) {
  uint16_t len = count;
  int rc = 0;
  while (len > 0) {
    uint16_t this_trans_len = get_trans_len(offset, len);
    rc = write_eeprom_page(fd, offset, buf, this_trans_len);
    if (rc < 0)
      return rc;
    buf += this_trans_len;
    offset += this_trans_len;
    len -= this_trans_len;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<write_eeprom>:
  endbr64
  test   %rcx,%rcx
  jle    L26
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  jmp    L14
  nop
L30:
  sub    %rbx,%rbp
  lea    (%r12,%rbx,4),%r12
  add    %rbx,%r14
  test   %rbp,%rbp
  jle    L17
L14:
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <get_trans_len@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r13d,%edi
  mov    %rax,%rcx
  mov    %rax,%rbx
  call   <write_eeprom_page@plt>
  test   %eax,%eax
  jns    L30
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L26:
  xor    %eax,%eax
  ret
```

assistant: ```c
int write_eeprom(int fd, uint16_t offset, uint8_t *buf, uint16_t count) {
  uint16_t len = count;
  int rc = 0;
  while (len > 0) {
    uint16_t this_trans_len = get_trans_len(offset, len);
    rc = write_eeprom_page(fd, offset, buf, this_trans_len);
    if (rc < 0)
      return rc;
    buf += this_trans_len;
    offset += this_trans_len;
    len -= this_trans_len;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<write_eeprom>:
  endbr64
  test   %rcx,%rcx
  jle    L5
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  jmp    L30
  nop
L9:
  sub    %rbx,%rbp
  lea    (%r12,%rbx,4),%r12
  add    %rbx,%r14
  test   %rbp,%rbp
  jle    L7
L30:
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <get_trans_len@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r13d,%edi
  mov    %rax,%rcx
  mov    %rax,%rbx
  call   <write_eeprom_page@plt>
  test   %eax,%eax
  jns    L9
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L5:
  xor    %eax,%eax
  ret
```

assistant: ```c
int write_eeprom(int fd, uint16_t offset, uint8_t *buf, uint16_t count) {
  uint16_t len = count;
  int rc = 0;
  while (len > 0) {
    uint16_t this_trans_len = get_trans_len(offset, len);
    rc = write_eeprom_page(fd, offset, buf, this_trans_len);
    if (rc < 0)
      return rc;
    buf += this_trans_len;
    offset += this_trans_len;
    len -= this_trans_len;
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<uninitvar_wcstof>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <wcstof@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <wcstod@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <wcstold@plt>
  nop
  leave
  ret
```

assistant: ```c
void uninitvar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<uninitvar_wcstof>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%ebp
  mov    %rbp,%rsi
  mov    $0x0,%ebx
  mov    %rbx,%rdi
  call   <wcstof@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <wcstod@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <wcstold@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void uninitvar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<uninitvar_wcstof>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  xor    %ebp,%ebp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <wcstof@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <wcstod@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1090 <wcstold@plt>
```

assistant: ```c
void uninitvar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<uninitvar_wcstof>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  xor    %ebp,%ebp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <wcstof@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <wcstod@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1090 <wcstold@plt>
```

assistant: ```c
void uninitvar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L22
L35:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  jle    L37
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L37
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <remove@plt>
L37:
  addl   $0x1,-0x4(%rbp)
L22:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L35
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    if (strlen(argv[i]) > 0 && argv[i][0] != '-')
      remove(argv[i]);
  }
  return 0;
}
```