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

```asm
<dist_nearest_point>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    D6(%rip),%rax
  mov    (%rax),%r14
  test   %ecx,%ecx
  jle    L29
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %rdx,%rbx
  lea    -0x1(%rcx),%eax
  lea    0x8(%rdx,%rax,8),%r13
  jmp    L13
L15:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L29
L13:
  mov    %r12d,%edx
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  call   <vectors_are_equal@plt>
  test   %eax,%eax
  jne    L15
  mov    %r12d,%edx
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  call   <squared_dist@plt>
  movq   %r14,%xmm1
  minsd  %xmm1,%xmm0
  movq   %xmm0,%r14
  jmp    L15
L29:
  movq   %r14,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
double dist_nearest_point(double *X, int vlen, double **front, int frontlen) {
  int i;
  double dist, mindist;
  mindist = DBL_MAX;
  for (i = 0; i < frontlen; i++) {
    if (!vectors_are_equal(X, front[i], vlen)) {
      dist = squared_dist(X, front[i], vlen);
      if (dist < mindist)
        mindist = dist;
    }
  }
  return mindist;
}
```
user: What is the c source code of the assembly code below:

```asm
<dist_nearest_point>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D4(%rip),%rax
  movsd  (%rax),%xmm2
  movsd  %xmm2,0x8(%rsp)
  test   %ecx,%ecx
  jle    L2
  lea    -0x1(%rcx),%eax
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %rdx,%rbx
  lea    0x8(%rdx,%rax,8),%r13
  jmp    L20
  cs nopw 0x0(%rax,%rax,1)
L15:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L2
L20:
  mov    (%rbx),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <vectors_are_equal@plt>
  test   %eax,%eax
  jne    L15
  mov    (%rbx),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <squared_dist@plt>
  minsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  cmp    %r13,%rbx
  jne    L20
L2:
  movsd  0x8(%rsp),%xmm0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
double dist_nearest_point(double *X, int vlen, double **front, int frontlen) {
  int i;
  double dist, mindist;
  mindist = DBL_MAX;
  for (i = 0; i < frontlen; i++) {
    if (!vectors_are_equal(X, front[i], vlen)) {
      dist = squared_dist(X, front[i], vlen);
      if (dist < mindist)
        mindist = dist;
    }
  }
  return mindist;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dist_nearest_point>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D3(%rip),%rax
  movsd  (%rax),%xmm2
  movsd  %xmm2,0x8(%rsp)
  test   %ecx,%ecx
  jle    L27
  lea    -0x1(%rcx),%eax
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %rdx,%rbx
  lea    0x8(%rdx,%rax,8),%r13
  jmp    L40
  cs nopw 0x0(%rax,%rax,1)
L38:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L27
L40:
  mov    (%rbx),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <vectors_are_equal@plt>
  test   %eax,%eax
  jne    L38
  mov    (%rbx),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <squared_dist@plt>
  minsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  cmp    %r13,%rbx
  jne    L40
L27:
  movsd  0x8(%rsp),%xmm0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
double dist_nearest_point(double *X, int vlen, double **front, int frontlen) {
  int i;
  double dist, mindist;
  mindist = DBL_MAX;
  for (i = 0; i < frontlen; i++) {
    if (!vectors_are_equal(X, front[i], vlen)) {
      dist = squared_dist(X, front[i], vlen);
      if (dist < mindist)
        mindist = dist;
    }
  }
  return mindist;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<not_the_ones_registered>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xc0(%rbp),%rdx
  lea    -0x120(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <my_task@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
void not_the_ones_registered(void) {
  double a[12], b[23], p[12], q[23];
#pragma starpu register a
#pragma starpu register b
  my_task(p, q);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<not_the_ones_registered>:
  endbr64
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0x60(%rsp),%rsi
  mov    %rsp,%rdi
  call   <my_task@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x128,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void not_the_ones_registered(void) {
  double a[12], b[23], p[12], q[23];
#pragma starpu register a
#pragma starpu register b
  my_task(p, q);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<not_the_ones_registered>:
  endbr64
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0x60(%rsp),%rsi
  mov    %rsp,%rdi
  call   <my_task@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x128,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void not_the_ones_registered(void) {
  double a[12], b[23], p[12], q[23];
#pragma starpu register a
#pragma starpu register b
  my_task(p, q);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<not_the_ones_registered>:
  endbr64
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0x60(%rsp),%rsi
  mov    %rsp,%rdi
  call   <my_task@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x128,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void not_the_ones_registered(void) {
  double a[12], b[23], p[12], q[23];
#pragma starpu register a
#pragma starpu register b
  my_task(p, q);
}
```
user: What is the c source code of the assembly code below?

