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

```asm
<apply_mask>:
  endbr64
  push   %rbx
  cmp    $0x2,%edi
  je     L0
  jg     L88
  test   %edi,%edi
  je     L73
  cmp    $0x1,%edi
  jne    L128
  movb   $0x1,(%rdx)
  test   %esi,%esi
  jle    L128
  movslq %esi,%r11
  xor    %r9d,%r9d
  nopw   0x0(%rax,%rax,1)
L132:
  movzbl (%rcx,%r9,1),%edi
  lea    (%r9,%r9,2),%eax
  add    %eax,%edi
  movslq %edi,%rax
  mov    %edi,%r10d
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%r10d
  sar    $0x25,%rax
  sub    %r10d,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edi
  mov    %dil,0x1(%rdx,%r9,1)
  add    $0x1,%r9
  cmp    %r9,%r11
  jne    L132
L128:
  lea    0x1(%rsi),%edi
  pop    %rbx
  mov    %r8d,%esi
  jmp    1050 <rsencode@plt>
  nopw   0x0(%rax,%rax,1)
L88:
  cmp    $0x3,%edi
  jne    L128
  movb   $0x3,(%rdx)
  test   %esi,%esi
  jle    L128
  mov    %esi,%r11d
  xor    %r10d,%r10d
  xor    %r9d,%r9d
  shl    $0x4,%r11d
  add    %esi,%r11d
  nopl   0x0(%rax)
L129:
  movzbl (%rcx,%r10,1),%edi
  add    %r9d,%edi
  add    $0x11,%r9d
  movslq %edi,%rax
  mov    %edi,%ebx
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%ebx
  sar    $0x25,%rax
  sub    %ebx,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edi
  mov    %dil,0x1(%rdx,%r10,1)
  add    $0x1,%r10
  cmp    %r9d,%r11d
  jne    L129
  lea    0x1(%rsi),%edi
  pop    %rbx
  mov    %r8d,%esi
  jmp    1050 <rsencode@plt>
  nopl   0x0(%rax,%rax,1)
L73:
  movb   $0x0,(%rdx)
  movslq %esi,%r9
  xor    %eax,%eax
  test   %esi,%esi
  jle    L128
L78:
  movzbl (%rcx,%rax,1),%edi
  mov    %dil,0x1(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L78
  jmp    L128
  nopw   0x0(%rax,%rax,1)
L0:
  movb   $0x2,(%rdx)
  test   %esi,%esi
  jle    L128
  lea    0x0(,%rsi,8),%r11d
  xor    %r10d,%r10d
  xor    %r9d,%r9d
  sub    %esi,%r11d
  nopl   0x0(%rax)
L103:
  movzbl (%rcx,%r10,1),%edi
  add    %r9d,%edi
  add    $0x7,%r9d
  movslq %edi,%rax
  mov    %edi,%ebx
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%ebx
  sar    $0x25,%rax
  sub    %ebx,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edi
  mov    %dil,0x1(%rdx,%r10,1)
  add    $0x1,%r10
  cmp    %r11d,%r9d
  jne    L103
  lea    0x1(%rsi),%edi
  pop    %rbx
  mov    %r8d,%esi
  jmp    1050 <rsencode@plt>
```

assistant: ```c
void apply_mask(int mask, int data_length, unsigned char *masked_codeword_array, unsigned char *codeword_array, int ecc_length) {
  int weight = 0;
  int j;
  switch (mask) {
  case 0:
    masked_codeword_array[0] = 0;
    for (j = 0; j < data_length; j++) {
      masked_codeword_array[j + 1] = codeword_array[j];
    }
    break;
  case 1:
    masked_codeword_array[0] = 1;
    for (j = 0; j < data_length; j++) {
      masked_codeword_array[j + 1] = (weight + codeword_array[j]) % 113;
      weight += 3;
    }
    break;
  case 2:
    masked_codeword_array[0] = 2;
    for (j = 0; j < data_length; j++) {
      masked_codeword_array[j + 1] = (weight + codeword_array[j]) % 113;
      weight += 7;
    }
    break;
  case 3:
    masked_codeword_array[0] = 3;
    for (j = 0; j < data_length; j++) {
      masked_codeword_array[j + 1] = (weight + codeword_array[j]) % 113;
      weight += 17;
    }
    break;
  }
  rsencode(data_length + 1, ecc_length, masked_codeword_array);
}
```