ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<inclass>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  movsbl -0x4(%rbp),%eax
  test   %eax,%eax
  je     L128
  test   %eax,%eax
  js     L125
  cmp    $0x3f,%eax
  jg     L125
  cmp    $0x9,%eax
  jl     L125
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  movabs $0x8000400200000000,%rdx
  and    %rax,%rdx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L63
  mov    %rax,%rdx
  and    $0x2400,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L128
  movabs $0x100000200,%rdx
  and    %rdx,%rax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  je     L125
  mov    $0x0,%eax
  jmp    L12
L63:
  mov    $0x1,%eax
  jmp    L12
L128:
  mov    $0x2,%eax
  jmp    L12
L125:
  cmpb   $0x1f,-0x4(%rbp)
  jle    L127
  cmpb   $0x7f,-0x4(%rbp)
  jne    L37
L127:
  mov    $0x2,%eax
  jmp    L12
L37:
  mov    $0x3,%eax
L12:
  pop    %rbp
  ret
```

assistant: ```c
int inclass(c)
char c;
{
  switch (c) {
  case ' ':
  case '\t':
    return 0;
  case '.':
  case '!':
  case '?':
    return 1;
  case '\n':
  case '\r':
  case '\0':
    return 2;
  default:
    if (c < ' ' || c > '~')
      return 2;
    else
      return 3;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<inclass>:
  endbr64
  mov    %edi,%ecx
  test   %dil,%dil
  je     L32
  lea    -0x9(%rdi),%eax
  cmp    $0x36,%al
  ja     L40
  mov    $0x1,%eax
  shl    %cl,%rax
  movabs $0x8000400200000000,%rdx
  test   %rdx,%rax
  jne    L1
  movabs $0x100000200,%rdx
  test   %rdx,%rax
  jne    L44
  test   $0x24,%ah
  jne    L8
L40:
  sub    $0x20,%ecx
  cmp    $0x5f,%cl
  setb   %al
  movzbl %al,%eax
  add    $0x2,%eax
  ret
L32:
  mov    $0x2,%eax
  ret
L1:
  mov    $0x1,%eax
  ret
L44:
  mov    $0x0,%eax
  ret
L8:
  mov    $0x2,%eax
  ret
```

assistant: ```c
int inclass(c)
char c;
{
  switch (c) {
  case ' ':
  case '\t':
    return 0;
  case '.':
  case '!':
  case '?':
    return 1;
  case '\n':
  case '\r':
  case '\0':
    return 2;
  default:
    if (c < ' ' || c > '~')
      return 2;
    else
      return 3;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<inclass>:
  endbr64
  mov    %edi,%ecx
  test   %dil,%dil
  je     L42
  lea    -0x9(%rdi),%eax
  cmp    $0x36,%al
  ja     L24
  movabs $0x8000400200000000,%rdx
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %rdx,%rax
  jne    L41
  movabs $0x100000200,%rdx
  test   %rdx,%rax
  jne    L26
  test   $0x24,%ah
  jne    L42
L24:
  sub    $0x20,%ecx
  xor    %eax,%eax
  cmp    $0x5f,%cl
  setb   %al
  add    $0x2,%eax
  ret
  nopl   0x0(%rax)
L42:
  mov    $0x2,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L41:
  mov    $0x1,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L26:
  xor    %eax,%eax
  ret
```

assistant: ```c
int inclass(c)
char c;
{
  switch (c) {
  case ' ':
  case '\t':
    return 0;
  case '.':
  case '!':
  case '?':
    return 1;
  case '\n':
  case '\r':
  case '\0':
    return 2;
  default:
    if (c < ' ' || c > '~')
      return 2;
    else
      return 3;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<inclass>:
  endbr64
  mov    %edi,%ecx
  test   %dil,%dil
  je     L49
  lea    -0x9(%rdi),%eax
  cmp    $0x36,%al
  ja     L11
  movabs $0x8000400200000000,%rdx
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %rdx,%rax
  jne    L38
  movabs $0x100000200,%rdx
  test   %rdx,%rax
  jne    L27
  test   $0x24,%ah
  jne    L49
L11:
  sub    $0x20,%ecx
  xor    %eax,%eax
  cmp    $0x5f,%cl
  setb   %al
  add    $0x2,%eax
  ret
  nopl   0x0(%rax)
L49:
  mov    $0x2,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L38:
  mov    $0x1,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L27:
  xor    %eax,%eax
  ret
```

assistant: ```c
int inclass(c)
char c;
{
  switch (c) {
  case ' ':
  case '\t':
    return 0;
  case '.':
  case '!':
  case '?':
    return 1;
  case '\n':
  case '\r':
  case '\0':
    return 2;
  default:
    if (c < ' ' || c > '~')
      return 2;
    else
      return 3;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<wifi_ntp_build_url>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x30,%edx
  mov    $0x0,%esi
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <memset@plt>
  movb   $0xe3,D61(%rip)
  movb   $0x0,D85(%rip)
  movb   $0x6,D55(%rip)
  movb   $0xec,D82(%rip)
  movb   $0x31,D74(%rip)
  movb   $0x4e,D73(%rip)
  movb   $0x31,D6(%rip)
  movb   $0x34,D70(%rip)
  lea    D61(%rip),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *wifi_ntp_build_url() {
  static char ntp_request_buffer[48];
  memset(ntp_request_buffer, '\0', sizeof(ntp_request_buffer));
  ntp_request_buffer[0] = 0xE3;
  ntp_request_buffer[1] = 0;
  ntp_request_buffer[2] = 6;
  ntp_request_buffer[3] = 0xEC;
  ntp_request_buffer[12] = 49;
  ntp_request_buffer[13] = 0x4E;
  ntp_request_buffer[14] = 49;
  ntp_request_buffer[15] = 52;
  return ntp_request_buffer;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<wifi_ntp_build_url>:
  endbr64
  push   %rbx
  mov    $0x30,%edx
  mov    $0x0,%esi
  lea    D63(%rip),%rbx
  mov    %rbx,%rdi
  call   <memset@plt>
  movb   $0xe3,D63(%rip)
  movb   $0x0,D56(%rip)
  movb   $0x6,D72(%rip)
  movb   $0xec,D50(%rip)
  movb   $0x31,D77(%rip)
  movb   $0x4e,D14(%rip)
  movb   $0x31,D66(%rip)
  movb   $0x34,D39(%rip)
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *wifi_ntp_build_url() {
  static char ntp_request_buffer[48];
  memset(ntp_request_buffer, '\0', sizeof(ntp_request_buffer));
  ntp_request_buffer[0] = 0xE3;
  ntp_request_buffer[1] = 0;
  ntp_request_buffer[2] = 6;
  ntp_request_buffer[3] = 0xEC;
  ntp_request_buffer[12] = 49;
  ntp_request_buffer[13] = 0x4E;
  ntp_request_buffer[14] = 49;
  ntp_request_buffer[15] = 52;
  return ntp_request_buffer;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<wifi_ntp_build_url>:
  endbr64
  push   %r12
  lea    D28(%rip),%r12
  mov    $0x30,%edx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %r12,%rax
  pop    %r12
  movl   $0xec0600e3,D28(%rip)
  movl   $0x34314e31,D3(%rip)
  ret
```

assistant: ```c
char *wifi_ntp_build_url() {
  static char ntp_request_buffer[48];
  memset(ntp_request_buffer, '\0', sizeof(ntp_request_buffer));
  ntp_request_buffer[0] = 0xE3;
  ntp_request_buffer[1] = 0;
  ntp_request_buffer[2] = 6;
  ntp_request_buffer[3] = 0xEC;
  ntp_request_buffer[12] = 49;
  ntp_request_buffer[13] = 0x4E;
  ntp_request_buffer[14] = 49;
  ntp_request_buffer[15] = 52;
  return ntp_request_buffer;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<wifi_ntp_build_url>:
  endbr64
  push   %r12
  lea    D5(%rip),%r12
  mov    $0x30,%edx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %r12,%rax
  pop    %r12
  movl   $0xec0600e3,D5(%rip)
  movl   $0x34314e31,D10(%rip)
  ret
```

assistant: ```c
char *wifi_ntp_build_url() {
  static char ntp_request_buffer[48];
  memset(ntp_request_buffer, '\0', sizeof(ntp_request_buffer));
  ntp_request_buffer[0] = 0xE3;
  ntp_request_buffer[1] = 0;
  ntp_request_buffer[2] = 6;
  ntp_request_buffer[3] = 0xEC;
  ntp_request_buffer[12] = 49;
  ntp_request_buffer[13] = 0x4E;
  ntp_request_buffer[14] = 49;
  ntp_request_buffer[15] = 52;
  return ntp_request_buffer;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<fastPower10>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D2(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  pop    %rbp
  ret
```

assistant: ```c
int fastPower10(int power) {
  static int powers[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
  return powers[power];
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fastPower10>:
  endbr64
  movslq %edi,%rdi
  lea    D6(%rip),%rax
  mov    (%rax,%rdi,4),%eax
  ret
```

tool_calls: name: read_data
arguments: data_tag: D6
data_type: string

tool: D6: 

assistant: ```c
int fastPower10(int power) {
  static int powers[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
  return powers[power];
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<fastPower10>:
  endbr64
  movslq %edi,%rdi
  lea    D4(%rip),%rax
  mov    (%rax,%rdi,4),%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
type_guessed: string

tool: D4: 

assistant: ```c
int fastPower10(int power) {
  static int powers[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
  return powers[power];
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<fastPower10>:
  endbr64
  movslq %edi,%rdi
  lea    D5(%rip),%rax
  mov    (%rax,%rdi,4),%eax
  ret
```

tool_calls: name: parse_data
arguments: label: D5
type_infered: string

tool: D5: 

assistant: ```c
int fastPower10(int power) {
  static int powers[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
  return powers[power];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<keylen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L51
L38:
  addl   $0x1,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
L51:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L70
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L70
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1a,%al
  jne    L38
L70:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L6
  mov    -0x20(%rbp),%rax
  mov    -0x10(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L65
L6:
  addq   $0x1,-0x8(%rbp)
  jmp    L80
L68:
  addl   $0x1,-0xc(%rbp)
  addq   $0x1,-0x8(%rbp)
L80:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L14
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1a,%al
  jne    L68
L14:
  mov    -0x20(%rbp),%rax
  mov    -0x10(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
L65:
  pop    %rbp
  ret
```

assistant: ```c
void keylen(record, l1, l2) char *record;
int *l1, *l2;
{
  char *wp;
  int c1, c2;
  c1 = c2 = 0;
  wp = record;
  while (*wp != '=' && *wp != '\n' && *wp != 26) {
    ++c1;
    ++wp;
  }
  if (*wp != '=') {
    *l1 = c1;
    *l2 = c2;
    return;
  }
  ++wp;
  while (*wp != '\n' && *wp != 26) {
    ++c2;
    ++wp;
  }
  *l1 = c1;
  *l2 = c2;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<keylen>:
  endbr64
  mov    %rsi,%r9
  mov    %rdx,%r8
  movzbl (%rdi),%edx
  mov    %edx,%eax
  and    $0xffffffef,%eax
  cmp    $0xa,%al
  je     L89
  cmp    $0x3d,%dl
  je     L89
  mov    %rdi,%rax
  mov    $0x1,%esi
  sub    %edi,%esi
L45:
  lea    (%rsi,%rax,1),%edi
  add    $0x1,%rax
  movzbl (%rax),%edx
  mov    %edx,%ecx
  and    $0xffffffef,%ecx
  cmp    $0xa,%cl
  je     L33
  cmp    $0x3d,%dl
  jne    L45
L33:
  mov    $0x0,%ecx
  cmp    $0x3d,%dl
  jne    L14
  lea    0x1(%rax),%rdx
  movzbl 0x1(%rax),%eax
  and    $0xffffffef,%eax
  cmp    $0xa,%al
  je     L22
  mov    %rdx,%rax
  mov    $0x1,%esi
  sub    %edx,%esi
L10:
  lea    (%rsi,%rax,1),%ecx
  add    $0x1,%rax
  movzbl (%rax),%edx
  and    $0xffffffef,%edx
  cmp    $0xa,%dl
  jne    L10
L14:
  mov    %edi,(%r9)
  mov    %ecx,(%r8)
  ret
L89:
  mov    %rdi,%rax
  mov    $0x0,%edi
  jmp    L33
L22:
  mov    $0x0,%ecx
  jmp    L14
```

assistant: ```c
void keylen(record, l1, l2) char *record;
int *l1, *l2;
{
  char *wp;
  int c1, c2;
  c1 = c2 = 0;
  wp = record;
  while (*wp != '=' && *wp != '\n' && *wp != 26) {
    ++c1;
    ++wp;
  }
  if (*wp != '=') {
    *l1 = c1;
    *l2 = c2;
    return;
  }
  ++wp;
  while (*wp != '\n' && *wp != 26) {
    ++c2;
    ++wp;
  }
  *l1 = c1;
  *l2 = c2;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<keylen>:
  endbr64
  movzbl (%rdi),%eax
  cmp    $0xa,%al
  je     L35
  xor    %ecx,%ecx
  cmp    $0x3d,%al
  jne    L4
  jmp    L35
  nopl   0x0(%rax,%rax,1)
L43:
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  add    $0x1,%ecx
  cmp    $0x3d,%al
  je     L69
  cmp    $0xa,%al
  je     L8
L4:
  cmp    $0x1a,%al
  jne    L43
L75:
  xor    %r8d,%r8d
  mov    %ecx,(%rsi)
  mov    %r8d,(%rdx)
  ret
L35:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L8:
  cmp    $0x3d,%al
  jne    L75
L69:
  lea    0x1(%rdi),%rax
  movzbl 0x1(%rdi),%edi
  and    $0xffffffef,%edi
  cmp    $0xa,%dil
  je     L75
  mov    $0x1,%r9d
  sub    %eax,%r9d
  xchg   %ax,%ax
L41:
  lea    (%r9,%rax,1),%r8d
  movzbl 0x1(%rax),%edi
  add    $0x1,%rax
  and    $0xffffffef,%edi
  cmp    $0xa,%dil
  jne    L41
  mov    %ecx,(%rsi)
  mov    %r8d,(%rdx)
  ret
```

assistant: ```c
void keylen(record, l1, l2) char *record;
int *l1, *l2;
{
  char *wp;
  int c1, c2;
  c1 = c2 = 0;
  wp = record;
  while (*wp != '=' && *wp != '\n' && *wp != 26) {
    ++c1;
    ++wp;
  }
  if (*wp != '=') {
    *l1 = c1;
    *l2 = c2;
    return;
  }
  ++wp;
  while (*wp != '\n' && *wp != 26) {
    ++c2;
    ++wp;
  }
  *l1 = c1;
  *l2 = c2;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<keylen>:
  endbr64
  movzbl (%rdi),%eax
  cmp    $0xa,%al
  je     L8
  xor    %ecx,%ecx
  cmp    $0x3d,%al
  jne    L71
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L38:
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  add    $0x1,%ecx
  cmp    $0x3d,%al
  je     L56
  cmp    $0xa,%al
  je     L18
L71:
  cmp    $0x1a,%al
  jne    L38
L9:
  xor    %r8d,%r8d
  mov    %ecx,(%rsi)
  mov    %r8d,(%rdx)
  ret
L8:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L18:
  cmp    $0x3d,%al
  jne    L9
L56:
  lea    0x1(%rdi),%rax
  movzbl 0x1(%rdi),%edi
  and    $0xffffffef,%edi
  cmp    $0xa,%dil
  je     L9
  mov    $0x1,%r9d
  sub    %eax,%r9d
  xchg   %ax,%ax
L22:
  lea    (%r9,%rax,1),%r8d
  movzbl 0x1(%rax),%edi
  add    $0x1,%rax
  and    $0xffffffef,%edi
  cmp    $0xa,%dil
  jne    L22
  mov    %ecx,(%rsi)
  mov    %r8d,(%rdx)
  ret
```

assistant: ```c
void keylen(record, l1, l2) char *record;
int *l1, *l2;
{
  char *wp;
  int c1, c2;
  c1 = c2 = 0;
  wp = record;
  while (*wp != '=' && *wp != '\n' && *wp != 26) {
    ++c1;
    ++wp;
  }
  if (*wp != '=') {
    *l1 = c1;
    *l2 = c2;
    return;
  }
  ++wp;
  while (*wp != '\n' && *wp != 26) {
    ++c2;
    ++wp;
  }
  *l1 = c1;
  *l2 = c2;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<majority_result>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    -0x38(%rbp),%rdx
  mov    -0x4c(%rbp),%esi
  mov    -0x48(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdi
  call   <unique_values@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L11
L52:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    -0x4c(%rbp),%esi
  mov    -0x48(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdi
  call   <value_count@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x34(%rbp)
L11:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L52
  mov    -0x58(%rbp),%rax
  movl   $0x3,(%rax)
  mov    -0x60(%rbp),%rax
  movl   $0xffffffff,(%rax)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L18
L36:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x30(%rbp)
  jge    L49
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x30(%rbp)
L49:
  addl   $0x1,-0x2c(%rbp)
L18:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L36
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void majority_result(const struct sample *samples, int count, unsigned *field, int *val) {
  int unique;
  int *vals = unique_values(samples, count, &unique, 3);
  int *occurs = (int *)malloc(sizeof(int) * unique);
  for (int i = 0; i < unique; i++)
    occurs[i] = value_count(samples, count, vals[i], 3);
  *field = 3;
  *val = -1;
  int best = 0;
  for (int i = 0; i < unique; i++) {
    if (occurs[i] > best) {
      *val = vals[i];
      best = occurs[i];
    }
  }
  free(vals);
  free(occurs);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<majority_result>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r14
  mov    %esi,%r15d
  mov    %rdx,0x18(%rsp)
  mov    %rcx,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%rdx
  mov    $0x3,%ecx
  call   <unique_values@plt>
  mov    %rax,%r13
  mov    %rax,0x10(%rsp)
  mov    0x24(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  cmpl   $0x0,0x24(%rsp)
  jle    L9
  mov    %rax,%rbx
  mov    %rax,%rbp
  mov    $0x0,%r12d
  sub    %rax,%r13
L58:
  mov    0x0(%r13,%rbp,1),%edx
  mov    $0x3,%ecx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <value_count@plt>
  mov    %eax,0x0(%rbp)
  add    $0x1,%r12d
  mov    0x24(%rsp),%eax
  add    $0x4,%rbp
  cmp    %r12d,%eax
  jg     L58
  mov    0x18(%rsp),%rsi
  movl   $0x3,(%rsi)
  mov    (%rsp),%rsi
  movl   $0xffffffff,(%rsi)
  test   %eax,%eax
  jle    L42
  mov    %eax,%eax
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rax,4),%rdx
  mov    $0x0,%eax
  jmp    L37
L46:
  add    $0x4,%rbx
  cmp    %rdx,%rbx
  je     L42
L37:
  cmp    %eax,(%rbx)
  jle    L46
  mov    0x0(%r13,%rbx,1),%eax
  mov    (%rsp),%rcx
  mov    %eax,(%rcx)
  mov    (%rbx),%eax
  jmp    L46
L9:
  mov    0x18(%rsp),%rax
  movl   $0x3,(%rax)
  mov    (%rsp),%rax
  movl   $0xffffffff,(%rax)
L42:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L47
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void majority_result(const struct sample *samples, int count, unsigned *field, int *val) {
  int unique;
  int *vals = unique_values(samples, count, &unique, 3);
  int *occurs = (int *)malloc(sizeof(int) * unique);
  for (int i = 0; i < unique; i++)
    occurs[i] = value_count(samples, count, vals[i], 3);
  *field = 3;
  *val = -1;
  int best = 0;
  for (int i = 0; i < unique; i++) {
    if (occurs[i] > best) {
      *val = vals[i];
      best = occurs[i];
    }
  }
  free(vals);
  free(occurs);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<majority_result>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %rdx,0x18(%rsp)
  lea    0x24(%rsp),%rdx
  mov    %rcx,(%rsp)
  mov    $0x3,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <unique_values@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%r14
  mov    0x24(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    0x24(%rsp),%edx
  mov    %rax,0x8(%rsp)
  test   %edx,%edx
  jle    L7
  mov    %rax,%r15
  mov    %rax,%r12
  xor    %r13d,%r13d
  sub    %rax,%r14
  nopl   0x0(%rax)
L64:
  mov    (%r14,%r12,1),%edx
  mov    $0x3,%ecx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  add    $0x1,%r13d
  add    $0x4,%r12
  call   <value_count@plt>
  mov    %eax,-0x4(%r12)
  mov    0x24(%rsp),%eax
  cmp    %r13d,%eax
  jg     L64
  mov    0x18(%rsp),%rsi
  movl   $0x3,(%rsi)
  mov    (%rsp),%rsi
  movl   $0xffffffff,(%rsi)
  test   %eax,%eax
  jle    L3
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rax,4),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L43:
  cmp    %eax,(%r15)
  jle    L50
  mov    (%r14,%r15,1),%eax
  mov    (%rsp),%rbx
  mov    %eax,(%rbx)
  mov    (%r15),%eax
L50:
  add    $0x4,%r15
  cmp    %rdx,%r15
  jne    L43
L3:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L7:
  mov    0x18(%rsp),%rax
  movl   $0x3,(%rax)
  mov    (%rsp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L3
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void majority_result(const struct sample *samples, int count, unsigned *field, int *val) {
  int unique;
  int *vals = unique_values(samples, count, &unique, 3);
  int *occurs = (int *)malloc(sizeof(int) * unique);
  for (int i = 0; i < unique; i++)
    occurs[i] = value_count(samples, count, vals[i], 3);
  *field = 3;
  *val = -1;
  int best = 0;
  for (int i = 0; i < unique; i++) {
    if (occurs[i] > best) {
      *val = vals[i];
      best = occurs[i];
    }
  }
  free(vals);
  free(occurs);
}
```
user: Translate the below assembly code into C programming language:

```asm
<majority_result>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %rdx,0x18(%rsp)
  lea    0x24(%rsp),%rdx
  mov    %rcx,(%rsp)
  mov    $0x3,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <unique_values@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%r14
  mov    0x24(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    0x24(%rsp),%edx
  mov    %rax,0x8(%rsp)
  test   %edx,%edx
  jle    L28
  mov    %rax,%r15
  mov    %rax,%r12
  xor    %r13d,%r13d
  sub    %rax,%r14
  nopl   0x0(%rax)
L37:
  mov    (%r14,%r12,1),%edx
  mov    $0x3,%ecx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  add    $0x1,%r13d
  add    $0x4,%r12
  call   <value_count@plt>
  mov    %eax,-0x4(%r12)
  mov    0x24(%rsp),%eax
  cmp    %r13d,%eax
  jg     L37
  mov    0x18(%rsp),%rsi
  movl   $0x3,(%rsi)
  mov    (%rsp),%rsi
  movl   $0xffffffff,(%rsi)
  test   %eax,%eax
  jle    L8
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rax,4),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L38:
  cmp    %eax,(%r15)
  jle    L66
  mov    (%r14,%r15,1),%eax
  mov    (%rsp),%rbx
  mov    %eax,(%rbx)
  mov    (%r15),%eax
L66:
  add    $0x4,%r15
  cmp    %rdx,%r15
  jne    L38
L8:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L28:
  mov    0x18(%rsp),%rax
  movl   $0x3,(%rax)
  mov    (%rsp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L8
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void majority_result(const struct sample *samples, int count, unsigned *field, int *val) {
  int unique;
  int *vals = unique_values(samples, count, &unique, 3);
  int *occurs = (int *)malloc(sizeof(int) * unique);
  for (int i = 0; i < unique; i++)
    occurs[i] = value_count(samples, count, vals[i], 3);
  *field = 3;
  *val = -1;
  int best = 0;
  for (int i = 0; i < unique; i++) {
    if (occurs[i] > best) {
      *val = vals[i];
      best = occurs[i];
    }
  }
  free(vals);
  free(occurs);
}
```