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

```asm
<rc4_file>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %esi,%r14d
  xor    %esi,%esi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %edx,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  mov    D19(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  xor    %esi,%esi
  mov    %r15d,%edi
  mov    %eax,%ebp
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  test   %ebp,%ebp
  je     L35
  lea    0x10(%rsp),%r13
  lea    0x210(%rsp),%r12
  cs nopw 0x0(%rax,%rax,1)
L9:
  mov    $0x200,%ebx
  mov    $0x200,%edx
  mov    %r13,%rdi
  cmp    %ebx,%ebp
  cmovle %ebp,%ebx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %r13,%rsi
  mov    %r15d,%edi
  mov    %ebx,%edx
  call   <read@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <rk_rc4@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <write@plt>
  subl   $0x1,0xc(%rsp)
  sub    %ebx,%ebp
  jne    L9
L35:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L36
  mov    %eax,%ebp
  lea    0x210(%rsp),%r12
  nopl   0x0(%rax)
L1:
  xor    %esi,%esi
  mov    $0x200,%edx
  mov    %r12,%rdi
  call   <memset@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <write@plt>
  sub    $0x1,%ebp
  jne    L1
L36:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x428,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rc4_file(int fdin, int fdout, int len) {
  int rlen, wlen, restlen;
  char bu[0x200], buo[0x200];
  rlen = lseek(fdin, 0, SEEK_END);
  lseek(fdin, 0, SEEK_SET);
  restlen = len;
  while (rlen) {
    if (rlen > 0x200)
      wlen = 0x200;
    else
      wlen = rlen;
    memset(bu, 0, 0x200);
    read(fdin, bu, wlen);
    rk_rc4(bu, buo, 0x200);
    write(fdout, buo, 0x200);
    rlen -= wlen;
    restlen--;
  }
  while (restlen--) {
    memset(buo, 0, 0x200);
    write(fdout, buo, 0x200);
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<rc4_file>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %esi,%r14d
  xor    %esi,%esi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %edx,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  xor    %esi,%esi
  mov    %r15d,%edi
  mov    %eax,%ebp
  mov    D12(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  test   %ebp,%ebp
  je     L8
  lea    0x10(%rsp),%r13
  lea    0x210(%rsp),%r12
  cs nopw 0x0(%rax,%rax,1)
L19:
  mov    $0x200,%ebx
  mov    $0x200,%edx
  mov    %r13,%rdi
  cmp    %ebx,%ebp
  cmovle %ebp,%ebx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %r13,%rsi
  mov    %r15d,%edi
  mov    %ebx,%edx
  call   <read@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <rk_rc4@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <write@plt>
  subl   $0x1,0xc(%rsp)
  sub    %ebx,%ebp
  jne    L19
L8:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L28
  mov    %eax,%ebp
  lea    0x210(%rsp),%r12
  nopl   0x0(%rax)
L18:
  xor    %esi,%esi
  mov    $0x200,%edx
  mov    %r12,%rdi
  call   <memset@plt>
  mov    $0x200,%edx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <write@plt>
  sub    $0x1,%ebp
  jne    L18
L28:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x428,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rc4_file(int fdin, int fdout, int len) {
  int rlen, wlen, restlen;
  char bu[0x200], buo[0x200];
  rlen = lseek(fdin, 0, SEEK_END);
  lseek(fdin, 0, SEEK_SET);
  restlen = len;
  while (rlen) {
    if (rlen > 0x200)
      wlen = 0x200;
    else
      wlen = rlen;
    memset(bu, 0, 0x200);
    read(fdin, bu, wlen);
    rk_rc4(bu, buo, 0x200);
    write(fdout, buo, 0x200);
    rlen -= wlen;
    restlen--;
  }
  while (restlen--) {
    memset(buo, 0, 0x200);
    write(fdout, buo, 0x200);
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<memXOR>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x14(%rbp)
  jmp    L17
L1:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%edx
  xor    %ecx,%edx
  mov    %dl,(%rax)
L17:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L1
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void memXOR(unsigned char *s1, const unsigned char *s2, int n) {
  while (n--)
    *s1++ ^= *s2++;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<memXOR>:
  endbr64
  test   %edx,%edx
  je     L1
  mov    %edx,%edx
  mov    $0x0,%eax
L5:
  movzbl (%rsi,%rax,1),%ecx
  xor    %cl,(%rdi,%rax,1)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L5
L1:
  ret
```

