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

```asm
<main>:
  endbr64
  push   %r12
  lea    D4(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  sub    $0x28,%rsp
  movdqa D11(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    $0x746e,%eax
  movb   $0x0,0x12(%rsp)
  mov    %rbp,%rsi
  movaps %xmm0,(%rsp)
  mov    %ax,0x10(%rsp)
  call   <printf@plt>
  mov    $0x5,%edx
  mov    $0x7a,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <printf@plt>
  mov    $0x5,%esi
  mov    %rbp,%rdi
  call   <bzero@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D4
type_guessed: string
name: unpack_data
arguments: data_tag: D11
type_guessed: byte[16]

tool: D4: %s


tool: {"D11": [0x4c,0x69,0x6e,0x75,0x78,0x20,0x43,0x20,0x69,0x73,0x20,0x6d,0x79,0x20,0x77,0x61]}

assistant: ```c
int main() {
  char ch[] = "Linux C is my want";
  printf("%s\n", ch);
  memset(ch, 'z', 5);
  printf("%s\n", ch);
  bzero(ch, 5);
  printf("%s\n", ch);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<component_camera_free>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L1
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <debug_warning@plt>
  jmp    L11
L1:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <h_free@plt>
L11:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D6
type: string

tool: D6: [component_camera_free] handle cannot be NULL

assistant: ```c
void component_camera_free(void *handle) {
  if (!handle) {
    debug_warning("[component_camera_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<component_camera_free>:
  endbr64
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L9
  call   <h_free@plt>
L12:
  add    $0x8,%rsp
  ret
L9:
  lea    D5(%rip),%rdi
  call   <debug_warning@plt>
  jmp    L12
```

tool_calls: name: unpack_data
arguments: data_label: D5
type: string

tool: D5: [component_camera_free] handle cannot be NULL

assistant: ```c
void component_camera_free(void *handle) {
  if (!handle) {
    debug_warning("[component_camera_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<component_camera_free>:
  endbr64
  test   %rdi,%rdi
  je     L9
  jmp    1070 <h_free@plt>
  xchg   %ax,%ax
L9:
  lea    D6(%rip),%rdi
  jmp    1060 <debug_warning@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D6
type_guessed: string

tool: D6: [component_camera_free] handle cannot be NULL

assistant: ```c
void component_camera_free(void *handle) {
  if (!handle) {
    debug_warning("[component_camera_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<component_camera_free>:
  endbr64
  test   %rdi,%rdi
  je     L8
  jmp    1070 <h_free@plt>
  xchg   %ax,%ax
L8:
  lea    D1(%rip),%rdi
  jmp    1060 <debug_warning@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D1
data_type: string

tool: D1: [component_camera_free] handle cannot be NULL

assistant: ```c
void component_camera_free(void *handle) {
  if (!handle) {
    debug_warning("[component_camera_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<signe>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L0
  mov    $0xffffffff,%eax
  jmp    L13
L0:
  mov    $0x1,%eax
L13:
  pop    %rbp
  ret
```

assistant: ```c
int signe(int x) {
  if (x < 0)
    return -1;
  else
    return 1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<signe>:
  endbr64
  mov    %edi,%eax
  sar    $0x1f,%eax
  or     $0x1,%eax
  ret
```

assistant: ```c
int signe(int x) {
  if (x < 0)
    return -1;
  else
    return 1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<signe>:
  endbr64
  mov    %edi,%eax
  sar    $0x1f,%eax
  or     $0x1,%eax
  ret
```

assistant: ```c
int signe(int x) {
  if (x < 0)
    return -1;
  else
    return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<signe>:
  endbr64
  mov    %edi,%eax
  sar    $0x1f,%eax
  or     $0x1,%eax
  ret
```

assistant: ```c
int signe(int x) {
  if (x < 0)
    return -1;
  else
    return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<merge>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x50,%rsp
  mov    %rdi,-0x1038(%rbp)
  mov    %esi,-0x103c(%rbp)
  mov    %edx,-0x1040(%rbp)
  mov    %ecx,-0x1044(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x103c(%rbp),%eax
  mov    %eax,-0x1024(%rbp)
  jmp    L74
L77:
  mov    -0x1024(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x1038(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1024(%rbp),%eax
  cltq
  mov    %edx,-0x1010(%rbp,%rax,4)
  addl   $0x1,-0x1024(%rbp)
L74:
  mov    -0x1024(%rbp),%eax
  cmp    -0x1044(%rbp),%eax
  jle    L77
  mov    -0x103c(%rbp),%eax
  mov    %eax,-0x1020(%rbp)
  mov    -0x103c(%rbp),%eax
  mov    %eax,-0x101c(%rbp)
  mov    -0x1040(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1018(%rbp)
  jmp    L49
L86:
  mov    -0x101c(%rbp),%eax
  cltq
  mov    -0x1010(%rbp,%rax,4),%edx
  mov    -0x1018(%rbp),%eax
  cltq
  mov    -0x1010(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jge    L23
  mov    -0x101c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x101c(%rbp)
  mov    -0x1020(%rbp),%edx
  lea    0x1(%rdx),%ecx
  mov    %ecx,-0x1020(%rbp)
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x1038(%rbp),%rdx
  add    %rcx,%rdx
  cltq
  mov    -0x1010(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
  jmp    L49
L23:
  mov    -0x1018(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1018(%rbp)
  mov    -0x1020(%rbp),%edx
  lea    0x1(%rdx),%ecx
  mov    %ecx,-0x1020(%rbp)
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x1038(%rbp),%rdx
  add    %rcx,%rdx
  cltq
  mov    -0x1010(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
L49:
  mov    -0x101c(%rbp),%eax
  cmp    -0x1040(%rbp),%eax
  jg     L66
  mov    -0x1018(%rbp),%eax
  cmp    -0x1044(%rbp),%eax
  jle    L86
L66:
  mov    -0x1040(%rbp),%eax
  sub    -0x101c(%rbp),%eax
  mov    %eax,-0x1014(%rbp)
  movl   $0x0,-0x1024(%rbp)
  jmp    L83
L46:
  mov    -0x101c(%rbp),%edx
  mov    -0x1024(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x1020(%rbp),%edx
  mov    -0x1024(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x1038(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  mov    -0x1010(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x1024(%rbp)
L83:
  mov    -0x1024(%rbp),%eax
  cmp    -0x1014(%rbp),%eax
  jle    L46
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

assistant: ```c
void merge(int a[], int begin, int mid, int end) {
  int k;
  int current, l, r;
  int rr;
  int b[1024];
  for (k = begin; k <= end; k++)
    b[k] = a[k];
  current = begin;
  l = begin;
  r = mid + 1;
  while ((l <= mid) && (r <= end))
    if (b[l] < b[r])
      a[current++] = b[l++];
    else
      a[current++] = b[r++];
  rr = mid - l;
  for (k = 0; k <= rr; k++)
    a[current + k] = b[l + k];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<merge>:
  endbr64
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x10,%rsp
  mov    %rdi,%r11
  mov    %edx,%r10d
  mov    %ecx,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  cmp    %ecx,%esi
  jg     L32
  movslq %esi,%rax
L64:
  mov    (%r11,%rax,4),%edx
  mov    %edx,(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edi
  jge    L64
L32:
  lea    0x1(%r10),%eax
  cmp    %r10d,%esi
  jg     L107
  cmp    %eax,%edi
  jl     L107
  lea    0x1(%rsi),%ecx
  movslq %esi,%rdx
  lea    (%r11,%rdx,4),%rdx
  jmp    L94
L19:
  add    $0x1,%eax
  mov    %ecx,%ebx
  mov    %r8d,(%rdx)
L103:
  add    $0x1,%ecx
  add    $0x4,%rdx
  cmp    %r10d,%esi
  jg     L9
  cmp    %edi,%eax
  jg     L9
L94:
  movslq %esi,%r8
  mov    (%rsp,%r8,4),%r9d
  movslq %eax,%r8
  mov    (%rsp,%r8,4),%r8d
  cmp    %r8d,%r9d
  jge    L19
  add    $0x1,%esi
  mov    %ecx,%ebx
  mov    %r9d,(%rdx)
  jmp    L103
L107:
  mov    %esi,%ebx
L9:
  sub    %esi,%r10d
  js     L83
  lea    0x1(%r10),%ecx
  shl    $0x2,%rcx
  movslq %esi,%rsi
  lea    (%rsp,%rsi,4),%rdi
  movslq %ebx,%rbx
  lea    (%r11,%rbx,4),%rsi
  mov    $0x0,%eax
L92:
  mov    (%rdi,%rax,1),%edx
  mov    %edx,(%rsi,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L92
L83:
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L116
  add    $0x1010,%rsp
  pop    %rbx
  ret
L116:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int a[], int begin, int mid, int end) {
  int k;
  int current, l, r;
  int rr;
  int b[1024];
  for (k = begin; k <= end; k++)
    b[k] = a[k];
  current = begin;
  l = begin;
  r = mid + 1;
  while ((l <= mid) && (r <= end))
    if (b[l] < b[r])
      a[current++] = b[l++];
    else
      a[current++] = b[r++];
  rr = mid - l;
  for (k = 0; k <= rr; k++)
    a[current + k] = b[l + k];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<merge>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  mov    %rdi,%r12
  mov    %esi,%ebx
  mov    %edx,%ebp
  mov    %ecx,%r13d
  cmp    %ecx,%esi
  jg     L6
  movslq %esi,%rsi
  mov    %ecx,%eax
  shl    $0x2,%rsi
  sub    %ebx,%eax
  lea    (%rsp,%rsi,1),%rdi
  lea    0x4(,%rax,4),%rdx
  add    %r12,%rsi
  call   <memcpy@plt>
L6:
  lea    0x1(%rbp),%ecx
  cmp    %ebp,%ebx
  jg     L35
  cmp    %ecx,%r13d
  lea    0x1(%rbx),%eax
  setge  %dl
  cltq
  test   %dl,%dl
  jne    L29
  jmp    L35
  nopl   0x0(%rax)
L102:
  add    $0x1,%ebx
  mov    %edx,-0x4(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %ebp,%ebx
  jg     L5
L0:
  cmp    %r13d,%ecx
  jg     L5
L29:
  movslq %ebx,%rdx
  movslq %ecx,%rsi
  movslq %eax,%rdi
  mov    (%rsp,%rdx,4),%edx
  mov    (%rsp,%rsi,4),%esi
  cmp    %esi,%edx
  jl     L102
  mov    %esi,%edx
  add    $0x1,%ecx
  mov    %edx,-0x4(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %ebp,%ebx
  jle    L0
L5:
  sub    %ebx,%ebp
  js     L103
  movslq %ebp,%rbp
  movslq %ebx,%rbx
  lea    (%r12,%rdi,4),%rdi
  lea    0x4(,%rbp,4),%rdx
  lea    (%rsp,%rbx,4),%rsi
  call   <memcpy@plt>
L103:
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L62
  add    $0x1018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  movslq %ebx,%rdi
  jmp    L5
L62:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int a[], int begin, int mid, int end) {
  int k;
  int current, l, r;
  int rr;
  int b[1024];
  for (k = begin; k <= end; k++)
    b[k] = a[k];
  current = begin;
  l = begin;
  r = mid + 1;
  while ((l <= mid) && (r <= end))
    if (b[l] < b[r])
      a[current++] = b[l++];
    else
      a[current++] = b[r++];
  rr = mid - l;
  for (k = 0; k <= rr; k++)
    a[current + k] = b[l + k];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<merge>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  mov    %rdi,%r12
  mov    %esi,%ebx
  mov    %edx,%ebp
  mov    %ecx,%r13d
  cmp    %ecx,%esi
  jg     L78
  movslq %esi,%rsi
  mov    %ecx,%eax
  shl    $0x2,%rsi
  sub    %ebx,%eax
  lea    (%rsp,%rsi,1),%rdi
  lea    0x4(,%rax,4),%rdx
  add    %r12,%rsi
  call   <memcpy@plt>
L78:
  lea    0x1(%rbp),%edx
  cmp    %ebp,%ebx
  jg     L10
  lea    0x1(%rbx),%eax
  movslq %ebx,%rsi
  cltq
  cmp    %edx,%r13d
  jl     L10
  cs nopw 0x0(%rax,%rax,1)
L27:
  movslq %edx,%r8
  mov    (%rsp,%rsi,4),%edi
  movslq %eax,%r9
  mov    (%rsp,%r8,4),%ecx
  cmp    %ecx,%edi
  jge    L26
L49:
  add    $0x1,%ebx
  mov    %edi,-0x4(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %ebp,%ebx
  jg     L0
  cmp    %r13d,%edx
  jg     L0
  movslq %ebx,%rsi
  mov    (%rsp,%r8,4),%ecx
  movslq %eax,%r9
  mov    (%rsp,%rsi,4),%edi
  cmp    %ecx,%edi
  jl     L49
L26:
  mov    %ecx,-0x4(%r12,%rax,4)
  add    $0x1,%edx
  add    $0x1,%rax
  cmp    %ebp,%ebx
  jg     L0
  cmp    %edx,%r13d
  jge    L27
L0:
  sub    %ebx,%ebp
  js     L38
  movslq %ebp,%rbp
  movslq %ebx,%rbx
  lea    (%r12,%r9,4),%rdi
  lea    0x4(,%rbp,4),%rdx
  lea    (%rsp,%rbx,4),%rsi
  call   <memcpy@plt>
L38:
  mov    0x1008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L92
  add    $0x1018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L10:
  movslq %ebx,%r9
  jmp    L0
L92:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int a[], int begin, int mid, int end) {
  int k;
  int current, l, r;
  int rr;
  int b[1024];
  for (k = begin; k <= end; k++)
    b[k] = a[k];
  current = begin;
  l = begin;
  r = mid + 1;
  while ((l <= mid) && (r <= end))
    if (b[l] < b[r])
      a[current++] = b[l++];
    else
      a[current++] = b[r++];
  rr = mid - l;
  for (k = 0; k <= rr; k++)
    a[current + k] = b[l + k];
}
```
user: What is the c source code of the assembly code below?

```asm
<asn1_primitive_free>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  test   %rsi,%rsi
  je     L42
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L153
  mov    (%rax),%rax
  test   %rax,%rax
  je     L153
  call   *%rax
  jmp    L63
L42:
  mov    (%rdi),%rdx
  lea    0x8(%rdx),%rbx
  cmpq   $0x0,0x8(%rdx)
  je     L63
  mov    (%rdx),%eax
  cmp    $0x81,%eax
  je     L158
  jle    L201
  cmp    $0x82,%eax
  je     L88
  cmp    $0x83,%eax
  je     L183
  jmp    L110
L153:
  mov    D2(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L219
  mov    0x8(%rsi),%eax
  cmp    $0x82,%eax
  je     L84
  cmpq   $0x0,(%rbx)
  je     L63
  cmp    $0x81,%eax
  je     L171
  jle    L134
  cmp    $0x83,%eax
  jne    L110
L183:
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <asn1_primitive_free>
  mov    (%rbx),%rdi
  call   <OPENSSL_free@plt>
  jmp    L158
L219:
  cmpq   $0x0,(%rbx)
  je     L63
L110:
  mov    (%rbx),%rdi
  call   <ASN1_STRING_free@plt>
L158:
  cmpq   $0x0,(%rbx)
  je     L63
L171:
  movq   $0x0,(%rbx)
L63:
  pop    %rbx
  ret
L84:
  mov    0xc(%rsi),%eax
  mov    %eax,(%rbx)
  jmp    L63
L88:
  movl   $0xffffffff,0x8(%rdx)
  jmp    L63
L201:
  cmp    $0x80,%eax
  je     L29
  jmp    L110
L134:
  cmp    $0x80,%eax
  jne    L110
L29:
  mov    (%rbx),%rdi
  call   <ASN1_OBJECT_free@plt>
  jmp    L158
```

assistant: ```c
void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  int utype;
  if (it) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf && pf->prim_free) {
      pf->prim_free(pval, it);
      return;
    }
  }
  if (!it) {
    ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
    utype = typ->type;
    pval = &typ->value.asn1_value;
    if (!*pval)
      return;
  } else if (it->itype == ASN1_ITYPE_MSTRING) {
    utype = -1;
    if (!*pval)
      return;
  } else {
    utype = it->utype;
    if ((utype != V_ASN1_BOOLEAN) && !*pval)
      return;
  }
  switch (utype) {
  case V_ASN1_OBJECT:
    ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
    break;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return;
  case V_ASN1_NULL:
    break;
  case V_ASN1_ANY:
    asn1_primitive_free(pval, NULL);
    OPENSSL_free(*pval);
    break;
  default:
    ASN1_STRING_free((ASN1_STRING *)*pval);
    break;
  }
  if (*pval)
    *pval = NULL;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<asn1_primitive_free>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  test   %rsi,%rsi
  je     L50
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L77
  mov    (%rax),%rax
  test   %rax,%rax
  je     L77
  pop    %rbp
  jmp    *%rax
  nopl   0x0(%rax)
L77:
  mov    D0(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L79
  mov    0x8(%rsi),%eax
  cmp    $0x82,%eax
  je     L8
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  je     L131
  cmp    $0x81,%eax
  je     L23
  jg     L93
L90:
  cmp    $0x80,%eax
  jne    L15
  call   <ASN1_OBJECT_free@plt>
  mov    0x0(%rbp),%rax
L113:
  test   %rax,%rax
  je     L131
L23:
  movq   $0x0,0x0(%rbp)
L131:
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L50:
  mov    (%rdi),%rdx
  mov    0x8(%rdx),%rdi
  mov    (%rdx),%eax
  lea    0x8(%rdx),%rbp
  test   %rdi,%rdi
  je     L131
  cmp    $0x81,%eax
  je     L23
  jle    L90
  cmp    $0x82,%eax
  je     L154
L93:
  cmp    $0x83,%eax
  jne    L15
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <asn1_primitive_free>
  mov    0x0(%rbp),%rdi
  call   <OPENSSL_free@plt>
  mov    0x0(%rbp),%rax
  jmp    L113
  nopw   0x0(%rax,%rax,1)
L79:
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  je     L131
L15:
  call   <ASN1_STRING_free@plt>
  mov    0x0(%rbp),%rax
  jmp    L113
  nopl   0x0(%rax)
L8:
  mov    0xc(%rsi),%eax
  mov    %eax,0x0(%rbp)
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L154:
  movl   $0xffffffff,0x8(%rdx)
  pop    %rbp
  ret
```

assistant: ```c
void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  int utype;
  if (it) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf && pf->prim_free) {
      pf->prim_free(pval, it);
      return;
    }
  }
  if (!it) {
    ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
    utype = typ->type;
    pval = &typ->value.asn1_value;
    if (!*pval)
      return;
  } else if (it->itype == ASN1_ITYPE_MSTRING) {
    utype = -1;
    if (!*pval)
      return;
  } else {
    utype = it->utype;
    if ((utype != V_ASN1_BOOLEAN) && !*pval)
      return;
  }
  switch (utype) {
  case V_ASN1_OBJECT:
    ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
    break;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return;
  case V_ASN1_NULL:
    break;
  case V_ASN1_ANY:
    asn1_primitive_free(pval, NULL);
    OPENSSL_free(*pval);
    break;
  default:
    ASN1_STRING_free((ASN1_STRING *)*pval);
    break;
  }
  if (*pval)
    *pval = NULL;
}
```
user: Translate the below assembly code into C programming language:

```asm
<asn1_primitive_free>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  test   %rsi,%rsi
  je     L179
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L97
  mov    (%rax),%rax
  test   %rax,%rax
  je     L97
  pop    %rbp
  jmp    *%rax
  nopl   0x0(%rax)
L97:
  mov    D3(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L31
  mov    0x8(%rsi),%eax
  cmp    $0x82,%eax
  je     L29
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  je     L94
  cmp    $0x81,%eax
  je     L78
  jg     L44
L133:
  cmp    $0x80,%eax
  jne    L22
  call   <ASN1_OBJECT_free@plt>
  mov    0x0(%rbp),%rax
L25:
  test   %rax,%rax
  je     L94
L78:
  movq   $0x0,0x0(%rbp)
L94:
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L179:
  mov    (%rdi),%rdx
  mov    0x8(%rdx),%rdi
  mov    (%rdx),%eax
  lea    0x8(%rdx),%rbp
  test   %rdi,%rdi
  je     L94
  cmp    $0x81,%eax
  je     L78
  jle    L133
  cmp    $0x82,%eax
  je     L151
L44:
  cmp    $0x83,%eax
  jne    L22
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <asn1_primitive_free>
  mov    0x0(%rbp),%rdi
  call   <OPENSSL_free@plt>
  mov    0x0(%rbp),%rax
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L31:
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  je     L94
L22:
  call   <ASN1_STRING_free@plt>
  mov    0x0(%rbp),%rax
  jmp    L25
  nopl   0x0(%rax)
L29:
  mov    0xc(%rsi),%eax
  mov    %eax,0x0(%rbp)
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L151:
  movl   $0xffffffff,0x8(%rdx)
  pop    %rbp
  ret
```

assistant: ```c
void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  int utype;
  if (it) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf && pf->prim_free) {
      pf->prim_free(pval, it);
      return;
    }
  }
  if (!it) {
    ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
    utype = typ->type;
    pval = &typ->value.asn1_value;
    if (!*pval)
      return;
  } else if (it->itype == ASN1_ITYPE_MSTRING) {
    utype = -1;
    if (!*pval)
      return;
  } else {
    utype = it->utype;
    if ((utype != V_ASN1_BOOLEAN) && !*pval)
      return;
  }
  switch (utype) {
  case V_ASN1_OBJECT:
    ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
    break;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return;
  case V_ASN1_NULL:
    break;
  case V_ASN1_ANY:
    asn1_primitive_free(pval, NULL);
    OPENSSL_free(*pval);
    break;
  default:
    ASN1_STRING_free((ASN1_STRING *)*pval);
    break;
  }
  if (*pval)
    *pval = NULL;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<is_normal_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x60,-0x4(%rbp)
  jle    L38
  cmpb   $0x7a,-0x4(%rbp)
  jg     L38
  mov    $0x1,%eax
  jmp    L59
L38:
  cmpb   $0x40,-0x4(%rbp)
  jle    L96
  cmpb   $0x5a,-0x4(%rbp)
  jg     L96
  mov    $0x1,%eax
  jmp    L59
L96:
  cmpb   $0x2f,-0x4(%rbp)
  jle    L48
  cmpb   $0x39,-0x4(%rbp)
  jg     L48
  mov    $0x1,%eax
  jmp    L59
L48:
  cmpb   $0x24,-0x4(%rbp)
  je     L30
  cmpb   $0x5f,-0x4(%rbp)
  jne    L1
L30:
  mov    $0x1,%eax
  jmp    L59
L1:
  mov    $0x0,%eax
L59:
  pop    %rbp
  ret
```

assistant: ```c
char is_normal_char(char c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  if (c >= 'A' && c <= 'Z')
    return 1;
  if (c >= '0' && c <= '9')
    return 1;
  if (c == '$' || c == '_')
    return 1;
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<is_normal_char>:
  endbr64
  mov    %edi,%edx
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  mov    $0x1,%eax
  cmp    $0x19,%dl
  jbe    L7
  lea    -0x24(%rdi),%ecx
  cmp    $0x3b,%cl
  ja     L1
  movabs $0x8000000003ff001,%rax
  shr    %cl,%rax
  xor    $0x1,%rax
  and    $0x1,%eax
L1:
  xor    $0x1,%eax
L7:
  ret
```

assistant: ```c
char is_normal_char(char c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  if (c >= 'A' && c <= 'Z')
    return 1;
  if (c >= '0' && c <= '9')
    return 1;
  if (c == '$' || c == '_')
    return 1;
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<is_normal_char>:
  endbr64
  mov    %edi,%edx
  mov    $0x1,%eax
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  cmp    $0x19,%dl
  jbe    L16
  lea    -0x24(%rdi),%ecx
  xor    %eax,%eax
  cmp    $0x3b,%cl
  ja     L16
  movabs $0xf7ffffffffc00ffe,%rax
  sar    %cl,%rax
  and    $0x1,%eax
  xor    $0x1,%eax
L16:
  ret
```

assistant: ```c
char is_normal_char(char c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  if (c >= 'A' && c <= 'Z')
    return 1;
  if (c >= '0' && c <= '9')
    return 1;
  if (c == '$' || c == '_')
    return 1;
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<is_normal_char>:
  endbr64
  mov    %edi,%edx
  mov    $0x1,%eax
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  cmp    $0x19,%dl
  jbe    L15
  lea    -0x24(%rdi),%ecx
  xor    %eax,%eax
  cmp    $0x3b,%cl
  ja     L15
  movabs $0xf7ffffffffc00ffe,%rax
  sar    %cl,%rax
  and    $0x1,%eax
  xor    $0x1,%eax
L15:
  ret
```

assistant: ```c
char is_normal_char(char c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  if (c >= 'A' && c <= 'Z')
    return 1;
  if (c >= '0' && c <= '9')
    return 1;
  if (c == '$' || c == '_')
    return 1;
  return 0;
}
```