ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<mutt_put_file_in_place>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  mov    %rbp,%rdi
  call   <safe_rename@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <unlink@plt>
  mov    %r13,%rdi
  call   <rmdir@plt>
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int mutt_put_file_in_place(const char *path, const char *safe_file, const char *safe_dir) {
  int rv;
  rv = safe_rename(safe_file, path);
  unlink(safe_file);
  rmdir(safe_dir);
  return rv;
}
```
user: Translate the below assembly code into C programming language:

```asm
<swap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void swap(char **a, char **b) {
  char *temp = *b;
  *b = *a;
  *a = temp;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<swap>:
  endbr64
  mov    (%rsi),%rax
  mov    (%rdi),%rdx
  mov    %rdx,(%rsi)
  mov    %rax,(%rdi)
  ret
```

assistant: ```c
void swap(char **a, char **b) {
  char *temp = *b;
  *b = *a;
  *a = temp;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<swap>:
  endbr64
  mov    (%rsi),%rax
  mov    (%rdi),%rdx
  mov    %rdx,(%rsi)
  mov    %rax,(%rdi)
  ret
```

assistant: ```c
void swap(char **a, char **b) {
  char *temp = *b;
  *b = *a;
  *a = temp;
}
```
user: Translate the below assembly code into C programming language:

```asm
<swap>:
  endbr64
  mov    (%rsi),%rax
  mov    (%rdi),%rdx
  mov    %rdx,(%rsi)
  mov    %rax,(%rdi)
  ret
```

assistant: ```c
void swap(char **a, char **b) {
  char *temp = *b;
  *b = *a;
  *a = temp;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rop3_59_1_0>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%ecx
  mov    %edx,%eax
  mov    %ecx,%edx
  mov    %dl,-0x1c(%rbp)
  mov    %al,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  not    %eax
  mov    %al,-0x3(%rbp)
  movzbl -0x20(%rbp),%eax
  or     -0x3(%rbp),%al
  mov    %al,-0x2(%rbp)
  movzbl -0x1c(%rbp),%eax
  and    -0x2(%rbp),%al
  mov    %al,-0x1(%rbp)
  notb   -0x1(%rbp)
  movzbl -0x1c(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  movzbl -0x1(%rbp),%eax
  and    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  and    -0x1c(%rbp),%al
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void rop3_59_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<rop3_59_1_0>:
  endbr64
  mov    %esi,%eax
  and    (%rdi),%al
  not    %esi
  or     %esi,%eax
  mov    %al,(%rdi)
  ret
```

assistant: ```c
void rop3_59_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rop3_59_1_0>:
  endbr64
  movzbl (%rdi),%eax
  and    %esi,%eax
  not    %esi
  or     %esi,%eax
  mov    %al,(%rdi)
  ret
```

assistant: ```c
void rop3_59_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<rop3_59_1_0>:
  endbr64
  movzbl (%rdi),%eax
  and    %esi,%eax
  not    %esi
  or     %esi,%eax
  mov    %al,(%rdi)
  ret
```

assistant: ```c
void rop3_59_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<median>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    (%rdi),%rbx
  cmp    $0x1,%esi
  jbe    L89
  lea    0x8(%rdi),%rdx
  lea    -0x2(%rsi),%eax
  lea    0x10(%rdi,%rax,8),%rcx
  mov    %rbx,%rbp
L15:
  mov    (%rdx),%rax
  cmp    %rax,%rbx
  cmovg  %rax,%rbx
  cmp    %rax,%rbp
  cmovl  %rax,%rbp
  add    $0x8,%rdx
  cmp    %rcx,%rdx
  jne    L15
L91:
  lea    0x1(%r12),%r14d
  shr    %r14d
  lea    -0x1(%r12),%eax
  lea    0x8(%r13,%rax,8),%r11
  jmp    L83
L89:
  mov    %rbx,%rbp
  jmp    L91
L42:
  jle    L11
  add    $0x1,%r8d
  cmp    %rdx,%r9
  cmovg  %rdx,%r9
L46:
  add    $0x8,%rax
  cmp    %r11,%rax
  je     L92
L115:
  mov    (%rax),%rdx
  cmp    %rcx,%rdx
  jge    L42
  add    $0x1,%edi
  cmp    %rdx,%rsi
  cmovl  %rdx,%rsi
  jmp    L46
L11:
  add    $0x1,%r10d
  jmp    L46
L92:
  cmp    %r8d,%edi
  mov    %r8d,%eax
  cmovae %edi,%eax
  cmp    %eax,%r14d
  jae    L50
  cmp    %r8d,%edi
  cmovbe %r9,%rbx
  cmova  %rsi,%rbp
L83:
  lea    (%rbx,%rbp,1),%rax
  mov    %rax,%rcx
  shr    $0x3f,%rcx
  add    %rax,%rcx
  sar    %rcx
  test   %r12d,%r12d
  je     L44
  mov    %r13,%rax
  mov    %rbp,%r9
  mov    %rbx,%rsi
  mov    $0x0,%r10d
  mov    $0x0,%r8d
  mov    $0x0,%edi
  jmp    L115
L44:
  mov    %r12d,%r10d
L60:
  cmp    %r12d,%r14d
  je     L23
  add    %r10d,%r12d
  cmp    %r12d,%r14d
  mov    %rbp,%rbx
  cmovbe %rcx,%rbx
L23:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L50:
  mov    %edi,%r12d
  mov    %r9,%rbp
  mov    %rsi,%rbx
  jmp    L60
```

assistant: ```c
long long median(long long array[], unsigned int count) {
  long long min;
  long long max;
  long long guess;
  long long maxltguess;
  long long mingtguess;
  unsigned int less;
  unsigned int greater;
  unsigned int equal;
  unsigned int i;
  min = array[0];
  max = array[0];
  for (i = 1; i < count; i++) {
    if (array[i] < min) {
      min = array[i];
    }
    if (array[i] > max) {
      max = array[i];
    }
  }
  while (1) {
    less = 0;
    greater = 0;
    equal = 0;
    guess = (min + max) / 2;
    maxltguess = min;
    mingtguess = max;
    for (i = 0; i < count; i++) {
      if (array[i] < guess) {
        less++;
        if (array[i] > maxltguess) {
          maxltguess = array[i];
        }
      } else if (array[i] > guess) {
        greater++;
        if (array[i] < mingtguess) {
          mingtguess = array[i];
        }
      } else {
        equal++;
      }
    }
    if (less <= (count + 1) / 2 && greater <= (count + 1) / 2) {
      break;
    } else if (less > greater) {
      max = maxltguess;
    } else {
      min = mingtguess;
    }
  }
  if (less >= (count + 1) / 2) {
    return (maxltguess);
  } else if (less + equal >= (count + 1) / 2) {
    return (guess);
  } else {
    return (mingtguess);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<median>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    (%rdi),%r14
  cmp    $0x1,%esi
  jbe    L109
  lea    0x8(%rdi),%r15
  lea    -0x2(%rsi),%eax
  mov    %r14,%rbx
  mov    %r14,%r12
  mov    %r15,%rdx
  lea    0x10(%rdi,%rax,8),%rcx
  nopl   0x0(%rax)
L19:
  mov    (%rdx),%rax
  cmp    %rax,%r12
  cmovg  %rax,%r12
  cmp    %rax,%rbx
  cmovl  %rax,%rbx
  add    $0x8,%rdx
  cmp    %rcx,%rdx
  jne    L19
L131:
  lea    0x1(%rbp),%r13d
  lea    -0x1(%rbp),%eax
  shr    %r13d
  lea    (%r15,%rax,8),%r9
L62:
  lea    (%rbx,%r12,1),%rax
  mov    %rax,%rdi
  shr    $0x3f,%rdi
  add    %rax,%rdi
  sar    %rdi
  test   %ebp,%ebp
  je     L68
  mov    %r15,%rax
  mov    %r14,%rdx
  mov    %rbx,%r10
  mov    %r12,%rsi
  xor    %r11d,%r11d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L118:
  add    $0x1,%ecx
  cmp    %rdx,%rsi
  cmovl  %rdx,%rsi
L81:
  cmp    %r9,%rax
  je     L134
L27:
  mov    (%rax),%rdx
  add    $0x8,%rax
L57:
  cmp    %rdx,%rdi
  jg     L118
  jge    L91
  add    $0x1,%r8d
  cmp    %rdx,%r10
  cmovg  %rdx,%r10
  cmp    %r9,%rax
  jne    L27
L134:
  cmp    %r8d,%ecx
  mov    %r8d,%eax
  cmovae %ecx,%eax
  cmp    %eax,%r13d
  jae    L70
  cmp    %r8d,%ecx
  cmovbe %r10,%r12
  cmova  %rsi,%rbx
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L91:
  add    $0x1,%r11d
  jmp    L81
  cs nopw 0x0(%rax,%rax,1)
L68:
  xor    %ecx,%ecx
L138:
  cmp    %ecx,%r13d
  je     L15
  add    %ebp,%ecx
  cmp    %ecx,%r13d
  cmovbe %rdi,%rbx
  mov    %rbx,%r12
L15:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L109:
  mov    %r14,%rbx
  mov    %r14,%r12
  lea    0x8(%rdi),%r15
  jmp    L131
L70:
  mov    %rsi,%r12
  mov    %r10,%rbx
  mov    %r11d,%ebp
  jmp    L138
```

assistant: ```c
long long median(long long array[], unsigned int count) {
  long long min;
  long long max;
  long long guess;
  long long maxltguess;
  long long mingtguess;
  unsigned int less;
  unsigned int greater;
  unsigned int equal;
  unsigned int i;
  min = array[0];
  max = array[0];
  for (i = 1; i < count; i++) {
    if (array[i] < min) {
      min = array[i];
    }
    if (array[i] > max) {
      max = array[i];
    }
  }
  while (1) {
    less = 0;
    greater = 0;
    equal = 0;
    guess = (min + max) / 2;
    maxltguess = min;
    mingtguess = max;
    for (i = 0; i < count; i++) {
      if (array[i] < guess) {
        less++;
        if (array[i] > maxltguess) {
          maxltguess = array[i];
        }
      } else if (array[i] > guess) {
        greater++;
        if (array[i] < mingtguess) {
          mingtguess = array[i];
        }
      } else {
        equal++;
      }
    }
    if (less <= (count + 1) / 2 && greater <= (count + 1) / 2) {
      break;
    } else if (less > greater) {
      max = maxltguess;
    } else {
      min = mingtguess;
    }
  }
  if (less >= (count + 1) / 2) {
    return (maxltguess);
  } else if (less + equal >= (count + 1) / 2) {
    return (guess);
  } else {
    return (mingtguess);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<median>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    (%rdi),%r12
  cmp    $0x1,%esi
  jbe    L103
  lea    0x8(%rdi),%rsi
  lea    -0x2(%rbp),%eax
  mov    %r12,%rbx
  mov    %rsi,%rdx
  lea    0x10(%rdi,%rax,8),%rcx
  nop
L69:
  mov    (%rdx),%rax
  cmp    %rax,%r12
  cmovg  %rax,%r12
  cmp    %rax,%rbx
  cmovl  %rax,%rbx
  add    $0x8,%rdx
  cmp    %rcx,%rdx
  jne    L69
L115:
  lea    0x1(%rbp),%r14d
  lea    -0x1(%rbp),%eax
  shr    %r14d
  lea    (%rsi,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L87:
  lea    (%rbx,%r12,1),%rax
  mov    %rax,%rdi
  shr    $0x3f,%rdi
  add    %rax,%rdi
  sar    %rdi
  test   %ebp,%ebp
  je     L66
  mov    %r13,%rax
  mov    %rbx,%r9
  mov    %r12,%rcx
  xor    %r10d,%r10d
  xor    %r8d,%r8d
  xor    %esi,%esi
  jmp    L3
  nopl   0x0(%rax,%rax,1)
L16:
  add    $0x1,%esi
  cmp    %rdx,%rcx
  cmovl  %rdx,%rcx
L117:
  add    $0x8,%rax
  cmp    %rax,%r11
  je     L11
L3:
  mov    (%rax),%rdx
  cmp    %rdx,%rdi
  jg     L16
  jge    L8
  add    $0x1,%r8d
  cmp    %rdx,%r9
  cmovg  %rdx,%r9
  add    $0x8,%rax
  cmp    %rax,%r11
  jne    L3
L11:
  cmp    %r8d,%esi
  mov    %r8d,%eax
  cmovae %esi,%eax
  cmp    %eax,%r14d
  jae    L46
  cmp    %r8d,%esi
  cmovbe %r9,%r12
  cmova  %rcx,%rbx
  jmp    L87
  nopl   0x0(%rax)
L8:
  add    $0x1,%r10d
  jmp    L117
  cs nopw 0x0(%rax,%rax,1)
L66:
  xor    %esi,%esi
L113:
  cmp    %esi,%r14d
  je     L77
  add    %esi,%ebp
  cmp    %ebp,%r14d
  cmovbe %rdi,%rbx
  mov    %rbx,%r12
L77:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L103:
  mov    %r12,%rbx
  lea    0x8(%rdi),%rsi
  jmp    L115
L46:
  mov    %rcx,%r12
  mov    %r9,%rbx
  mov    %r10d,%ebp
  jmp    L113
```

assistant: ```c
long long median(long long array[], unsigned int count) {
  long long min;
  long long max;
  long long guess;
  long long maxltguess;
  long long mingtguess;
  unsigned int less;
  unsigned int greater;
  unsigned int equal;
  unsigned int i;
  min = array[0];
  max = array[0];
  for (i = 1; i < count; i++) {
    if (array[i] < min) {
      min = array[i];
    }
    if (array[i] > max) {
      max = array[i];
    }
  }
  while (1) {
    less = 0;
    greater = 0;
    equal = 0;
    guess = (min + max) / 2;
    maxltguess = min;
    mingtguess = max;
    for (i = 0; i < count; i++) {
      if (array[i] < guess) {
        less++;
        if (array[i] > maxltguess) {
          maxltguess = array[i];
        }
      } else if (array[i] > guess) {
        greater++;
        if (array[i] < mingtguess) {
          mingtguess = array[i];
        }
      } else {
        equal++;
      }
    }
    if (less <= (count + 1) / 2 && greater <= (count + 1) / 2) {
      break;
    } else if (less > greater) {
      max = maxltguess;
    } else {
      min = mingtguess;
    }
  }
  if (less >= (count + 1) / 2) {
    return (maxltguess);
  } else if (less + equal >= (count + 1) / 2) {
    return (guess);
  } else {
    return (mingtguess);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<filtering_buff>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L29
L6:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  mov    %rax,%rdi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L17
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L17:
  addq   $0x1,-0x8(%rbp)
L29:
  mov    -0x8(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L6
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int filtering_buff(char *buff, size_t buff_size) {
  size_t i = 0;
  for (i = 0; i < buff_size; i++) {
    if (!isalnum((char *)buff[i]))
      buff[i] = ' ';
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<filtering_buff>:
  endbr64
  test   %rsi,%rsi
  je     L4
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  lea    (%rdi,%rsi,1),%rbp
  jmp    L34
L38:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L0
L34:
  movsbq (%rbx),%rdi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L38
  movb   $0x20,(%rbx)
  jmp    L38
L0:
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L4:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int filtering_buff(char *buff, size_t buff_size) {
  size_t i = 0;
  for (i = 0; i < buff_size; i++) {
    if (!isalnum((char *)buff[i]))
      buff[i] = ' ';
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<filtering_buff>:
  endbr64
  test   %rsi,%rsi
  je     L10
  push   %rbp
  lea    (%rdi,%rsi,1),%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cs nopw 0x0(%rax,%rax,1)
L23:
  movsbq (%rbx),%rdi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L18
  movb   $0x20,(%rbx)
L18:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L23
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L10:
  xor    %eax,%eax
  ret
```

assistant: ```c
int filtering_buff(char *buff, size_t buff_size) {
  size_t i = 0;
  for (i = 0; i < buff_size; i++) {
    if (!isalnum((char *)buff[i]))
      buff[i] = ' ';
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<filtering_buff>:
  endbr64
  test   %rsi,%rsi
  je     L9
  push   %rbp
  lea    (%rdi,%rsi,1),%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cs nopw 0x0(%rax,%rax,1)
L0:
  movsbq (%rbx),%rdi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L13
  movb   $0x20,(%rbx)
L13:
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L0
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L9:
  xor    %eax,%eax
  ret
```

assistant: ```c
int filtering_buff(char *buff, size_t buff_size) {
  size_t i = 0;
  for (i = 0; i < buff_size; i++) {
    if (!isalnum((char *)buff[i]))
      buff[i] = ' ';
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<majorityElement>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L127
  cmpl   $0x0,-0x3c(%rbp)
  jne    L148
L127:
  mov    -0x48(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  jmp    L2
L148:
  movl   $0x0,-0x18(%rbp)
  jmp    L112
L99:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L122
  addl   $0x1,-0x20(%rbp)
  jmp    L51
L122:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L78
  addl   $0x1,-0x1c(%rbp)
  jmp    L51
L78:
  cmpl   $0x0,-0x20(%rbp)
  jne    L155
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L51
L155:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L60
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  addl   $0x1,-0x1c(%rbp)
  jmp    L51
L60:
  subl   $0x1,-0x20(%rbp)
  subl   $0x1,-0x1c(%rbp)
L51:
  addl   $0x1,-0x18(%rbp)
L112:
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L99
  mov    -0x14(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <validate@plt>
  test   %rax,%rax
  je     L38
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
L38:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L3
  mov    -0x10(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <validate@plt>
  test   %rax,%rax
  je     L3
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
L3:
  mov    -0x48(%rbp),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
L2:
  leave
  ret
```

assistant: ```c
int *majorityElement(int *nums, int numsSize, int *returnSize) {
  int *ret, count = 0, c1 = 0, c2 = 0, i, curr, n1 = 0, n2 = 0;
  ret = (int *)malloc(2 * sizeof(int));
  if (!(nums && numsSize)) {
    *returnSize = 0;
    return ret;
  }
  for (i = 0; i < numsSize; ++i) {
    curr = nums[i];
    if (curr == n1)
      ++c1;
    else if (curr == n2)
      ++c2;
    else if (!c1) {
      n1 = curr;
      ++c1;
    } else if (!c2) {
      n2 = curr;
      ++c2;
    } else {
      --c1;
      --c2;
    }
  }
  if (validate(nums, numsSize, n1))
    ret[count++] = n1;
  if (n2 != n1 && validate(nums, numsSize, n2))
    ret[count++] = n2;
  *returnSize = count;
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<majorityElement>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %rdx,0x8(%rsp)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rbp,%rbp
  je     L175
  test   %r12d,%r12d
  je     L175
  jle    L158
  mov    %rbp,%rax
  lea    -0x1(%r12),%edx
  lea    0x4(%rbp,%rdx,4),%rsi
  mov    $0x0,%r13d
  mov    $0x0,%ebx
  mov    $0x0,%edi
  mov    $0x0,%ecx
  jmp    L33
L84:
  add    $0x1,%ecx
L155:
  add    $0x4,%rax
  cmp    %rsi,%rax
  je     L28
L33:
  mov    (%rax),%edx
  cmp    %ebx,%edx
  je     L84
  cmp    %r13d,%edx
  je     L6
  test   %ecx,%ecx
  je     L167
  test   %edi,%edi
  je     L63
  sub    $0x1,%ecx
  sub    $0x1,%edi
  jmp    L155
L6:
  add    $0x1,%edi
  jmp    L155
L167:
  mov    %edx,%ebx
  mov    $0x1,%ecx
  jmp    L155
L63:
  mov    %edx,%r13d
  mov    $0x1,%edi
  jmp    L155
L28:
  mov    %ebx,%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <validate@plt>
  mov    $0x0,%r15d
  test   %rax,%rax
  je     L65
L24:
  mov    %ebx,(%r14)
  mov    $0x1,%r15d
L65:
  cmp    %r13d,%ebx
  je     L98
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <validate@plt>
  test   %rax,%rax
  je     L98
  movslq %r15d,%rax
  mov    %r13d,(%r14,%rax,4)
  lea    0x1(%r15),%r15d
  jmp    L98
L61:
  mov    $0x0,%r13d
  mov    $0x0,%ebx
  jmp    L24
L175:
  mov    $0x0,%r15d
L98:
  mov    0x8(%rsp),%rax
  mov    %r15d,(%rax)
  mov    %r14,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L158:
  mov    $0x0,%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <validate@plt>
  test   %rax,%rax
  jne    L61
  mov    $0x0,%r15d
  jmp    L98
```

assistant: ```c
int *majorityElement(int *nums, int numsSize, int *returnSize) {
  int *ret, count = 0, c1 = 0, c2 = 0, i, curr, n1 = 0, n2 = 0;
  ret = (int *)malloc(2 * sizeof(int));
  if (!(nums && numsSize)) {
    *returnSize = 0;
    return ret;
  }
  for (i = 0; i < numsSize; ++i) {
    curr = nums[i];
    if (curr == n1)
      ++c1;
    else if (curr == n2)
      ++c2;
    else if (!c1) {
      n1 = curr;
      ++c1;
    } else if (!c2) {
      n2 = curr;
      ++c2;
    } else {
      --c1;
      --c2;
    }
  }
  if (validate(nums, numsSize, n1))
    ret[count++] = n1;
  if (n2 != n1 && validate(nums, numsSize, n2))
    ret[count++] = n2;
  *returnSize = count;
  return ret;
}
```