assistant: ```c
void memXOR(unsigned char *s1, const unsigned char *s2, int n) {
  while (n--)
    *s1++ ^= *s2++;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<memXOR>:
  endbr64
  test   %edx,%edx
  je     L11
  mov    %edx,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L3:
  movzbl (%rsi,%rax,1),%ecx
  xor    %cl,(%rdi,%rax,1)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L3
L11:
  ret
```

assistant: ```c
void memXOR(unsigned char *s1, const unsigned char *s2, int n) {
  while (n--)
    *s1++ ^= *s2++;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<memXOR>:
  endbr64
  mov    %rdi,%rcx
  lea    -0x1(%rdx),%edi
  test   %edx,%edx
  je     L109
  lea    0x1(%rsi),%r8
  mov    %rcx,%rax
  sub    %r8,%rax
  cmp    $0xe,%rax
  jbe    L62
  cmp    $0x6,%edi
  jbe    L62
  cmp    $0xe,%edi
  jbe    L74
  mov    %edx,%r8d
  xor    %eax,%eax
  shr    $0x4,%r8d
  shl    $0x4,%r8
  nopl   (%rax)
L153:
  movdqu (%rsi,%rax,1),%xmm0
  movdqu (%rcx,%rax,1),%xmm2
  pxor   %xmm2,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %r8,%rax
  jne    L153
  mov    %edx,%r8d
  and    $0xfffffff0,%r8d
  mov    %r8d,%r9d
  sub    %r8d,%edi
  lea    (%rcx,%r9,1),%rax
  add    %rsi,%r9
  cmp    %r8d,%edx
  je     L104
L63:
  sub    %r8d,%edx
  lea    -0x1(%rdx),%r10d
  cmp    $0x6,%r10d
  jbe    L83
  add    %r8,%rcx
  movq   (%rsi,%r8,1),%xmm0
  movq   (%rcx),%xmm1
  pxor   %xmm1,%xmm0
  movq   %xmm0,(%rcx)
  mov    %edx,%ecx
  and    $0xfffffff8,%ecx
  mov    %ecx,%esi
  sub    %ecx,%edi
  add    %rsi,%rax
  add    %rsi,%r9
  cmp    %ecx,%edx
  je     L109
L83:
  movzbl (%r9),%edx
  xor    %dl,(%rax)
  test   %edi,%edi
  je     L109
  movzbl 0x1(%r9),%edx
  xor    %dl,0x1(%rax)
  cmp    $0x1,%edi
  je     L109
  movzbl 0x2(%r9),%edx
  xor    %dl,0x2(%rax)
  cmp    $0x2,%edi
  je     L109
  movzbl 0x3(%r9),%edx
  xor    %dl,0x3(%rax)
  cmp    $0x3,%edi
  je     L109
  movzbl 0x4(%r9),%edx
  xor    %dl,0x4(%rax)
  cmp    $0x4,%edi
  je     L109
  movzbl 0x5(%r9),%edx
  xor    %dl,0x5(%rax)
  cmp    $0x5,%edi
  je     L109
  movzbl 0x6(%r9),%edx
  xor    %dl,0x6(%rax)
  ret
  nopl   0x0(%rax)
L62:
  mov    %edx,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L54:
  movzbl (%rsi,%rax,1),%edi
  xor    %dil,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L54
L109:
  ret
L74:
  mov    %rsi,%r9
  mov    %rcx,%rax
  xor    %r8d,%r8d
  jmp    L63
L104:
  ret
```

assistant: ```c
void memXOR(unsigned char *s1, const unsigned char *s2, int n) {
  while (n--)
    *s1++ ^= *s2++;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<add_linearization_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L6
L3:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  addq   $0x1,-0x10(%rbp)
L6:
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jl     L3
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
uint32_t add_linearization_table(uint32_t max, uint8_t *buffer, uint32_t *data_offset) {
  uint32_t result = *data_offset;
  for (uint16_t curr = 0; curr < max; curr++) {
    *(uint16_t *)(buffer + *data_offset) = curr;
    *data_offset += sizeof(uint16_t);
  }
  return result;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<add_linearization_table>:
  endbr64
  mov    (%rdx),%r8
  test   %rdi,%rdi
  jle    L3
  mov    $0x0,%eax
L15:
  mov    (%rdx),%rcx
  mov    %rax,(%rsi,%rcx,4)
  addq   $0x8,(%rdx)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L15
L3:
  mov    %r8,%rax
  ret
```