```asm
<graph_connected_components_perm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%ebx
  mov    %rsi,0x28(%rsp)
  mov    %rdx,%r14
  mov    %rcx,%rbp
  mov    %r8,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %r9,0x40(%rsp)
  lea    0x40(%rsp),%rsi
  call   <u_alloc@plt>
  mov    %rax,0x8(%rsp)
  test   %ebx,%ebx
  jle    L41
  mov    %r13,%rax
  lea    -0x1(%rbx),%ebx
  shl    $0x2,%rbx
  lea    0x4(%r13,%rbx,1),%rdx
L80:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L80
  lea    0x3c(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <s_reset@plt>
  mov    %rbp,%r15
  lea    0x4(%rbp,%rbx,1),%rax
  mov    %rax,0x20(%rsp)
  movl   $0x0,0x1c(%rsp)
  lea    0x3c(%rsp),%rax
  mov    %rax,0x10(%rsp)
  jmp    L15
L64:
  add    $0x1,%rbx
  cmp    %ebx,(%r12)
  jle    L118
L35:
  mov    (%r14,%rbx,4),%edi
  movslq %edi,%rax
  lea    0x0(%r13,%rax,4),%rbp
  cmpl   $0x0,0x0(%rbp)
  jns    L64
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,0x0(%rbp)
  jmp    L64
L118:
  cmpl   $0x0,0x3c(%rsp)
  jle    L103
L1:
  mov    0x10(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <s_pop@plt>
  cltq
  mov    0x28(%rsp),%rcx
  mov    (%rcx,%rax,4),%ebx
  lea    0x4(%rcx,%rax,4),%r12
  cmp    (%r12),%ebx
  jge    L118
  movslq %ebx,%rbx
  jmp    L35
L103:
  addl   $0x1,0x1c(%rsp)
L29:
  add    $0x4,%r15
  cmp    0x20(%rsp),%r15
  je     L60
L15:
  mov    (%r15),%edi
  movslq %edi,%rax
  lea    0x0(%r13,%rax,4),%rbx
  cmpl   $0x0,(%rbx)
  jns    L29
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,(%rbx)
  cmpl   $0x0,0x3c(%rsp)
  jg     L1
  jmp    L103
L41:
  lea    0x3c(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <s_reset@plt>
  movl   $0x0,0x1c(%rsp)
L60:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  mov    0x1c(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int graph_connected_components_perm(int n, int *xadj, int *adj, int *perm, int *part, int *aux) {
  int *auxptr = aux;
  int *active = u_alloc(n, &auxptr);
  for (int v = 0; v < n; v++) {
    part[v] = -1;
  }
  int size;
  int nc = 0;
  s_reset(active, &size);
  for (int i = 0; i < n; i++) {
    int v = perm[i];
    if (part[v] < 0) {
      s_push(v, active, &size);
      part[v] = nc;
      while (size > 0) {
        int v = s_pop(active, &size);
        for (int j = xadj[v]; j < xadj[v + 1]; j++) {
          int w = adj[j];
          if (part[w] < 0) {
            s_push(w, active, &size);
            part[w] = nc;
          }
        }
      }
      nc++;
    }
  }
  return nc;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<graph_connected_components_perm>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x58,%rsp
  mov    %rsi,0x28(%rsp)
  lea    0x40(%rsp),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %r9,0x40(%rsp)
  call   <u_alloc@plt>
  mov    %rax,%rbp
  test   %r13d,%r13d
  jle    L97
  mov    %r13d,%edx
  mov    $0xff,%esi
  lea    0x3c(%rsp),%r12
  mov    %r15,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <s_reset@plt>
  lea    -0x1(%r13),%eax
  mov    %rbx,0x8(%rsp)
  lea    0x4(%rbx,%rax,4),%rax
  movl   $0x0,0x1c(%rsp)
  mov    %rax,0x20(%rsp)
  jmp    L96
  nop
L58:
  addq   $0x4,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    0x20(%rsp),%rax
  je     L114
L96:
  mov    0x8(%rsp),%rax
  movslq (%rax),%rax
  lea    (%r15,%rax,4),%rcx
  mov    %rax,%rdi
  mov    (%rcx),%esi
  test   %esi,%esi
  jns    L58
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rcx,0x10(%rsp)
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    0x10(%rsp),%rcx
  mov    %eax,(%rcx)
  cs nopw 0x0(%rax,%rax,1)
L29:
  mov    0x3c(%rsp),%edx
  test   %edx,%edx
  jle    L54
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <s_pop@plt>
  mov    0x28(%rsp),%rdx
  cltq
  lea    0x4(%rdx,%rax,4),%rbx
  mov    (%rdx,%rax,4),%ecx
  cmp    (%rbx),%ecx
  jge    L29
  movslq %ecx,%r13
  jmp    L22
  nop
L105:
  add    $0x1,%r13
  cmp    %r13d,(%rbx)
  jle    L29
L22:
  movslq (%r14,%r13,4),%rax
  lea    (%r15,%rax,4),%r9
  mov    %rax,%rdi
  mov    (%r9),%eax
  test   %eax,%eax
  jns    L105
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r9,0x10(%rsp)
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    0x10(%rsp),%r9
  mov    %eax,(%r9)
  jmp    L105
L97:
  lea    0x3c(%rsp),%rsi
  mov    %rax,%rdi
  call   <s_reset@plt>
  movl   $0x0,0x1c(%rsp)
  xchg   %ax,%ax
L114:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  mov    0x1c(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L54:
  addl   $0x1,0x1c(%rsp)
  jmp    L58
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int graph_connected_components_perm(int n, int *xadj, int *adj, int *perm, int *part, int *aux) {
  int *auxptr = aux;
  int *active = u_alloc(n, &auxptr);
  for (int v = 0; v < n; v++) {
    part[v] = -1;
  }
  int size;
  int nc = 0;
  s_reset(active, &size);
  for (int i = 0; i < n; i++) {
    int v = perm[i];
    if (part[v] < 0) {
      s_push(v, active, &size);
      part[v] = nc;
      while (size > 0) {
        int v = s_pop(active, &size);
        for (int j = xadj[v]; j < xadj[v + 1]; j++) {
          int w = adj[j];
          if (part[w] < 0) {
            s_push(w, active, &size);
            part[w] = nc;
          }
        }
      }
      nc++;
    }
  }
  return nc;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<graph_connected_components_perm>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x58,%rsp
  mov    %rsi,0x28(%rsp)
  lea    0x40(%rsp),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %r9,0x40(%rsp)
  call   <u_alloc@plt>
  mov    %rax,%r12
  test   %ebp,%ebp
  jle    L26
  mov    %ebp,%edx
  mov    $0xff,%esi
  lea    0x3c(%rsp),%r13
  mov    %r15,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <s_reset@plt>
  lea    -0x1(%rbp),%eax
  mov    %rbx,0x8(%rsp)
  lea    0x4(%rbx,%rax,4),%rax
  movl   $0x0,0x1c(%rsp)
  mov    %rax,0x20(%rsp)
  jmp    L19
  nopl   0x0(%rax,%rax,1)
L95:
  addq   $0x4,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    0x20(%rsp),%rax
  je     L69
L19:
  mov    0x8(%rsp),%rax
  movslq (%rax),%rax
  lea    (%r15,%rax,4),%rbp
  mov    %rax,%rdi
  mov    0x0(%rbp),%ecx
  test   %ecx,%ecx
  jns    L95
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,0x0(%rbp)
  xchg   %ax,%ax
L128:
  mov    0x3c(%rsp),%edx
  test   %edx,%edx
  jle    L42
L29:
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <s_pop@plt>
  mov    0x28(%rsp),%rcx
  cltq
  movslq (%rcx,%rax,4),%rbp
  lea    0x4(%rcx,%rax,4),%rax
  mov    (%rax),%edx
  mov    %rax,0x10(%rsp)
  cmp    %edx,%ebp
  jge    L128
  xchg   %ax,%ax
L77:
  movslq (%r14,%rbp,4),%rax
  lea    (%r15,%rax,4),%rbx
  mov    %rax,%rdi
  mov    (%rbx),%eax
  test   %eax,%eax
  js     L110
  add    $0x1,%rbp
  cmp    %ebp,%edx
  jg     L77
  jmp    L128
  nopl   0x0(%rax,%rax,1)
L110:
  mov    %r13,%rdx
  mov    %r12,%rsi
  add    $0x1,%rbp
  call   <s_push@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x10(%rsp),%rax
  mov    (%rax),%edx
  cmp    %ebp,%edx
  jg     L77
  mov    0x3c(%rsp),%edx
  test   %edx,%edx
  jg     L29
L42:
  addl   $0x1,0x1c(%rsp)
  jmp    L95
L26:
  lea    0x3c(%rsp),%rsi
  mov    %rax,%rdi
  call   <s_reset@plt>
  movl   $0x0,0x1c(%rsp)
  nopw   0x0(%rax,%rax,1)
L69:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L85
  mov    0x1c(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L85:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int graph_connected_components_perm(int n, int *xadj, int *adj, int *perm, int *part, int *aux) {
  int *auxptr = aux;
  int *active = u_alloc(n, &auxptr);
  for (int v = 0; v < n; v++) {
    part[v] = -1;
  }
  int size;
  int nc = 0;
  s_reset(active, &size);
  for (int i = 0; i < n; i++) {
    int v = perm[i];
    if (part[v] < 0) {
      s_push(v, active, &size);
      part[v] = nc;
      while (size > 0) {
        int v = s_pop(active, &size);
        for (int j = xadj[v]; j < xadj[v + 1]; j++) {
          int w = adj[j];
          if (part[w] < 0) {
            s_push(w, active, &size);
            part[w] = nc;
          }
        }
      }
      nc++;
    }
  }
  return nc;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<rdtsc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  rdtsc
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
uint64_t rdtsc(void) {
  uint64_t r;
  __asm__ __volatile__("rdtsc" : "=A"(r));
  return r;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<rdtsc>:
  endbr64
  rdtsc
  ret
```

