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

```asm
<CreateUmtsInterleaver>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x328,%rsp
  mov    %edi,0x2c(%rsp)
  mov    %rsi,%rbp
  mov    %rdx,0x60(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x318(%rsp)
  xor    %eax,%eax
  movl   $0x7,0x170(%rsp)
  movl   $0xb,0x174(%rsp)
  movl   $0xd,0x178(%rsp)
  movl   $0x11,0x17c(%rsp)
  movl   $0x13,0x180(%rsp)
  movl   $0x17,0x184(%rsp)
  movl   $0x1d,0x188(%rsp)
  movl   $0x1f,0x18c(%rsp)
  movl   $0x25,0x190(%rsp)
  movl   $0x29,0x194(%rsp)
  movl   $0x2b,0x198(%rsp)
  movl   $0x2f,0x19c(%rsp)
  movl   $0x35,0x1a0(%rsp)
  movl   $0x3b,0x1a4(%rsp)
  movl   $0x3d,0x1a8(%rsp)
  movl   $0x43,0x1ac(%rsp)
  movl   $0x47,0x1b0(%rsp)
  movl   $0x49,0x1b4(%rsp)
  movl   $0x4f,0x1b8(%rsp)
  movl   $0x53,0x1bc(%rsp)
  movl   $0x59,0x1c0(%rsp)
  movl   $0x61,0x1c4(%rsp)
  movl   $0x65,0x1c8(%rsp)
  movl   $0x67,0x1cc(%rsp)
  movl   $0x6b,0x1d0(%rsp)
  movl   $0x6d,0x1d4(%rsp)
  movl   $0x71,0x1d8(%rsp)
  movl   $0x7f,0x1dc(%rsp)
  movl   $0x83,0x1e0(%rsp)
  movl   $0x89,0x1e4(%rsp)
  movl   $0x8b,0x1e8(%rsp)
  movl   $0x95,0x1ec(%rsp)
  movl   $0x97,0x1f0(%rsp)
  movl   $0x9d,0x1f4(%rsp)
  movl   $0xa3,0x1f8(%rsp)
  movl   $0xa7,0x1fc(%rsp)
  movl   $0xad,0x200(%rsp)
  movl   $0xb3,0x204(%rsp)
  movl   $0xb5,0x208(%rsp)
  movl   $0xbf,0x20c(%rsp)
  movl   $0xc1,0x210(%rsp)
  movl   $0xc5,0x214(%rsp)
  movl   $0xc7,0x218(%rsp)
  movl   $0xd3,0x21c(%rsp)
  movl   $0xdf,0x220(%rsp)
  movl   $0xe3,0x224(%rsp)
  movl   $0xe5,0x228(%rsp)
  movl   $0xe9,0x22c(%rsp)
  movl   $0xef,0x230(%rsp)
  movl   $0xf1,0x234(%rsp)
  movl   $0xfb,0x238(%rsp)
  movl   $0x101,0x23c(%rsp)
  movl   $0x3,0x240(%rsp)
  movl   $0x2,0x244(%rsp)
  movl   $0x2,0x248(%rsp)
  movl   $0x3,0x24c(%rsp)
  movl   $0x2,0x250(%rsp)
  movl   $0x5,0x254(%rsp)
  movl   $0x2,0x258(%rsp)
  movl   $0x3,0x25c(%rsp)
  movl   $0x2,0x260(%rsp)
  movl   $0x6,0x264(%rsp)
  movl   $0x3,0x268(%rsp)
  movl   $0x5,0x26c(%rsp)
  movl   $0x2,0x270(%rsp)
  movl   $0x2,0x274(%rsp)
  movl   $0x2,0x278(%rsp)
  movl   $0x2,0x27c(%rsp)
  movl   $0x7,0x280(%rsp)
  movl   $0x5,0x284(%rsp)
  movl   $0x3,0x288(%rsp)
  movl   $0x2,0x28c(%rsp)
  movl   $0x3,0x290(%rsp)
  movl   $0x5,0x294(%rsp)
  movl   $0x2,0x298(%rsp)
  movl   $0x5,0x29c(%rsp)
  movl   $0x2,0x2a0(%rsp)
  movl   $0x6,0x2a4(%rsp)
  movl   $0x3,0x2a8(%rsp)
  movl   $0x3,0x2ac(%rsp)
  movl   $0x2,0x2b0(%rsp)
  movl   $0x3,0x2b4(%rsp)
  movl   $0x2,0x2b8(%rsp)
  movl   $0x2,0x2bc(%rsp)
  movl   $0x6,0x2c0(%rsp)
  movl   $0x5,0x2c4(%rsp)
  movl   $0x2,0x2c8(%rsp)
  movl   $0x5,0x2cc(%rsp)
  movl   $0x2,0x2d0(%rsp)
  movl   $0x2,0x2d4(%rsp)
  movl   $0x2,0x2d8(%rsp)
  movl   $0x13,0x2dc(%rsp)
  movl   $0x5,0x2e0(%rsp)
  movl   $0x2,0x2e4(%rsp)
  movl   $0x3,0x2e8(%rsp)
  movl   $0x2,0x2ec(%rsp)
  movl   $0x3,0x2f0(%rsp)
  movl   $0x2,0x2f4(%rsp)
  movl   $0x6,0x2f8(%rsp)
  movl   $0x3,0x2fc(%rsp)
  movl   $0x7,0x300(%rsp)
  movl   $0x7,0x304(%rsp)
  movl   $0x6,0x308(%rsp)
  movl   $0x3,0x30c(%rsp)
  movl   $0x4,0x80(%rsp)
  movl   $0x3,0x84(%rsp)
  movl   $0x2,0x88(%rsp)
  movl   $0x1,0x8c(%rsp)
  movl   $0x0,0x90(%rsp)
  movl   $0x9,0xa0(%rsp)
  movl   $0x8,0xa4(%rsp)
  movl   $0x7,0xa8(%rsp)
  movl   $0x6,0xac(%rsp)
  movl   $0x5,0xb0(%rsp)
  movl   $0x4,0xb4(%rsp)
  movl   $0x3,0xb8(%rsp)
  movl   $0x2,0xbc(%rsp)
  movl   $0x1,0xc0(%rsp)
  movl   $0x0,0xc4(%rsp)
  movl   $0x13,0xd0(%rsp)
  movl   $0x9,0xd4(%rsp)
  movl   $0xe,0xd8(%rsp)
  movl   $0x4,0xdc(%rsp)
  movl   $0x0,0xe0(%rsp)
  movl   $0x2,0xe4(%rsp)
  movl   $0x5,0xe8(%rsp)
  movl   $0x7,0xec(%rsp)
  movl   $0xc,0xf0(%rsp)
  movl   $0x12,0xf4(%rsp)
  movl   $0x10,0xf8(%rsp)
  movl   $0xd,0xfc(%rsp)
  movl   $0x11,0x100(%rsp)
  movl   $0xf,0x104(%rsp)
  movl   $0x3,0x108(%rsp)
  movl   $0x1,0x10c(%rsp)
  movl   $0x6,0x110(%rsp)
  movl   $0xb,0x114(%rsp)
  movl   $0x8,0x118(%rsp)
  movl   $0xa,0x11c(%rsp)
  movl   $0x13,0x120(%rsp)
  movl   $0x9,0x124(%rsp)
  movl   $0xe,0x128(%rsp)
  movl   $0x4,0x12c(%rsp)
  movl   $0x0,0x130(%rsp)
  movl   $0x2,0x134(%rsp)
  movl   $0x5,0x138(%rsp)
  movl   $0x7,0x13c(%rsp)
  movl   $0xc,0x140(%rsp)
  movl   $0x12,0x144(%rsp)
  movl   $0xa,0x148(%rsp)
  movl   $0x8,0x14c(%rsp)
  movl   $0xd,0x150(%rsp)
  movl   $0x11,0x154(%rsp)
  movl   $0x3,0x158(%rsp)
  movl   $0x1,0x15c(%rsp)
  movl   $0x10,0x160(%rsp)
  movl   $0x6,0x164(%rsp)
  movl   $0xf,0x168(%rsp)
  movl   $0xb,0x16c(%rsp)
  lea    -0x28(%rdi),%eax
  cmp    $0x77,%eax
  jbe    L187
  lea    -0xa0(%rdi),%eax
  cmp    $0x28,%eax
  jbe    L124
  lea    -0x1e1(%rdi),%eax
  cmp    $0x31,%eax
  jbe    L191
  movl   $0x14,0x28(%rsp)
L167:
  lea    0x170(%rsp),%rcx
  mov    $0x0,%edx
  mov    0x28(%rsp),%esi
  mov    0x2c(%rsp),%edi
L669:
  mov    (%rcx),%eax
  add    $0x1,%eax
  imul   %esi,%eax
  cmp    %edi,%eax
  jge    L373
  add    $0x1,%edx
  add    $0x4,%rcx
  cmp    $0x34,%edx
  jne    L669
L373:
  movslq %edx,%rdx
  mov    0x170(%rsp,%rdx,4),%ecx
  mov    %ecx,0xc(%rsp)
  mov    0x240(%rsp,%rdx,4),%ebx
  lea    -0x1(%rcx),%eax
  mov    %eax,0x30(%rsp)
  mov    0x28(%rsp),%edi
  imul   %edi,%eax
  mov    0x2c(%rsp),%esi
  cmp    %esi,%eax
  jge    L685
  add    %edi,%eax
  cmp    %esi,%eax
  setl   %al
  movzbl %al,%eax
  add    %ecx,%eax
  mov    %eax,0x30(%rsp)
  jmp    L685
L187:
  movl   $0x5,0x28(%rsp)
L676:
  mov    0x2c(%rsp),%eax
  sub    $0x1e1,%eax
  cmp    $0x31,%eax
  ja     L167
  mov    $0x2,%ebx
  movl   $0x35,0xc(%rsp)
  movl   $0x35,0x30(%rsp)
L685:
  mov    0x30(%rsp),%r13d
  mov    %r13d,%r14d
  mov    0x28(%rsp),%r12d
  imul   %r12d,%r14d
  mov    %r14d,0x44(%rsp)
  mov    $0x4,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,%r15
  mov    $0x4,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x38(%rsp)
  mov    $0x4,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x20(%rsp)
  mov    $0x0,%r8d
  mov    $0x0,%r9d
  mov    %r12d,%esi
  mov    %r13d,%r11d
  mov    %r13d,%r10d
  mov    %r12d,%r14d
  mov    0x2c(%rsp),%edi
  jmp    L620
L124:
  movl   $0xa,0x28(%rsp)
  jmp    L676
L191:
  movl   $0xa,0x28(%rsp)
  mov    $0x2,%ebx
  movl   $0x35,0xc(%rsp)
  movl   $0x35,0x30(%rsp)
  jmp    L685
L413:
  movslq %edx,%r12
  movl   $0xffffffff,(%r15,%r12,4)
L449:
  add    $0x1,%rax
  add    %esi,%edx
  cmp    %rcx,%rax
  je     L602
L272:
  cmp    %eax,%edi
  jle    L413
  movslq %edx,%r12
  mov    0x0(%rbp,%rax,4),%r8d
  mov    %r8d,(%r15,%r12,4)
  jmp    L449
L602:
  mov    (%rsp),%r8d
  add    %r11d,%r9d
L516:
  add    $0x1,%r8d
  cmp    %r14d,%r8d
  je     L0
L620:
  movslq %r9d,%rax
  mov    %r8d,%edx
  lea    (%r10,%rax,1),%rcx
  test   %r13d,%r13d
  jle    L516
  mov    %r8d,(%rsp)
  jmp    L272
L0:
  mov    0xc(%rsp),%ebp
  lea    -0x1(%rbp),%r14d
  mov    $0x4,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,%rsi
  mov    %rax,0x48(%rsp)
  movl   $0x1,(%rax)
  cmp    $0x1,%r14d
  jle    L627
  mov    %rax,%rcx
  mov    %ebp,%edi
  lea    -0x3(%rbp),%eax
  lea    0x4(%rsi,%rax,4),%rsi
L286:
  mov    %ebx,%eax
  imul   (%rcx),%eax
  cltd
  idiv   %edi
  mov    %edx,0x4(%rcx)
  add    $0x4,%rcx
  cmp    %rsi,%rcx
  jne    L286
L627:
  mov    $0x4,%esi
  mov    0x28(%rsp),%ebx
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,%rsi
  mov    %rax,0x50(%rsp)
  movl   $0x1,(%rax)
  mov    %ebx,0x40(%rsp)
  lea    -0x1(%rbx),%eax
  lea    (%rsi,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%r12d
  mov    %r15,0x18(%rsp)
  mov    %rsi,%r15
  jmp    L526
L281:
  lea    0x1(%r13),%r12d
  add    $0x1,%rbx
  cmp    $0x33,%ebx
  jg     L589
L177:
  mov    %ebx,%r13d
  mov    %ebx,%r12d
  mov    0x170(%rsp,%rbx,4),%ebp
  mov    %r14d,%esi
  mov    %ebp,%edi
  call   <gcd@plt>
  cmp    $0x1,%eax
  jne    L281
  cmp    (%r15),%ebp
  jle    L281
  mov    (%rsp),%rax
  mov    %ebp,0x4(%rax)
L589:
  add    $0x4,%r15
  cmp    0x10(%rsp),%r15
  je     L397
L526:
  movslq %r12d,%rbx
  mov    %r15,(%rsp)
  cmp    $0x33,%r12d
  jle    L177
  jmp    L589
L397:
  mov    0x18(%rsp),%r15
  mov    $0x4,%esi
  mov    0x28(%rsp),%ebx
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,%r12
  cmp    $0x5,%ebx
  je     L275
  cmpl   $0xa,0x28(%rsp)
  je     L594
  mov    0x2c(%rsp),%ecx
  lea    -0x8e9(%rcx),%eax
  cmp    $0xc7,%eax
  jbe    L694
  lea    -0xc59(%rcx),%edx
  mov    0x40(%rsp),%esi
  mov    $0x0,%eax
  mov    0x50(%rsp),%rdi
  cmp    $0x31,%edx
  jbe    L694
L432:
  mov    (%rdi,%rax,4),%ecx
  movslq 0x120(%rsp,%rax,4),%rdx
  mov    %ecx,(%r12,%rdx,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L432
  jmp    L386
L275:
  mov    $0x0,%eax
  mov    0x50(%rsp),%rsi
L431:
  mov    (%rsi,%rax,1),%ecx
  movslq 0x80(%rsp,%rax,1),%rdx
  mov    %ecx,(%r12,%rdx,4)
  add    $0x4,%rax
  cmp    $0x14,%rax
  jne    L431
L386:
  mov    0x40(%rsp),%edi
  mov    %edi,%eax
  imul   %r14d,%eax
  mov    %eax,0x34(%rsp)
  mov    0xc(%rsp),%esi
  mov    %esi,%eax
  imul   %edi,%eax
  mov    %eax,0x70(%rsp)
  mov    0x28(%rsp),%edx
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rbp
  mov    0x20(%rsp),%rbx
  lea    -0x4(%rbx,%rbp,1),%rax
  mov    %rax,0x78(%rsp)
  mov    %r12,%rcx
  lea    -0x1(%rdi),%eax
  mov    %rax,0x58(%rsp)
  mov    %edi,%r13d
  mov    $0x0,%r10d
  lea    0x1(%rsi),%eax
  mov    %eax,0x18(%rsp)
  lea    -0x1(%rdx),%eax
  mov    %eax,0x74(%rsp)
  lea    -0x1(%rsi),%r8d
  mov    0x48(%rsp),%r11
  mov    %r12,0x68(%rsp)
  mov    %edx,%r12d
  mov    %r13,0x10(%rsp)
  mov    0x30(%rsp),%r13d
  jmp    L296
L594:
  mov    $0x0,%eax
  mov    0x50(%rsp),%rsi
L194:
  mov    (%rsi,%rax,1),%ecx
  movslq 0xa0(%rsp,%rax,1),%rdx
  mov    %ecx,(%r12,%rdx,4)
  add    $0x4,%rax
  cmp    $0x28,%rax
  jne    L194
  jmp    L386
L694:
  mov    0x40(%rsp),%esi
  mov    $0x0,%eax
  mov    0x50(%rsp),%rdi
L351:
  mov    (%rdi,%rax,4),%ecx
  movslq 0xd0(%rsp,%rax,4),%rdx
  mov    %ecx,(%r12,%rdx,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L351
  jmp    L386
L700:
  test   %r14d,%r14d
  jle    L56
  mov    %rbx,%rdi
  mov    $0x0,%esi
L70:
  mov    %esi,%eax
  imul   (%rcx),%eax
  cltd
  idiv   %r14d
  movslq %edx,%rdx
  mov    %r12d,%eax
  imul   (%r11,%rdx,4),%eax
  add    %r9d,%eax
  cltq
  mov    (%r15,%rax,4),%eax
  mov    %eax,(%rdi)
  add    $0x1,%esi
  add    %rbp,%rdi
  cmp    %r8d,%esi
  jne    L70
L56:
  mov    (%r15,%r10,4),%edx
  mov    (%rsp),%eax
  add    0x34(%rsp),%eax
  cltq
  mov    0x20(%rsp),%rdi
  mov    %edx,(%rdi,%rax,4)
  jmp    L90
L257:
  test   %r14d,%r14d
  jle    L209
  mov    %rbx,%rdi
  mov    $0x0,%esi
L288:
  mov    %esi,%eax
  imul   (%rcx),%eax
  cltd
  idiv   %r14d
  movslq %edx,%rdx
  mov    %r12d,%eax
  imul   (%r11,%rdx,4),%eax
  add    %r9d,%eax
  cltq
  mov    (%r15,%rax,4),%eax
  mov    %eax,(%rdi)
  add    $0x1,%esi
  add    %rbp,%rdi
  cmp    %r8d,%esi
  jne    L288
L209:
  mov    (%r15,%r10,4),%edx
  mov    0x34(%rsp),%eax
  mov    (%rsp),%edi
  add    %edi,%eax
  cltq
  mov    0x20(%rsp),%rsi
  mov    %edx,(%rsi,%rax,4)
  add    0x70(%rsp),%edi
  movslq %edi,%rdx
  lea    (%rsi,%rdx,4),%rax
  mov    (%r15,%rdx,4),%edx
  mov    %edx,(%rax)
  mov    0x2c(%rsp),%esi
  cmp    %esi,0x44(%rsp)
  je     L256
L90:
  add    $0x1,%r10
  add    $0x4,%rbx
  add    $0x4,%rcx
  cmp    0x10(%rsp),%r10
  je     L140
L296:
  mov    %r10d,(%rsp)
  mov    %r10d,%r9d
  cmp    0xc(%rsp),%r13d
  je     L700
  cmp    %r13d,0x18(%rsp)
  je     L257
  mov    %rbx,%rdi
  mov    $0x0,%esi
  test   %r14d,%r14d
  jle    L90
L226:
  mov    %esi,%eax
  imul   (%rcx),%eax
  cltd
  idiv   %r14d
  movslq %edx,%rdx
  mov    (%r11,%rdx,4),%eax
  sub    $0x1,%eax
  imul   %r12d,%eax
  add    %r9d,%eax
  cltq
  mov    (%r15,%rax,4),%eax
  mov    %eax,(%rdi)
  add    $0x1,%esi
  add    %rbp,%rdi
  cmp    %r8d,%esi
  jne    L226
  jmp    L90
L256:
  cmp    %r10d,0x74(%rsp)
  jne    L90
  mov    0x78(%rsp),%rdi
  mov    (%rdi),%esi
  mov    %edx,(%rdi)
  mov    %esi,(%rax)
  jmp    L90
L140:
  mov    0x68(%rsp),%r12
  mov    0x38(%rsp),%rsi
  mov    $0x0,%r8d
  mov    0x2c(%rsp),%eax
  lea    -0x8e9(%rax),%r9d
  lea    -0xc59(%rax),%ecx
  mov    0x30(%rsp),%r10d
  mov    0x20(%rsp),%r13
  mov    0x28(%rsp),%ebx
  jmp    L185
L95:
  mov    0x80(%rsp,%r8,4),%eax
L63:
  test   %r10d,%r10d
  jle    L128
  cltq
  lea    0x0(%r13,%rax,4),%r11
  mov    $0x0,%eax
  mov    $0x0,%edx
L234:
  mov    (%r11,%rax,1),%edi
  mov    %edi,(%rsi,%rax,1)
  add    $0x1,%edx
  add    %rbp,%rax
  cmp    %edx,%r10d
  jne    L234
L128:
  add    $0x1,%r8
  add    $0x4,%rsi
  cmp    %r8d,%ebx
  jle    L107
L185:
  cmp    $0x5,%ebx
  je     L95
  cmp    $0xa,%ebx
  je     L438
  cmp    $0xc7,%r9d
  jbe    L1
  cmp    $0x31,%ecx
  jbe    L1
  mov    0x120(%rsp,%r8,4),%eax
  jmp    L63
L438:
  mov    0xa0(%rsp,%r8,4),%eax
  jmp    L63
L1:
  mov    0xd0(%rsp,%r8,4),%eax
  jmp    L63
L107:
  mov    0x30(%rsp),%r11d
  test   %r11d,%r11d
  jle    L32
  mov    0x38(%rsp),%rax
  mov    0x58(%rsp),%rcx
  lea    0x4(%rax,%rcx,4),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0x40(%rsp),%r9d
  neg    %r9
  shl    $0x2,%r9
  mov    0x60(%rsp),%r10
  jmp    L201
L64:
  add    $0x4,%rax
  cmp    %rax,%rsi
  je     L85
L58:
  mov    (%rax),%edx
  test   %edx,%edx
  js     L64
  movslq %ecx,%rdi
  mov    %edx,(%r10,%rdi,4)
  add    $0x1,%ecx
  jmp    L64
L85:
  add    $0x1,%r8d
  add    %rbp,%rsi
  cmp    %r8d,%r11d
  je     L32
L201:
  lea    (%r9,%rsi,1),%rax
  jmp    L58
L32:
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x50(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x318(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L622
  add    $0x328,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L622:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CreateUmtsInterleaver(int LL, int *input, int *output) {
  int RR, CC;
  int index, i, j, itemp;
  int pValue, vValue;
  int pTable[52] = {7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257};
  int vTable[52] = {3, 2, 2, 3, 2, 5, 2, 3, 2, 6, 3, 5, 2, 2, 2, 2, 7, 5, 3, 2, 3, 5, 2, 5, 2, 6, 3, 3, 2, 3, 2, 2, 6, 5, 2, 5, 2, 2, 2, 19, 5, 2, 3, 2, 3, 2, 6, 3, 7, 7, 6, 3};
  int T5[5] = {4, 3, 2, 1, 0};
  int T10[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  int T20a[20] = {19, 9, 14, 4, 0, 2, 5, 7, 12, 18, 16, 13, 17, 15, 3, 1, 6, 11, 8, 10};
  int T20b[20] = {19, 9, 14, 4, 0, 2, 5, 7, 12, 18, 10, 8, 13, 17, 3, 1, 16, 6, 15, 11};
  int *Matrix, *IntraMatrix, *InterMatrix, *s, *q, *r;
  if ((40 <= LL) && (LL <= 159)) {
    RR = 5;
  } else if ((160 <= LL) && (LL <= 200)) {
    RR = 10;
  } else if ((481 <= LL) && (LL <= 530)) {
    RR = 10;
  } else {
    RR = 20;
  }
  if ((481 <= LL) && (LL <= 530)) {
    pValue = 53;
    CC = pValue;
    vValue = 2;
  } else {
    for (index = 0; index < 52; index++) {
      if (LL <= RR * (pTable[index] + 1)) {
        break;
      }
    }
    pValue = pTable[index];
    vValue = vTable[index];
    if (LL <= RR * (pValue - 1)) {
      CC = pValue - 1;
    } else if (RR * pValue < LL) {
      CC = pValue + 1;
    } else {
      CC = pValue;
    }
  }
  Matrix = calloc(RR * CC, sizeof(int));
  InterMatrix = calloc(RR * CC, sizeof(int));
  IntraMatrix = calloc(RR * CC, sizeof(int));
  index = 0;
  for (i = 0; i < RR; i++) {
    for (j = 0; j < CC; j++) {
      if (index < LL) {
        Matrix[i + j * RR] = input[index];
      } else {
        Matrix[i + j * RR] = -1;
      }
      index++;
    }
  }
  s = calloc(pValue - 1, sizeof(int));
  s[0] = 1;
  for (j = 1; j < pValue - 1; j++) {
    s[j] = (vValue * s[j - 1]) % pValue;
  }
  q = calloc(RR, sizeof(int));
  q[0] = 1;
  index = 0;
  for (i = 1; i < RR; i++) {
    itemp = index;
    for (index = itemp; index < 52; index++) {
      if ((gcd(pTable[index], pValue - 1) == 1) && (pTable[index] > q[i - 1])) {
        q[i] = pTable[index];
        break;
      }
    }
  }
  r = calloc(RR, sizeof(int));
  if (RR == 5) {
    for (i = 0; i < RR; i++) {
      r[T5[i]] = q[i];
    }
  } else if (RR == 10) {
    for (i = 0; i < RR; i++) {
      r[T10[i]] = q[i];
    }
  } else if (((2281 <= LL) && (LL <= 2480)) || ((3161 <= LL) && (LL <= 3210))) {
    for (i = 0; i < RR; i++) {
      r[T20a[i]] = q[i];
    }
  } else {
    for (i = 0; i < RR; i++) {
      r[T20b[i]] = q[i];
    }
  }
  for (i = 0; i < RR; i++) {
    if (CC == pValue) {
      for (j = 0; j <= pValue - 2; j++) {
        index = s[(j * r[i]) % (pValue - 1)];
        IntraMatrix[i + j * RR] = Matrix[i + index * RR];
      }
      IntraMatrix[i + (pValue - 1) * RR] = Matrix[i];
    } else if (CC == pValue + 1) {
      for (j = 0; j <= pValue - 2; j++) {
        index = s[(j * r[i]) % (pValue - 1)];
        IntraMatrix[i + j * RR] = Matrix[i + index * RR];
      }
      IntraMatrix[i + (pValue - 1) * RR] = Matrix[i];
      IntraMatrix[i + pValue * RR] = Matrix[i + pValue * RR];
      if ((LL == RR * CC) && (i == RR - 1)) {
        itemp = IntraMatrix[RR - 1];
        IntraMatrix[RR - 1] = IntraMatrix[(RR - 1) + RR * pValue];
        IntraMatrix[(RR - 1) + RR * pValue] = itemp;
      }
    } else {
      for (j = 0; j <= pValue - 2; j++) {
        index = s[(j * r[i]) % (pValue - 1)] - 1;
        IntraMatrix[i + j * RR] = Matrix[i + index * RR];
      }
    }
  }
  for (i = 0; i < RR; i++) {
    if (RR == 5) {
      index = T5[i];
    } else if (RR == 10) {
      index = T10[i];
    } else if (((2281 <= LL) && (LL <= 2480)) || ((3161 <= LL) && (LL <= 3210))) {
      index = T20a[i];
    } else {
      index = T20b[i];
    }
    for (j = 0; j < CC; j++) {
      InterMatrix[i + j * RR] = IntraMatrix[index + j * RR];
    }
  }
  index = 0;
  for (j = 0; j < CC; j++) {
    for (i = 0; i < RR; i++) {
      if (InterMatrix[i + j * RR] >= 0) {
        output[index] = InterMatrix[i + j * RR];
        index++;
      }
    }
  }
  free(Matrix);
  free(InterMatrix);
  free(IntraMatrix);
  free(s);
  free(q);
  free(r);
}
```