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

```asm
<read_obs_seq_from_file>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    -0x1(%rsp),%r12
  jmp    L97
  xchg   %ax,%ax
L12:
  cmpb   $0x3e,(%rsp)
  jne    L47
L97:
  mov    %rbx,%rdx
  mov    $0x3e8,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L12
  mov    %rbx,%rdi
  add    $0x1,%r14d
  lea    -0x1(%rsp),%r12
  call   <rewind@plt>
  movl   $0x1,0x0(%r13)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    %rax,(%r15)
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %r14d,%edx
  xor    %esi,%esi
  xor    %r14d,%r14d
  mov    %rax,0x0(%r13)
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L79
  cs nopw 0x0(%rax,%rax,1)
L0:
  cmpb   $0x3e,(%rsp)
  jne    L75
L79:
  mov    %rbx,%rdx
  mov    $0x3e8,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L0
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  add    $0x3f8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L47:
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  nopl   (%rax)
L63:
  movzbl (%r12,%rax,1),%edx
  mov    %eax,%ecx
  sub    $0x1,%rax
  cmp    $0xa,%dl
  je     L63
  cmp    $0xd,%dl
  je     L63
  add    %ecx,%r14d
  jmp    L97
  nopl   (%rax)
L75:
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  nopl   (%rax)
L99:
  movzbl (%r12,%rax,1),%edx
  mov    %eax,%r15d
  sub    $0x1,%rax
  cmp    $0xa,%dl
  je     L99
  cmp    $0xd,%dl
  je     L99
  movslq %r14d,%rdi
  mov    %r15d,%edx
  add    0x0(%r13),%rdi
  mov    %rbp,%rsi
  call   <memcpy@plt>
  add    %r15d,%r14d
  jmp    L79
L81:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void read_obs_seq_from_file(FILE *fp, int *num_seqs_ptr, char ***obs_seqs_ptr) {
  int i = 0;
  int j = 0;
  int bp_count;
  char mystring[1000];
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      bp_count = strlen(mystring) - 1;
      while (mystring[bp_count - 1] == 10 || mystring[bp_count - 1] == 13) {
        bp_count--;
      }
      i += bp_count;
    }
  }
  rewind(fp);
  *num_seqs_ptr = 1;
  *obs_seqs_ptr = (char **)malloc(*num_seqs_ptr * sizeof(char *));
  char **obs_seqs = *obs_seqs_ptr;
  obs_seqs[0] = (char *)malloc(i * sizeof(char) + 1);
  memset(obs_seqs[0], 0, i * sizeof(char) + 1);
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      bp_count = strlen(mystring) - 1;
      while (mystring[bp_count - 1] == 10 || mystring[bp_count - 1] == 13) {
        bp_count--;
      }
      memcpy(obs_seqs[0] + j, mystring, bp_count);
      j += bp_count;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<read_obs_seq_from_file>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    -0x1(%rsp),%r12
  jmp    L129
  xchg   %ax,%ax
L42:
  cmpb   $0x3e,(%rsp)
  jne    L33
L129:
  mov    %rbx,%rdx
  mov    $0x3e8,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L42
  mov    %rbx,%rdi
  add    $0x1,%r14d
  lea    -0x1(%rsp),%r12
  call   <rewind@plt>
  movl   $0x1,0x0(%r13)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    %rax,(%r15)
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %r14d,%edx
  xor    %esi,%esi
  xor    %r14d,%r14d
  mov    %rax,0x0(%r13)
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L81
  cs nopw 0x0(%rax,%rax,1)
L60:
  cmpb   $0x3e,(%rsp)
  jne    L9
L81:
  mov    %rbx,%rdx
  mov    $0x3e8,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L60
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L65
  add    $0x3f8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L33:
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  nopl   (%rax)
L113:
  movzbl (%r12,%rax,1),%edx
  mov    %eax,%ecx
  sub    $0x1,%rax
  cmp    $0xa,%dl
  je     L113
  cmp    $0xd,%dl
  je     L113
  add    %ecx,%r14d
  jmp    L129
  nopl   (%rax)
L9:
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  nopl   (%rax)
L17:
  movzbl (%r12,%rax,1),%edx
  mov    %eax,%r15d
  sub    $0x1,%rax
  cmp    $0xa,%dl
  je     L17
  cmp    $0xd,%dl
  je     L17
  movslq %r14d,%rdi
  mov    %r15d,%edx
  add    0x0(%r13),%rdi
  mov    %rbp,%rsi
  call   <memcpy@plt>
  add    %r15d,%r14d
  jmp    L81
L65:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void read_obs_seq_from_file(FILE *fp, int *num_seqs_ptr, char ***obs_seqs_ptr) {
  int i = 0;
  int j = 0;
  int bp_count;
  char mystring[1000];
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      bp_count = strlen(mystring) - 1;
      while (mystring[bp_count - 1] == 10 || mystring[bp_count - 1] == 13) {
        bp_count--;
      }
      i += bp_count;
    }
  }
  rewind(fp);
  *num_seqs_ptr = 1;
  *obs_seqs_ptr = (char **)malloc(*num_seqs_ptr * sizeof(char *));
  char **obs_seqs = *obs_seqs_ptr;
  obs_seqs[0] = (char *)malloc(i * sizeof(char) + 1);
  memset(obs_seqs[0], 0, i * sizeof(char) + 1);
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      bp_count = strlen(mystring) - 1;
      while (mystring[bp_count - 1] == 10 || mystring[bp_count - 1] == 13) {
        bp_count--;
      }
      memcpy(obs_seqs[0] + j, mystring, bp_count);
      j += bp_count;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<udelay>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L3
L8:
  mov    -0x8(%rbp),%eax
  imul   -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  addl   $0x1,-0x4(%rbp)
L3:
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  cmp    %eax,-0x4(%rbp)
  jl     L8
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void udelay(int delay) {
  volatile int a;
  for (int i = 1; i < 3 * delay / 4; i++)
    a *= i;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<udelay>:
  endbr64
  lea    (%rdi,%rdi,2),%eax
  lea    0x3(%rax),%ecx
  test   %eax,%eax
  cmovns %eax,%ecx
  sar    $0x2,%ecx
  cmp    $0x7,%eax
  jle    L5
  mov    $0x1,%eax
L3:
  mov    -0x4(%rsp),%edx
  imul   %eax,%edx
  mov    %edx,-0x4(%rsp)
  add    $0x1,%eax
  cmp    %ecx,%eax
  jl     L3
L5:
  ret
```

