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

```asm
<main>:
  endbr64
  push   %r15
  lea    D7(%rip),%rsi
  lea    D30(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  call   <popen@plt>
  mov    %rax,%r14
  nopl   0x0(%rax)
L219:
  mov    %r14,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L198
  movzbl (%rsp),%edx
  test   %dl,%dl
  je     L201
  mov    %rbx,%rax
  cmp    $0x7c,%dl
  je     L201
  nopl   0x0(%rax)
L56:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L50
  cmp    $0x7c,%dl
  jne    L56
L50:
  lea    0x1(%rax),%r12
  movb   $0x0,(%rax)
  movzbl 0x1(%rax),%eax
  mov    %r12,%rdx
  test   %al,%al
  jne    L212
  jmp    L160
  nopl   (%rax)
L164:
  movzbl 0x1(%rdx),%eax
  add    $0x1,%rdx
  test   %al,%al
  je     L160
L212:
  cmp    $0x7c,%al
  jne    L164
L160:
  movb   $0x0,(%rdx)
  lea    0x1(%rdx),%rax
  movzbl 0x1(%rdx),%edx
  test   %dl,%dl
  jne    L101
  jmp    L49
  nopl   0x0(%rax)
L35:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L49
L101:
  cmp    $0x7c,%dl
  jne    L35
L49:
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r15
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L65
  cmp    $0x7c,%al
  je     L65
  mov    %r15,%rax
  nop
L234:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L99
  cmp    $0x7c,%dl
  jne    L234
L99:
  movb   $0x0,(%rax)
  mov    %rbx,%rdi
  call   <trim_clean@plt>
  mov    %r12,%rdi
  mov    %rax,%rbp
  call   <trim_clean@plt>
  mov    %r15,%rdi
  mov    %rax,%r13
  call   <trim_clean@plt>
  movsbl 0x0(%rbp),%edi
  mov    %rax,%r12
  test   %dil,%dil
  je     L61
  mov    %rbp,%r15
  nopl   0x0(%rax)
L108:
  call   <isspace@plt>
  test   %rax,%rax
  je     L179
  movb   $0x3a,(%r15)
L179:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  test   %dil,%dil
  jne    L108
L61:
  mov    %r13,%rdx
  mov    %rbp,%rdi
  lea    D18(%rip),%rsi
  call   <print_line@plt>
  mov    %r12,%rdx
  lea    D17(%rip),%rsi
  mov    %rbp,%rdi
  call   <print_line@plt>
  jmp    L219
  nopl   (%rax)
L198:
  mov    %r14,%rdi
  call   <pclose@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L163
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L65:
  mov    %r15,%rax
  jmp    L99
  nopl   0x0(%rax,%rax,1)
L201:
  mov    %rbx,%rax
  jmp    L50
L163:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D7
datatype: string
name: unpack_data
arguments: tag: D30
datatype: string
name: unpack_data
arguments: tag: D18
datatype: string
name: unpack_data
arguments: tag: D17
datatype: string

tool: D7: r

tool: D30: /usr/sbin/ipmitool sensor

tool: D18: value

tool: D17: status

assistant: ```c
int main() {
  FILE *output;
  char buf[256];
  output = popen("/usr/sbin/ipmitool sensor", "r");
  while (NULL != fgets(buf, sizeof(buf), output)) {
    char *col1, *col2, *col3, *col4, *cp;
    cp = buf;
    do {
      col1 = cp;
      while (*cp && *cp != '|')
        cp++;
      if (!cp)
        continue;
      *cp++ = '\0';
    } while (0);
    do {
      col2 = cp;
      while (*cp && *cp != '|')
        cp++;
      if (!cp)
        continue;
      *cp++ = '\0';
    } while (0);
    do {
      col3 = cp;
      while (*cp && *cp != '|')
        cp++;
      if (!cp)
        continue;
      *cp++ = '\0';
    } while (0);
    do {
      col4 = cp;
      while (*cp && *cp != '|')
        cp++;
      if (!cp)
        continue;
      *cp++ = '\0';
    } while (0);
    col1 = trim_clean(col1);
    col2 = trim_clean(col2);
    col4 = trim_clean(col4);
    cp = col1;
    while (*cp) {
      if (isspace(*cp))
        *cp = ':';
      cp++;
    }
    print_line(col1, "value", col2);
    print_line(col1, "status", col4);
  }
  pclose(output);
  return 0;
}
```