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

```asm
<test_case>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %edi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L2:
  cmp    %rdx,%rsp
  je     L71
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L2
L71:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L125
  orq    $0x0,-0x8(%rsp,%rax,1)
L125:
  mov    %rsp,-0x60(%rbp)
  test   %r14d,%r14d
  jle    L143
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  movl   $0xffffffff,-0x64(%rbp)
  movl   $0xffffffff,-0x54(%rbp)
  movl   $0x0,-0x58(%rbp)
  mov    $0xc351,%r13d
  lea    D13(%rip),%r15
  jmp    L213
L225:
  mov    -0x4c(%rbp),%eax
  cmp    %eax,%r13d
  cmovg  %eax,%r13d
  jmp    L114
L201:
  mov    -0x4c(%rbp),%eax
  mov    -0x58(%rbp),%ecx
  cmp    %eax,%ecx
  cmovge %ecx,%eax
  mov    %eax,-0x58(%rbp)
  jmp    L114
L195:
  movslq %r12d,%rdx
  mov    -0x60(%rbp),%rdi
  mov    %eax,(%rdi,%rdx,4)
  lea    0x1(%r12),%r12d
L114:
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  je     L36
L213:
  lea    -0x4c(%rbp),%rcx
  lea    -0x47(%rbp),%rdx
  lea    -0x42(%rbp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  movzbl -0x42(%rbp),%eax
  cmp    $0x6c,%al
  je     L225
  cmp    $0x67,%al
  je     L201
  mov    -0x4c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L195
  mov    %r12d,-0x64(%rbp)
  mov    %eax,-0x54(%rbp)
  jmp    L195
L36:
  cmp    $0xc351,%r13d
  je     L143
  mov    -0x58(%rbp),%eax
  lea    0x1(%rax),%ebx
  cmp    %r13d,%ebx
  jge    L3
  test   %r12d,%r12d
  jne    L224
  lea    D11(%rip),%r12
L90:
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jne    L90
  mov    $0xa,%edi
  call   <putchar@plt>
L115:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L191
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L143:
  lea    D5(%rip),%rdi
  call   <puts@plt>
  jmp    L115
L3:
  lea    D35(%rip),%rdi
  call   <puts@plt>
  jmp    L115
L224:
  cmp    $0x1,%r12d
  je     L41
  sub    $0x1,%r12d
  mov    -0x64(%rbp),%eax
  cmp    %r12d,%eax
  jne    L148
L113:
  mov    -0x54(%rbp),%r8d
  mov    %r12d,%ecx
  mov    -0x60(%rbp),%rdx
  mov    %r13d,%esi
  mov    -0x58(%rbp),%edi
  call   <generate@plt>
  jmp    L115
L41:
  mov    -0x54(%rbp),%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %r13d,%esi
  mov    -0x58(%rbp),%edi
  call   <generate@plt>
  jmp    L115
L148:
  mov    -0x60(%rbp),%rdx
  mov    %r12d,%esi
  mov    %eax,%edi
  call   <swap@plt>
  jmp    L113
L191:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D13
type_infered: string
name: disassemble_data
arguments: tag: D11
type_infered: string
name: disassemble_data
arguments: tag: D5
type_infered: string
name: disassemble_data
arguments: tag: D35
type_infered: string

tool: D13: %s %s %d

tool: D11: %d 

tool: D5: infinite

tool: D35: none

assistant: ```c
void test_case(int n) {
  int value, upper_bound = 50001, lower_bound = 0, max_div = -1, max_div_index = -1, curr_index = 0;
  int divs[n];
  char cmd[10], dmp[5];
  for (int i = 0; i < n; i++) {
    scanf("%s %s %d", cmd, dmp, &value);
    if (cmd[0] == 'l') {
      if (value < upper_bound)
        upper_bound = value;
    } else if (cmd[0] == 'g') {
      if (value > lower_bound)
        lower_bound = value;
    } else {
      if (max_div < value) {
        max_div = value;
        max_div_index = curr_index;
      }
      divs[curr_index++] = value;
    }
  }
  if (upper_bound == 50001)
    printf("infinite\n");
  else if (upper_bound <= lower_bound + 1)
    printf("none\n");
  else if (curr_index == 0) {
    for (int i = lower_bound + 1; i < upper_bound; i++)
      printf("%d ", i);
    printf("\n");
  } else if (curr_index == 1) {
    generate(lower_bound, upper_bound, NULL, 0, max_div);
  } else {
    curr_index--;
    if (max_div_index != curr_index)
      swap(max_div_index, curr_index, divs);
    generate(lower_bound, upper_bound, divs, curr_index, max_div);
  }
}
```