user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  lea    D1(%rip),%rsi
  lea    D31(%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)
L230:
  mov    %r14,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L80
  movzbl (%rsp),%edx
  test   %dl,%dl
  je     L153
  mov    %rbx,%rax
  cmp    $0x7c,%dl
  je     L153
  nopl   0x0(%rax)
L17:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L215
  cmp    $0x7c,%dl
  jne    L17
L215:
  lea    0x1(%rax),%r12
  movb   $0x0,(%rax)
  movzbl 0x1(%rax),%eax
  mov    %r12,%rdx
  test   %al,%al
  jne    L34
  jmp    L78
  nopl   (%rax)
L132:
  movzbl 0x1(%rdx),%eax
  add    $0x1,%rdx
  test   %al,%al
  je     L78
L34:
  cmp    $0x7c,%al
  jne    L132
L78:
  movb   $0x0,(%rdx)
  lea    0x1(%rdx),%rax
  movzbl 0x1(%rdx),%edx
  test   %dl,%dl
  jne    L118
  jmp    L218
  nopl   0x0(%rax)
L16:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L218
L118:
  cmp    $0x7c,%dl
  jne    L16
L218:
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r15
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L140
  cmp    $0x7c,%al
  je     L140
  mov    %r15,%rax
  nop
L155:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L67
  cmp    $0x7c,%dl
  jne    L155
L67:
  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     L8
  mov    %rbp,%r15
  nopl   0x0(%rax)
L102:
  call   <isspace@plt>
  test   %rax,%rax
  je     L62
  movb   $0x3a,(%r15)
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  test   %dil,%dil
  jne    L102
L8:
  mov    %r13,%rdx
  mov    %rbp,%rdi
  lea    D38(%rip),%rsi
  call   <print_line@plt>
  mov    %r12,%rdx
  lea    D23(%rip),%rsi
  mov    %rbp,%rdi
  call   <print_line@plt>
  jmp    L230
  nopl   (%rax)
L62:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  test   %dil,%dil
  jne    L102
  jmp    L8
L80:
  mov    %r14,%rdi
  call   <pclose@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L221
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L140:
  mov    %r15,%rax
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L153:
  mov    %rbx,%rax
  jmp    L215
L221:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D1
datatype: string
name: retrieve_data
arguments: label: D31
datatype: string
name: retrieve_data
arguments: label: D38
datatype: string
name: retrieve_data
arguments: label: D23
datatype: string

tool: D1: r

tool: D31: /usr/sbin/ipmitool sensor

tool: D38: value

tool: D23: 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;
}
```