assistant: ```c
uint64_t rdtsc(void) {
  uint64_t r;
  __asm__ __volatile__("rdtsc" : "=A"(r));
  return r;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<rdtsc>:
  endbr64
  rdtsc
  ret
```

assistant: ```c
uint64_t rdtsc(void) {
  uint64_t r;
  __asm__ __volatile__("rdtsc" : "=A"(r));
  return r;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<rdtsc>:
  endbr64
  rdtsc
  ret
```

assistant: ```c
uint64_t rdtsc(void) {
  uint64_t r;
  __asm__ __volatile__("rdtsc" : "=A"(r));
  return r;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<x67_Tag_DescriptorParser>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L26
  mov    $0xffffffff,%eax
  jmp    L13
L26:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <Parser_DisplayTagInfo@plt>
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x14(%rbp),%eax
  lea    D46(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L24
  mov    -0x14(%rbp),%eax
  lea    D45(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L42
L25:
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x14(%rbp),%eax
  lea    D41(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  addl   $0x1,-0x4(%rbp)
L42:
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    %eax,-0x4(%rbp)
  jb     L25
  mov    -0x14(%rbp),%eax
  lea    D35(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
L24:
  mov    -0x14(%rbp),%eax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L13:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D46
type_infered: string
name: unpack_data
arguments: data_label: D45
type_infered: string
name: unpack_data
arguments: data_label: D41
type_infered: string
name: unpack_data
arguments: data_label: D35
type_infered: string
name: unpack_data
arguments: data_label: D28
type_infered: string

tool: D46: Descriptor_length = 0x%x


tool: D45: Transport stream descriptor:

tool: D41:  0x%x

tool: D35: 


tool: D28: ******END******


assistant: ```c
int x67_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  if (0 != buff[1]) {
    Parser_TsPacketLog(type, "Transport stream descriptor:");
    for (i = 0; i < buff[1]; i++) {
      Parser_TsPacketLog(type, " 0x%x", buff[i + 2]);
    }
    Parser_TsPacketLog(type, "\n");
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<x67_Tag_DescriptorParser>:
  endbr64
  test   %rsi,%rsi
  je     L19
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbx
  movzbl (%rsi),%esi
  call   <Parser_DisplayTagInfo@plt>
  movzbl 0x1(%rbx),%edx
  lea    D42(%rip),%rsi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x1(%rbx)
  jne    L48
L31:
  lea    D47(%rip),%rsi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  movzbl 0x1(%rbx),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L48:
  lea    D20(%rip),%rsi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x1(%rbx)
  je     L34
  mov    $0x0,%ebp
  lea    D22(%rip),%r13
L35:
  lea    0x2(%rbp),%eax
  movzbl (%rbx,%rax,1),%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  add    $0x1,%ebp
  movzbl 0x1(%rbx),%eax
  cmp    %ebp,%eax
  ja     L35
L34:
  lea    D6(%rip),%rsi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  jmp    L31
L19:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: retrieve_data
arguments: label: D42
data_type: string
name: retrieve_data
arguments: label: D47
data_type: string
name: retrieve_data
arguments: label: D20
data_type: string
name: retrieve_data
arguments: label: D22
data_type: string
name: retrieve_data
arguments: label: D6
data_type: string

tool: D42: Descriptor_length = 0x%x


tool: D47: ******END******


tool: D20: Transport stream descriptor:

tool: D22:  0x%x

tool: D6: 


assistant: ```c
int x67_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  if (0 != buff[1]) {
    Parser_TsPacketLog(type, "Transport stream descriptor:");
    for (i = 0; i < buff[1]; i++) {
      Parser_TsPacketLog(type, " 0x%x", buff[i + 2]);
    }
    Parser_TsPacketLog(type, "\n");
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<x67_Tag_DescriptorParser>:
  endbr64
  test   %rsi,%rsi
  je     L4
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movzbl (%rsi),%esi
  call   <Parser_DisplayTagInfo@plt>
  movzbl 0x1(%rbx),%edx
  xor    %eax,%eax
  mov    %r12d,%edi
  lea    D32(%rip),%rsi
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x1(%rbx)
  jne    L17
L40:
  mov    %r12d,%edi
  lea    D29(%rip),%rsi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  movzbl 0x1(%rbx),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  xor    %eax,%eax
  lea    D25(%rip),%rsi
  mov    %r12d,%edi
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x1(%rbx)
  je     L47
  xor    %ebp,%ebp
  lea    D26(%rip),%r13
L14:
  movzbl 0x2(%rbx,%rbp,1),%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  xor    %eax,%eax
  add    $0x1,%rbp
  call   <Parser_TsPacketLog@plt>
  movzbl 0x1(%rbx),%eax
  cmp    %ebp,%eax
  ja     L14
L47:
  lea    D2(%rip),%rsi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  jmp    L40
L4:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D32
data_type: string
name: retrieve_data
arguments: data_tag: D29
data_type: string
name: retrieve_data
arguments: data_tag: D25
data_type: string
name: retrieve_data
arguments: data_tag: D26
data_type: string
name: retrieve_data
arguments: data_tag: D2
data_type: string

tool: D32: Descriptor_length = 0x%x


tool: D29: ******END******


tool: D25: Transport stream descriptor:

tool: D26:  0x%x

tool: D2: 


assistant: ```c
int x67_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  if (0 != buff[1]) {
    Parser_TsPacketLog(type, "Transport stream descriptor:");
    for (i = 0; i < buff[1]; i++) {
      Parser_TsPacketLog(type, " 0x%x", buff[i + 2]);
    }
    Parser_TsPacketLog(type, "\n");
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```