ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<printHeader>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%r12d
  mov    %edx,%r13d
  lea    D27(%rip),%rbx
  mov    %rbx,%rdi
  call   <puts@plt>
  lea    D4(%rip),%rdi
  call   <puts@plt>
  lea    D19(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <puts@plt>
  mov    %r13d,%ecx
  mov    %r12d,%edx
  mov    %ebp,%esi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D27
type_guessed: string
name: retrieve_data
arguments: data_tag: D4
type_guessed: string
name: retrieve_data
arguments: data_tag: D19
type_guessed: string
name: retrieve_data
arguments: data_tag: D7
type_guessed: string

tool: D27: |====================================================================|

tool: D4: | matrix multiplication (C = A * B) using square matrices (N x N)    |

tool: D19: | 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |

tool: D7: | N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d 


assistant: ```c
void printHeader(int N, int BS, int REPETITIONS) {
  printf("|====================================================================|\n");
  printf("| matrix multiplication (C = A * B) using square matrices (N x N)    |\n");
  printf("| 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |\n");
  printf("|====================================================================|\n");
  printf("| N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d \n", N, BS, REPETITIONS);
  printf("|====================================================================|\n");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<printHeader>:
  endbr64
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  lea    D6(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <puts@plt>
  lea    D21(%rip),%rdi
  call   <puts@plt>
  lea    D27(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %r12d,%esi
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <puts@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D6
type_infered: string
name: unpack_data
arguments: data_tag: D21
type_infered: string
name: unpack_data
arguments: data_tag: D27
type_infered: string
name: unpack_data
arguments: data_tag: D8
type_infered: string

tool: D6: |====================================================================|

tool: D21: | matrix multiplication (C = A * B) using square matrices (N x N)    |

tool: D27: | 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |

tool: D8: | N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d 


assistant: ```c
void printHeader(int N, int BS, int REPETITIONS) {
  printf("|====================================================================|\n");
  printf("| matrix multiplication (C = A * B) using square matrices (N x N)    |\n");
  printf("| 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |\n");
  printf("|====================================================================|\n");
  printf("| N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d \n", N, BS, REPETITIONS);
  printf("|====================================================================|\n");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<printHeader>:
  endbr64
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  lea    D18(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <puts@plt>
  lea    D19(%rip),%rdi
  call   <puts@plt>
  lea    D37(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %r12d,%esi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <puts@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D18
data_type: string
name: extract_symbolic_data
arguments: data_label: D19
data_type: string
name: extract_symbolic_data
arguments: data_label: D37
data_type: string
name: extract_symbolic_data
arguments: data_label: D36
data_type: string

tool: D18: |====================================================================|

tool: D19: | matrix multiplication (C = A * B) using square matrices (N x N)    |

tool: D37: | 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |

tool: D36: | N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d 


assistant: ```c
void printHeader(int N, int BS, int REPETITIONS) {
  printf("|====================================================================|\n");
  printf("| matrix multiplication (C = A * B) using square matrices (N x N)    |\n");
  printf("| 4 different algorithms: naive, cache-optimized, parallel, BLAS-lib |\n");
  printf("|====================================================================|\n");
  printf("| N = %d, BLOCK SIZE = %d, REPETITIONS for each algorithm: %d \n", N, BS, REPETITIONS);
  printf("|====================================================================|\n");
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ip_checksum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    $0x14,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movq   $0x0,(%rax)
  lea    -0x20(%rbp),%rax
  mov    $0x14,%esi
  mov    %rax,%rdi
  call   <in_cksum@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

assistant: ```c
unsigned short ip_checksum(unsigned char *iphdr) {
  char buf[20];
  struct iphdr *iph;
  memcpy(buf, iphdr, sizeof(buf));
  iph = (struct iphdr *)buf;
  iph->check = 0;
  return in_cksum((unsigned short *)buf, sizeof(buf));
}
```
user: What is the c source code of the assembly code below:

```asm
<ip_checksum>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    $0x14,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  movq   $0x0,(%rsp)
  mov    $0x14,%esi
  mov    %rbx,%rdi
  call   <in_cksum@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x20,%rsp
  pop    %rbx
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned short ip_checksum(unsigned char *iphdr) {
  char buf[20];
  struct iphdr *iph;
  memcpy(buf, iphdr, sizeof(buf));
  iph = (struct iphdr *)buf;
  iph->check = 0;
  return in_cksum((unsigned short *)buf, sizeof(buf));
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ip_checksum>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  mov    $0x14,%edx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    $0x14,%esi
  mov    %rbp,%rdi
  movq   $0x0,(%rsp)
  call   <in_cksum@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x20,%rsp
  pop    %rbp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned short ip_checksum(unsigned char *iphdr) {
  char buf[20];
  struct iphdr *iph;
  memcpy(buf, iphdr, sizeof(buf));
  iph = (struct iphdr *)buf;
  iph->check = 0;
  return in_cksum((unsigned short *)buf, sizeof(buf));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<ip_checksum>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  mov    $0x14,%edx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    $0x14,%esi
  mov    %rbp,%rdi
  movq   $0x0,(%rsp)
  call   <in_cksum@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x20,%rsp
  pop    %rbp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned short ip_checksum(unsigned char *iphdr) {
  char buf[20];
  struct iphdr *iph;
  memcpy(buf, iphdr, sizeof(buf));
  iph = (struct iphdr *)buf;
  iph->check = 0;
  return in_cksum((unsigned short *)buf, sizeof(buf));
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<strToHexstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <chk_calloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L13
L30:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <charToHex@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L36
L19:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  lea    0x0(,%rdx,8),%ecx
  mov    -0x18(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
L36:
  cmpl   $0x7,-0x18(%rbp)
  jle    L19
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x1c(%rbp)
L13:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L30
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *strToHexstr(int len, char *s) {
  int newlen = len * 8;
  char *res = (char *)chk_calloc(newlen, sizeof(char));
  int i;
  for (i = 0; i < len; i++) {
    char *si_coded = charToHex(s[i]);
    int j;
    for (j = 0; j < 8; j++) {
      res[j + i * 8] = si_coded[j];
    }
    free(si_coded);
  }
  return res;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<strToHexstr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r15
  lea    0x0(,%rdi,8),%edi
  mov    $0x1,%esi
  call   <chk_calloc@plt>
  mov    %rax,%r14
  test   %r13d,%r13d
  jle    L23
  mov    %r15,%r12
  mov    %rax,%rbp
  neg    %rbp
  lea    0x8(%rax),%rbx
  lea    -0x1(%r13),%eax
  lea    0x1(%r15,%rax,1),%r13
  jmp    L38
L15:
  call   <free@plt>
  add    $0x1,%r12
  sub    $0x8,%rbp
  add    $0x8,%rbx
  cmp    %r13,%r12
  je     L23
L38:
  movsbl (%r12),%edi
  call   <charToHex@plt>
  mov    %rax,%rdi
  mov    %rbp,%rdx
  neg    %rdx
  lea    (%rax,%rbp,1),%rsi
L1:
  movzbl (%rsi,%rdx,1),%ecx
  mov    %cl,(%rdx)
  add    $0x1,%rdx
  cmp    %rbx,%rdx
  jne    L1
  jmp    L15
L23:
  mov    %r14,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *strToHexstr(int len, char *s) {
  int newlen = len * 8;
  char *res = (char *)chk_calloc(newlen, sizeof(char));
  int i;
  for (i = 0; i < len; i++) {
    char *si_coded = charToHex(s[i]);
    int j;
    for (j = 0; j < 8; j++) {
      res[j + i * 8] = si_coded[j];
    }
    free(si_coded);
  }
  return res;
}
```
user: What is the c source code of the assembly code below?

```asm
<strToHexstr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %edi,%r12d
  shl    $0x3,%edi
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    $0x1,%esi
  call   <chk_calloc@plt>
  mov    %rax,%r13
  test   %r12d,%r12d
  jle    L3
  mov    %rax,%rbp
  lea    0x8(%rax),%r14
  lea    -0x1(%r12),%eax
  neg    %rbp
  lea    0x1(%rbx,%rax,1),%r12
  nopl   0x0(%rax,%rax,1)
L8:
  movsbl (%rbx),%edi
  call   <charToHex@plt>
  mov    %rbp,%rdx
  mov    %rax,%rdi
  neg    %rdx
  lea    (%rax,%rbp,1),%rsi
  nopl   (%rax)
L22:
  movzbl (%rsi,%rdx,1),%ecx
  add    $0x1,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %r14,%rdx
  jne    L22
  add    $0x1,%rbx
  sub    $0x8,%rbp
  add    $0x8,%r14
  call   <free@plt>
  cmp    %r12,%rbx
  jne    L8
L3:
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *strToHexstr(int len, char *s) {
  int newlen = len * 8;
  char *res = (char *)chk_calloc(newlen, sizeof(char));
  int i;
  for (i = 0; i < len; i++) {
    char *si_coded = charToHex(s[i]);
    int j;
    for (j = 0; j < 8; j++) {
      res[j + i * 8] = si_coded[j];
    }
    free(si_coded);
  }
  return res;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strToHexstr>:
  endbr64
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  lea    0x0(,%r12,8),%edi
  mov    %rsi,%rbp
  mov    $0x1,%esi
  push   %rbx
  sub    $0x8,%rsp
  call   <chk_calloc@plt>
  mov    %rax,%r13
  test   %r12d,%r12d
  jle    L17
  mov    %rax,%rbx
  lea    (%rax,%r12,8),%r12
  nopl   (%rax)
L7:
  movsbl 0x0(%rbp),%edi
  add    $0x8,%rbx
  add    $0x1,%rbp
  call   <charToHex@plt>
  mov    %rax,%rdi
  movzbl (%rax),%eax
  mov    %al,-0x8(%rbx)
  movzbl 0x1(%rdi),%eax
  mov    %al,-0x7(%rbx)
  movzbl 0x2(%rdi),%eax
  mov    %al,-0x6(%rbx)
  movzbl 0x3(%rdi),%eax
  mov    %al,-0x5(%rbx)
  movzbl 0x4(%rdi),%eax
  mov    %al,-0x4(%rbx)
  movzbl 0x5(%rdi),%eax
  mov    %al,-0x3(%rbx)
  movzbl 0x6(%rdi),%eax
  mov    %al,-0x2(%rbx)
  movzbl 0x7(%rdi),%eax
  mov    %al,-0x1(%rbx)
  call   <free@plt>
  cmp    %rbx,%r12
  jne    L7
L17:
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *strToHexstr(int len, char *s) {
  int newlen = len * 8;
  char *res = (char *)chk_calloc(newlen, sizeof(char));
  int i;
  for (i = 0; i < len; i++) {
    char *si_coded = charToHex(s[i]);
    int j;
    for (j = 0; j < 8; j++) {
      res[j + i * 8] = si_coded[j];
    }
    free(si_coded);
  }
  return res;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D18
data_type: string
name: retrieve_data
arguments: label: D23
data_type: string
name: retrieve_data
arguments: label: D12
data_type: string

tool: D18: spng2ppm png_file_name



tool: D23:   reads simple-png input file and


tool: D12:   writes ppm output to out.ppm file



assistant: ```c
int usage() {
  printf("spng2ppm png_file_name\n\n");
  printf("  reads simple-png input file and\n");
  printf("  writes ppm output to out.ppm file\n\n");
  return 1;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D17(%rip),%rdi
  call   <printf@plt>
  lea    D2(%rip),%rdi
  call   <printf@plt>
  lea    D22(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D17
type_infered: string
name: parse_data
arguments: data_label: D2
type_infered: string
name: parse_data
arguments: data_label: D22
type_infered: string

tool: D17: spng2ppm png_file_name



tool: D2:   reads simple-png input file and


tool: D22:   writes ppm output to out.ppm file



assistant: ```c
int usage() {
  printf("spng2ppm png_file_name\n\n");
  printf("  reads simple-png input file and\n");
  printf("  writes ppm output to out.ppm file\n\n");
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D13(%rip),%rdi
  call   <printf@plt>
  lea    D29(%rip),%rdi
  call   <printf@plt>
  lea    D11(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
datatype: string
name: extract_symbolic_data
arguments: data_label: D29
datatype: string
name: extract_symbolic_data
arguments: data_label: D11
datatype: string

tool: D13: spng2ppm png_file_name



tool: D29:   reads simple-png input file and


tool: D11:   writes ppm output to out.ppm file



assistant: ```c
int usage() {
  printf("spng2ppm png_file_name\n\n");
  printf("  reads simple-png input file and\n");
  printf("  writes ppm output to out.ppm file\n\n");
  return 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D27(%rip),%rdi
  call   <printf@plt>
  lea    D15(%rip),%rdi
  call   <printf@plt>
  lea    D19(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D27
type_infered: string
name: extract_symbolic_data
arguments: tag: D15
type_infered: string
name: extract_symbolic_data
arguments: tag: D19
type_infered: string

tool: D27: spng2ppm png_file_name



tool: D15:   reads simple-png input file and


tool: D19:   writes ppm output to out.ppm file



assistant: ```c
int usage() {
  printf("spng2ppm png_file_name\n\n");
  printf("  reads simple-png input file and\n");
  printf("  writes ppm output to out.ppm file\n\n");
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<ASN1_primitive_new>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  test   %rsi,%rsi
  je     L4
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L99
  mov    (%rax),%rax
  test   %rax,%rax
  je     L99
  call   *%rax
  jmp    L117
L99:
  mov    D12(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L142
  mov    0x8(%rsi),%edi
  cmp    $0x82,%edi
  je     L159
  jg     L112
  cmp    $0x80,%edi
  je     L126
  cmp    $0x81,%edi
  jne    L133
  movq   $0x1,(%rbx)
  mov    $0x1,%eax
  jmp    L117
L112:
  cmp    $0x83,%edi
  jne    L133
  mov    $0x10,%edi
  call   <OPENSSL_malloc@plt>
  test   %rax,%rax
  je     L87
  movq   $0x0,0x8(%rax)
  movl   $0xffffffff,(%rax)
  jmp    L121
L126:
  mov    D3(%rip),%rax
  mov    (%rax),%edi
  call   <OBJ_nid2obj@plt>
  mov    %rax,(%rbx)
  mov    $0x1,%eax
  jmp    L117
L159:
  mov    0xc(%rsi),%eax
  mov    %eax,(%rbx)
  mov    $0x1,%eax
  jmp    L117
L4:
  mov    $0xffffffff,%edi
L133:
  call   <ASN1_STRING_type_new@plt>
L121:
  mov    %rax,(%rbx)
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
L117:
  pop    %rbx
  ret
L142:
  mov    $0xffffffff,%edi
  jmp    L133
L87:
  mov    $0x0,%eax
  jmp    L117
```

assistant: ```c
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  ASN1_TYPE *typ;
  int utype;
  if (it && it->funcs) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf->prim_new)
      return pf->prim_new(pval, it);
  }
  if (!it || (it->itype == ASN1_ITYPE_MSTRING))
    utype = -1;
  else
    utype = it->utype;
  switch (utype) {
  case V_ASN1_OBJECT:
    *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
    return 1;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return 1;
  case V_ASN1_NULL:
    *pval = (ASN1_VALUE *)1;
    return 1;
  case V_ASN1_ANY:
    typ = OPENSSL_malloc(sizeof(ASN1_TYPE));
    if (!typ)
      return 0;
    typ->value.ptr = NULL;
    typ->type = -1;
    *pval = (ASN1_VALUE *)typ;
    break;
  default:
    *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype);
    break;
  }
  if (*pval)
    return 1;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ASN1_primitive_new>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  test   %rsi,%rsi
  je     L23
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L94
  mov    (%rax),%rax
  test   %rax,%rax
  je     L94
  pop    %rbp
  jmp    *%rax
  nopl   0x0(%rax)
L94:
  mov    D19(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L23
  mov    0x8(%rsi),%edi
  cmp    $0x82,%edi
  je     L40
  jg     L21
  cmp    $0x80,%edi
  je     L99
  cmp    $0x81,%edi
  jne    L96
  movq   $0x1,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L23:
  mov    $0xffffffff,%edi
L96:
  call   <ASN1_STRING_type_new@plt>
L8:
  test   %rax,%rax
  mov    %rax,0x0(%rbp)
  pop    %rbp
  setne  %al
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L21:
  cmp    $0x83,%edi
  jne    L96
  mov    $0x10,%edi
  call   <OPENSSL_malloc@plt>
  test   %rax,%rax
  je     L22
  movq   $0x0,0x8(%rax)
  movl   $0xffffffff,(%rax)
  jmp    L8
  nopw   0x0(%rax,%rax,1)
L99:
  mov    D9(%rip),%rax
  mov    (%rax),%edi
  call   <OBJ_nid2obj@plt>
  mov    %rax,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax)
L40:
  mov    0xc(%rsi),%eax
  mov    %eax,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopl   (%rax)
L22:
  xor    %eax,%eax
  pop    %rbp
  ret
```

assistant: ```c
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  ASN1_TYPE *typ;
  int utype;
  if (it && it->funcs) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf->prim_new)
      return pf->prim_new(pval, it);
  }
  if (!it || (it->itype == ASN1_ITYPE_MSTRING))
    utype = -1;
  else
    utype = it->utype;
  switch (utype) {
  case V_ASN1_OBJECT:
    *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
    return 1;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return 1;
  case V_ASN1_NULL:
    *pval = (ASN1_VALUE *)1;
    return 1;
  case V_ASN1_ANY:
    typ = OPENSSL_malloc(sizeof(ASN1_TYPE));
    if (!typ)
      return 0;
    typ->value.ptr = NULL;
    typ->type = -1;
    *pval = (ASN1_VALUE *)typ;
    break;
  default:
    *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype);
    break;
  }
  if (*pval)
    return 1;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ASN1_primitive_new>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  test   %rsi,%rsi
  je     L46
  mov    0x10(%rsi),%rax
  test   %rax,%rax
  je     L39
  mov    (%rax),%rax
  test   %rax,%rax
  je     L39
  pop    %rbp
  jmp    *%rax
  nopl   0x0(%rax)
L39:
  mov    D13(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  je     L46
  mov    0x8(%rsi),%edi
  cmp    $0x82,%edi
  je     L78
  jg     L8
  cmp    $0x80,%edi
  je     L41
  cmp    $0x81,%edi
  jne    L73
  movq   $0x1,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L46:
  mov    $0xffffffff,%edi
L73:
  call   <ASN1_STRING_type_new@plt>
L61:
  test   %rax,%rax
  mov    %rax,0x0(%rbp)
  pop    %rbp
  setne  %al
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L8:
  cmp    $0x83,%edi
  jne    L73
  mov    $0x10,%edi
  call   <OPENSSL_malloc@plt>
  test   %rax,%rax
  je     L45
  movq   $0x0,0x8(%rax)
  movl   $0xffffffff,(%rax)
  jmp    L61
  nopw   0x0(%rax,%rax,1)
L41:
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <OBJ_nid2obj@plt>
  mov    %rax,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax)
L78:
  mov    0xc(%rsi),%eax
  mov    %eax,0x0(%rbp)
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopl   (%rax)
L45:
  xor    %eax,%eax
  pop    %rbp
  ret
```

assistant: ```c
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  ASN1_TYPE *typ;
  int utype;
  if (it && it->funcs) {
    const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
    if (pf->prim_new)
      return pf->prim_new(pval, it);
  }
  if (!it || (it->itype == ASN1_ITYPE_MSTRING))
    utype = -1;
  else
    utype = it->utype;
  switch (utype) {
  case V_ASN1_OBJECT:
    *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
    return 1;
  case V_ASN1_BOOLEAN:
    if (it)
      *(ASN1_BOOLEAN *)pval = it->size;
    else
      *(ASN1_BOOLEAN *)pval = -1;
    return 1;
  case V_ASN1_NULL:
    *pval = (ASN1_VALUE *)1;
    return 1;
  case V_ASN1_ANY:
    typ = OPENSSL_malloc(sizeof(ASN1_TYPE));
    if (!typ)
      return 0;
    typ->value.ptr = NULL;
    typ->type = -1;
    *pval = (ASN1_VALUE *)typ;
    break;
  default:
    *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype);
    break;
  }
  if (*pval)
    return 1;
  return 0;
}
```