assistant: ```c
void udelay(int delay) {
  volatile int a;
  for (int i = 1; i < 3 * delay / 4; i++)
    a *= i;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<udelay>:
  endbr64
  lea    (%rdi,%rdi,2),%eax
  test   %eax,%eax
  lea    0x3(%rax),%ecx
  cmovns %eax,%ecx
  sar    $0x2,%ecx
  cmp    $0x7,%eax
  jle    L3
  mov    $0x1,%eax
  nopl   0x0(%rax)
L8:
  mov    -0x4(%rsp),%edx
  imul   %eax,%edx
  add    $0x1,%eax
  mov    %edx,-0x4(%rsp)
  cmp    %ecx,%eax
  jl     L8
L3:
  ret
```

assistant: ```c
void udelay(int delay) {
  volatile int a;
  for (int i = 1; i < 3 * delay / 4; i++)
    a *= i;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<udelay>:
  endbr64
  lea    (%rdi,%rdi,2),%eax
  test   %eax,%eax
  lea    0x3(%rax),%ecx
  cmovns %eax,%ecx
  sar    $0x2,%ecx
  cmp    $0x7,%eax
  jle    L2
  mov    $0x1,%eax
  nopl   0x0(%rax)
L5:
  mov    -0x4(%rsp),%edx
  imul   %eax,%edx
  add    $0x1,%eax
  mov    %edx,-0x4(%rsp)
  cmp    %ecx,%eax
  jl     L5
L2:
  ret
```

assistant: ```c
void udelay(int delay) {
  volatile int a;
  for (int i = 1; i < 3 * delay / 4; i++)
    a *= i;
}
```
user: Translate the below assembly code into C programming language:

```asm
<wack_int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %edi,%edx
  mov    %esi,%eax
  mov    %edx,%ebx
  mov    %eax,%r12d
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <add_int@plt>
  mov    %eax,%ebx
  lea    (%rbx,%r12,1),%eax
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int wack_int(register int u, register int v) {
  register int l = u, r = v;
  l = add_int(l, r);
  return l + r;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<wack_int>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  call   <add_int@plt>
  add    %ebx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int wack_int(register int u, register int v) {
  register int l = u, r = v;
  l = add_int(l, r);
  return l + r;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<wack_int>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  call   <add_int@plt>
  add    %ebx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int wack_int(register int u, register int v) {
  register int l = u, r = v;
  l = add_int(l, r);
  return l + r;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<wack_int>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  call   <add_int@plt>
  add    %ebx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int wack_int(register int u, register int v) {
  register int l = u, r = v;
  l = add_int(l, r);
  return l + r;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<error>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L6
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L6:
  mov    -0xc8(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb4(%rbp),%edx
  mov    -0xc8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <vprintf@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

assistant: ```c
void error(char *s, ...) {
  va_list ap;
  va_start(ap, s);
  vprintf(s, ap);
  va_end(ap);
  putchar('\n');
  exit(-1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<error>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <vprintf@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void error(char *s, ...) {
  va_list ap;
  va_start(ap, s);
  vprintf(s, ap);
  va_end(ap);
  putchar('\n');
  exit(-1);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<error>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <va_start@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <vprintf@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void error(char *s, ...) {
  va_list ap;
  va_start(ap, s);
  vprintf(s, ap);
  va_end(ap);
  putchar('\n');
  exit(-1);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<error>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <va_start@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <vprintf@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void error(char *s, ...) {
  va_list ap;
  va_start(ap, s);
  vprintf(s, ap);
  va_end(ap);
  putchar('\n');
  exit(-1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<Point_trimAngle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movss  %xmm0,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movd   %eax,%xmm0
  call   <round@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%eax
  movd   %eax,%xmm0
  call   <round@plt>
  movslq %eax,%rdx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x8(%rbp)
  mov    -0x8(%rbp),%edx
  imul   $0x168,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  sub    -0x8(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,-0x4(%rbp)
  movss  -0x14(%rbp),%xmm0
  subss  -0x4(%rbp),%xmm0
  leave
  ret
```

assistant: ```c
float Point_trimAngle(float inputAngle) {
  int deg = (int)round(inputAngle);
  int degTrimmed = (int)round(inputAngle) % 360;
  float toremove = deg - degTrimmed;
  return inputAngle - toremove;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<Point_trimAngle>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  movss  %xmm0,0xc(%rsp)
  call   <round@plt>
  mov    %rax,%rbx
  movss  0xc(%rsp),%xmm0
  call   <round@plt>
  movslq %eax,%rdx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x168,%edx,%edx
  sub    %edx,%eax
  sub    %eax,%ebx
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebx,%xmm1
  movss  0xc(%rsp),%xmm0
  subss  %xmm1,%xmm0
  add    $0x10,%rsp
  pop    %rbx
  ret
```

assistant: ```c
float Point_trimAngle(float inputAngle) {
  int deg = (int)round(inputAngle);
  int degTrimmed = (int)round(inputAngle) % 360;
  float toremove = deg - degTrimmed;
  return inputAngle - toremove;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<Point_trimAngle>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  movss  %xmm0,0xc(%rsp)
  call   <round@plt>
  movss  0xc(%rsp),%xmm0
  mov    %rax,%rbx
  call   <round@plt>
  pxor   %xmm1,%xmm1
  movss  0xc(%rsp),%xmm0
  add    $0x10,%rsp
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  sub    %ecx,%edx
  imul   $0x168,%edx,%edx
  sub    %edx,%eax
  sub    %eax,%ebx
  cvtsi2ss %ebx,%xmm1
  pop    %rbx
  subss  %xmm1,%xmm0
  ret
```

assistant: ```c
float Point_trimAngle(float inputAngle) {
  int deg = (int)round(inputAngle);
  int degTrimmed = (int)round(inputAngle) % 360;
  float toremove = deg - degTrimmed;
  return inputAngle - toremove;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Point_trimAngle>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  movss  %xmm0,0xc(%rsp)
  call   <round@plt>
  movss  0xc(%rsp),%xmm0
  mov    %rax,%rbx
  call   <round@plt>
  pxor   %xmm1,%xmm1
  movss  0xc(%rsp),%xmm0
  add    $0x10,%rsp
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  sub    %ecx,%edx
  imul   $0x168,%edx,%edx
  sub    %edx,%eax
  sub    %eax,%ebx
  cvtsi2ss %ebx,%xmm1
  pop    %rbx
  subss  %xmm1,%xmm0
  ret
```

assistant: ```c
float Point_trimAngle(float inputAngle) {
  int deg = (int)round(inputAngle);
  int degTrimmed = (int)round(inputAngle) % 360;
  float toremove = deg - degTrimmed;
  return inputAngle - toremove;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<libusb_free_config_descriptor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L18
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <clear_configuration@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L19
L18:
  nop
L19:
  leave
  ret
```

assistant: ```c
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  if (!config)
    return;
  clear_configuration(config);
  free(config);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<libusb_free_config_descriptor>:
  endbr64
  test   %rdi,%rdi
  je     L9
  push   %rbx
  mov    %rdi,%rbx
  call   <clear_configuration@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  pop    %rbx
  ret
L9:
  ret
```

assistant: ```c
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  if (!config)
    return;
  clear_configuration(config);
  free(config);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<libusb_free_config_descriptor>:
  endbr64
  test   %rdi,%rdi
  je     L7
  push   %rbp
  mov    %rdi,%rbp
  call   <clear_configuration@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
  nopl   0x0(%rax,%rax,1)
L7:
  ret
```

assistant: ```c
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  if (!config)
    return;
  clear_configuration(config);
  free(config);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<libusb_free_config_descriptor>:
  endbr64
  test   %rdi,%rdi
  je     L0
  push   %rbp
  mov    %rdi,%rbp
  call   <clear_configuration@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
  nopl   0x0(%rax,%rax,1)
L0:
  ret
```

assistant: ```c
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  if (!config)
    return;
  clear_configuration(config);
  free(config);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<list_lp_destroy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <list_lp_delete@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void list_lp_destroy(struct list_lp *target) {
  list_lp_delete(target);
  free(target);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<list_lp_destroy>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <list_lp_delete@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  pop    %rbx
  ret
```

assistant: ```c
void list_lp_destroy(struct list_lp *target) {
  list_lp_delete(target);
  free(target);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<list_lp_destroy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  call   <list_lp_delete@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
```

assistant: ```c
void list_lp_destroy(struct list_lp *target) {
  list_lp_delete(target);
  free(target);
}
```
user: What is the c source code of the assembly code below?

```asm
<list_lp_destroy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  call   <list_lp_delete@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
```

assistant: ```c
void list_lp_destroy(struct list_lp *target) {
  list_lp_delete(target);
  free(target);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<checklabel>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x30,%eax
  jle    L77
  mov    $0x0,%eax
  jmp    L118
L77:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%ebx
  cmp    $0x2a,%bl
  jne    L81
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L81
  mov    $0x1,%eax
  jmp    L118
L81:
  movsbl %bl,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L70
  cmp    $0x5f,%bl
  je     L70
  cmp    $0x2e,%bl
  je     L70
  mov    $0x0,%eax
  jmp    L118
L86:
  movsbl %bl,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L70
  cmp    $0x5f,%bl
  je     L70
  cmp    $0x2e,%bl
  je     L70
  mov    $0x0,%eax
  jmp    L118
L70:
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%ebx
  test   %bl,%bl
  jne    L86
  mov    $0x1,%eax
L118:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int checklabel(char *name) {
  register char c;
  if (strlen(name) > 48)
    return 0;
  c = *name;
  if (c == '*' && name[1] == 0)
    return 1;
  if (!isalpha(c) && c != '_' && c != '.')
    return 0;
  while ((c = *++name) != 0)
    if (!isalnum(c) && c != '_' && c != '.')
      return 0;
  return 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<checklabel>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0x30,%edx
  jg     L94
  movzbl (%rbx),%ebp
  cmp    $0x2a,%bpl
  jne    L147
  mov    $0x1,%eax
  cmpb   $0x0,0x1(%rbx)
  je     L94
  mov    $0x2a,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L94
L123:
  lea    0x1(%rbx),%rbp
  movzbl 0x1(%rbx),%ebx
  test   %bl,%bl
  jne    L138
  mov    $0x1,%eax
  jmp    L94
L147:
  movsbl %bpl,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L123
  cmp    $0x5f,%bpl
  je     L123
  cmp    $0x2e,%bpl
  je     L123
  jmp    L94
L13:
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  je     L39
L138:
  movsbl %bl,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L13
  cmp    $0x5f,%bl
  je     L13
  cmp    $0x2e,%bl
  je     L13
  jmp    L94
L39:
  mov    $0x1,%eax
L94:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int checklabel(char *name) {
  register char c;
  if (strlen(name) > 48)
    return 0;
  c = *name;
  if (c == '*' && name[1] == 0)
    return 1;
  if (!isalpha(c) && c != '_' && c != '.')
    return 0;
  while ((c = *++name) != 0)
    if (!isalnum(c) && c != '_' && c != '.')
      return 0;
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<checklabel>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x30,%eax
  jg     L64
  movzbl (%rbx),%ebp
  cmp    $0x2a,%bpl
  jne    L74
  cmpb   $0x0,0x1(%rbx)
  je     L22
  mov    $0x2a,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L64
L2:
  lea    0x1(%rbx),%rbp
  movzbl 0x1(%rbx),%ebx
  test   %bl,%bl
  je     L22
L88:
  movsbl %bl,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L15
  cmp    $0x5f,%bl
  je     L15
  cmp    $0x2e,%bl
  jne    L64
L15:
  movzbl 0x1(%rbp),%ebx
  add    $0x1,%rbp
  test   %bl,%bl
  jne    L88
L22:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L74:
  movsbl %bpl,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L2
  cmp    $0x5f,%bpl
  je     L2
  cmp    $0x2e,%bpl
  je     L2
L64:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int checklabel(char *name) {
  register char c;
  if (strlen(name) > 48)
    return 0;
  c = *name;
  if (c == '*' && name[1] == 0)
    return 1;
  if (!isalpha(c) && c != '_' && c != '.')
    return 0;
  while ((c = *++name) != 0)
    if (!isalnum(c) && c != '_' && c != '.')
      return 0;
  return 1;
}
```