user: 请从给定的汇编指令推导出C源代码：

```asm
<checkRecord>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  lea    (%rdi,%rdi,2),%edi
  shl    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  movslq %r12d,%rbp
  shl    $0x2,%rbp
  lea    (%rax,%rbp,1),%r8
  lea    (%r8,%rbp,1),%r9
  movl   $0x1,(%rax)
  movl   $0x2,0x4(%rax)
  movl   $0x4,0x8(%rax)
  movl   $0x1,(%r8)
  movl   $0x1,(%r9)
  movl   $0x3,0x4(%r9)
  cmp    $0x1,%r12d
  jle    L10
  mov    (%rax),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  add    (%r8),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  mov    %eax,0x4(%r8)
  lea    0x4(%rbx),%rdi
  mov    %r12d,%r10d
  mov    $0x2,%ecx
  jmp    L25
L0:
  add    $0x1,%rcx
  add    $0x4,%rdi
L25:
  cmp    %r10,%rcx
  je     L10
  mov    -0x4(%r8,%rcx,4),%esi
  mov    -0x4(%r9,%rcx,4),%eax
  add    (%rdi),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  mov    %eax,(%r8,%rcx,4)
  cmp    $0x1,%ecx
  jle    L0
  mov    -0x8(%r8,%rcx,4),%eax
  add    -0x4(%rdi),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  add    (%rdi),%esi
  movslq %esi,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %esi,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%esi
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  mov    %eax,(%r9,%rcx,4)
  cmp    $0x2,%ecx
  jle    L0
  mov    -0x4(%rdi),%eax
  add    -0x8(%rdi),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  add    (%rdi),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  mov    %eax,0x4(%rdi)
  jmp    L0
L10:
  mov    -0x4(%r9,%rbp,1),%eax
  add    -0x4(%rbx,%rbp,1),%eax
  movslq %eax,%rdx
  imul   $0x44b82f99,%rdx,%rdx
  sar    $0x3c,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3b9aca07,%edx,%edx
  sub    %edx,%eax
  add    -0x4(%r8,%rbp,1),%eax
  movslq %eax,%rbp
  imul   $0x44b82f99,%rbp,%rbp
  sar    $0x3c,%rbp
  cltd
  sub    %edx,%ebp
  imul   $0x3b9aca07,%ebp,%edx
  sub    %edx,%eax
  mov    %eax,%ebp
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int checkRecord(int n) {
  int t = 1000000007, *a, *p, *l, i, ret;
  a = (int *)malloc(3 * n * sizeof(int));
  p = a + n;
  l = p + n;
  a[0] = 1;
  a[1] = 2;
  a[2] = 4;
  p[0] = 1;
  l[0] = 1;
  l[1] = 3;
  for (i = 1; i < n; ++i) {
    p[i] = ((a[i - 1] + l[i - 1]) % t + p[i - 1]) % t;
    if (i > 1) {
      l[i] = ((a[i - 2] + p[i - 2]) % t + (a[i - 1] + p[i - 1]) % t) % t;
      if (i > 2)
        a[i] = ((a[i - 3] + a[i - 2]) % t + a[i - 1]) % t;
    }
  }
  ret = ((a[n - 1] + l[n - 1]) % t + p[n - 1]) % t;
  free(a);
  return ret;
}
```