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

```asm
<or_m32abs_imm32>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   $0xffffffff80000000,%rdi
  jne    L15
L17:
  mov    $0x81,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    $0xc,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    $0x25,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    %ebx,%edi
  xor    %eax,%eax
  call   <put32@plt>
  add    $0x8,%rsp
  mov    %ebp,%edi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  jmp    1090 <put32@plt>
  nopl   0x0(%rax)
L15:
  mov    %rdi,%rsi
  xor    %eax,%eax
  lea    D6(%rip),%rdi
  call   <printf@plt>
  int3
  jmp    L17
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
type: string

tool: D6: Error: destination %lx not in lower 2GB for or_m32abs_imm32()


assistant: ```c
void or_m32abs_imm32(unsigned int *m32, unsigned int imm32) {
  if ((long)m32 & 0xFFFFFFFF80000000LL) {
    printf("Error: destination %lx not in lower 2GB for or_m32abs_imm32()\n", (long)m32);
    asm(" int $3; ");
  }
  put8(0x81);
  put8(0x0C);
  put8(0x25);
  put32((int)(unsigned long)m32);
  put32(imm32);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<or_m32abs_imm32>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   $0xffffffff80000000,%rdi
  jne    L19
L10:
  mov    $0x81,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    $0xc,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    $0x25,%edi
  xor    %eax,%eax
  call   <put8@plt>
  mov    %ebx,%edi
  xor    %eax,%eax
  call   <put32@plt>
  add    $0x8,%rsp
  mov    %ebp,%edi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  jmp    1090 <put32@plt>
  nopl   0x0(%rax)
L19:
  mov    %rdi,%rsi
  xor    %eax,%eax
  lea    D7(%rip),%rdi
  call   <printf@plt>
  int3
  jmp    L10
```

tool_calls: name: parse_data
arguments: tag: D7
data_type: string

tool: D7: Error: destination %lx not in lower 2GB for or_m32abs_imm32()


assistant: ```c
void or_m32abs_imm32(unsigned int *m32, unsigned int imm32) {
  if ((long)m32 & 0xFFFFFFFF80000000LL) {
    printf("Error: destination %lx not in lower 2GB for or_m32abs_imm32()\n", (long)m32);
    asm(" int $3; ");
  }
  put8(0x81);
  put8(0x0C);
  put8(0x25);
  put32((int)(unsigned long)m32);
  put32(imm32);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<is_valid_date_format>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  lea    D41(%rip),%rsi
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  movabs $0x1c0000001f,%rax
  lea    0x8(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  lea    0x4(%rsp),%r8
  mov    %rax,0x10(%rsp)
  movabs $0x1e0000001f,%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,0x20(%rsp)
  movabs $0x1f0000001f,%rax
  mov    %rax,0x28(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x30(%rsp)
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <sscanf@plt>
  cmp    $0x3,%eax
  jne    L47
  mov    0xc(%rsp),%edx
  imul   $0xc28f5c29,%edx,%eax
  add    $0x51eb850,%eax
  mov    %eax,%ecx
  ror    $0x4,%ecx
  cmp    $0xa3d70a,%ecx
  ja     L12
L17:
  movl   $0x1d,0x14(%rsp)
L99:
  mov    0x8(%rsp),%edx
  lea    -0x1(%rdx),%eax
  cmp    $0xb,%eax
  ja     L130
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jle    L55
  cltq
  cmp    0x10(%rsp,%rax,4),%edx
  jg     L55
  xor    %eax,%eax
L9:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L15
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  ret
L12:
  ror    $0x2,%eax
  cmp    $0x28f5c28,%eax
  ja     L17
  and    $0x3,%edx
  jne    L99
  jmp    L17
  nopl   0x0(%rax)
L47:
  test   %ebx,%ebx
  je     L25
L86:
  mov    $0xffffffff,%eax
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L55:
  test   %ebx,%ebx
  jne    L86
  lea    D32(%rip),%rsi
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  mov    $0xffffffff,%eax
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L130:
  test   %ebx,%ebx
  jne    L86
  lea    D32(%rip),%rsi
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  jmp    L86
L25:
  mov    %rbp,%rsi
  lea    D53(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  mov    $0xffffffff,%eax
  jmp    L9
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D41
type: string
name: disassemble_data
arguments: data_label: D32
type: string
name: disassemble_data
arguments: data_label: D59
type: string
name: disassemble_data
arguments: data_label: D30
type: string
name: disassemble_data
arguments: data_label: D53
type: string

tool: D41: %04d-%02d-%02d

tool: D32: is_valid_date_format

tool: D59: %s: invalid day %d


tool: D30: %s: invalid month %d


tool: D53: invalid date format: %s


assistant: ```c
int is_valid_date_format(const char *date, int silent_errors) {
  int d;
  int m;
  int y;
  int ret;
  int day_count[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  ret = sscanf(date, "%04d-%02d-%02d", &y, &m, &d);
  if (ret != 3) {
    if (!silent_errors)
      fail("invalid date format: %s\n", date);
    return -1;
  }
  if (y % 400 == 0 || y % 100 != 0 || y % 4 == 0)
    day_count[1] = 29;
  if (m <= 0 || m >= 13) {
    if (!silent_errors)
      fail("%s: invalid month %d\n", __func__, m);
    return -1;
  }
  if (d <= 0 || d > day_count[m - 1]) {
    if (!silent_errors)
      fail("%s: invalid day %d\n", __func__, d);
    return -1;
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xc(%rbp),%rax
  mov    %rax,%rdi
  call   <getint@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D2
datatype: string

tool: D2: The number is %i

assistant: ```c
int main(int argc, char const *argv[]) {
  int n;
  getint(&n);
  printf("The number is %i", n);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <getint@plt>
  mov    0x4(%rsp),%esi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    $0x0,%eax
  add    $0x18,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D1
datatype: string

tool: D1: The number is %i

assistant: ```c
int main(int argc, char const *argv[]) {
  int n;
  getint(&n);
  printf("The number is %i", n);
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <getint@plt>
  mov    0x4(%rsp),%esi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D7
type_guessed: string

tool: D7: The number is %i

assistant: ```c
int main(int argc, char const *argv[]) {
  int n;
  getint(&n);
  printf("The number is %i", n);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <getint@plt>
  mov    0x4(%rsp),%esi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D9
data_type: string

tool: D9: The number is %i

assistant: ```c
int main(int argc, char const *argv[]) {
  int n;
  getint(&n);
  printf("The number is %i", n);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<hash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x1505,-0x8(%rbp)
  jmp    L9
L2:
  mov    -0x8(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
L9:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L2
  mov    -0x8(%rbp),%eax
  movzbl %al,%eax
  pop    %rbp
  ret
```

assistant: ```c
uint32_t hash(const char *str) {
  uint32_t hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & 0x0ff;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hash>:
  endbr64
  lea    0x1(%rdi),%rcx
  movsbl (%rdi),%edx
  test   %edx,%edx
  je     L17
  mov    $0x1505,%eax
L1:
  mov    %eax,%esi
  shl    $0x5,%esi
  add    %esi,%eax
  add    %edx,%eax
  add    $0x1,%rcx
  movsbl -0x1(%rcx),%edx
  test   %edx,%edx
  jne    L1
L10:
  movzbl %al,%eax
  ret
L17:
  mov    $0x1505,%eax
  jmp    L10
```

assistant: ```c
uint32_t hash(const char *str) {
  uint32_t hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & 0x0ff;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<hash>:
  endbr64
  movsbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  test   %edx,%edx
  je     L17
  mov    $0x1505,%eax
  nopl   0x0(%rax)
L9:
  mov    %eax,%esi
  add    $0x1,%rcx
  shl    $0x5,%esi
  add    %esi,%eax
  add    %edx,%eax
  movsbl -0x1(%rcx),%edx
  test   %edx,%edx
  jne    L9
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L17:
  mov    $0x5,%eax
  ret
```

assistant: ```c
uint32_t hash(const char *str) {
  uint32_t hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & 0x0ff;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hash>:
  endbr64
  movsbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  test   %edx,%edx
  je     L5
  mov    $0x1505,%eax
  nopl   0x0(%rax)
L10:
  mov    %eax,%esi
  add    $0x1,%rcx
  shl    $0x5,%esi
  add    %esi,%eax
  add    %edx,%eax
  movsbl -0x1(%rcx),%edx
  test   %edx,%edx
  jne    L10
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L5:
  mov    $0x5,%eax
  ret
```

assistant: ```c
uint32_t hash(const char *str) {
  uint32_t hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & 0x0ff;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<plat_idx_to_val>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  cmpl   $0x12ff,-0x14(%rbp)
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x1ff,-0x14(%rbp)
  ja     L43
  mov    -0x14(%rbp),%eax
  jmp    L10
L43:
  mov    -0x14(%rbp),%eax
  shr    $0x8,%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  add    $0x8,%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  test   %rax,%rax
  js     L51
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L15
L51:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L15:
  mov    -0x4(%rbp),%eax
  test   %rax,%rax
  js     L58
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  jmp    L52
L58:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdx,%xmm1
  addsd  %xmm1,%xmm1
L52:
  movsd  D5(%rip),%xmm2
  addsd  %xmm1,%xmm2
  mov    -0xc(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
L10:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D5
type_infered: f64

tool: D5: 0.5

assistant: ```c
unsigned int plat_idx_to_val(unsigned int idx) {
  unsigned int error_bits, k, base;
  assert(idx < (19 * (1 << 8)));
  if (idx < ((1 << 8) << 1))
    return idx;
  error_bits = (idx >> 8) - 1;
  base = 1 << (error_bits + 8);
  k = idx % (1 << 8);
  return base + ((k + 0.5) * (1 << error_bits));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<plat_idx_to_val>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  cmp    $0x12ff,%edi
  setbe  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %ebx,%eax
  cmp    $0x1ff,%ebx
  jbe    L2
  mov    %ebx,%edx
  shr    $0x8,%edx
  movzbl %bl,%ebx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rbx,%xmm0
  addsd  D0(%rip),%xmm0
  lea    -0x1(%rdx),%ecx
  mov    $0x1,%eax
  mov    %eax,%esi
  shl    %cl,%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  mulsd  %xmm1,%xmm0
  lea    0x7(%rdx),%ecx
  shl    %cl,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
L2:
  pop    %rbx
  ret
```

tool_calls: name: read_data
arguments: data_label: D0
data_type: f64

tool: D0: 0.5

assistant: ```c
unsigned int plat_idx_to_val(unsigned int idx) {
  unsigned int error_bits, k, base;
  assert(idx < (19 * (1 << 8)));
  if (idx < ((1 << 8) << 1))
    return idx;
  error_bits = (idx >> 8) - 1;
  base = 1 << (error_bits + 8);
  k = idx % (1 << 8);
  return base + ((k + 0.5) * (1 << error_bits));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<plat_idx_to_val>:
  endbr64
  push   %rbx
  cmp    $0x12ff,%edi
  mov    %edi,%ebx
  setbe  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %ebx,%eax
  cmp    $0x1ff,%ebx
  jbe    L4
  movzbl %bl,%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %ebx,%edx
  cvtsi2sd %eax,%xmm0
  shr    $0x8,%edx
  mov    $0x1,%eax
  lea    -0x1(%rdx),%ecx
  mov    %eax,%esi
  addsd  D3(%rip),%xmm0
  shl    %cl,%esi
  lea    0x7(%rdx),%ecx
  cvtsi2sd %esi,%xmm1
  shl    %cl,%eax
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
L4:
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type_guessed: f64

tool: D3: 0.5

assistant: ```c
unsigned int plat_idx_to_val(unsigned int idx) {
  unsigned int error_bits, k, base;
  assert(idx < (19 * (1 << 8)));
  if (idx < ((1 << 8) << 1))
    return idx;
  error_bits = (idx >> 8) - 1;
  base = 1 << (error_bits + 8);
  k = idx % (1 << 8);
  return base + ((k + 0.5) * (1 << error_bits));
}
```
user: Translate the below assembly code into C programming language:

```asm
<plat_idx_to_val>:
  endbr64
  push   %rbx
  cmp    $0x12ff,%edi
  mov    %edi,%ebx
  setbe  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %ebx,%eax
  cmp    $0x1ff,%ebx
  jbe    L2
  movzbl %bl,%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %ebx,%edx
  cvtsi2sd %eax,%xmm0
  shr    $0x8,%edx
  mov    $0x1,%eax
  lea    -0x1(%rdx),%ecx
  mov    %eax,%esi
  addsd  D2(%rip),%xmm0
  shl    %cl,%esi
  lea    0x7(%rdx),%ecx
  cvtsi2sd %esi,%xmm1
  shl    %cl,%eax
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
L2:
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D2
type_guessed: f64

tool: D2: 0.5

assistant: ```c
unsigned int plat_idx_to_val(unsigned int idx) {
  unsigned int error_bits, k, base;
  assert(idx < (19 * (1 << 8)));
  if (idx < ((1 << 8) << 1))
    return idx;
  error_bits = (idx >> 8) - 1;
  base = 1 << (error_bits + 8);
  k = idx % (1 << 8);
  return base + ((k + 0.5) * (1 << error_bits));
}
```
user: Translate the below assembly code into C programming language:

```asm
<macan_check_cmac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %rdx,-0x88(%rbp)
  mov    %rcx,-0x90(%rbp)
  mov    %r8d,-0x94(%rbp)
  mov    %r9d,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x94(%rbp)
  js     L14
  mov    -0x94(%rbp),%eax
  mov    %eax,%edx
  mov    -0x98(%rbp),%eax
  sub    $0x8,%rax
  cmp    %rax,%rdx
  jbe    L30
L14:
  mov    -0x90(%rbp),%rcx
  lea    -0x50(%rbp),%rdx
  mov    -0x98(%rbp),%esi
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <macan_aes_cmac@plt>
  lea    -0x50(%rbp),%rcx
  mov    -0x88(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memchk@plt>
  jmp    L6
L30:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <macan_get_time@plt>
  mov    %rax,-0x60(%rbp)
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  movl   $0xffffffff,-0x64(%rbp)
  jmp    L68
L28:
  mov    -0x64(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <htole32@plt>
  mov    -0x58(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x90(%rbp),%rcx
  lea    -0x50(%rbp),%rdx
  mov    -0x98(%rbp),%esi
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <macan_aes_cmac@plt>
  lea    -0x50(%rbp),%rcx
  mov    -0x88(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L45
  mov    $0x1,%eax
  jmp    L6
L45:
  addl   $0x1,-0x64(%rbp)
L68:
  cmpl   $0x1,-0x64(%rbp)
  jle    L28
  mov    $0x0,%eax
L6:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
int macan_check_cmac(struct macan_ctx *ctx, struct macan_key *skey, const uint8_t *cmac4, uint8_t *plain, int time_index, unsigned len) {
  uint8_t cmac[16];
  uint32_t *time_ptr;
  if (time_index < 0 || (unsigned)time_index > len - sizeof(*time_ptr)) {
    macan_aes_cmac(skey, len, cmac, plain);
    return memchk(cmac4, cmac, 4);
  }
  uint32_t time = (uint32_t)macan_get_time(ctx);
  int delta_t;
  time_ptr = (uint32_t *)&plain[time_index];
  for (delta_t = -1; delta_t <= 1; delta_t++) {
    *time_ptr = htole32(time + (uint32_t)delta_t);
    macan_aes_cmac(skey, len, cmac, plain);
    if (memcmp(cmac4, cmac, 4) == 0) {
      return 1;
    }
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<macan_check_cmac>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %rcx,%rbp
  mov    %r9d,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %r8d,%r8d
  js     L52
  mov    %r8d,%r14d
  mov    %r8d,%edx
  mov    %r9d,%eax
  sub    $0x8,%rax
  cmp    %rax,%rdx
  jbe    L24
L52:
  lea    0x10(%rsp),%r14
  mov    %rbp,%rcx
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <macan_aes_cmac@plt>
  mov    $0x4,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <memchk@plt>
L65:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L64
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L24:
  call   <macan_get_time@plt>
  movslq %r14d,%r14
  lea    0x0(%rbp,%r14,4),%rsi
  mov    %rsi,(%rsp)
  lea    -0x1(%rax),%r14
  add    $0x2,%rax
  mov    %rax,0x8(%rsp)
  lea    0x10(%rsp),%r15
L57:
  mov    %r14,%rdi
  call   <htole32@plt>
  mov    (%rsp),%rcx
  mov    %rax,(%rcx)
  mov    %rbp,%rcx
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <macan_aes_cmac@plt>
  mov    $0x4,%edx
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L40
  add    $0x1,%r14
  cmp    0x8(%rsp),%r14
  jne    L57
  mov    $0x0,%eax
  jmp    L65
L40:
  mov    $0x1,%eax
  jmp    L65
L64:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int macan_check_cmac(struct macan_ctx *ctx, struct macan_key *skey, const uint8_t *cmac4, uint8_t *plain, int time_index, unsigned len) {
  uint8_t cmac[16];
  uint32_t *time_ptr;
  if (time_index < 0 || (unsigned)time_index > len - sizeof(*time_ptr)) {
    macan_aes_cmac(skey, len, cmac, plain);
    return memchk(cmac4, cmac, 4);
  }
  uint32_t time = (uint32_t)macan_get_time(ctx);
  int delta_t;
  time_ptr = (uint32_t *)&plain[time_index];
  for (delta_t = -1; delta_t <= 1; delta_t++) {
    *time_ptr = htole32(time + (uint32_t)delta_t);
    macan_aes_cmac(skey, len, cmac, plain);
    if (memcmp(cmac4, cmac, 4) == 0) {
      return 1;
    }
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<macan_check_cmac>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %r8d,%r8d
  js     L52
  mov    %r9d,%eax
  movslq %r8d,%rbx
  sub    $0x8,%rax
  cmp    %rax,%rbx
  jbe    L57
L52:
  lea    0x10(%rsp),%r15
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %r12,%rcx
  mov    %r15,%rdx
  call   <macan_aes_cmac@plt>
  mov    $0x4,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <memchk@plt>
L29:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L21
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L57:
  call   <macan_get_time@plt>
  lea    (%r12,%rbx,4),%rbx
  lea    -0x1(%rax),%r15
  add    $0x2,%rax
  mov    %rbx,(%rsp)
  lea    0x10(%rsp),%rbx
  mov    %rax,0x8(%rsp)
L56:
  mov    %r15,%rdi
  call   <htole32@plt>
  mov    (%rsp),%rcx
  mov    %rbx,%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %rax,(%rcx)
  mov    %r12,%rcx
  call   <macan_aes_cmac@plt>
  mov    $0x4,%edx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L22
  add    $0x1,%r15
  cmp    0x8(%rsp),%r15
  jne    L56
  xor    %eax,%eax
  jmp    L29
  nopl   (%rax)
L22:
  mov    $0x1,%eax
  jmp    L29
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int macan_check_cmac(struct macan_ctx *ctx, struct macan_key *skey, const uint8_t *cmac4, uint8_t *plain, int time_index, unsigned len) {
  uint8_t cmac[16];
  uint32_t *time_ptr;
  if (time_index < 0 || (unsigned)time_index > len - sizeof(*time_ptr)) {
    macan_aes_cmac(skey, len, cmac, plain);
    return memchk(cmac4, cmac, 4);
  }
  uint32_t time = (uint32_t)macan_get_time(ctx);
  int delta_t;
  time_ptr = (uint32_t *)&plain[time_index];
  for (delta_t = -1; delta_t <= 1; delta_t++) {
    *time_ptr = htole32(time + (uint32_t)delta_t);
    macan_aes_cmac(skey, len, cmac, plain);
    if (memcmp(cmac4, cmac, 4) == 0) {
      return 1;
    }
  }
  return 0;
}
```