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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x280,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x70(%rbp),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,-0x278(%rbp)
  movl   $0x0,-0x280(%rbp)
  movl   $0x0,-0x280(%rbp)
  jmp    L70
L147:
  mov    -0x280(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  cmp    $0x20,%al
  je     L48
  mov    -0x280(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  lea    -0x30(%rax),%edx
  mov    -0x280(%rbp),%eax
  cltq
  mov    %edx,-0x270(%rbp,%rax,4)
L48:
  addl   $0x1,-0x280(%rbp)
L70:
  mov    -0x280(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L147
  movl   $0x0,-0x274(%rbp)
  movl   $0x0,-0x27c(%rbp)
  cmpl   $0x2,-0x280(%rbp)
  jne    L256
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  cmpl   $0x0,-0x27c(%rbp)
  jne    L256
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L256:
  cmpl   $0x3,-0x280(%rbp)
  jne    L18
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %eax,%edx
  mov    -0x268(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L67
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%esi
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D172(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x27c(%rbp)
L67:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x268(%rbp),%eax
  add    %ecx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L223
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%esi
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D172(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x27c(%rbp)
L223:
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L0
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%esi
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x27c(%rbp)
L0:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L5
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%esi
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x27c(%rbp)
L5:
  cmpl   $0x0,-0x27c(%rbp)
  jne    L18
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L18:
  cmpl   $0x4,-0x280(%rbp)
  jne    L245
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %eax,%edx
  mov    -0x268(%rbp),%eax
  add    %eax,%edx
  mov    -0x264(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L219
  mov    -0x264(%rbp),%esi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%edi
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D108(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x27c(%rbp)
L219:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x264(%rbp),%eax
  add    %ecx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L186
  movl   $0x1,-0x27c(%rbp)
  mov    -0x264(%rbp),%esi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%edi
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L186:
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %eax,%edx
  mov    -0x268(%rbp),%eax
  add    %edx,%eax
  mov    -0x264(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L235
  movl   $0x1,-0x27c(%rbp)
  mov    -0x264(%rbp),%esi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%edi
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D151(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L235:
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    -0x264(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L218
  movl   $0x1,-0x27c(%rbp)
  mov    -0x264(%rbp),%esi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%edi
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L218:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x268(%rbp),%eax
  add    %ecx,%eax
  mov    -0x264(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L204
  movl   $0x1,-0x27c(%rbp)
  mov    -0x264(%rbp),%esi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  mov    -0x274(%rbp),%edi
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D88(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L204:
  cmpl   $0x0,-0x27c(%rbp)
  jne    L245
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L245:
  cmpl   $0x5,-0x280(%rbp)
  jne    L191
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %eax,%edx
  mov    -0x268(%rbp),%eax
  add    %eax,%edx
  mov    -0x264(%rbp),%eax
  add    %eax,%edx
  mov    -0x260(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L80
  movl   $0x1,-0x27c(%rbp)
  mov    -0x260(%rbp),%r8d
  mov    -0x264(%rbp),%edi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x274(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
L80:
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x264(%rbp),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x260(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L130
  movl   $0x1,-0x27c(%rbp)
  mov    -0x260(%rbp),%r8d
  mov    -0x264(%rbp),%edi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x274(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D144(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
L130:
  mov    -0x270(%rbp),%edx
  mov    -0x26c(%rbp),%eax
  add    %eax,%edx
  mov    -0x268(%rbp),%eax
  add    %eax,%edx
  mov    -0x264(%rbp),%eax
  add    %edx,%eax
  mov    -0x260(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L44
  movl   $0x1,-0x27c(%rbp)
  mov    -0x260(%rbp),%r8d
  mov    -0x264(%rbp),%edi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x274(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
L44:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    -0x268(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x264(%rbp),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x260(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L161
  movl   $0x1,-0x27c(%rbp)
  mov    -0x260(%rbp),%r8d
  mov    -0x264(%rbp),%edi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x274(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D144(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
L161:
  mov    -0x270(%rbp),%eax
  mov    -0x26c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x268(%rbp),%eax
  add    %ecx,%eax
  mov    -0x264(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x260(%rbp),%eax
  add    %ecx,%eax
  mov    %eax,-0x274(%rbp)
  mov    -0x274(%rbp),%eax
  cmp    -0x278(%rbp),%eax
  jne    L184
  movl   $0x1,-0x27c(%rbp)
  mov    -0x260(%rbp),%r8d
  mov    -0x264(%rbp),%edi
  mov    -0x268(%rbp),%ecx
  mov    -0x26c(%rbp),%edx
  mov    -0x270(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x274(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D110(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
L184:
  cmpl   $0x0,-0x27c(%rbp)
  jne    L191
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L191:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D47
data_type: string
name: retrieve_data
arguments: data_label: D142
data_type: string
name: retrieve_data
arguments: data_label: D172
data_type: string
name: retrieve_data
arguments: data_label: D101
data_type: string
name: retrieve_data
arguments: data_label: D107
data_type: string
name: retrieve_data
arguments: data_label: D108
data_type: string
name: retrieve_data
arguments: data_label: D89
data_type: string
name: retrieve_data
arguments: data_label: D151
data_type: string
name: retrieve_data
arguments: data_label: D50
data_type: string
name: retrieve_data
arguments: data_label: D88
data_type: string
name: retrieve_data
arguments: data_label: D65
data_type: string
name: retrieve_data
arguments: data_label: D144
data_type: string
name: retrieve_data
arguments: data_label: D77
data_type: string
name: retrieve_data
arguments: data_label: D110
data_type: string

tool: D47: %s

tool: D142: -1

tool: D172: %d+%d+%d=%d


tool: D101: %d+%d-%d=%d


tool: D107: %d-%d-%d=%d


tool: D108: %d+%d+%d+%d=%d


tool: D89: %d-%d-%d+%d=%d


tool: D151: %d+%d+%d-%d=%d


tool: D50: %d+%d-%d-%d=%d


tool: D88: %d-%d+%d-%d=%d


tool: D65: %d+%d+%d+%d+%d=%d


tool: D144: %d-%d-%d+%d+%d=%d


tool: D77: %d+%d+%d+%d-%d=%d


tool: D110: %d-%d+%d-%d+%d=%d


assistant: ```c
int main() {
  int arr[100];
  char array1[100];
  char array[100];
  scanf("%s", array);
  scanf("%s", array1);
  int target = atoi(array1);
  int m = 0;
  for (m = 0; array[m]; m++) {
    if (array[m] != ' ') {
      arr[m] = array[m] - '0';
    }
  }
  int sum = 0;
  int flag = 0;
  if (m == 2) {
    sum = arr[0] + arr[1];
    sum = arr[0] - arr[1];
    if (flag == 0) {
      printf("-1\n");
    }
  }
  if (m == 3) {
    sum = arr[0] + arr[1] + arr[2];
    if (sum == target) {
      printf("%d+%d+%d=%d\n", arr[0], arr[1], arr[2], sum);
      flag = 1;
    }
    sum = arr[0] - arr[1] + arr[2];
    if (sum == target) {
      printf("%d+%d+%d=%d\n", arr[0], arr[1], arr[2], sum);
      flag = 1;
    }
    sum = arr[0] + arr[1] - arr[2];
    if (sum == target) {
      printf("%d+%d-%d=%d\n", arr[0], arr[1], arr[2], sum);
      flag = 1;
    }
    sum = arr[0] - arr[1] - arr[2];
    if (sum == target) {
      printf("%d-%d-%d=%d\n", arr[0], arr[1], arr[2], sum);
      flag = 1;
    }
    if (flag == 0) {
      printf("-1\n");
    }
  }
  if (m == 4) {
    sum = arr[0] + arr[1] + arr[2] + arr[3];
    if (sum == target) {
      printf("%d+%d+%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], sum);
      flag = 1;
    }
    sum = arr[0] - arr[1] - arr[2] + arr[3];
    if (sum == target) {
      flag = 1;
      printf("%d-%d-%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], sum);
    }
    sum = arr[0] + arr[1] + arr[2] - arr[3];
    if (sum == target) {
      flag = 1;
      printf("%d+%d+%d-%d=%d\n", arr[0], arr[1], arr[2], arr[3], sum);
    }
    sum = arr[0] + arr[1] - arr[2] - arr[3];
    if (sum == target) {
      flag = 1;
      printf("%d+%d-%d-%d=%d\n", arr[0], arr[1], arr[2], arr[3], sum);
    }
    sum = arr[0] - arr[1] + arr[2] - arr[3];
    if (sum == target) {
      flag = 1;
      printf("%d-%d+%d-%d=%d\n", arr[0], arr[1], arr[2], arr[3], sum);
    }
    if (flag == 0) {
      printf("-1\n");
    }
  }
  if (m == 5) {
    sum = arr[0] + arr[1] + arr[2] + arr[3] + arr[4];
    if (sum == target) {
      flag = 1;
      printf("%d+%d+%d+%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], sum);
    }
    sum = arr[0] + arr[1] - arr[2] + arr[3] + arr[4];
    if (sum == target) {
      flag = 1;
      printf("%d-%d-%d+%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], sum);
    }
    sum = arr[0] + arr[1] + arr[2] + arr[3] - arr[4];
    if (sum == target) {
      flag = 1;
      printf("%d+%d+%d+%d-%d=%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], sum);
    }
    sum = arr[0] - arr[1] - arr[2] + arr[3] + arr[4];
    if (sum == target) {
      flag = 1;
      printf("%d-%d-%d+%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], sum);
    }
    sum = arr[0] - arr[1] + arr[2] - arr[3] + arr[4];
    if (sum == target) {
      flag = 1;
      printf("%d-%d+%d-%d+%d=%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], sum);
    }
    if (flag == 0) {
      printf("-1\n");
    }
  }
  return 0;
}
```