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

```asm
<__sn_outw>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    %rsi,%rdi
  call   <sn_io_addr@plt>
  test   %rax,%rax
  je     L7
  mov    %bx,(%rax)
  xor    %eax,%eax
  pop    %rbx
  jmp    1070 <sn_mmiob@plt>
  nop
L7:
  pop    %rbx
  ret
```

assistant: ```c
void __sn_outw(unsigned short val, unsigned long port) {
  volatile unsigned short *addr;
  if ((addr = sn_io_addr(port))) {
    *addr = val;
    sn_mmiob();
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<__sn_outw>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    %rsi,%rdi
  call   <sn_io_addr@plt>
  test   %rax,%rax
  je     L6
  mov    %bx,(%rax)
  xor    %eax,%eax
  pop    %rbx
  jmp    1070 <sn_mmiob@plt>
  nop
L6:
  pop    %rbx
  ret
```

assistant: ```c
void __sn_outw(unsigned short val, unsigned long port) {
  volatile unsigned short *addr;
  if ((addr = sn_io_addr(port))) {
    *addr = val;
    sn_mmiob();
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<str_n_cpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L21
  cmpq   $0x0,-0x20(%rbp)
  jne    L12
L21:
  mov    $0x0,%eax
  jmp    L40
L12:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L34
L36:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x8(%rbp)
  addq   $0x1,-0x20(%rbp)
  subq   $0x1,-0x28(%rbp)
L34:
  cmpq   $0x0,-0x28(%rbp)
  je     L31
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L36
L31:
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L40:
  pop    %rbp
  ret
```

assistant: ```c
char *str_n_cpy(char *dest, const char *src, size_t len) {
  char *temp;
  if (dest == NULL || src == NULL)
    return NULL;
  for (temp = dest; len && *src; ++temp, ++src, --len)
    *temp = *src;
  *temp = '\0';
  return dest;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<str_n_cpy>:
  endbr64
  test   %rdi,%rdi
  je     L30
  test   %rsi,%rsi
  je     L30
  test   %rdx,%rdx
  je     L58
  add    %rsi,%rdx
  mov    %rdi,%rcx
L47:
  movzbl (%rsi),%r8d
  test   %r8b,%r8b
  je     L0
  mov    %r8b,(%rcx)
  add    $0x1,%rcx
  add    $0x1,%rsi
  cmp    %rsi,%rdx
  jne    L47
L0:
  movb   $0x0,(%rcx)
  mov    %rdi,%rax
  ret
L58:
  mov    %rdi,%rcx
  jmp    L0
L30:
  mov    $0x0,%eax
  ret
```

assistant: ```c
char *str_n_cpy(char *dest, const char *src, size_t len) {
  char *temp;
  if (dest == NULL || src == NULL)
    return NULL;
  for (temp = dest; len && *src; ++temp, ++src, --len)
    *temp = *src;
  *temp = '\0';
  return dest;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<str_n_cpy>:
  endbr64
  test   %rdi,%rdi
  je     L14
  test   %rsi,%rsi
  je     L14
  test   %rdx,%rdx
  je     L7
  add    %rsi,%rdx
  mov    %rdi,%rcx
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L40:
  add    $0x1,%rsi
  mov    %r8b,(%rcx)
  add    $0x1,%rcx
  cmp    %rsi,%rdx
  je     L13
L32:
  movzbl (%rsi),%r8d
  test   %r8b,%r8b
  jne    L40
L13:
  movb   $0x0,(%rcx)
  mov    %rdi,%rax
  ret
L14:
  xor    %eax,%eax
  ret
L7:
  mov    %rdi,%rcx
  jmp    L13
```

assistant: ```c
char *str_n_cpy(char *dest, const char *src, size_t len) {
  char *temp;
  if (dest == NULL || src == NULL)
    return NULL;
  for (temp = dest; len && *src; ++temp, ++src, --len)
    *temp = *src;
  *temp = '\0';
  return dest;
}
```
user: Translate the below assembly code into C programming language:

```asm
<str_n_cpy>:
  endbr64
  test   %rdi,%rdi
  je     L30
  test   %rsi,%rsi
  je     L30
  test   %rdx,%rdx
  je     L13
  add    %rsi,%rdx
  mov    %rdi,%rcx
  jmp    L66
  nopl   0x0(%rax,%rax,1)
L63:
  add    $0x1,%rsi
  mov    %r8b,(%rcx)
  add    $0x1,%rcx
  cmp    %rsi,%rdx
  je     L12
L66:
  movzbl (%rsi),%r8d
  test   %r8b,%r8b
  jne    L63
L12:
  movb   $0x0,(%rcx)
  mov    %rdi,%rax
  ret
L30:
  xor    %eax,%eax
  ret
L13:
  mov    %rdi,%rcx
  jmp    L12
```