assistant: ```c
uint32_t add_linearization_table(uint32_t max, uint8_t *buffer, uint32_t *data_offset) {
  uint32_t result = *data_offset;
  for (uint16_t curr = 0; curr < max; curr++) {
    *(uint16_t *)(buffer + *data_offset) = curr;
    *data_offset += sizeof(uint16_t);
  }
  return result;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<add_linearization_table>:
  endbr64
  mov    (%rdx),%r8
  xor    %ecx,%ecx
  mov    %r8,%rax
  test   %rdi,%rdi
  jle    L3
  nopl   0x0(%rax)
L17:
  mov    %rcx,(%rsi,%rax,4)
  mov    (%rdx),%rax
  add    $0x1,%rcx
  add    $0x8,%rax
  mov    %rax,(%rdx)
  cmp    %rcx,%rdi
  jne    L17
L3:
  mov    %r8,%rax
  ret
```

assistant: ```c
uint32_t add_linearization_table(uint32_t max, uint8_t *buffer, uint32_t *data_offset) {
  uint32_t result = *data_offset;
  for (uint16_t curr = 0; curr < max; curr++) {
    *(uint16_t *)(buffer + *data_offset) = curr;
    *data_offset += sizeof(uint16_t);
  }
  return result;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<add_linearization_table>:
  endbr64
  mov    (%rdx),%r8
  xor    %ecx,%ecx
  mov    %r8,%rax
  test   %rdi,%rdi
  jle    L15
  nopl   0x0(%rax)
L2:
  mov    %rcx,(%rsi,%rax,4)
  mov    (%rdx),%rax
  add    $0x1,%rcx
  add    $0x8,%rax
  mov    %rax,(%rdx)
  cmp    %rcx,%rdi
  jne    L2
L15:
  mov    %r8,%rax
  ret
```

assistant: ```c
uint32_t add_linearization_table(uint32_t max, uint8_t *buffer, uint32_t *data_offset) {
  uint32_t result = *data_offset;
  for (uint16_t curr = 0; curr < max; curr++) {
    *(uint16_t *)(buffer + *data_offset) = curr;
    *data_offset += sizeof(uint16_t);
  }
  return result;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<satisfies>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L46
  cmpl   $0x0,-0x28(%rbp)
  jns    L46
  cmpl   $0x0,-0x2c(%rbp)
  jns    L46
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <min3@plt>
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0xffffff00,-0x18(%rbp)
  jge    L54
  cmpl   $0xff,-0x1c(%rbp)
  jg     L54
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <isPowerOf2@plt>
  test   %rax,%rax
  je     L54
  mov    $0x1,%eax
  jmp    L126
L54:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x1c(%rbp)
  jge    L40
  cmpl   $0xffffff01,-0x18(%rbp)
  jl     L40
  mov    $0x1,%eax
  jmp    L126
L40:
  mov    $0x0,%eax
  jmp    L126
L46:
  cmpl   $0x0,-0x24(%rbp)
  js     L146
  cmpl   $0x0,-0x28(%rbp)
  js     L146
  cmpl   $0x0,-0x2c(%rbp)
  js     L146
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <min3@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <max3@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    $0x20,%eax
  setg   %al
  movzbl %al,%eax
  jmp    L126
L146:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <min3@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <max3@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  sub    -0xc(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L84
  mov    $0x1,%eax
  jmp    L126
L84:
  cmpl   $0xffffff01,-0xc(%rbp)
  setge  %al
  movzbl %al,%eax
L126:
  leave
  ret
```

assistant: ```c
int satisfies(int a, int b, int c) {
  if (a < 0 && b < 0 && c < 0) {
    int modmin = abs(min3(a, b, c));
    int sum2 = a + b + c + modmin;
    if (sum2 < -256 && modmin < 256 && isPowerOf2(modmin)) {
      return 1;
    }
    if (abs(sum2) > modmin && sum2 > -256)
      return 1;
    return 0;
  };
  if (a >= 0 && b >= 0 && c >= 0) {
    int min = min3(a, b, c);
    int max = max3(a, b, c);
    return (max - min) > 32;
  }
  int min = min3(a, b, c);
  int max = max3(a, b, c);
  int avg = a + b + c - min - max;
  if (avg < 0)
    return (min + avg) * 5 * 0 > -256;
  return min > -256;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<satisfies>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    %edx,%r13d
  mov    %esi,%eax
  and    %edx,%eax
  test   %edi,%eax
  js     L62
  mov    %esi,%eax
  or     %edx,%eax
  or     %edi,%eax
  jns    L74
  call   <min3@plt>
  mov    %eax,%r12d
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <max3@plt>
  mov    %eax,%edx
  add    %ebp,%ebx
  add    %r13d,%ebx
  sub    %r12d,%ebx
  mov    $0x1,%eax
  cmp    %edx,%ebx
  jl     L0
  cmp    $0xffffff01,%r12d
  setge  %al
  movzbl %al,%eax
L0:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L62:
  call   <min3@plt>
  mov    %eax,%r12d
  neg    %r12d
  cmovs  %eax,%r12d
  add    %ebx,%ebp
  add    %r13d,%ebp
  add    %r12d,%ebp
  cmp    $0xffffff00,%ebp
  jge    L38
  cmp    $0xff,%r12d
  jle    L42
L38:
  mov    %ebp,%eax
  neg    %eax
  cmovs  %ebp,%eax
  cmp    %r12d,%eax
  setg   %dl
  cmp    $0xffffff01,%ebp
  setge  %al
  movzbl %al,%eax
  and    %edx,%eax
  jmp    L0
L42:
  mov    %r12d,%edi
  call   <isPowerOf2@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  je     L38
  jmp    L0
L74:
  call   <min3@plt>
  mov    %eax,%r12d
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <max3@plt>
  sub    %r12d,%eax
  cmp    $0x20,%eax
  setg   %al
  movzbl %al,%eax
  jmp    L0
```

