user: Translate the below assembly code into C programming language:

```asm
<battery>:
  endbr64
  push   %r14
  lea    D55(%rip),%rdi
  push   %r13
  lea    D9(%rip),%r13
  push   %r12
  mov    %r13,%rsi
  lea    D8(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rsp,%rdx
  mov    %r12,%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <fscanf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r13,%rsi
  lea    D60(%rip),%rdi
  call   <fopen@plt>
  mov    %r12,%rsi
  lea    0x4(%rsp),%rdx
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <fscanf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    $0x19,%edi
  call   <malloc@plt>
  mov    (%rsp),%ecx
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %rax,%r12
  mov    0x4(%rsp),%eax
  cvtsi2sd %ecx,%xmm1
  cvtsi2sd %eax,%xmm0
  divsd  %xmm1,%xmm0
  movsd  D72(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L4
  lea    D46(%rip),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
L14:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L4:
  lea    (%rax,%rax,4),%eax
  lea    D32(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x1,%ebx
  add    %eax,%eax
  lea    D65(%rip),%r14
  lea    D59(%rip),%r13
  cltd
  idiv   %ecx
  mov    %eax,%ebp
  call   <strcpy@plt>
  jmp    L58
  xchg   %ax,%ax
L67:
  mov    %r13,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strcat@plt>
  cmp    $0xb,%ebx
  je     L19
L58:
  cmp    %ebx,%ebp
  jge    L67
  mov    %r14,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strcat@plt>
  cmp    $0xb,%ebx
  jne    L58
L19:
  lea    D38(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L14
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D55
type: string
name: read_data
arguments: label: D9
type: string
name: read_data
arguments: label: D8
type: string
name: read_data
arguments: label: D60
type: string
name: read_data
arguments: label: D72
type: f64
name: read_data
arguments: label: D46
type: string
name: read_data
arguments: label: D32
type: string
name: read_data
arguments: label: D65
type: string
name: read_data
arguments: label: D59
type: string
name: read_data
arguments: label: D38
type: string

tool: D55: /sys/class/power_supply/BAT1/energy_full

tool: D9: r

tool: D8: %d

tool: D60: /sys/class/power_supply/BAT1/energy_now

tool: D72: 0.05

tool: D46: *** BATTERIE < 5% ***

tool: D32: [

tool: D65:  

tool: D59: #

tool: D38: ]

assistant: ```c
char *battery(void) {
  int nmarks, full, now;
  char *bar;
  FILE *battinfo = fopen("/sys/class/power_supply/BAT1/energy_full", "r");
  fscanf(battinfo, "%d", &full);
  fclose(battinfo);
  battinfo = fopen("/sys/class/power_supply/BAT1/energy_now", "r");
  fscanf(battinfo, "%d", &now);
  fclose(battinfo);
  bar = (char *)malloc(sizeof(char) * 25);
  nmarks = 10 * now / full;
  if ((double)now / full <= 0.05) {
    strcpy(bar, "*** BATTERIE < 5% ***");
  } else {
    strcpy(bar, "[");
    for (int i = 1; i < 11; i++) {
      if (i <= nmarks)
        strcat(bar, "#");
      else
        strcat(bar, " ");
    }
    strcat(bar, "]");
  }
  return bar;
}
```