assistant: ```c
char *str_n_cpy(char *dest, const char *src, size_t len) {
  char *temp;
  if (dest == NULL || src == NULL)
    return NULL;
  for (temp = dest; len && *src; ++temp, ++src, --len)
    *temp = *src;
  *temp = '\0';
  return dest;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<readLineGeneric>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0xa,-0x14(%rbp)
  movl   $0xa,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L1
L117:
  addq   $0x1,-0x8(%rbp)
L1:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L117
  jmp    L68
L98:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L134
  cmpl   $0xa,-0x10(%rbp)
  jne    L122
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L90
L122:
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L90:
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  movl   $0xa,-0x14(%rbp)
  movl   $0xa,-0x10(%rbp)
  jmp    L114
L134:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L114
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L114
  cmpl   $0xa,-0x14(%rbp)
  jne    L50
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L114
L50:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x10(%rbp)
L114:
  addq   $0x1,-0x8(%rbp)
L68:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L98
  cmpl   $0xa,-0x10(%rbp)
  jne    L4
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L15
L4:
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L15:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void readLineGeneric(int *dest, char *source) {
  char *ptr = source;
  int count = 0;
  int digit10 = 10;
  int digit1 = 10;
  int num = 0;
  while (ptr[0] != '=') {
    ptr++;
  }
  while (ptr[0] != 0x0a) {
    if (ptr[0] == 0x2c) {
      if (digit1 == 10) {
        num = digit10;
      } else {
        num = digit10 * 10 + digit1;
      }
      (dest + count++)[0] = num;
      digit10 = 10;
      digit1 = 10;
    } else if (ptr[0] >= '0' && ptr[0] <= '9') {
      if (digit10 == 10) {
        digit10 = ptr[0] - '0';
      } else {
        digit1 = ptr[0] - '0';
      }
    }
    ptr++;
  }
  if (digit1 == 10) {
    num = digit10;
  } else {
    num = digit10 * 10 + digit1;
  }
  (dest + count)[0] = num;
}
```
user: What is the c source code of the assembly code below:

```asm
<readLineGeneric>:
  endbr64
  mov    %rdi,%r9
  cmpb   $0x3d,(%rsi)
  je     L20
L0:
  add    $0x1,%rsi
  cmpb   $0x3d,(%rsi)
  jne    L0
L20:
  movzbl (%rsi),%eax
  mov    $0xa,%edi
  mov    $0xa,%edx
  mov    $0x0,%ecx
  mov    $0xa,%r10d
  jmp    L108
L64:
  cmp    $0xa,%edi
  je     L15
  lea    (%rdx,%rdx,4),%eax
  lea    (%rdi,%rax,2),%edx
L15:
  movslq %ecx,%rax
  mov    %edx,(%r9,%rax,4)
  lea    0x1(%rcx),%ecx
  mov    %r10d,%edi
  mov    %r10d,%edx
L92:
  add    $0x1,%rsi
  movzbl (%rsi),%eax
  cmp    $0xa,%al
  je     L32
L108:
  cmp    $0x2c,%al
  je     L64
  lea    -0x30(%rax),%r8d
  cmp    $0x9,%r8b
  ja     L92
  cmp    $0xa,%edx
  je     L97
  movsbl %al,%eax
  lea    -0x30(%rax),%edi
  jmp    L92
L97:
  movsbl %al,%eax
  lea    -0x30(%rax),%edx
  jmp    L92
L32:
  cmp    $0xa,%edi
  je     L53
  lea    (%rdx,%rdx,4),%eax
  lea    (%rdi,%rax,2),%edx
L53:
  movslq %ecx,%rcx
  mov    %edx,(%r9,%rcx,4)
  ret
```

