user: Converte this assembly snippet into its equivalent C code:

```asm
<grtm_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x1c8,%rsp
  mov    %edi,-0x1b4(%rbp)
  mov    %esi,-0x1b8(%rbp)
  mov    %edx,-0x1bc(%rbp)
  mov    %ecx,-0x1c0(%rbp)
  mov    %r8d,-0x1c4(%rbp)
  mov    %r9d,-0x1c8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    $0x1030000,%edi
  mov    $0x0,%eax
  call   <report_device@plt>
  mov    -0x1b4(%rbp),%eax
  cltq
  mov    %rax,-0x98(%rbp)
  mov    -0x1b4(%rbp),%eax
  sub    $0xffffff80,%eax
  cltq
  mov    %rax,-0x90(%rbp)
  mov    -0x1c4(%rbp),%eax
  sub    $0x1,%eax
  shl    $0xf,%eax
  mov    %eax,%edx
  mov    -0x1c8(%rbp),%eax
  shl    $0xe,%eax
  or     %eax,%edx
  mov    0x10(%rbp),%eax
  shl    $0xd,%eax
  or     %eax,%edx
  mov    0x18(%rbp),%eax
  shl    $0xc,%eax
  or     %eax,%edx
  mov    0x28(%rbp),%eax
  shl    $0xb,%eax
  or     %eax,%edx
  mov    0x20(%rbp),%eax
  shl    $0xa,%eax
  or     %eax,%edx
  mov    0x30(%rbp),%eax
  shl    $0x9,%eax
  or     %eax,%edx
  mov    0x38(%rbp),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  cltq
  mov    %rax,-0x88(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  mov    -0x98(%rbp),%rax
  mov    0x28(%rax),%rax
  movzbl %al,%eax
  cmp    $0x1,%rax
  je     L145
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <fail@plt>
L145:
  movl   $0x0,-0x19c(%rbp)
  movl   $0x1,-0x198(%rbp)
  movl   $0x1,-0x194(%rbp)
  movl   $0x0,-0x190(%rbp)
  movl   $0x0,-0x18c(%rbp)
  mov    -0x19c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x198(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0x194(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x190(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x18c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x0,-0x198(%rbp)
  movl   $0x0,-0x194(%rbp)
  movl   $0x0,-0x18c(%rbp)
  mov    -0x19c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x198(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0x194(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x190(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x18c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x40,-0x188(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  lea    0xdf(%rax),%edx
  mov    -0x1c4(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x184(%rbp)
  mov    -0x188(%rbp),%eax
  sub    $0x1,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  mov    -0x184(%rbp),%eax
  sub    $0x1,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,0x10(%rax)
  movl   $0x1,-0x180(%rbp)
  movl   $0x1,-0x17c(%rbp)
  movl   $0x0,-0x178(%rbp)
  movl   $0x1,-0x174(%rbp)
  mov    -0x180(%rbp),%eax
  shl    $0x1f,%eax
  mov    %eax,%edx
  mov    -0x17c(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x178(%rbp),%eax
  shl    $0xf,%eax
  or     %edx,%eax
  or     -0x174(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x20(%rax)
  movl   $0x0,-0x170(%rbp)
  movl   $0x0,-0x16c(%rbp)
  movl   $0x0,-0x168(%rbp)
  mov    -0x1c8(%rbp),%eax
  mov    %eax,-0x164(%rbp)
  mov    -0x1c4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x160(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    0x18(%rbp),%eax
  mov    %eax,-0x158(%rbp)
  mov    0x28(%rbp),%eax
  mov    %eax,-0x154(%rbp)
  mov    0x20(%rbp),%eax
  mov    %eax,-0x150(%rbp)
  movl   $0x0,-0x14c(%rbp)
  mov    0x30(%rbp),%eax
  mov    %eax,-0x148(%rbp)
  mov    0x38(%rbp),%eax
  mov    %eax,-0x144(%rbp)
  mov    -0x170(%rbp),%eax
  shl    $0x13,%eax
  mov    %eax,%edx
  mov    -0x16c(%rbp),%eax
  shl    $0x11,%eax
  or     %eax,%edx
  mov    -0x168(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x164(%rbp),%eax
  shl    $0xf,%eax
  or     %eax,%edx
  mov    -0x160(%rbp),%eax
  shl    $0xc,%eax
  or     %eax,%edx
  mov    -0x15c(%rbp),%eax
  shl    $0xb,%eax
  or     %eax,%edx
  mov    -0x158(%rbp),%eax
  shl    $0x7,%eax
  or     %eax,%edx
  mov    -0x154(%rbp),%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0x150(%rbp),%eax
  shl    $0x5,%eax
  or     %eax,%edx
  mov    -0x14c(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x148(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x144(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x28(%rax)
  movq   $0x352ef853,-0x80(%rbp)
  mov    -0x80(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x30(%rax)
  movl   $0x0,-0x140(%rbp)
  movl   $0x0,-0x13c(%rbp)
  movl   $0x1,-0x138(%rbp)
  movl   $0x0,-0x134(%rbp)
  movl   $0x0,-0x130(%rbp)
  mov    -0x140(%rbp),%eax
  shl    $0x11,%eax
  mov    %eax,%edx
  mov    -0x13c(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x138(%rbp),%eax
  shl    $0xf,%eax
  or     %eax,%edx
  mov    -0x134(%rbp),%eax
  shl    $0xe,%eax
  or     %eax,%edx
  mov    -0x130(%rbp),%eax
  shl    $0xc,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x40(%rax)
  movl   $0x1,-0x12c(%rbp)
  movl   $0x0,-0x128(%rbp)
  movl   $0x1,-0x124(%rbp)
  movl   $0x1,-0x120(%rbp)
  mov    -0x12c(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x128(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x124(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x120(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x48(%rax)
  movl   $0x1,-0x11c(%rbp)
  movl   $0x1,-0x118(%rbp)
  movl   $0x0,-0x114(%rbp)
  movl   $0x0,-0x110(%rbp)
  movl   $0x0,-0x10c(%rbp)
  movl   $0x0,-0x108(%rbp)
  movl   $0x7,-0x104(%rbp)
  movl   $0x123,-0x100(%rbp)
  mov    -0x11c(%rbp),%eax
  shl    $0x15,%eax
  mov    %eax,%edx
  mov    -0x118(%rbp),%eax
  shl    $0x14,%eax
  or     %eax,%edx
  mov    -0x114(%rbp),%eax
  shl    $0x13,%eax
  or     %eax,%edx
  mov    -0x110(%rbp),%eax
  shl    $0x12,%eax
  or     %eax,%edx
  mov    -0x10c(%rbp),%eax
  shl    $0x11,%eax
  or     %eax,%edx
  mov    -0x108(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x104(%rbp),%eax
  shl    $0xa,%eax
  or     %edx,%eax
  or     -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x50(%rax)
  mov    $0xfeedbacc,%eax
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0xa0(%rax)
  movl   $0x1,-0xfc(%rbp)
  mov    -0xfc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
  nop
L173:
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  and    $0x40,%eax
  cmp    $0x40,%rax
  jne    L173
  movl   $0x0,-0x19c(%rbp)
  movl   $0x1,-0x198(%rbp)
  movl   $0x1,-0x194(%rbp)
  movl   $0x0,-0x190(%rbp)
  movl   $0x0,-0x18c(%rbp)
  mov    -0x19c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x198(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0x194(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x190(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x18c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x0,-0x198(%rbp)
  movl   $0x0,-0x194(%rbp)
  movl   $0x0,-0x18c(%rbp)
  mov    -0x19c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x198(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0x194(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x190(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x18c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x40,-0x188(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  lea    0xdf(%rax),%edx
  mov    -0x1c4(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x184(%rbp)
  mov    -0x188(%rbp),%eax
  sub    $0x1,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  mov    -0x184(%rbp),%eax
  sub    $0x1,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,0x10(%rax)
  movl   $0x1,-0x180(%rbp)
  movl   $0x1,-0x17c(%rbp)
  movl   $0x0,-0x178(%rbp)
  movl   $0x1,-0x174(%rbp)
  mov    -0x180(%rbp),%eax
  shl    $0x1f,%eax
  mov    %eax,%edx
  mov    -0x17c(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x178(%rbp),%eax
  shl    $0xf,%eax
  or     %edx,%eax
  or     -0x174(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x20(%rax)
  movl   $0x0,-0x170(%rbp)
  movl   $0x0,-0x16c(%rbp)
  movl   $0x0,-0x168(%rbp)
  mov    -0x1c8(%rbp),%eax
  mov    %eax,-0x164(%rbp)
  mov    -0x1c4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x160(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    0x18(%rbp),%eax
  mov    %eax,-0x158(%rbp)
  mov    0x28(%rbp),%eax
  mov    %eax,-0x154(%rbp)
  mov    0x20(%rbp),%eax
  mov    %eax,-0x150(%rbp)
  movl   $0x0,-0x14c(%rbp)
  mov    0x30(%rbp),%eax
  mov    %eax,-0x148(%rbp)
  mov    0x38(%rbp),%eax
  mov    %eax,-0x144(%rbp)
  mov    -0x170(%rbp),%eax
  shl    $0x13,%eax
  mov    %eax,%edx
  mov    -0x16c(%rbp),%eax
  shl    $0x11,%eax
  or     %eax,%edx
  mov    -0x168(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x164(%rbp),%eax
  shl    $0xf,%eax
  or     %eax,%edx
  mov    -0x160(%rbp),%eax
  shl    $0xc,%eax
  or     %eax,%edx
  mov    -0x15c(%rbp),%eax
  shl    $0xb,%eax
  or     %eax,%edx
  mov    -0x158(%rbp),%eax
  shl    $0x7,%eax
  or     %eax,%edx
  mov    -0x154(%rbp),%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0x150(%rbp),%eax
  shl    $0x5,%eax
  or     %eax,%edx
  mov    -0x14c(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x148(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x144(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x28(%rax)
  movq   $0x352ef853,-0x80(%rbp)
  mov    -0x80(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x30(%rax)
  movl   $0x0,-0x140(%rbp)
  movl   $0x0,-0x13c(%rbp)
  movl   $0x1,-0x138(%rbp)
  movl   $0x0,-0x134(%rbp)
  movl   $0x0,-0x130(%rbp)
  mov    -0x140(%rbp),%eax
  shl    $0x11,%eax
  mov    %eax,%edx
  mov    -0x13c(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x138(%rbp),%eax
  shl    $0xf,%eax
  or     %eax,%edx
  mov    -0x134(%rbp),%eax
  shl    $0xe,%eax
  or     %eax,%edx
  mov    -0x130(%rbp),%eax
  shl    $0xc,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x40(%rax)
  movl   $0x1,-0x12c(%rbp)
  movl   $0x0,-0x128(%rbp)
  movl   $0x1,-0x124(%rbp)
  movl   $0x1,-0x120(%rbp)
  mov    -0x12c(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x128(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x124(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x120(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x48(%rax)
  movl   $0x1,-0x11c(%rbp)
  movl   $0x1,-0x118(%rbp)
  movl   $0x0,-0x114(%rbp)
  movl   $0x0,-0x110(%rbp)
  movl   $0x0,-0x10c(%rbp)
  movl   $0x0,-0x108(%rbp)
  movl   $0x7,-0x104(%rbp)
  movl   $0x123,-0x100(%rbp)
  mov    -0x11c(%rbp),%eax
  shl    $0x15,%eax
  mov    %eax,%edx
  mov    -0x118(%rbp),%eax
  shl    $0x14,%eax
  or     %eax,%edx
  mov    -0x114(%rbp),%eax
  shl    $0x13,%eax
  or     %eax,%edx
  mov    -0x110(%rbp),%eax
  shl    $0x12,%eax
  or     %eax,%edx
  mov    -0x10c(%rbp),%eax
  shl    $0x11,%eax
  or     %eax,%edx
  mov    -0x108(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x104(%rbp),%eax
  shl    $0xa,%eax
  or     %edx,%eax
  or     -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x50(%rax)
  mov    $0xfeedbacc,%eax
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0xa0(%rax)
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movl   $0x1,-0xfc(%rbp)
  mov    -0xfc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
  nop
L60:
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  and    $0x40,%eax
  cmp    $0x40,%rax
  jne    L60
  mov    -0x1b8(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x70(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1e0(%rbp)
  movq   $0x0,-0x1d8(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1f0(%rbp)
  movq   $0x0,-0x1e8(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L45:
  cmp    %rdx,%rsp
  je     L47
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L45
L47:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L157
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L157:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    $0xfffffc00,%eax
  and    %rax,-0x60(%rbp)
  addq   $0x400,-0x60(%rbp)
  mov    -0x1bc(%rbp),%eax
  imul   -0x1c0(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x58(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L147:
  cmp    %rdx,%rsp
  je     L18
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L147
L18:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L164
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L164:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    $0xfffffc00,%eax
  and    %rax,-0x48(%rbp)
  addq   $0x400,-0x48(%rbp)
  mov    -0x60(%rbp),%rax
  sar    $0xa,%rax
  mov    %eax,-0xf8(%rbp)
  movl   $0x0,-0xf4(%rbp)
  mov    -0xf8(%rbp),%eax
  shl    $0xa,%eax
  mov    %eax,%edx
  mov    -0xf4(%rbp),%eax
  shl    $0x3,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,0x18(%rax)
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movl   $0x0,-0xf0(%rbp)
  movl   $0x0,-0xec(%rbp)
  movl   $0x0,-0xe8(%rbp)
  movl   $0x0,-0xe4(%rbp)
  movl   $0x0,-0xe0(%rbp)
  movl   $0x0,-0xdc(%rbp)
  movl   $0x0,-0xd8(%rbp)
  movl   $0x0,-0xd4(%rbp)
  movl   $0x0,-0xd0(%rbp)
  movl   $0x0,-0xcc(%rbp)
  movl   $0x0,-0xc8(%rbp)
  movl   $0x1,-0xc4(%rbp)
  mov    -0xf0(%rbp),%eax
  shl    $0xf,%eax
  mov    %eax,%edx
  mov    -0xec(%rbp),%eax
  shl    $0xe,%eax
  or     %eax,%edx
  mov    -0xe8(%rbp),%eax
  shl    $0x9,%eax
  or     %eax,%edx
  mov    -0xe4(%rbp),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0xe0(%rbp),%eax
  shl    $0x7,%eax
  or     %eax,%edx
  mov    -0xdc(%rbp),%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0xd8(%rbp),%eax
  shl    $0x5,%eax
  or     %eax,%edx
  mov    -0xd4(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0xd0(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0xcc(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0xc8(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0xc4(%rbp),%eax
  mov    %eax,-0x1a4(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  movl   $0x0,-0x1a0(%rbp)
  jmp    L103
L3:
  cmpl   $0x3,-0x1a0(%rbp)
  jne    L23
  movl   $0x1,-0xc8(%rbp)
  mov    -0xf0(%rbp),%eax
  shl    $0xf,%eax
  mov    %eax,%edx
  mov    -0xec(%rbp),%eax
  shl    $0xe,%eax
  or     %eax,%edx
  mov    -0xe8(%rbp),%eax
  shl    $0x9,%eax
  or     %eax,%edx
  mov    -0xe4(%rbp),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0xe0(%rbp),%eax
  shl    $0x7,%eax
  or     %eax,%edx
  mov    -0xdc(%rbp),%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0xd8(%rbp),%eax
  shl    $0x5,%eax
  or     %eax,%edx
  mov    -0xd4(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0xd0(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0xcc(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0xc8(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0xc4(%rbp),%eax
  mov    %eax,-0x1a4(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    -0x1a4(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L84
L23:
  mov    -0xa0(%rbp),%rax
  mov    -0x1a4(%rbp),%edx
  mov    %edx,(%rax)
L84:
  addq   $0x4,-0xa0(%rbp)
  mov    -0x1a0(%rbp),%eax
  imul   -0x1bc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0xa0(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x4,-0xa0(%rbp)
  addl   $0x1,-0x1a0(%rbp)
L103:
  cmpl   $0x3,-0x1a0(%rbp)
  jle    L3
  movl   $0x0,-0xc0(%rbp)
  movl   $0x0,-0xbc(%rbp)
  movq   $0x0,-0x40(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  add    $0xdf,%eax
  imul   -0x1c4(%rbp),%eax
  mov    %eax,%esi
  mov    -0xc0(%rbp),%edi
  mov    -0xbc(%rbp),%ecx
  mov    -0x124(%rbp),%edx
  mov    -0x100(%rbp),%eax
  sub    $0x8,%rsp
  push   -0xa0(%rbp)
  push   %rsi
  push   -0x40(%rbp)
  push   $0x1
  push   $0xffffffffbaadcaad
  push   $0x0
  push   $0x3
  push   $0x0
  push   $0x0
  mov    $0x0,%r9d
  mov    %edi,%r8d
  mov    $0x6,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <TMTF@plt>
  add    $0x50,%rsp
  addl   $0x1,-0xbc(%rbp)
  addl   $0x1,-0xc0(%rbp)
  addq   $0x1,-0x40(%rbp)
  mov    -0x1bc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  add    $0xdf,%eax
  imul   -0x1c4(%rbp),%eax
  mov    %eax,%esi
  mov    -0xc0(%rbp),%edi
  mov    -0xbc(%rbp),%ecx
  mov    -0x124(%rbp),%edx
  mov    -0x100(%rbp),%eax
  sub    $0x8,%rsp
  push   -0xa0(%rbp)
  push   %rsi
  push   -0x40(%rbp)
  push   $0x1
  push   $0xffffffffbaadcaad
  push   $0x0
  push   $0x3
  push   $0x0
  push   $0x0
  mov    $0x0,%r9d
  mov    %edi,%r8d
  mov    $0x6,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <TMTF@plt>
  add    $0x50,%rsp
  addl   $0x1,-0xbc(%rbp)
  addl   $0x1,-0xc0(%rbp)
  addq   $0x1,-0x40(%rbp)
  mov    -0x1bc(%rbp),%eax
  add    %eax,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  add    $0xdf,%eax
  imul   -0x1c4(%rbp),%eax
  mov    %eax,%esi
  mov    -0xc0(%rbp),%edi
  mov    -0xbc(%rbp),%ecx
  mov    -0x124(%rbp),%edx
  mov    -0x100(%rbp),%eax
  sub    $0x8,%rsp
  push   -0xa0(%rbp)
  push   %rsi
  push   -0x40(%rbp)
  push   $0x1
  push   $0xffffffffbaadcaad
  push   $0x0
  push   $0x3
  push   $0x0
  push   $0x0
  mov    $0x0,%r9d
  mov    %edi,%r8d
  mov    $0x6,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <TMTF@plt>
  add    $0x50,%rsp
  addl   $0x1,-0xbc(%rbp)
  addl   $0x1,-0xc0(%rbp)
  addq   $0x1,-0x40(%rbp)
  mov    -0x1bc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x4,%eax
  add    $0xdf,%eax
  imul   -0x1c4(%rbp),%eax
  mov    %eax,%esi
  mov    -0xc0(%rbp),%edi
  mov    -0xbc(%rbp),%ecx
  mov    -0x124(%rbp),%edx
  mov    -0x100(%rbp),%eax
  sub    $0x8,%rsp
  push   -0xa0(%rbp)
  push   %rsi
  push   -0x40(%rbp)
  push   $0x1
  push   $0xffffffffbaadcaad
  push   $0x0
  push   $0x3
  push   $0x0
  push   $0x0
  mov    $0x0,%r9d
  mov    %edi,%r8d
  mov    $0x6,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <TMTF@plt>
  add    $0x50,%rsp
  addl   $0x1,-0xbc(%rbp)
  addl   $0x1,-0xc0(%rbp)
  addq   $0x1,-0x40(%rbp)
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movl   $0x1,-0x18c(%rbp)
  mov    -0x19c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x198(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0x194(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0x190(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0x18c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  nop
L114:
  mov    -0x98(%rbp),%rax
  mov    (%rax),%rax
  and    $0x1,%eax
  test   %rax,%rax
  jne    L114
  mov    $0x4,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  nop
L95:
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  and    $0x20,%eax
  cmp    $0x20,%rax
  jne    L95
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movl   $0x0,-0xb8(%rbp)
  movl   $0x1,-0xb4(%rbp)
  movl   $0x1,-0xb0(%rbp)
  movl   $0x1,-0xac(%rbp)
  movl   $0x1,-0xa8(%rbp)
  movl   $0x1,-0xa4(%rbp)
  mov    -0xb8(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edx
  mov    -0xb4(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0xb0(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0xac(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0xa8(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0xa4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,0x8(%rax)
  nop
L49:
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  and    $0x10,%eax
  cmp    $0x10,%rax
  jne    L49
  mov    $0x6,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  movl   $0x0,-0xb8(%rbp)
  movl   $0x1,-0xb4(%rbp)
  movl   $0x1,-0xb0(%rbp)
  movl   $0x1,-0xac(%rbp)
  movl   $0x1,-0xa8(%rbp)
  movl   $0x1,-0xa4(%rbp)
  mov    -0xb8(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edx
  mov    -0xb4(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0xb0(%rbp),%eax
  shl    $0x3,%eax
  or     %eax,%edx
  mov    -0xac(%rbp),%eax
  shl    $0x2,%eax
  or     %eax,%edx
  mov    -0xa8(%rbp),%eax
  add    %eax,%eax
  or     %edx,%eax
  or     -0xa4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,0x8(%rax)
  nop
L19:
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  and    $0x10,%eax
  cmp    $0x10,%rax
  jne    L19
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  mov    $0x7,%edi
  mov    $0x0,%eax
  call   <report_subtest@plt>
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L146
  call   <__stack_chk_fail@plt>
L146:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
grtm_test(int paddr, int descsize, int buffersize, int buffers, int rsdepth, int reed, int reed8, int pseudo, int conv, int mark, int split, int sub) {
  report_device(0x01030000);
  struct grtm_dma {
    volatile unsigned long ctrl;
    volatile unsigned long stat;
    volatile unsigned long len;
    volatile unsigned long descr;
    volatile unsigned long conf;
    volatile unsigned long rev;
  };
  struct grtm_tx {
    volatile unsigned long ctrl;
    volatile unsigned long stat;
    volatile unsigned long conf;
    volatile unsigned long dummy0;
    volatile unsigned long phy;
    volatile unsigned long code;
    volatile unsigned long aasm;
    volatile unsigned long dummy1;
    volatile unsigned long all;
    volatile unsigned long master;
    volatile unsigned long idle;
    volatile unsigned long dummy2;
    volatile unsigned long dummy3;
    volatile unsigned long dummy4;
    volatile unsigned long dummy5;
    volatile unsigned long dummy6;
    volatile unsigned long fsh0;
    volatile unsigned long fsh1;
    volatile unsigned long fsh2;
    volatile unsigned long fsh3;
    volatile unsigned long ocf;
  };
  struct grtm_dma *ldma = (struct grtm_dma *)(paddr);
  struct grtm_tx *ltx = (struct grtm_tx *)(paddr + 0x80);
  long int subtst = ((rsdepth - 1) << 15) | (reed << 14) | (reed8 << 13) | (pseudo << 12) | (mark << 11) | (conv << 10) | (split << 9) | (sub << 8);
  report_subtest(subtst);
  if ((ldma->rev & 0xff) != 1)
    fail(1);
  int TFIE = 0;
  int RST = 1;
  int TXRST = 1;
  int IE = 0;
  int EN = 0;
  ldma->ctrl = (TFIE << 4) | (RST << 3) | (TXRST << 2) | (IE << 1) | (EN);
  RST = 0;
  TXRST = 0;
  EN = 0;
  ldma->ctrl = (TFIE << 4) | (RST << 3) | (TXRST << 2) | (IE << 1) | (EN);
  int LIMIT = 32 * 2;
  int LENGTH = rsdepth * (223 + 16 * reed8);
  ldma->len = ((LIMIT - 1) << 16) | (LENGTH - 1);
  int SF = 1;
  int SYMBOLRATE = 1;
  int SCF = 0;
  int SUBRATE = 1;
  ltx->phy = (SF << 31) | (SYMBOLRATE << 16) | (SCF << 15) | (SUBRATE);
  int CIF = 0;
  int CSEL = 0;
  int AASM = 0;
  int RS = reed;
  int RSDEPTH = rsdepth - 1;
  int RS8 = reed8;
  int PSR = pseudo;
  int NRZ = mark;
  int CE = conv;
  int CERATE = 0;
  int SP = split;
  int SC = sub;
  ltx->code = (CIF << 19) | (CSEL << 17) | (AASM << 16) | (RS << 15) | (RSDEPTH << 12) | (RS8 << 11) | (PSR << 7) | (NRZ << 6) | (CE << 5) | (CERATE << 2) | (SP << 1) | (SC);
  long int SYNC = 0x352EF853;
  ltx->aasm = SYNC;
  int FSHLENGTH = 0;
  int IZ = 0;
  int FECF = 1;
  int FHEC = 0;
  int VER = 0x0;
  ltx->all = (FSHLENGTH << 17) | (IZ << 16) | (FECF << 15) | (FHEC << 14) | (VER << 12);
  int MC = 1;
  int FSH = 0;
  int OCF = 1;
  int OW = 1;
  ltx->master = (MC << 3) | (FSH << 2) | (OCF << 1) | (OW);
  int IDLE = 1;
  int IDLE_OCF = 1;
  int EVC = 0;
  int IDLE_FSH = 0;
  int VCC = 0;
  int IDLE_MC = 0;
  int VCID = 0x7;
  int SCID = 0x123;
  ltx->idle = (IDLE << 21) | (IDLE_OCF << 20) | (EVC << 19) | (IDLE_FSH << 18) | (VCC << 17) | (IDLE_MC << 16) | (VCID << 10) | (SCID);
  long int CLCW = 0xFEEDBACC;
  ltx->ocf = CLCW;
  int TXTE = 1;
  ltx->ctrl = (TXTE);
  while ((ldma->stat & 0x40) != 0x40)
    ;
  TFIE = 0;
  RST = 1;
  TXRST = 1;
  IE = 0;
  EN = 0;
  ldma->ctrl = (TFIE << 4) | (RST << 3) | (TXRST << 2) | (IE << 1) | (EN);
  RST = 0;
  TXRST = 0;
  EN = 0;
  ldma->ctrl = (TFIE << 4) | (RST << 3) | (TXRST << 2) | (IE << 1) | (EN);
  LIMIT = 32 * 2;
  LENGTH = rsdepth * (223 + 16 * reed8);
  ldma->len = ((LIMIT - 1) << 16) | (LENGTH - 1);
  SF = 1;
  SYMBOLRATE = 1;
  SCF = 0;
  SUBRATE = 1;
  ltx->phy = (SF << 31) | (SYMBOLRATE << 16) | (SCF << 15) | (SUBRATE);
  CIF = 0;
  CSEL = 0;
  AASM = 0;
  RS = reed;
  RSDEPTH = rsdepth - 1;
  RS8 = reed8;
  PSR = pseudo;
  NRZ = mark;
  CE = conv;
  CERATE = 0;
  SP = split;
  SC = sub;
  ltx->code = (CIF << 19) | (CSEL << 17) | (AASM << 16) | (RS << 15) | (RSDEPTH << 12) | (RS8 << 11) | (PSR << 7) | (NRZ << 6) | (CE << 5) | (CERATE << 2) | (SP << 1) | (SC);
  SYNC = 0x352EF853;
  ltx->aasm = SYNC;
  FSHLENGTH = 0;
  IZ = 0;
  FECF = 1;
  FHEC = 0;
  VER = 0x0;
  ltx->all = (FSHLENGTH << 17) | (IZ << 16) | (FECF << 15) | (FHEC << 14) | (VER << 12);
  MC = 1;
  FSH = 0;
  OCF = 1;
  OW = 1;
  ltx->master = (MC << 3) | (FSH << 2) | (OCF << 1) | (OW);
  IDLE = 1;
  IDLE_OCF = 1;
  EVC = 0;
  IDLE_FSH = 0;
  VCC = 0;
  IDLE_MC = 0;
  VCID = 0x7;
  SCID = 0x123;
  ltx->idle = (IDLE << 21) | (IDLE_OCF << 20) | (EVC << 19) | (IDLE_FSH << 18) | (VCC << 17) | (IDLE_MC << 16) | (VCID << 10) | (SCID);
  CLCW = 0xFEEDBACC;
  ltx->ocf = CLCW;
  report_subtest(0x1);
  TXTE = 1;
  ltx->ctrl = (TXTE);
  while ((ldma->stat & 0x40) != 0x40)
    ;
  volatile long int descmemory[descsize / 4];
  long int descmemorybase;
  descmemorybase = (long int)&descmemory[0];
  descmemorybase = descmemorybase & 0xFFFFFC00;
  descmemorybase = descmemorybase + 0x400;
  volatile long int framememory[buffersize * buffers / 4];
  long int framememorybase;
  framememorybase = (long int)&framememory[0];
  framememorybase = framememorybase & 0xFFFFFC00;
  framememorybase = framememorybase + 0x400;
  int BASE = descmemorybase >> 10;
  int INDEX = 0;
  ldma->descr = (BASE << 10) | (INDEX << 3);
  report_subtest(0x2);
  int UE = 0;
  int TS = 0;
  int VCE = 0;
  int MCB = 0;
  int FSHB = 0;
  int OCFB = 0;
  int FHECB = 0;
  int IZB = 0;
  int FECFB = 0;
  int DESC_IE = 0;
  int WR = 0;
  int DESC_EN = 1;
  int DESCRIPTOR = (UE << 15) | (TS << 14) | (VCE << 9) | (MCB << 8) | (FSHB << 7) | (OCFB << 6) | (FHECB << 5) | (IZB << 4) | (FECFB << 3) | (DESC_IE << 2) | (WR << 1) | (DESC_EN);
  volatile int *memorytx;
  memorytx = (int *)descmemorybase;
  int i;
  for (i = 0; i < 4; i++) {
    if (i == 3) {
      WR = 1;
      DESCRIPTOR = (UE << 15) | (TS << 14) | (VCE << 9) | (MCB << 8) | (FSHB << 7) | (OCFB << 6) | (FHECB << 5) | (IZB << 4) | (FECFB << 3) | (DESC_IE << 2) | (WR << 1) | (DESC_EN);
      *memorytx = DESCRIPTOR;
    } else
      *memorytx = DESCRIPTOR;
    memorytx++;
    *memorytx = framememorybase + i * buffersize;
    memorytx++;
  };
  int VCFrameCntr = 0;
  int MCFrameCntr = 0;
  long int SequenceCount = 0;
  memorytx = (int *)framememorybase;
  TMTF(SCID, 6, OCF, MCFrameCntr, VCFrameCntr, 0, 0, 0, 3, 0, 0xBAADCAAD, 1, SequenceCount, rsdepth * (223 + 16 * reed8), memorytx);
  MCFrameCntr++;
  VCFrameCntr++;
  SequenceCount++;
  memorytx = (int *)(framememorybase + buffersize);
  TMTF(SCID, 6, OCF, MCFrameCntr, VCFrameCntr, 0, 0, 0, 3, 0, 0xBAADCAAD, 1, SequenceCount, rsdepth * (223 + 16 * reed8), memorytx);
  MCFrameCntr++;
  VCFrameCntr++;
  SequenceCount++;
  memorytx = (int *)(framememorybase + buffersize * 2);
  TMTF(SCID, 6, OCF, MCFrameCntr, VCFrameCntr, 0, 0, 0, 3, 0, 0xBAADCAAD, 1, SequenceCount, rsdepth * (223 + 16 * reed8), memorytx);
  MCFrameCntr++;
  VCFrameCntr++;
  SequenceCount++;
  memorytx = (int *)(framememorybase + buffersize * 3);
  TMTF(SCID, 6, OCF, MCFrameCntr, VCFrameCntr, 0, 0, 0, 3, 0, 0xBAADCAAD, 1, SequenceCount, rsdepth * (223 + 16 * reed8), memorytx);
  MCFrameCntr++;
  VCFrameCntr++;
  SequenceCount++;
  report_subtest(0x3);
  EN = 1;
  ldma->ctrl = (TFIE << 4) | (RST << 3) | (TXRST << 2) | (IE << 1) | (EN);
  while ((ldma->ctrl & 0x1) != 0x0)
    ;
  report_subtest(0x4);
  while ((ldma->stat & 0x20) != 0x20)
    ;
  report_subtest(0x5);
  int TFO = 0;
  int TFS = 1;
  int TFF = 1;
  int TA = 1;
  int TI = 1;
  int TERROR = 1;
  ldma->stat = (TFO << 5) | (TFS << 4) | (TFF << 3) | (TA << 2) | (TI << 1) | (TERROR);
  while ((ldma->stat & 0x10) != 0x10)
    ;
  report_subtest(0x6);
  TFO = 0;
  TFS = 1;
  TFF = 1;
  TA = 1;
  TI = 1;
  TERROR = 1;
  ldma->stat = (TFO << 5) | (TFS << 4) | (TFF << 3) | (TA << 2) | (TI << 1) | (TERROR);
  while ((ldma->stat & 0x10) != 0x10)
    ;
  report_subtest(subtst);
  report_subtest(0x7);
}
```