user: Translate the below assembly code into C programming language:

```asm
<randnorep>:
  endbr64
  cmpq   $0x0,D205(%rip)
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  je     L228
L208:
  cmp    $0xfffffffc,%ebx
  je     L135
  cmp    $0xffffffff,%ebx
  je     L124
  cmp    $0xfffffffe,%ebx
  je     L212
  cmp    $0xfffffffd,%ebx
  jne    L137
  mov    D134(%rip),%esi
  test   %esi,%esi
  je     L297
  mov    D205(%rip),%r8
  mov    (%r12),%ecx
  test   %r8,%r8
  je     L137
  mov    %r8,%rdi
  xor    %edx,%edx
  jmp    L263
  nopl   0x0(%rax)
L95:
  mov    0x8(%rdi),%rax
  mov    %rdi,%rdx
  test   %rax,%rax
  je     L137
  mov    %rax,%rdi
L263:
  cmp    %ecx,(%rdi)
  jne    L95
  sub    $0x1,%esi
  mov    %esi,D45(%rip)
  test   %esi,%esi
  jle    L75
  test   %rdx,%rdx
  je     L56
  mov    0x8(%rdi),%rax
  mov    %rax,0x8(%rdx)
  jmp    L46
  nopl   0x0(%rax,%rax,1)
L124:
  mov    D45(%rip),%esi
  test   %esi,%esi
  je     L297
  xor    %edi,%edi
  call   <randmm@plt>
  mov    D205(%rip),%rdi
  test   %eax,%eax
  jle    L27
  xor    %edx,%edx
  xchg   %ax,%ax
L273:
  add    $0x1,%edx
  mov    %rdi,%rcx
  mov    0x8(%rdi),%rdi
  cmp    %edx,%eax
  jne    L273
  mov    (%rdi),%eax
  mov    %eax,(%r12)
  mov    D45(%rip),%eax
  sub    $0x1,%eax
  mov    %eax,D45(%rip)
  test   %eax,%eax
  jle    L75
  mov    0x8(%rdi),%rax
  mov    %rax,0x8(%rcx)
L46:
  call   <free@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L75:
  xor    %eax,%eax
L182:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L135:
  mov    (%r12),%eax
  test   %eax,%eax
  jle    L137
  mov    D205(%rip),%rbp
  mov    0x8(%rbp),%rbx
  test   %rbx,%rbx
  je     L239
L54:
  mov    %rbx,%rdi
  mov    0x8(%rbx),%rbx
  call   <free@plt>
  test   %rbx,%rbx
  jne    L54
  mov    (%r12),%eax
  mov    D205(%rip),%rbp
  mov    %eax,D45(%rip)
  movq   $0x0,0x8(%rbp)
  test   %eax,%eax
  jle    10a0 <randnorep.cold>
L172:
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L192:
  mov    %ebx,0x0(%rbp)
  mov    $0x10,%edi
  mov    %rbp,%r12
  add    $0x1,%ebx
  call   <malloc@plt>
  cmp    %ebx,D45(%rip)
  mov    %rax,0x8(%r12)
  mov    %rax,%rbp
  movq   $0x0,0x8(%rax)
  jg     L192
  mov    %rax,%rdi
  call   <free@plt>
  xor    %eax,%eax
  movq   $0x0,0x8(%r12)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L228:
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,D45(%rip)
  movq   $0x0,0x8(%rax)
  mov    %rax,D45(%rip)
  jmp    L208
  nopl   (%rax)
L137:
  pop    %rbx
  mov    $0xfffffffd,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L212:
  mov    D45(%rip),%eax
  test   %eax,%eax
  je     L47
  mov    D45(%rip),%rax
  test   %rax,%rax
  je     L285
  mov    (%rax),%edx
  mov    0x8(%rax),%rax
  mov    %edx,(%r12)
  pop    %rbx
  mov    %rax,D95(%rip)
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  ret
L27:
  mov    (%rdi),%eax
  mov    %eax,(%r12)
  mov    D45(%rip),%eax
  sub    $0x1,%eax
  mov    %eax,D95(%rip)
  test   %eax,%eax
  jle    L75
  mov    0x8(%rdi),%rax
  mov    %rax,D95(%rip)
  mov    %rax,D95(%rip)
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L56:
  mov    0x8(%r8),%rax
  mov    %rax,D95(%rip)
  mov    %rax,D95(%rip)
  jmp    L46
  nop
L239:
  mov    %eax,D95(%rip)
  jmp    L172
L297:
  mov    $0xffffffff,%eax
  jmp    L182
L47:
  mov    $0xfffffffe,%eax
  jmp    L182
L285:
  mov    D95(%rip),%rax
  mov    %rax,D95(%rip)
  mov    $0xfffffffe,%eax
  jmp    L182
```

assistant: ```c
int randnorep(int mode, int *n) {
  struct listnum {
    int num;
    struct listnum *prox;
  };
  static int listqtd = 0;
  static struct listnum *lcab = NULL;
  struct listnum *ln = NULL, *lant = NULL;
  static struct listnum *lista = NULL;
  int j;
  int sort;
  if (lcab == NULL) {
    lcab = (struct listnum *)malloc(sizeof(struct listnum));
    lcab->prox = NULL;
    lista = lcab;
  }
  if (mode == -4) {
    if (*n < 1)
      return -3;
    lant = lcab->prox;
    while (lant != NULL) {
      ln = lant->prox;
      free(lant);
      lant = ln;
    }
    lcab->prox = NULL;
    listqtd = *n;
    ln = lcab;
    for (j = 0; j < listqtd; j++) {
      ln->num = j;
      ln->prox = (struct listnum *)malloc(sizeof(struct listnum));
      lant = ln;
      ln = ln->prox;
      ln->prox = NULL;
    }
    free(ln);
    lant->prox = NULL;
    return 0;
  } else if (mode == -1) {
    if (listqtd == 0)
      return -1;
    sort = randmm(0, listqtd);
    ln = lcab;
    lant = NULL;
    for (j = 0; j < sort; j++) {
      lant = ln;
      ln = ln->prox;
    }
    *n = ln->num;
    listqtd--;
    if (listqtd <= 0)
      return 0;
    if (lant != NULL)
      lant->prox = ln->prox;
    else {
      lcab = lcab->prox;
      lista = lcab;
    }
    free(ln);
    return 0;
  } else if (mode == -2) {
    if (listqtd == 0)
      return -2;
    if (lista == NULL) {
      lista = lcab;
      return -2;
    }
    while (lista != NULL) {
      *n = lista->num;
      lista = lista->prox;
      return 0;
    }
  } else if (mode == -3) {
    if (listqtd == 0)
      return -1;
    sort = *n;
    ln = lcab;
    lant = NULL;
    while (ln != NULL) {
      if (ln->num == sort)
        break;
      lant = ln;
      ln = ln->prox;
    }
    if (ln == NULL)
      return -3;
    listqtd--;
    if (listqtd <= 0)
      return 0;
    if (lant != NULL)
      lant->prox = ln->prox;
    else {
      lcab = lcab->prox;
      lista = lcab;
    }
    free(ln);
    return 0;
  }
  return -3;
}
```