assistant: ```c
void readLineGeneric(int *dest, char *source) {
  char *ptr = source;
  int count = 0;
  int digit10 = 10;
  int digit1 = 10;
  int num = 0;
  while (ptr[0] != '=') {
    ptr++;
  }
  while (ptr[0] != 0x0a) {
    if (ptr[0] == 0x2c) {
      if (digit1 == 10) {
        num = digit10;
      } else {
        num = digit10 * 10 + digit1;
      }
      (dest + count++)[0] = num;
      digit10 = 10;
      digit1 = 10;
    } else if (ptr[0] >= '0' && ptr[0] <= '9') {
      if (digit10 == 10) {
        digit10 = ptr[0] - '0';
      } else {
        digit1 = ptr[0] - '0';
      }
    }
    ptr++;
  }
  if (digit1 == 10) {
    num = digit10;
  } else {
    num = digit10 * 10 + digit1;
  }
  (dest + count)[0] = num;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<readLineGeneric>:
  endbr64
  cmpb   $0x3d,(%rsi)
  je     L54
  nopl   0x0(%rax)
L33:
  add    $0x1,%rsi
  cmpb   $0x3d,(%rsi)
  jne    L33
L54:
  mov    $0xa,%r8d
  mov    $0xa,%edx
  xor    %ecx,%ecx
  mov    $0x3d,%eax
  jmp    L79
  nopl   (%rax)
L108:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L8
  cmp    $0xa,%edx
  je     L13
  movsbl %al,%r8d
L8:
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0xa,%al
  je     L4
L79:
  cmp    $0x2c,%al
  jne    L108
  cmp    $0xa,%r8d
  je     L42
  lea    (%rdx,%rdx,4),%eax
  lea    (%r8,%rax,2),%edx
L42:
  movslq %ecx,%rax
  add    $0x1,%rsi
  add    $0x1,%ecx
  mov    $0xa,%r8d
  mov    %edx,(%rdi,%rax,4)
  movzbl (%rsi),%eax
  mov    $0xa,%edx
  cmp    $0xa,%al
  jne    L79
L4:
  cmp    $0xa,%r8d
  je     L0
  lea    (%rdx,%rdx,4),%eax
  lea    (%r8,%rax,2),%edx
L0:
  movslq %ecx,%rcx
  mov    %edx,(%rdi,%rcx,4)
  ret
L13:
  movsbl %al,%edx
  jmp    L8
```

assistant: ```c
void readLineGeneric(int *dest, char *source) {
  char *ptr = source;
  int count = 0;
  int digit10 = 10;
  int digit1 = 10;
  int num = 0;
  while (ptr[0] != '=') {
    ptr++;
  }
  while (ptr[0] != 0x0a) {
    if (ptr[0] == 0x2c) {
      if (digit1 == 10) {
        num = digit10;
      } else {
        num = digit10 * 10 + digit1;
      }
      (dest + count++)[0] = num;
      digit10 = 10;
      digit1 = 10;
    } else if (ptr[0] >= '0' && ptr[0] <= '9') {
      if (digit10 == 10) {
        digit10 = ptr[0] - '0';
      } else {
        digit1 = ptr[0] - '0';
      }
    }
    ptr++;
  }
  if (digit1 == 10) {
    num = digit10;
  } else {
    num = digit10 * 10 + digit1;
  }
  (dest + count)[0] = num;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<readLineGeneric>:
  endbr64
  cmpb   $0x3d,(%rsi)
  je     L45
  nopl   0x0(%rax)
L102:
  add    $0x1,%rsi
  cmpb   $0x3d,(%rsi)
  jne    L102
L45:
  mov    $0xa,%r8d
  mov    $0xa,%edx
  xor    %ecx,%ecx
  mov    $0x3d,%eax
  jmp    L25
  nopl   (%rax)
L104:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L37
  cmp    $0xa,%edx
  je     L58
  movsbl %al,%r8d
L37:
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0xa,%al
  je     L106
L25:
  cmp    $0x2c,%al
  jne    L104
  cmp    $0xa,%r8d
  je     L85
  lea    (%rdx,%rdx,4),%eax
  lea    (%r8,%rax,2),%edx
L85:
  movslq %ecx,%rax
  add    $0x1,%rsi
  add    $0x1,%ecx
  mov    $0xa,%r8d
  mov    %edx,(%rdi,%rax,4)
  movzbl (%rsi),%eax
  mov    $0xa,%edx
  cmp    $0xa,%al
  jne    L25
L106:
  cmp    $0xa,%r8d
  je     L84
  lea    (%rdx,%rdx,4),%eax
  lea    (%r8,%rax,2),%edx
L84:
  movslq %ecx,%rcx
  mov    %edx,(%rdi,%rcx,4)
  ret
L58:
  movsbl %al,%edx
  jmp    L37
```

