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

```asm
<cmdline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0xd8,%rsp
  mov    %rsi,0x18(%rsp)
  mov    %edi,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  call   <get_Clkgen@plt>
  mov    $0x7669,%ecx
  movdqa D30(%rip),%xmm0
  mov    $0xffffffff,%esi
  mov    %al,0x35(%rsp)
  movaps %xmm0,0x60(%rsp)
  movdqa D176(%rip),%xmm0
  mov    %cx,0xc0(%rsp)
  movaps %xmm0,0x70(%rsp)
  movdqa D136(%rip),%xmm0
  movb   $0x0,0xc2(%rsp)
  movaps %xmm0,0x80(%rsp)
  movdqa D54(%rip),%xmm0
  movl   $0xffffffff,0x50(%rsp)
  movaps %xmm0,0x90(%rsp)
  movdqa D135(%rip),%xmm0
  mov    %si,0x54(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movdqa D122(%rip),%xmm0
  movaps %xmm0,0xb0(%rsp)
  pcmpeqd %xmm0,%xmm0
  movaps %xmm0,0x40(%rsp)
  cmp    $0x1,%ebx
  jle    L246
  mov    $0xffffff9c,%eax
  mov    $0x1,%edx
  movss  D56(%rip),%xmm2
  movl   $0xffffffff,0x3c(%rsp)
  mov    %ax,0x36(%rsp)
  lea    0x60(%rsp),%rax
  lea    0xc3(%rsp),%rbp
  mov    %rax,0x28(%rsp)
  lea    0x40(%rsp),%rax
  mov    %dx,0x16(%rsp)
  movl   $0x1,0x30(%rsp)
  mov    %rax,0x20(%rsp)
  movss  %xmm2,0x38(%rsp)
  nopl   (%rax)
L166:
  movswq 0x16(%rsp),%rbx
  mov    0x18(%rsp),%r13
  lea    D174(%rip),%rsi
  shl    $0x3,%rbx
  lea    0x0(%r13,%rbx,1),%r12
  lea    0x8(%r13,%rbx,1),%r13
  mov    (%r12),%r15
  mov    %r15,%rdi
  call   <strcmp@plt>
  movzbl 0x35(%rsp),%r14d
  lea    D102(%rip),%rsi
  mov    %r15,%rdi
  test   %eax,%eax
  mov    $0x0,%eax
  cmove  %eax,%r14d
  call   <strcmp@plt>
  mov    0x20(%rsp),%rbx
  test   %eax,%eax
  mov    $0x1,%eax
  cmove  %eax,%r14d
  mov    0x30(%rsp),%eax
  add    $0x1,%eax
  mov    %r14b,0x35(%rsp)
  mov    0x28(%rsp),%r14
  mov    %eax,0x10(%rsp)
  nopl   0x0(%rax)
L425:
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L13
  mov    0xc(%rsp),%ecx
  cmp    %ecx,0x10(%rsp)
  je     L89
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    (%r12),%r15
  mov    %ax,(%rbx)
L13:
  add    $0x9,%r14
  add    $0x2,%rbx
  cmp    %r14,%rbp
  jne    L425
  lea    D79(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L72
  mov    0x30(%rsp),%eax
  add    $0x1,%eax
  cmp    0xc(%rsp),%eax
  je     L148
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    (%r12),%r15
  lea    D165(%rip),%rsi
  mov    %eax,0x3c(%rsp)
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L347
  lea    D132(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L522
L477:
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %ax,0x36(%rsp)
L522:
  addw   $0x1,0x16(%rsp)
  movswl 0x16(%rsp),%eax
  mov    %eax,0x30(%rsp)
  cmp    0xc(%rsp),%eax
  jl     L166
  mov    0x3c(%rsp),%eax
  cmpb   $0x0,0x35(%rsp)
  lea    -0x1(%rax),%ebx
  je     L427
  cmpb   $0x1,0x35(%rsp)
  jne    L239
  movzwl 0x36(%rsp),%eax
  cmp    $0xfffa,%ax
  jl     L447
  cmp    $0xa,%ax
  jle    L275
L239:
  cmp    $0xfffe,%ebx
  jbe    L283
L127:
  movss  0x38(%rsp),%xmm3
  comiss D136(%rip),%xmm3
  jbe    L215
  movss  D53(%rip),%xmm0
  comiss %xmm3,%xmm0
  ja     L343
L215:
  movzwl 0x40(%rsp),%eax
  sub    $0x2,%eax
  cmp    $0x1,%ax
  jbe    L314
L418:
  movzwl 0x42(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L134
L16:
  movzwl 0x44(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L335
L426:
  movzwl 0x46(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L543
L228:
  movzwl 0x48(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L397
L269:
  movzwl 0x4a(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L243
L367:
  movzwl 0x4c(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xe,%ax
  jbe    L216
L78:
  movzwl 0x4e(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0xf,%ax
  jbe    L424
L486:
  movzwl 0x50(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x7,%ax
  jbe    L386
  movzwl 0x52(%rsp),%eax
  lea    -0x21(%rax),%edx
  cmp    $0x133,%dx
  jbe    L537
L554:
  movzwl 0x54(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x7,%ax
  jbe    L87
L371:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L111
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  lea    D165(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L48
  mov    0x30(%rsp),%eax
  add    $0x1,%eax
  cmp    0xc(%rsp),%eax
  je     L148
L347:
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  call   <atof@plt>
  pxor   %xmm1,%xmm1
  mov    (%r12),%rdi
  lea    D132(%rip),%rsi
  cvtsi2ss %eax,%xmm1
  movss  %xmm1,0x38(%rsp)
  call   <strcmp@plt>
  test   %eax,%eax
  je     L477
  jmp    L522
  cs nopw 0x0(%rax,%rax,1)
L48:
  lea    D132(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L522
  mov    0x30(%rsp),%eax
  add    $0x1,%eax
  cmp    0xc(%rsp),%eax
  jne    L477
L148:
  mov    %r15,%rsi
  lea    D27(%rip),%rdi
  xor    %eax,%eax
  jmp    L10
  nopl   0x0(%rax)
L427:
  movzwl 0x36(%rsp),%eax
  cmp    $0xffec,%ax
  jl     L396
  cmp    $0x24,%ax
  jg     L239
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_add_FLCDCLK@plt>
  jmp    L239
L275:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_add_ULCDCLK@plt>
  jmp    L239
L87:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_920_Div@plt>
  jmp    L371
L386:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_DCLK_Div@plt>
  movzwl 0x52(%rsp),%eax
  lea    -0x21(%rax),%edx
  cmp    $0x133,%dx
  ja     L554
L537:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_FCLK@plt>
  jmp    L554
L424:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tRCD@plt>
  jmp    L486
L216:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tRP@plt>
  jmp    L78
L243:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tRFC@plt>
  jmp    L367
L397:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tMRD@plt>
  jmp    L269
L543:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tWR@plt>
  jmp    L228
L335:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tRAS@plt>
  jmp    L426
L134:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_tRC@plt>
  jmp    L16
L314:
  movswl %ax,%edi
  xor    %eax,%eax
  call   <set_CAS@plt>
  jmp    L418
L343:
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtss2sd %xmm3,%xmm0
  call   <set_gamma@plt>
  jmp    L215
L283:
  mov    0x3c(%rsp),%edi
  xor    %eax,%eax
  sub    $0x1,%edi
  call   <set_REFPERD@plt>
  jmp    L127
L246:
  test   %al,%al
  jne    L364
  movss  D56(%rip),%xmm4
  movl   $0xffffffff,0x3c(%rsp)
  mov    $0xfffffffe,%ebx
  movss  %xmm4,0x38(%rsp)
L396:
  xor    %edi,%edi
  xor    %eax,%eax
  call   <get_LCDClk@plt>
  mov    %eax,%edi
  xor    %eax,%eax
  call   <set_add_FLCDCLK@plt>
  jmp    L239
L364:
  cmp    $0x1,%al
  jne    L215
  movss  D56(%rip),%xmm5
  movl   $0xffffffff,0x3c(%rsp)
  mov    $0xfffffffe,%ebx
  movss  %xmm5,0x38(%rsp)
L447:
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <get_LCDClk@plt>
  mov    %eax,%edi
  xor    %eax,%eax
  call   <set_add_ULCDCLK@plt>
  jmp    L239
L89:
  mov    %r14,%rsi
  lea    D27(%rip),%rdi
L10:
  call   <printf@plt>
  xor    %eax,%eax
  call   <gp2x_deinit@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L111:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D30
type_guessed: byte[16]
name: unpack_data
arguments: tag: D176
type_guessed: byte[16]
name: unpack_data
arguments: tag: D136
type_guessed: f32[4]
name: unpack_data
arguments: tag: D54
type_guessed: byte[16]
name: unpack_data
arguments: tag: D135
type_guessed: byte[16]
name: unpack_data
arguments: tag: D122
type_guessed: byte[16]
name: unpack_data
arguments: tag: D56
type_guessed: byte[4]
name: unpack_data
arguments: tag: D174
type_guessed: string
name: unpack_data
arguments: tag: D102
type_guessed: string
name: unpack_data
arguments: tag: D79
type_guessed: string
name: unpack_data
arguments: tag: D165
type_guessed: string
name: unpack_data
arguments: tag: D132
type_guessed: string
name: unpack_data
arguments: tag: D53
type_guessed: f32
name: unpack_data
arguments: tag: D27
type_guessed: string

tool: {"D30": [0x2d,0x2d,0x63,0x61,0x73,0x00,0x00,0x00,0x00,0x2d,0x2d,0x74,0x72,0x63,0x00,0x00]}

tool: {"D176": [0x00,0x00,0x2d,0x2d,0x74,0x72,0x61,0x73,0x00,0x00,0x00,0x2d,0x2d,0x74,0x77,0x72]}

tool: {"D136": [0.0,4.7230597852989115e27,3.6032988711648346e-41,5.488159576163876e31]}

tool: {"D54": [0x72,0x66,0x63,0x00,0x00,0x00,0x2d,0x2d,0x74,0x72,0x70,0x00,0x00,0x00,0x00,0x2d]}

tool: {"D135": [0x2d,0x74,0x72,0x63,0x64,0x00,0x00,0x00,0x2d,0x2d,0x72,0x61,0x6d,0x64,0x69,0x76]}

tool: {"D122": [0x00,0x2d,0x2d,0x63,0x70,0x75,0x63,0x6c,0x6b,0x00,0x2d,0x2d,0x63,0x70,0x75,0x64]}

tool: {"D56": [0x00,0x00,0x80,0xbf]}

tool: D174: --fpll

tool: D102: --upll

tool: D79: --refperd

tool: D165: --gamma

tool: D132: --timing

tool: D53: 15

tool: D27: %s is missing it's parameter


assistant: ```c
void cmdline(int argc, char *argv[]) {
  short i, n;
  short varis = 11;
  char clockgen = get_Clkgen();
  char var[11][9] = {"--cas", "--trc", "--tras", "--twr", "--tmrd", "--trfc", "--trp", "--trcd", "--ramdiv", "--cpuclk", "--cpudiv"};
  short val[varis];
  for (n = 0; n < varis; n++) {
    val[n] = -1;
  }
  short timing = -100;
  int refperd = -1;
  float gamma = -1.;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--fpll") == 0)
      clockgen = 0;
    if (strcmp(argv[i], "--upll") == 0)
      clockgen = 1;
    for (n = 0; n < varis; n++) {
      if (strcmp(argv[i], var[n]) == 0) {
        if (i + 1 == argc) {
          printf("%s is missing it's parameter\r\n", var[n]);
          gp2x_deinit();
          exit(1);
        }
        val[n] = atoi(argv[i + 1]);
      }
    }
    if (strcmp(argv[i], "--refperd") == 0) {
      if (i + 1 == argc) {
        printf("%s is missing it's parameter\r\n", argv[i]);
        gp2x_deinit();
        exit(1);
      }
      refperd = atoi(argv[i + 1]);
    }
    if (strcmp(argv[i], "--gamma") == 0) {
      if (i + 1 == argc) {
        printf("%s is missing it's parameter\r\n", argv[i]);
        gp2x_deinit();
        exit(1);
      }
      gamma = atof(argv[i + 1]);
    }
    if (strcmp(argv[i], "--timing") == 0) {
      if (i + 1 == argc) {
        printf("%s is missing it's parameter\r\n", argv[i]);
        gp2x_deinit();
        exit(1);
      }
      timing = atoi(argv[i + 1]);
    }
  }
  if (clockgen == 0) {
    if (timing > -21) {
      if (timing < 37)
        set_add_FLCDCLK(timing);
    } else
      set_add_FLCDCLK(get_LCDClk(clockgen));
  }
  if (clockgen == 1) {
    if (timing > -7) {
      if (timing < 11)
        set_add_ULCDCLK(timing);
    } else
      set_add_ULCDCLK(get_LCDClk(clockgen));
  }
  if (refperd - 1 > -1) {
    if (refperd - 1 < 0xffff)
      set_REFPERD(refperd - 1);
  }
  if (gamma > 0.) {
    if (gamma < 15.)
      set_gamma(gamma);
  }
  if (val[0] - 2 > -1) {
    if (val[0] - 2 < 2)
      set_CAS(val[0] - 2);
  }
  if (val[1] - 1 > -1) {
    if (val[1] - 1 < 16)
      set_tRC(val[1] - 1);
  }
  if (val[2] - 1 > -1) {
    if (val[2] - 1 < 16)
      set_tRAS(val[2] - 1);
  }
  if (val[3] - 1 > -1) {
    if (val[3] - 1 < 16)
      set_tWR(val[3] - 1);
  }
  if (val[4] - 1 > -1) {
    if (val[4] - 1 < 16)
      set_tMRD(val[4] - 1);
  }
  if (val[5] - 1 > -1) {
    if (val[5] - 1 < 16)
      set_tRFC(val[5] - 1);
  }
  if (val[6] - 1 > -1) {
    if (val[6] < 16)
      set_tRP(val[6] - 1);
  }
  if (val[7] - 1 > -1) {
    if (val[7] - 1 < 16)
      set_tRCD(val[7] - 1);
  }
  if (val[8] - 1 > -1) {
    if (val[8] - 1 < 8)
      set_DCLK_Div(val[8] - 1);
  }
  if (val[9] > 32) {
    if (val[9] < 341)
      set_FCLK(val[9]);
  }
  if (val[10] - 1 > -1) {
    if (val[10] - 1 < 8)
      set_920_Div(val[10] - 1);
  }
}
```