user: 下面的汇编指令对应的C源代码是什么：

```asm
<getbattery>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x20(%rbp)
  mov    $0xc,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movb   $0x3f,-0x29(%rbp)
  movq   $0x0,-0x10(%rbp)
  lea    D14(%rip),%rax
  mov    %rax,%rsi
  lea    D123(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L43
  lea    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D0(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D14(%rip),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  lea    -0x20(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D0(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D14(%rip),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D77(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x18(%rbp),%rax
  lea    D20(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L36
  movb   $0x2b,-0x29(%rbp)
L36:
  mov    -0x18(%rbp),%rax
  lea    D85(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L40
  movb   $0x2d,-0x29(%rbp)
L40:
  mov    -0x18(%rbp),%rax
  lea    D134(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L13
  movb   $0x3d,-0x29(%rbp)
L13:
  mov    -0x28(%rbp),%rsi
  mov    -0x20(%rbp),%rcx
  movabs $0xa3d70a3d70a3d70b,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x6,%rax
  sar    $0x3f,%rcx
  sub    %rcx,%rax
  mov    %rax,%rcx
  mov    %rsi,%rax
  cqto
  idiv   %rcx
  mov    %rax,%rdx
  movsbl -0x29(%rbp),%eax
  mov    %eax,%esi
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <smprintf@plt>
  jmp    L57
L43:
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <smprintf@plt>
L57:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L56
  call   <__stack_chk_fail@plt>
L56:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D14
type: string
name: extract_symbolic_data
arguments: data_tag: D123
type: string
name: extract_symbolic_data
arguments: data_tag: D0
type: string
name: extract_symbolic_data
arguments: data_tag: D30
type: string
name: extract_symbolic_data
arguments: data_tag: D5
type: string
name: extract_symbolic_data
arguments: data_tag: D77
type: string
name: extract_symbolic_data
arguments: data_tag: D20
type: string
name: extract_symbolic_data
arguments: data_tag: D85
type: string
name: extract_symbolic_data
arguments: data_tag: D134
type: string
name: extract_symbolic_data
arguments: data_tag: D73
type: string
name: extract_symbolic_data
arguments: data_tag: D62
type: string

tool: D14: r

tool: D123: /sys/class/power_supply/BAT0/charge_now

tool: D0: %ld


tool: D30: /sys/class/power_supply/BAT0/charge_full

tool: D5: /sys/class/power_supply/BAT0/status

tool: D77: %s


tool: D20: Charging

tool: D85: Discharging

tool: D134: Full

tool: D73: %c%ld%%

tool: 

assistant: ```c
char *getbattery() {
  long lnum1, lnum2 = 0;
  char *status = malloc(sizeof(char) * 12);
  char s = '?';
  FILE *fp = NULL;
  if ((fp = fopen("/sys/class/power_supply/BAT0/charge_now", "r"))) {
    fscanf(fp, "%ld\n", &lnum1);
    fclose(fp);
    fp = fopen("/sys/class/power_supply/BAT0/charge_full", "r");
    fscanf(fp, "%ld\n", &lnum2);
    fclose(fp);
    fp = fopen("/sys/class/power_supply/BAT0/status", "r");
    fscanf(fp, "%s\n", status);
    fclose(fp);
    if (strcmp(status, "Charging") == 0)
      s = '+';
    if (strcmp(status, "Discharging") == 0)
      s = '-';
    if (strcmp(status, "Full") == 0)
      s = '=';
    return smprintf("%c%ld%%", s, (lnum1 / (lnum2 / 100)));
  } else
    return smprintf("");
}
```