assistant: ```c
void readLineGeneric(int *dest, char *source) {
  char *ptr = source;
  int count = 0;
  int digit10 = 10;
  int digit1 = 10;
  int num = 0;
  while (ptr[0] != '=') {
    ptr++;
  }
  while (ptr[0] != 0x0a) {
    if (ptr[0] == 0x2c) {
      if (digit1 == 10) {
        num = digit10;
      } else {
        num = digit10 * 10 + digit1;
      }
      (dest + count++)[0] = num;
      digit10 = 10;
      digit1 = 10;
    } else if (ptr[0] >= '0' && ptr[0] <= '9') {
      if (digit10 == 10) {
        digit10 = ptr[0] - '0';
      } else {
        digit1 = ptr[0] - '0';
      }
    }
    ptr++;
  }
  if (digit1 == 10) {
    num = digit10;
  } else {
    num = digit10 * 10 + digit1;
  }
  (dest + count)[0] = num;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<dict_hash_murmur>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movq   $0xbadcafe,-0x20(%rbp)
  movq   $0x5bd1e995,-0x18(%rbp)
  movq   $0x18,-0x10(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L43
  cmpq   $0x0,-0x40(%rbp)
  jne    L52
L43:
  mov    $0x0,%eax
  jmp    L61
L52:
  mov    -0x20(%rbp),%rax
  xor    -0x40(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L10
L88:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%ecx
  shr    %cl,%rax
  xor    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x8(%rbp),%rax
  xor    %rax,-0x30(%rbp)
  addq   $0x10,-0x28(%rbp)
  subq   $0x4,-0x40(%rbp)
L10:
  cmpq   $0x3,-0x40(%rbp)
  ja     L88
  cmpq   $0x3,-0x40(%rbp)
  je     L33
  cmpq   $0x3,-0x40(%rbp)
  ja     L80
  cmpq   $0x1,-0x40(%rbp)
  je     L63
  cmpq   $0x2,-0x40(%rbp)
  je     L25
  jmp    L80
L33:
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  cltq
  xor    %rax,-0x30(%rbp)
L25:
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  cltq
  xor    %rax,-0x30(%rbp)
L63:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cltq
  xor    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L80:
  mov    -0x30(%rbp),%rax
  shr    $0xd,%rax
  xor    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  imul   -0x18(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  shr    $0xf,%rax
  xor    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
L61:
  pop    %rbp
  ret
```

assistant: ```c
uint32_t dict_hash_murmur(char *key, size_t len) {
  uint32_t h, k;
  uint8_t *data;
  uint32_t seed = 0x0badcafe;
  uint32_t m = 0x5bd1e995;
  uint32_t r = 24;
  if (!key || !len) {
    return 0;
  }
  h = seed ^ len;
  data = (uint8_t *)key;
  while (len >= 4) {
    k = *(uint32_t *)data;
    k *= m;
    k ^= k >> r;
    k *= m;
    h *= m;
    h ^= k;
    data += 4;
    len -= 4;
  }
  switch (len) {
  case 3:
    h ^= data[2] << 16;
  case 2:
    h ^= data[1] << 8;
  case 1:
    h ^= data[0];
    h *= m;
  };
  h ^= h >> 13;
  h *= m;
  h ^= h >> 15;
  return h;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dict_hash_murmur>:
  endbr64
  mov    %rdi,%r9
  test   %rdi,%rdi
  je     L34
  test   %rsi,%rsi
  je     L34
  mov    %rsi,%rdx
  xor    $0xbadcafe,%rdx
  cmp    $0x3,%rsi
  jbe    L63
  mov    %rsi,%rcx
L76:
  imul   $0x5bd1e995,(%rdi),%r8
  mov    %r8,%rax
  shr    $0x18,%rax
  xor    %r8,%rax
  imul   $0x5bd1e995,%rdx,%rdx
  imul   $0x5bd1e995,%rax,%rax
  xor    %rax,%rdx
  add    $0x10,%rdi
  sub    $0x4,%rcx
  cmp    $0x3,%rcx
  ja     L76
  lea    -0x4(%rsi),%rax
  shr    $0x2,%rax
  add    $0x1,%rax
  shl    $0x4,%rax
  add    %rax,%r9
  and    $0x3,%esi
L63:
  cmp    $0x2,%rsi
  je     L67
  cmp    $0x3,%rsi
  je     L10
  cmp    $0x1,%rsi
  jne    L65
  jmp    L28
L10:
  mov    0x8(%r9),%eax
  shl    $0x10,%eax
  cltq
  xor    %rax,%rdx
L67:
  mov    0x4(%r9),%eax
  shl    $0x8,%eax
  cltq
  xor    %rax,%rdx
L28:
  movslq (%r9),%rax
  xor    %rdx,%rax
  imul   $0x5bd1e995,%rax,%rdx
L65:
  mov    %rdx,%rax
  shr    $0xd,%rax
  xor    %rax,%rdx
  imul   $0x5bd1e995,%rdx,%rdx
  mov    %rdx,%rax
  shr    $0xf,%rax
  xor    %rdx,%rax
  ret
L34:
  mov    $0x0,%eax
  ret
```

