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

```asm
<msd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x220,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x21c(%rbp)
  movl   $0x1,-0x218(%rbp)
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <set_interface@plt>
  movl   $0x0,-0x220(%rbp)
  jmp    L27
L28:
  mov    -0x220(%rbp),%eax
  mov    %eax,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x210(%rbp),%rax
  mov    $0x200,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x210(%rbp),%rax
  mov    $0x4,%edx
  lea    D5(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x210(%rbp),%rax
  add    $0x4,%rax
  movl   $0x12330984,(%rax)
  movb   $0x24,-0x208(%rbp)
  movb   $0x80,-0x204(%rbp)
  movb   $0x6,-0x202(%rbp)
  movb   $0x12,-0x201(%rbp)
  movb   $0x24,-0x1fd(%rbp)
  lea    -0x210(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    $0x1f,%esi
  mov    %rax,%rdi
  call   <hex@plt>
  lea    -0x210(%rbp),%rcx
  mov    -0x218(%rbp),%eax
  mov    $0x1f,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_bulk@plt>
  test   %rax,%rax
  js     L38
  lea    -0x210(%rbp),%rax
  mov    $0x200,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x210(%rbp),%rcx
  mov    -0x21c(%rbp),%eax
  mov    $0x24,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <recv_bulk@plt>
  mov    %eax,-0x214(%rbp)
  mov    -0x214(%rbp),%ecx
  lea    -0x210(%rbp),%rax
  lea    D30(%rip),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <hex@plt>
  lea    -0x210(%rbp),%rax
  mov    $0x200,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x210(%rbp),%rcx
  mov    -0x21c(%rbp),%eax
  mov    $0x24,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <recv_bulk@plt>
  mov    %eax,-0x214(%rbp)
  mov    -0x214(%rbp),%ecx
  lea    -0x210(%rbp),%rax
  lea    D48(%rip),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <hex@plt>
  mov    $0x249f0,%edi
  call   <usleep@plt>
  addl   $0x1,-0x220(%rbp)
L27:
  cmpl   $0x2,-0x220(%rbp)
  jle    L28
  jmp    L41
L38:
  nop
L41:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D24
type_guessed: string
name: read_data
arguments: label: D5
type_guessed: string
name: read_data
arguments: label: D7
type_guessed: string
name: read_data
arguments: label: D30
type_guessed: string
name: read_data
arguments: label: D48
type_guessed: string

tool: D24: i=%d


tool: D5: USBC

tool: D7: intquery req

tool: D30: inquiry result

tool: D48: inquiry sense?

assistant: ```c
void msd() {
  unsigned InEndPt = 1;
  unsigned OutEndPt = 1;
  unsigned char abBuf[512];
  int i;
  set_interface(0, 0);
  for (i = 0; i < 3; i++) {
    printf("i=%d\n", i);
    memset(abBuf, 0, sizeof(abBuf));
    memcpy(abBuf, "USBC", 4);
    *(uint32_t *)(&abBuf[4]) = 0x12330984;
    abBuf[8] = 0x24;
    abBuf[0xc] = 0x80;
    abBuf[0xe] = 0x06;
    abBuf[0x0f] = 0x12;
    abBuf[0x13] = 0x24;
    hex(abBuf, 31, "intquery req");
    if (send_bulk(OutEndPt, abBuf, 31) < 0)
      return;
    memset(abBuf, 0, sizeof(abBuf));
    int cb = recv_bulk(InEndPt, abBuf, 36);
    hex(abBuf, cb, "inquiry result");
    memset(abBuf, 0, sizeof(abBuf));
    cb = recv_bulk(InEndPt, abBuf, 36);
    hex(abBuf, cb, "inquiry sense?");
    usleep(150000);
  }
}
```