user: What is the c source code of the assembly code below:

```asm
<grtc_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%r12d
  mov    %esi,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    $0x1031000,%edi
  call   <report_device@plt>
  movslq %r12d,%r12
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movq   $0x55000001,(%r12)
  movq   $0x55000000,0x8(%r12)
  movq   $0x0,0x10(%r12)
  lea    0x3(%r13),%eax
  test   %r13d,%r13d
  cmovns %r13d,%eax
  sar    $0x2,%eax
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L294:
  cmp    %rdx,%rsp
  je     L750
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L294
L750:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L1113
  orq    $0x0,-0x8(%rsp,%rax,1)
L1113:
  mov    %rsp,%r14
  and    $0xfffffc00,%r14d
  lea    0x400(%r14),%rbx
  lea    0x3ff(%r13),%eax
  test   %r13d,%r13d
  cmovns %r13d,%eax
  sar    $0xa,%eax
  sub    $0x1,%eax
  and    $0x3ff,%eax
  mov    %rbx,%rdx
  sar    $0xa,%rdx
  shl    $0xa,%edx
  or     %edx,%eax
  cltq
  mov    %rax,0x50(%r12)
  movq   $0x55000001,0x40(%r12)
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
L713:
  mov    0xd8(%r12),%rax
  test   $0x40,%al
  je     L713
  mov    0x400(%r14),%eax
  cmp    $0x10010500,%eax
  jne    L800
L623:
  mov    0x4(%rbx),%eax
  cmp    $0xc0000000,%eax
  jne    L322
L522:
  mov    0x8(%rbx),%eax
  cmp    $0x700,%eax
  jne    L541
L37:
  mov    0xc(%rbx),%eax
  cmp    $0x100,%eax
  jne    L391
L665:
  mov    0x10(%rbx),%eax
  cmp    $0x2000300,%eax
  jne    L447
L304:
  mov    0x14(%rbx),%eax
  cmp    $0x4000500,%eax
  jne    L192
L315:
  mov    0x18(%rbx),%eax
  cmp    $0x3700c500,%eax
  jne    L438
L33:
  movq   $0x55000800,0x8(%r12)
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
L418:
  mov    0xd8(%r12),%rax
  test   $0x40,%al
  je     L418
  mov    0x1c(%rbx),%eax
  cmp    $0x21001,%eax
  jne    L974
L476:
  mov    0x20(%rbx),%eax
  cmp    $0x500c000,%eax
  jne    L685
L904:
  mov    0x24(%rbx),%eax
  cmp    $0x1000000,%eax
  jne    L358
L34:
  mov    0x28(%rbx),%eax
  cmp    $0xe000000,%eax
  jne    L44
L585:
  mov    0x2c(%rbx),%eax
  cmp    $0x1000200,%eax
  jne    L426
L415:
  mov    0x30(%rbx),%eax
  cmp    $0x3000400,%eax
  jne    L1106
L390:
  mov    0x34(%rbx),%eax
  cmp    $0x5000600,%eax
  jne    L969
L184:
  mov    0x38(%rbx),%eax
  cmp    $0x7000800,%eax
  jne    L772
L591:
  mov    0x3c(%rbx),%eax
  cmp    $0x9000a00,%eax
  jne    L469
L764:
  mov    0x40(%rbx),%eax
  cmp    $0xb000c00,%eax
  jne    L361
L130:
  mov    0x44(%rbx),%eax
  cmp    $0xc7005f00,%eax
  jne    L121
L690:
  movq   $0x55000400,0x8(%r12)
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
L1115:
  mov    0xd8(%r12),%rax
  test   $0x40,%al
  je     L1115
  mov    0x48(%rbx),%eax
  cmp    $0x21001,%eax
  jne    L867
L527:
  mov    0x4c(%rbx),%eax
  cmp    $0x500c000,%eax
  jne    L178
L255:
  mov    0x50(%rbx),%eax
  cmp    $0x2000000,%eax
  jne    L777
L874:
  mov    0x54(%rbx),%eax
  cmp    $0x15000000,%eax
  jne    L582
L552:
  mov    0x58(%rbx),%eax
  cmp    $0x1000200,%eax
  jne    L569
L1118:
  mov    0x5c(%rbx),%eax
  cmp    $0x3000400,%eax
  jne    L575
L749:
  mov    0x60(%rbx),%eax
  cmp    $0x5000600,%eax
  jne    L691
L92:
  mov    0x64(%rbx),%eax
  cmp    $0x7000800,%eax
  jne    L230
L745:
  mov    0x68(%rbx),%eax
  cmp    $0x9000a00,%eax
  jne    L829
L942:
  mov    0x6c(%rbx),%eax
  cmp    $0xb000c00,%eax
  jne    L1032
L107:
  mov    0x70(%rbx),%eax
  cmp    $0xd000e00,%eax
  jne    L987
L330:
  mov    0x74(%rbx),%eax
  cmp    $0xf001000,%eax
  jne    L325
L332:
  mov    0x78(%rbx),%eax
  cmp    $0x11001200,%eax
  jne    L350
L198:
  mov    0x7c(%rbx),%eax
  cmp    $0x13007d00,%eax
  jne    L1083
L546:
  mov    0x80(%rbx),%eax
  cmp    $0xbc000002,%eax
  jne    L439
L451:
  movq   $0x55000c00,0x8(%r12)
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
L1054:
  mov    0xd8(%r12),%rax
  test   $0x40,%al
  je     L1054
  mov    0x84(%rbx),%eax
  cmp    $0x10010500,%eax
  jne    L403
L134:
  mov    0x88(%rbx),%eax
  cmp    $0xc0000300,%eax
  jne    L297
L185:
  mov    0x8c(%rbx),%eax
  cmp    $0x1c00,%eax
  jne    L158
L290:
  mov    0x90(%rbx),%eax
  cmp    $0x100,%eax
  jne    L334
L881:
  mov    0x94(%rbx),%eax
  cmp    $0x2000300,%eax
  jne    L961
L311:
  mov    0x98(%rbx),%eax
  cmp    $0x4000500,%eax
  jne    L305
L592:
  mov    0x9c(%rbx),%eax
  cmp    $0x6000700,%eax
  jne    L1052
L848:
  mov    0xa0(%rbx),%eax
  cmp    $0x8000900,%eax
  jne    L1008
L612:
  mov    0xa4(%rbx),%eax
  cmp    $0xa000b00,%eax
  jne    L741
L717:
  mov    0xa8(%rbx),%eax
  cmp    $0xc000d00,%eax
  jne    L810
L223:
  mov    0xac(%rbx),%eax
  cmp    $0xe000f00,%eax
  jne    L336
L207:
  mov    0xb0(%rbx),%eax
  cmp    $0x10001100,%eax
  jne    L610
L666:
  mov    0xb4(%rbx),%eax
  cmp    $0x12001300,%eax
  jne    L515
L731:
  mov    0xb8(%rbx),%eax
  cmp    $0x14001500,%eax
  jne    L86
L812:
  mov    0xbc(%rbx),%eax
  cmp    $0x16001700,%eax
  jne    L329
L975:
  mov    0xc0(%rbx),%eax
  cmp    $0x18001900,%eax
  jne    L407
L69:
  mov    0xc4(%rbx),%eax
  cmp    $0x1a004b00,%eax
  jne    L692
L111:
  mov    0xc8(%rbx),%eax
  cmp    $0x11000002,%eax
  jne    L1082
L982:
  mov    0x60(%r12),%rax
  add    $0xcc,%rbx
  movslq %ebx,%rbx
  cmp    %rbx,%rax
  jne    L39
L703:
  mov    $0x6,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L700
  mov    $0x0,%eax
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L800:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L623
L322:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L522
L541:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L37
L391:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L665
L447:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L304
L192:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L315
L438:
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L33
L974:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L476
L685:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L904
L358:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L34
L44:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L585
L426:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L415
L1106:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L390
L969:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L184
L772:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L591
L469:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L764
L361:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L130
L121:
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L690
L867:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L527
L178:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L255
L777:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L874
L582:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L552
L569:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L1118
L575:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L749
L691:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L92
L230:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L745
L829:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L942
L1032:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L107
L987:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L330
L325:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L332
L350:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L198
L1083:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L546
L439:
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L451
L403:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L134
L297:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L185
L158:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L290
L334:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L881
L961:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L311
L305:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L592
L1052:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L848
L1008:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L612
L741:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L717
L810:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L223
L336:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L207
L610:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L666
L515:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L731
L86:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L812
L329:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L975
L407:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L69
L692:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L111
L1082:
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L982
L39:
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <fail@plt>
  jmp    L703
L700:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
grtc_test(int paddr, int buffersize) {
  report_device(0x01031000);
  struct grtc_reg {
    volatile unsigned long grr;
    volatile unsigned long gcr;
    volatile unsigned long pmr;
    volatile unsigned long sir;
    volatile unsigned long far;
    volatile unsigned long clcwr1;
    volatile unsigned long clcwr2;
    volatile unsigned long phir;
    volatile unsigned long cor;
    volatile unsigned long str;
    volatile unsigned long asr;
    volatile unsigned long rrp;
    volatile unsigned long rwp;
    volatile unsigned long dummy0;
    volatile unsigned long dummy1;
    volatile unsigned long dummy2;
    volatile unsigned long dummy3;
    volatile unsigned long dummy4;
    volatile unsigned long dummy5;
    volatile unsigned long dummy6;
    volatile unsigned long dummy7;
    volatile unsigned long dummy8;
    volatile unsigned long dummy9;
    volatile unsigned long dummy10;
    volatile unsigned long pimsr;
    volatile unsigned long pimr;
    volatile unsigned long pisr;
    volatile unsigned long pir;
    volatile unsigned long imr;
    volatile unsigned long picr;
  };
  struct grtc_reg *ltc = (struct grtc_reg *)(paddr);
  report_subtest(0x0);
  int SEB = 0x55;
  int SRST = 1;
  ltc->grr = (SEB << 24) | (SRST);
  int PSS = 0;
  int NRZM = 0;
  int PSR = 0;
  ltc->gcr = (SEB << 24) | (PSS << 12) | (NRZM << 11) | (PSR << 10);
  int MASK = 0;
  ltc->pmr = MASK;
  int CWTY = 0;
  int VNUM = 0;
  int STAF = 0;
  int CIE = 0;
  int VCI = 0;
  int NRFA = 0;
  int NBLO = 0;
  int LOUT = 0;
  int WAIT = 0;
  int RTMI = 0;
  int FBCO = 0;
  int RTYPE = 0;
  int RVAL = 0;
  volatile long int framememory[buffersize / 4];
  long int framememorybase;
  framememorybase = (long int)&framememory[0];
  framememorybase = framememorybase & 0xFFFFFC00;
  framememorybase = framememorybase + 0x400;
  int BUFST = (framememorybase >> 10) & 0x003FFFFF;
  int RXLEN = (buffersize / 1024 - 1) & 0x3FF;
  ltc->asr = (BUFST << 10) | (RXLEN);
  int PCS = 0;
  int POV = 0;
  int PRBF = 0;
  int PCR = 0;
  int PFAR = 0;
  int PBLO = 0;
  int PRFA = 0;
  int CRST = 0;
  int RE = 1;
  ltc->cor = (SEB << 24) | (CRST << 9) | (RE);
  report_subtest(0x1);
  report_subtest(0x2);
  while ((ltc->pir & 0x40) != 0x40)
    ;
  volatile int *memoryrx;
  memoryrx = (int *)framememorybase;
  if (0x10010500 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0xC0000000 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0x00000700 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0x00000100 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0x02000300 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0x04000500 != *memoryrx)
    fail(1);
  memoryrx++;
  if (0x3700C500 != *memoryrx)
    fail(1);
  memoryrx++;
  NRZM = 1;
  PSR = 0;
  ltc->gcr = (SEB << 24) | (PSS << 12) | (NRZM << 11) | (PSR << 10);
  report_subtest(0x3);
  while ((ltc->pir & 0x40) != 0x40)
    ;
  if (0x00021001 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x0500C000 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x01000000 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x0E000000 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x01000200 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x03000400 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x05000600 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x07000800 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x09000A00 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0x0B000C00 != *memoryrx)
    fail(2);
  memoryrx++;
  if (0xC7005F00 != *memoryrx)
    fail(2);
  memoryrx++;
  NRZM = 0;
  PSR = 1;
  ltc->gcr = (SEB << 24) | (PSS << 12) | (NRZM << 11) | (PSR << 10);
  report_subtest(0x4);
  while ((ltc->pir & 0x40) != 0x40)
    ;
  if (0x00021001 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x0500C000 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x02000000 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x15000000 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x01000200 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x03000400 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x05000600 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x07000800 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x09000A00 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x0B000C00 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x0D000E00 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x0F001000 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x11001200 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0x13007D00 != *memoryrx)
    fail(3);
  memoryrx++;
  if (0xBC000002 != *memoryrx)
    fail(3);
  memoryrx++;
  NRZM = 1;
  PSR = 1;
  ltc->gcr = (SEB << 24) | (PSS << 12) | (NRZM << 11) | (PSR << 10);
  report_subtest(0x5);
  while ((ltc->pir & 0x40) != 0x40)
    ;
  if (0x10010500 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0xC0000300 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x00001C00 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x00000100 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x02000300 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x04000500 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x06000700 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x08000900 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x0A000B00 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x0C000D00 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x0E000F00 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x10001100 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x12001300 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x14001500 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x16001700 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x18001900 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x1A004B00 != *memoryrx)
    fail(4);
  memoryrx++;
  if (0x11000002 != *memoryrx)
    fail(4);
  memoryrx++;
  int RXWRPR = memoryrx;
  if (ltc->rwp != RXWRPR)
    fail(5);
  report_subtest(0x6);
}
```