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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    0xf0(%rsp),%rbx
  mov    %rbx,%rsi
  lea    D45(%rip),%rdi
  call   <scanf@plt>
  lea    0x1c(%rsp),%rsi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  test   %edx,%edx
  jle    L97
  movslq %edx,%rdx
L473:
  movzbl 0xf0(%rsp,%rdx,1),%ecx
  mov    %cl,0xf0(%rsp,%rdx,2)
  sub    $0x1,%rdx
  test   %edx,%edx
  jg     L473
  lea    -0x1(%rax),%ecx
  mov    $0x1,%r13d
  mov    $0x0,%edx
L420:
  add    %r13d,%r13d
  add    $0x1,%edx
  cmp    %ecx,%edx
  jne    L420
L341:
  lea    (%rax,%rax,1),%ebx
  lea    -0x1(%rbx),%r15d
  cmp    $0x3,%ebx
  jle    L232
  lea    0xf1(%rsp),%rax
  lea    -0x4(%rbx),%edx
  shr    %edx
  mov    %edx,%edx
  lea    0xf3(%rsp,%rdx,2),%rdx
L228:
  movb   $0x2b,(%rax)
  add    $0x2,%rax
  cmp    %rdx,%rax
  jne    L228
L232:
  test   %r15d,%r15d
  jle    L157
  lea    0xf0(%rsp),%rax
  lea    -0x2(%rbx),%edx
  shr    %edx
  mov    %edx,%edx
  lea    0xf2(%rsp,%rdx,2),%rdx
L48:
  subb   $0x30,(%rax)
  add    $0x2,%rax
  cmp    %rdx,%rax
  jne    L48
L157:
  cmp    $0x1,%r13d
  jle    L66
  lea    -0x3(%rbx),%eax
  shr    %eax
  mov    %eax,%eax
  lea    0xf4(%rsp,%rax,2),%rbp
  movl   $0x0,0xc(%rsp)
  mov    $0x1,%r12d
  lea    -0x3(%rbx),%r14d
  movslq %r14d,%r14
  lea    -0x5(%rbx),%eax
  cltq
  mov    %rax,(%rsp)
  jmp    L430
L97:
  mov    $0x1,%r13d
  jmp    L341
L280:
  movsbl (%rax),%ecx
  sub    %ecx,%edx
L74:
  add    $0x2,%rax
  cmp    %rbp,%rax
  je     L445
L443:
  cmpb   $0x2b,-0x1(%rax)
  jne    L280
  movsbl (%rax),%ecx
  add    %ecx,%edx
  jmp    L74
L445:
  cmp    %edx,0x1c(%rsp)
  je     L75
L462:
  cmpb   $0x2b,0xf0(%rsp,%r14,1)
  sete   %al
  lea    0x2b(%rax,%rax,1),%eax
  mov    %al,0xf0(%rsp,%r14,1)
  mov    %r12d,%eax
  test   $0x1,%r12b
  jne    L6
  mov    (%rsp),%rsi
  cmpb   $0x2b,0xf0(%rsp,%rsi,1)
  je     L398
  mov    (%rsp),%rsi
  movb   $0x2b,0xf0(%rsp,%rsi,1)