assistant: ```c
uint32_t dict_hash_murmur(char *key, size_t len) {
  uint32_t h, k;
  uint8_t *data;
  uint32_t seed = 0x0badcafe;
  uint32_t m = 0x5bd1e995;
  uint32_t r = 24;
  if (!key || !len) {
    return 0;
  }
  h = seed ^ len;
  data = (uint8_t *)key;
  while (len >= 4) {
    k = *(uint32_t *)data;
    k *= m;
    k ^= k >> r;
    k *= m;
    h *= m;
    h ^= k;
    data += 4;
    len -= 4;
  }
  switch (len) {
  case 3:
    h ^= data[2] << 16;
  case 2:
    h ^= data[1] << 8;
  case 1:
    h ^= data[0];
    h *= m;
  };
  h ^= h >> 13;
  h *= m;
  h ^= h >> 15;
  return h;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<dict_hash_murmur>:
  endbr64
  mov    %rdi,%r9
  test   %rdi,%rdi
  je     L48
  test   %rsi,%rsi
  je     L48
  mov    %rsi,%rdx
  xor    $0xbadcafe,%rdx
  cmp    $0x3,%rsi
  jbe    L52
  mov    %rsi,%rcx
  nopl   0x0(%rax)
L57:
  imul   $0x5bd1e995,(%rdi),%r8
  sub    $0x4,%rcx
  add    $0x10,%rdi
  imul   $0x5bd1e995,%rdx,%rdx
  mov    %r8,%rax
  shr    $0x18,%rax
  xor    %r8,%rax
  imul   $0x5bd1e995,%rax,%rax
  xor    %rax,%rdx
  cmp    $0x3,%rcx
  ja     L57
  lea    -0x4(%rsi),%rax
  and    $0x3,%esi
  shr    $0x2,%rax
  add    $0x1,%rax
  shl    $0x4,%rax
  add    %rax,%r9
L52:
  cmp    $0x2,%rsi
  je     L21
  cmp    $0x3,%rsi
  je     L12
  cmp    $0x1,%rsi
  je     L4
L38:
  mov    %rdx,%rax
  shr    $0xd,%rax
  xor    %rax,%rdx
  imul   $0x5bd1e995,%rdx,%rdx
  mov    %rdx,%rax
  shr    $0xf,%rax
  xor    %rdx,%rax
  ret
  nopl   0x0(%rax)
L12:
  mov    0x8(%r9),%eax
  shl    $0x10,%eax
  cltq
  xor    %rax,%rdx
L21:
  mov    0x4(%r9),%eax
  shl    $0x8,%eax
  cltq
  xor    %rax,%rdx
L4:
  movslq (%r9),%rax
  xor    %rdx,%rax
  imul   $0x5bd1e995,%rax,%rdx
  jmp    L38
  nop
L48:
  xor    %eax,%eax
  ret
```