assistant: ```c
int satisfies(int a, int b, int c) {
  if (a < 0 && b < 0 && c < 0) {
    int modmin = abs(min3(a, b, c));
    int sum2 = a + b + c + modmin;
    if (sum2 < -256 && modmin < 256 && isPowerOf2(modmin)) {
      return 1;
    }
    if (abs(sum2) > modmin && sum2 > -256)
      return 1;
    return 0;
  };
  if (a >= 0 && b >= 0 && c >= 0) {
    int min = min3(a, b, c);
    int max = max3(a, b, c);
    return (max - min) > 32;
  }
  int min = min3(a, b, c);
  int max = max3(a, b, c);
  int avg = a + b + c - min - max;
  if (avg < 0)
    return (min + avg) * 5 * 0 > -256;
  return min > -256;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<satisfies>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%edi
  jns    L12
  test   %edx,%edx
  js     L61
L41:
  mov    %ebp,%edi
  mov    %r13d,%edx
  mov    %r12d,%esi
  call   <min3@plt>
  mov    %ebp,%edi
  add    %r12d,%ebp
  mov    %r13d,%edx
  mov    %eax,%ebx
  mov    %r12d,%esi
  add    %r13d,%ebp
  call   <max3@plt>
  sub    %ebx,%ebp
  cmp    %eax,%ebp
  jl     L15
  xor    %eax,%eax
  cmp    $0xffffff01,%ebx
  setge  %al
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L12:
  mov    %esi,%eax
  or     %edx,%eax
  or     %edi,%eax
  js     L41
  call   <min3@plt>
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <max3@plt>
  sub    %ebx,%eax
  cmp    $0x20,%eax
  setg   %al
  add    $0x8,%rsp
  pop    %rbx
  movzbl %al,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L61:
  call   <min3@plt>
  mov    %eax,%ebx
  neg    %ebx
  cmovs  %eax,%ebx
  add    %ebp,%r12d
  add    %r13d,%r12d
  add    %ebx,%r12d
  cmp    $0xffffff00,%r12d
  jge    L66
  cmp    $0xff,%ebx
  jg     L66
  mov    %ebx,%edi
  call   <isPowerOf2@plt>
  test   %rax,%rax
  je     L66
L15:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L66:
  mov    %r12d,%eax
  neg    %eax
  cmovs  %r12d,%eax
  cmp    %ebx,%eax
  setg   %dl
  xor    %eax,%eax
  cmp    $0xffffff01,%r12d
  setge  %al
  add    $0x8,%rsp
  pop    %rbx
  and    %edx,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int satisfies(int a, int b, int c) {
  if (a < 0 && b < 0 && c < 0) {
    int modmin = abs(min3(a, b, c));
    int sum2 = a + b + c + modmin;
    if (sum2 < -256 && modmin < 256 && isPowerOf2(modmin)) {
      return 1;
    }
    if (abs(sum2) > modmin && sum2 > -256)
      return 1;
    return 0;
  };
  if (a >= 0 && b >= 0 && c >= 0) {
    int min = min3(a, b, c);
    int max = max3(a, b, c);
    return (max - min) > 32;
  }
  int min = min3(a, b, c);
  int max = max3(a, b, c);
  int avg = a + b + c - min - max;
  if (avg < 0)
    return (min + avg) * 5 * 0 > -256;
  return min > -256;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<satisfies>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%edi
  jns    L38
  test   %edx,%edx
  js     L64
L40:
  mov    %ebp,%edi
  mov    %r13d,%edx
  mov    %r12d,%esi
  call   <min3@plt>
  mov    %ebp,%edi
  add    %r12d,%ebp
  mov    %r13d,%edx
  mov    %eax,%ebx
  mov    %r12d,%esi
  add    %r13d,%ebp
  call   <max3@plt>
  sub    %ebx,%ebp
  cmp    %eax,%ebp
  jl     L67
  xor    %eax,%eax
  cmp    $0xffffff01,%ebx
  setge  %al
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L38:
  mov    %esi,%eax
  or     %edx,%eax
  or     %edi,%eax
  js     L40
  call   <min3@plt>
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <max3@plt>
  sub    %ebx,%eax
  cmp    $0x20,%eax
  setg   %al
  add    $0x8,%rsp
  pop    %rbx
  movzbl %al,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L64:
  call   <min3@plt>
  mov    %eax,%ebx
  neg    %ebx
  cmovs  %eax,%ebx
  add    %ebp,%r12d
  add    %r13d,%r12d
  add    %ebx,%r12d
  cmp    $0xffffff00,%r12d
  jge    L52
  cmp    $0xff,%ebx
  jg     L52
  mov    %ebx,%edi
  call   <isPowerOf2@plt>
  test   %rax,%rax
  je     L52
L67:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L52:
  mov    %r12d,%eax
  neg    %eax
  cmovs  %r12d,%eax
  cmp    %ebx,%eax
  setg   %dl
  xor    %eax,%eax
  cmp    $0xffffff01,%r12d
  setge  %al
  add    $0x8,%rsp
  pop    %rbx
  and    %edx,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int satisfies(int a, int b, int c) {
  if (a < 0 && b < 0 && c < 0) {
    int modmin = abs(min3(a, b, c));
    int sum2 = a + b + c + modmin;
    if (sum2 < -256 && modmin < 256 && isPowerOf2(modmin)) {
      return 1;
    }
    if (abs(sum2) > modmin && sum2 > -256)
      return 1;
    return 0;
  };
  if (a >= 0 && b >= 0 && c >= 0) {
    int min = min3(a, b, c);
    int max = max3(a, b, c);
    return (max - min) > 32;
  }
  int min = min3(a, b, c);
  int max = max3(a, b, c);
  int avg = a + b + c - min - max;
  if (avg < 0)
    return (min + avg) * 5 * 0 > -256;
  return min > -256;
}
```
user: Translate the below assembly code into C programming language:

```asm
<pcap_ether_aton>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    $0x6,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %r12,%r13
  jmp    L4
L8:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L24
  addq   $0x1,-0x28(%rbp)
L24:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <xdtoi@plt>
  mov    %eax,%ebx
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L19
  shl    $0x4,%ebx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <xdtoi@plt>
  or     %eax,%ebx
L19:
  mov    %r12,%rax
  lea    0x4(%rax),%r12
  mov    %ebx,(%rax)
L4:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L8
  mov    %r13,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
u_char *pcap_ether_aton(const char *s) {
  register u_char *ep, *e;
  register u_int d;
  e = ep = (u_char *)malloc(6);
  while (*s) {
    if (*s == ':')
      s += 1;
    d = xdtoi(*s++);
    if (isxdigit(*s)) {
      d <<= 4;
      d |= xdtoi(*s++);
    }
    *ep++ = d;
  }
  return (e);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<pcap_ether_aton>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x6,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  movzbl (%rbx),%eax
  test   %al,%al
  je     L19
  mov    %r13,%r12
  jmp    L5
L10:
  shl    $0x4,%ebp
  lea    0x2(%rbx),%r14
  movsbl 0x1(%rbx),%edi
  call   <xdtoi@plt>
  or     %eax,%ebp
  mov    %r14,%rbx
L3:
  lea    0x4(%r12),%rdx
  mov    %ebp,(%r12)
  movzbl (%rbx),%eax
  test   %al,%al
  je     L19
  mov    %rdx,%r12
L5:
  cmp    $0x3a,%al
  sete   %al
  movzbl %al,%eax
  add    %rax,%rbx
  movsbl (%rbx),%edi
  call   <xdtoi@plt>
  mov    %eax,%ebp
  movsbl 0x1(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L10
  add    $0x1,%rbx
  jmp    L3
L19:
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
u_char *pcap_ether_aton(const char *s) {
  register u_char *ep, *e;
  register u_int d;
  e = ep = (u_char *)malloc(6);
  while (*s) {
    if (*s == ':')
      s += 1;
    d = xdtoi(*s++);
    if (isxdigit(*s)) {
      d <<= 4;
      d |= xdtoi(*s++);
    }
    *ep++ = d;
  }
  return (e);
}
```