L6:
  test   $0x3,%al
  jne    L382
  lea    -0x7(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L182
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L382:
  test   $0x7,%al
  jne    L247
  lea    -0x9(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L1
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L247:
  test   $0xf,%al
  jne    L52
  lea    -0xb(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L307
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L52:
  test   $0x1f,%al
  jne    L287
  lea    -0xd(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L320
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L287:
  test   $0x3f,%al
  jne    L459
  lea    -0xf(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L502
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L459:
  test   $0x7f,%al
  jne    L456
  lea    -0x11(%rbx),%edx
  movslq %edx,%rcx
  cmpb   $0x2b,0xf0(%rsp,%rcx,1)
  je     L314
  movslq %edx,%rdx
  movb   $0x2b,0xf0(%rsp,%rdx,1)
L456:
  test   %al,%al
  jne    L115
  lea    -0x13(%rbx),%eax
  movslq %eax,%rdx
  cmpb   $0x2b,0xf0(%rsp,%rdx,1)
  je     L49
  cltq
  movb   $0x2b,0xf0(%rsp,%rax,1)
L115:
  add    $0x1,%r12d
  cmp    %r13d,%r12d
  je     L458
L430:
  movsbl 0xf0(%rsp),%edx
  cmp    $0x1,%r15d
  jle    L445
  lea    0xf2(%rsp),%rax
  jmp    L443
L75:
  lea    0xf0(%rsp),%rsi
  movslq 0xc(%rsp),%rax
  lea    (%rax,%rax,4),%rax
  lea    0x20(%rsp,%rax,4),%rdi
  call   <strcpy@plt>
  addl   $0x1,0xc(%rsp)
  jmp    L462
L398:
  movb   $0x2d,0xf0(%rsp,%rsi,1)
  jmp    L6
L182:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L382
L1:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L247
L307:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L52
L320:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L287
L502:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L459
L314:
  movb   $0x2d,0xf0(%rsp,%rcx,1)
  jmp    L456
L49:
  movb   $0x2d,0xf0(%rsp,%rdx,1)
  jmp    L115
L458:
  cmpl   $0x0,0xc(%rsp)
  je     L66
  mov    0xc(%rsp),%esi
  mov    %esi,%eax
  sub    $0x1,%eax
  js     L387
  cltq
  lea    (%rax,%rax,4),%rax
  shl    $0x2,%rax
  lea    0x20(%rsp,%rax,1),%r13
  lea    0xc(%rsp,%rax,1),%rdx
  lea    -0x1(%rsi),%eax
  lea    (%rax,%rax,4),%rax
  shl    $0x2,%rax
  sub    %rax,%rdx
  mov    %rdx,(%rsp)
  sub    $0x1,%ebx
  lea    D22(%rip),%r14
  jmp    L412
L66:
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L387:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L442
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L336:
  movsbl (%r12),%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L222:
  add    $0x1,%ebp
  add    $0x1,%r12
  cmp    %ebp,%ebx
  je     L300
L372:
  test   $0x1,%bpl
  je     L336
  movsbl (%r12),%edi
  call   <putchar@plt>
  jmp    L222
L300:
  mov    0x1c(%rsp),%esi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  sub    $0x14,%r13
  cmp    (%rsp),%r13
  je     L387
L412:
  mov    %r13,%r12
  mov    $0x0,%ebp
  test   %r15d,%r15d
  jg     L372
  jmp    L300
L442:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D45
type_infered: string
name: read_data
arguments: tag: D22
type_infered: string
name: read_data
arguments: tag: D34
type_infered: string
name: read_data
arguments: tag: D7
type_infered: string

tool: D45: %s

tool: D22: %d

tool: D34: -1

tool: D7: =%d


assistant: ```c
int main() {
  char string[20], string1[10][20];
  int k = 0, y = 0, z = 0, sum = 0, a, l, s = 1;
  scanf("%s", string);
  scanf("%d", &a);
  l = strlen(string);
  for (k = l - 1; k > 0; k--)
    string[k + k] = string[k];
  for (k = 0; k < l - 1; k++)
    s = s * 2;
  l = l + l - 1;
  for (k = 1; k < l - 1; k = k + 2)
    string[k] = '+';
  for (k = 0; k < l; k = k + 2)
    string[k] = string[k] - '0';
  for (k = 1, z = 0; k < s; k++) {
    sum = string[0];
    for (y = 1; y < l; y = y + 2)
      if (string[y] == '+')
        sum = sum + string[y + 1];
      else
        sum = sum - string[y + 1];
    if (sum == a) {
      strcpy(string1[z], string);
      z++;
    }
    if (string[l - 2] == '+')
      string[l - 2] = '-';
    else
      string[l - 2] = '+';
    if (k % 2 == 0) {
      if (string[l - 4] == '+')
        string[l - 4] = '-';
      else
        string[l - 4] = '+';
    }
    if (k % 4 == 0) {
      if (string[l - 6] == '+')
        string[l - 6] = '-';
      else
        string[l - 6] = '+';
    }
    if (k % 8 == 0) {
      if (string[l - 8] == '+')
        string[l - 8] = '-';
      else
        string[l - 8] = '+';
    }
    if (k % 16 == 0) {
      if (string[l - 10] == '+')
        string[l - 10] = '-';
      else
        string[l - 10] = '+';
    }
    if (k % 32 == 0) {
      if (string[l - 12] == '+')
        string[l - 12] = '-';
      else
        string[l - 12] = '+';
    }
    if (k % 64 == 0) {
      if (string[l - 14] == '+')
        string[l - 14] = '-';
      else
        string[l - 14] = '+';
    }
    if (k % 128 == 0) {
      if (string[l - 16] == '+')
        string[l - 16] = '-';
      else
        string[l - 16] = '+';
    }
    if (k % 256 == 0) {
      if (string[l - 18] == '+')
        string[l - 18] = '-';
      else
        string[l - 18] = '+';
    }
  }
  if (z == 0)
    printf("-1");
  for (k = z - 1; k >= 0; k--) {
    for (y = 0; y < l; y++)
      if (y % 2 != 0)
        printf("%c", string1[k][y]);
      else
        printf("%d", string1[k][y]);
    printf("=%d\n", a);
  }
  return 0;
}
```