assistant: ```c
uint32_t dict_hash_murmur(char *key, size_t len) {
  uint32_t h, k;
  uint8_t *data;
  uint32_t seed = 0x0badcafe;
  uint32_t m = 0x5bd1e995;
  uint32_t r = 24;
  if (!key || !len) {
    return 0;
  }
  h = seed ^ len;
  data = (uint8_t *)key;
  while (len >= 4) {
    k = *(uint32_t *)data;
    k *= m;
    k ^= k >> r;
    k *= m;
    h *= m;
    h ^= k;
    data += 4;
    len -= 4;
  }
  switch (len) {
  case 3:
    h ^= data[2] << 16;
  case 2:
    h ^= data[1] << 8;
  case 1:
    h ^= data[0];
    h *= m;
  };
  h ^= h >> 13;
  h *= m;
  h ^= h >> 15;
  return h;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<dict_hash_murmur>:
  endbr64
  mov    %rdi,%r9
  test   %rdi,%rdi
  je     L20
  test   %rsi,%rsi
  je     L20
  mov    %rsi,%rdx
  xor    $0xbadcafe,%rdx
  cmp    $0x3,%rsi
  jbe    L67
  mov    %rsi,%rcx
  nopl   0x0(%rax)
L57:
  imul   $0x5bd1e995,(%rdi),%r8
  sub    $0x4,%rcx
  add    $0x10,%rdi
  imul   $0x5bd1e995,%rdx,%rdx
  mov    %r8,%rax
  shr    $0x18,%rax
  xor    %r8,%rax
  imul   $0x5bd1e995,%rax,%rax
  xor    %rax,%rdx
  cmp    $0x3,%rcx
  ja     L57
  lea    -0x4(%rsi),%rax
  and    $0x3,%esi
  shr    $0x2,%rax
  add    $0x1,%rax
  shl    $0x4,%rax
  add    %rax,%r9
L67:
  cmp    $0x2,%rsi
  je     L10
  cmp    $0x3,%rsi
  je     L7
  cmp    $0x1,%rsi
  je     L55
L2:
  mov    %rdx,%rax
  shr    $0xd,%rax
  xor    %rax,%rdx
  imul   $0x5bd1e995,%rdx,%rdx
  mov    %rdx,%rax
  shr    $0xf,%rax
  xor    %rdx,%rax
  ret
  nopl   0x0(%rax)
L7:
  mov    0x8(%r9),%eax
  shl    $0x10,%eax
  cltq
  xor    %rax,%rdx
L10:
  mov    0x4(%r9),%eax
  shl    $0x8,%eax
  cltq
  xor    %rax,%rdx
L55:
  movslq (%r9),%rax
  xor    %rdx,%rax
  imul   $0x5bd1e995,%rax,%rdx
  jmp    L2
  nop
L20:
  xor    %eax,%eax
  ret
```

assistant: ```c
uint32_t dict_hash_murmur(char *key, size_t len) {
  uint32_t h, k;
  uint8_t *data;
  uint32_t seed = 0x0badcafe;
  uint32_t m = 0x5bd1e995;
  uint32_t r = 24;
  if (!key || !len) {
    return 0;
  }
  h = seed ^ len;
  data = (uint8_t *)key;
  while (len >= 4) {
    k = *(uint32_t *)data;
    k *= m;
    k ^= k >> r;
    k *= m;
    h *= m;
    h ^= k;
    data += 4;
    len -= 4;
  }
  switch (len) {
  case 3:
    h ^= data[2] << 16;
  case 2:
    h ^= data[1] << 8;
  case 1:
    h ^= data[0];
    h *= m;
  };
  h ^= h >> 13;
  h *= m;
  h ^= h >> 15;
  return h;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<eckey_param2type>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L73
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_KEY_get0_group@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L3
L73:
  mov    D23(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  mov    $0x0,%eax
  jmp    L91
L3:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_GROUP_get_asn1_flag@plt>
  test   %rax,%rax
  je     L14
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <EC_GROUP_get_curve_name@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L14
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <OBJ_nid2obj@plt>
  mov    -0x30(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    D11(%rip),%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L1
L14:
  movq   $0x0,-0x8(%rbp)
  mov    $0x0,%eax
  call   <ASN1_STRING_new@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L38
  mov    $0x0,%eax
  jmp    L91
L38:
  mov    -0x8(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <i2d_ECParameters@plt>
  mov    -0x8(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jg     L57
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <ASN1_STRING_free@plt>
  mov    D31(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ECerror@plt>
  mov    $0x0,%eax
  jmp    L91
L57:
  mov    -0x30(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    D35(%rip),%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
L1:
  mov    $0x1,%eax
L91:
  leave
  ret
```

assistant: ```c
int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key) {
  const EC_GROUP *group;
  int nid;
  if (ec_key == NULL || (group = EC_KEY_get0_group(ec_key)) == NULL) {
    ECerror(EC_R_MISSING_PARAMETERS);
    return 0;
  }
  if (EC_GROUP_get_asn1_flag(group) && (nid = EC_GROUP_get_curve_name(group))) {
    *ppval = OBJ_nid2obj(nid);
    *pptype = V_ASN1_OBJECT;
  } else {
    ASN1_STRING *pstr = NULL;
    pstr = ASN1_STRING_new();
    if (!pstr)
      return 0;
    pstr->length = i2d_ECParameters(ec_key, &pstr->data);
    if (pstr->length <= 0) {
      ASN1_STRING_free(pstr);
      ECerror(ERR_R_EC_LIB);
      return 0;
    }
    *ppval = pstr;
    *pptype = V_ASN1_SEQUENCE;
  }
  return 1;
}
```