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

```asm
<csc_memdump_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,%rbp
  mov    %esi,0x1c(%rsp)
  mov    %edx,%r14d
  mov    %edx,0xc(%rsp)
  mov    %rcx,%rbx
  mov    %r8d,%r15d
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %edx,%edi
  call   <csc_memdump_find_step@plt>
  mov    %eax,%r12d
  lea    0x20(%rsp),%rdi
  lea    D12(%rip),%rsi
  call   <strcpy@plt>
  test   $0x10000,%r14d
  jne    L583
L483:
  mov    0xc(%rsp),%eax
  mov    %eax,%edx
  sar    $0x8,%edx
  and    $0xf,%edx
  je     L654
  test   $0x40,%ah
  je     L406
  lea    0x40(%rsp),%rdi
  lea    D206(%rip),%rsi
  call   <sprintf@plt>
L147:
  lea    0x40(%rsp),%rsi
  lea    0x20(%rsp),%rdi
  call   <strcat@plt>
  mov    0xc(%rsp),%eax
  and    $0xf,%eax
  mov    %eax,0x14(%rsp)
  cmp    $0x3,%eax
  je     L462
  mov    0xc(%rsp),%eax
  and    $0xf0,%eax
  mov    %eax,0x18(%rsp)
  cmp    $0x20,%eax
  je     L464
  jle    L342
  mov    0x18(%rsp),%eax
  cmp    $0x30,%eax
  je     L90
  cmp    $0x40,%eax
  jne    L357
L632:
  lea    0x20(%rsp),%rdi
  lea    D101(%rip),%rsi
  call   <strcat@plt>
  movl   $0x40,0x18(%rsp)
  jmp    L335
L583:
  lea    0x20(%rsp),%rdi
  lea    D60(%rip),%rsi
  call   <strcat@plt>
  jmp    L483
L406:
  lea    0x40(%rsp),%rdi
  lea    D199(%rip),%rsi
  call   <sprintf@plt>
  jmp    L147
L654:
  testl  $0x4000,0xc(%rsp)
  jne    L578
  testb  $0xe0,0xc(%rsp)
  je     L38
  mov    0xc(%rsp),%eax
  and    $0xf0,%eax
  cmp    $0x40,%eax
  je     L413
  lea    0x40(%rsp),%rdi
  lea    D166(%rip),%rsi
  call   <strcpy@plt>
  jmp    L147
L578:
  lea    0x40(%rsp),%rdi
  lea    D166(%rip),%rsi
  call   <strcpy@plt>
  jmp    L147
L38:
  lea    (%r12,%r12,1),%edx
  movzbl %dl,%edx
  lea    0x40(%rsp),%rdi
  lea    D199(%rip),%rsi
  call   <sprintf@plt>
  jmp    L147
L413:
  lea    (%r12,%r12,2),%edx
  movzbl %dl,%edx
  lea    0x40(%rsp),%r13
  lea    D199(%rip),%rsi
  mov    %r13,%rdi
  call   <sprintf@plt>
  lea    0x20(%rsp),%rdi
  mov    %r13,%rsi
  call   <strcat@plt>
  mov    0xc(%rsp),%eax
  and    $0xf,%eax
  mov    %eax,0x14(%rsp)
  cmp    $0x3,%eax
  jne    L632
  lea    0x20(%rsp),%rdi
  lea    D144(%rip),%rsi
  call   <strcat@plt>
  jmp    L632
L462:
  lea    0x20(%rsp),%rdi
  lea    D144(%rip),%rsi
  call   <strcat@plt>
  mov    0xc(%rsp),%eax
  and    $0xf0,%eax
  mov    %eax,0x18(%rsp)
  cmp    $0x30,%eax
  je     L90
  jg     L196
  cmp    $0x10,%eax
  je     L144
  cmp    $0x20,%eax
  jne    L428
L464:
  lea    0x20(%rsp),%rdi
  lea    D27(%rip),%rsi
  call   <strcat@plt>
  movl   $0x20,0x18(%rsp)
  jmp    L335
L196:
  cmpl   $0x40,0x18(%rsp)
  je     L632
L428:
  lea    0x20(%rsp),%rdi
  lea    D16(%rip),%rsi
  call   <strcat@plt>
  jmp    L335
L342:
  cmp    $0x10,%eax
  jne    L357
L144:
  lea    0x20(%rsp),%rdi
  lea    D126(%rip),%rsi
  call   <strcat@plt>
  movl   $0x10,0x18(%rsp)
L335:
  testl  $0x8000,0xc(%rsp)
  je     L735
L122:
  movl   $0x0,0x10(%rsp)
  testl  $0x2000,0xc(%rsp)
  je     L358
L301:
  mov    0x1c(%rsp),%eax
  cmp    %eax,%r12d
  jg     L325
  mov    %eax,%r13d
  mov    %rbp,%r14
  jmp    L96
L90:
  lea    0x20(%rsp),%rdi
  lea    D61(%rip),%rsi
  call   <strcat@plt>
  movl   $0x30,0x18(%rsp)
  jmp    L335
L357:
  cmpl   $0x4,0x14(%rsp)
  je     L237
  cmpl   $0x5,0x14(%rsp)
  jne    L428
  lea    0x20(%rsp),%rdi
  lea    D128(%rip),%rsi
  call   <strcat@plt>
  jmp    L335
L237:
  lea    0x20(%rsp),%rdi
  lea    D203(%rip),%rsi
  call   <strcat@plt>
  jmp    L335
L735:
  lea    0x20(%rsp),%rdi
  lea    D196(%rip),%rsi
  call   <strcat@plt>
  jmp    L122
L358:
  movzbl %bpl,%edx
  lea    0x40(%rsp),%rdi
  lea    D53(%rip),%rsi
  call   <sprintf@plt>
  mov    %eax,%r14d
  mov    %eax,0x10(%rsp)
  test   %rbx,%rbx
  je     L301
  cmp    %eax,%r15d
  jle    L301
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  movslq %r14d,%rax
  add    %rax,%rbx
  sub    %r14d,%r15d
  jmp    L301
  cmpl   $0x30,0x18(%rsp)
  je     L470
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L470:
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
  cmpl   $0x30,0x18(%rsp)
  je     L591
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L591:
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
  cmpl   $0x30,0x18(%rsp)
  je     L225
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L225:
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
  cvttss2si (%r14),%edx
  movzbl %dl,%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
L195:
  test   %rbx,%rbx
  je     L534
  cmp    %r15d,0x8(%rsp)
  jle    L282
L534:
  mov    0x8(%rsp),%edi
  add    %edi,0x10(%rsp)
  testl  $0x20000,0xc(%rsp)
  je     L600
  movslq %r12d,%rax
  sub    %rax,%r14
L675:
  sub    %r12d,%r13d
  cmp    %r13d,%r12d
  jg     L325
L96:
  mov    0x14(%rsp),%eax
  cmp    $0x5,%eax
  ja     L647
  mov    %eax,%eax
  lea    D112(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  cvttsd2si (%r14),%edx
  movzbl %dl,%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L647:
  cmpl   $0x30,0x18(%rsp)
  je     L207
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L207:
  movzbl (%r14),%edx
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <sprintf@plt>
  mov    %eax,0x8(%rsp)
  jmp    L195
L282:
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    0x8(%rsp),%esi
  movslq %esi,%rax
  add    %rax,%rbx
  sub    %esi,%r15d
  jmp    L534
L600:
  movslq %r12d,%rax
  add    %rax,%r14
  jmp    L675
L325:
  testl  $0x1000,0xc(%rsp)
  jne    L511
  test   %rbx,%rbx
  je     L524
  test   %r15d,%r15d
  jg     L269
L524:
  mov    0x10(%rsp),%eax
  add    $0x1,%eax
  mov    0x1c(%rsp),%edx
  test   %edx,%edx
  je     L126
  mov    %edx,%eax
  mov    $0x2e,%r8d
  mov    0xc(%rsp),%esi
  and    $0x20000,%esi
  jmp    L513
L269:
  lea    D196(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  add    $0x1,%rbx
  sub    $0x1,%r15d
  jmp    L524
L136:
  mov    %dl,(%rbx)
  sub    $0x1,%r15d
  mov    %rcx,%rbx
L177:
  lea    -0x1(%rbp),%rdx
  add    $0x1,%rbp
  test   %esi,%esi
  cmovne %rdx,%rbp
  sub    $0x1,%eax
  je     L165
L513:
  test   %rbx,%rbx
  je     L177
  test   %r15d,%r15d
  jle    L177
  movzbl 0x0(%rbp),%edx
  lea    -0x20(%rdx),%edi
  lea    0x1(%rbx),%rcx
  cmp    $0x5e,%dil
  jbe    L136
  mov    %r8d,%edx
  jmp    L136
L165:
  mov    0x10(%rsp),%eax
  mov    0x1c(%rsp),%ecx
  lea    0x1(%rax,%rcx,1),%eax
  mov    %eax,0x10(%rsp)
L161:
  test   %rbx,%rbx
  je     L511
  test   %r15d,%r15d
  jle    L511
  movb   $0x0,(%rbx)
L511:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  mov    0x10(%rsp),%eax
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L126:
  mov    %eax,0x10(%rsp)
  jmp    L161
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D12
data_type: string
name: parse_data
arguments: tag: D206
data_type: string
name: parse_data
arguments: tag: D101
data_type: string
name: parse_data
arguments: tag: D60
data_type: string
name: parse_data
arguments: tag: D199
data_type: string
name: parse_data
arguments: tag: D166
data_type: string
name: parse_data
arguments: tag: D144
data_type: string
name: parse_data
arguments: tag: D27
data_type: string
name: parse_data
arguments: tag: D16
data_type: string
name: parse_data
arguments: tag: D126
data_type: string
name: parse_data
arguments: tag: D61
data_type: string
name: parse_data
arguments: tag: D128
data_type: string
name: parse_data
arguments: tag: D203
data_type: string
name: parse_data
arguments: tag: D196
data_type: string
name: parse_data
arguments: tag: D53
data_type: string

tool: D12: %

tool: D206: %d

tool: D101: o

tool: D60: -

tool: D199: 0%d

tool: 

tool: D144: ll

tool: D27: u

tool: D16: X

tool: D126: x

tool: D61: d

tool: D128: e

tool: D203: f

tool: D196:  

tool: D53: %lX: 

assistant: ```c
int csc_memdump_line(void *mem, int msize, int flags, char *buf, int blen) {
  char *mp, format[32], tmp[64];
  int n, sp, step, amnt;
  step = csc_memdump_find_step(flags);
  strcpy(format, "%");
  if (flags & 0x10000) {
    strcat(format, "-");
  }
  n = (flags & 0xf00) >> 8;
  if (n > 0) {
    if (flags & 0x4000) {
      sprintf(tmp, "%d", n);
    } else {
      sprintf(tmp, "0%d", n);
    }
  } else if (flags & 0x4000) {
    strcpy(tmp, "");
  } else if (((((flags)&0xf0) == 0x10) || (((flags)&0xf0) == 0))) {
    sprintf(tmp, "0%d", step * 2);
  } else if ((flags & 0xf0) == 0x40) {
    sprintf(tmp, "0%d", step * 3);
  } else {
    strcpy(tmp, "");
  }
  strcat(format, tmp);
  if ((flags & 0xf) == 3) {
    strcat(format, "ll");
  }
  switch (flags & 0xf0) {
  case 0x10:
    strcat(format, "x");
    break;
  case 0x20:
    strcat(format, "u");
    break;
  case 0x30:
    strcat(format, "d");
    break;
  case 0x40:
    strcat(format, "o");
    break;
  default:
    if ((flags & 0xf) == 4) {
      strcat(format, "f");
      break;
    }
    if ((flags & 0xf) == 5) {
      strcat(format, "e");
      break;
    }
    strcat(format, "X");
    break;
  }
  if ((flags & 0x8000) == 0) {
    strcat(format, " ");
  }
  amnt = 0;
  if ((flags & 0x2000) == 0) {
    n = sprintf(tmp, "%lX: ", (unsigned long)mem);
    if (buf && (blen > n)) {
      strcpy(buf, tmp);
      buf += n;
      blen -= n;
    }
    amnt += n;
  }
  mp = mem;
  sp = msize;
  while (sp >= step) {
    switch (flags & 0xf) {
    case 1:
      if ((((flags)&0xf0) == 0x30)) {
        n = sprintf(tmp, format, *((short *)mp));
      } else {
        n = sprintf(tmp, format, *((unsigned short *)mp));
      }
      break;
    case 2:
      if ((((flags)&0xf0) == 0x30)) {
        n = sprintf(tmp, format, *((int *)mp));
      } else {
        n = sprintf(tmp, format, *((unsigned *)mp));
      }
      break;
    case 3:
      if ((((flags)&0xf0) == 0x30)) {
        n = sprintf(tmp, format, *((long long *)mp));
      } else {
        n = sprintf(tmp, format, *((unsigned long long *)mp));
      }
      break;
    case 4:
      n = sprintf(tmp, format, *((float *)mp));
      break;
    case 5:
      n = sprintf(tmp, format, *((double *)mp));
      break;
    default:
      if ((((flags)&0xf0) == 0x30)) {
        n = sprintf(tmp, format, *mp);
      } else {
        n = sprintf(tmp, format, *((unsigned char *)mp));
      }
      break;
    }
    if (buf && blen >= n) {
      strcpy(buf, tmp);
      buf += n;
      blen -= n;
    }
    amnt += n;
    if (flags & 0x20000) {
      mp -= step;
    } else {
      mp += step;
    }
    sp -= step;
  }
  if (flags & 0x1000) {
    return amnt;
  }
  if (buf && blen > 0) {
    strcpy(buf, " ");
    buf++;
    blen--;
  }
  amnt++;
  mp = mem;
  sp = msize;
  while (sp) {
    if (buf && blen > 0) {
      if ((*mp < ' ') || (*mp > 0x7e)) {
        *buf++ = '.';
      } else {
        *buf++ = *mp;
      }
      blen--;
    }
    if (flags & 0x20000) {
      mp--;
    } else {
      mp++;
    }
    sp--;
    amnt++;
  }
  if (buf && blen > 0) {
    *buf++ = 0;
  }
  return amnt;
}
```