user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  push   %r12
  lea    D41(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  movaps %xmm0,0x10(%rsp)
  movq   $0x0,0x30(%rsp)
  mov    %r13,%rbp
  movaps %xmm0,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L35:
  xor    %eax,%eax
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  jle    L32
  mov    0x0(%rbp),%eax
  cmp    $0xa,%eax
  je     L32
  sub    $0x30,%eax
  add    $0x1,%ebx
  add    $0x4,%rbp
  mov    %eax,-0x4(%rbp)
  cmp    $0xa,%ebx
  jne    L35
L32:
  movslq %ebx,%rax
  lea    0xc(%rsp),%rsi
  lea    -0x1(%rbx),%r12d
  xor    %ebp,%ebp
  movl   $0x0,0x10(%rsp,%rax,4)
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  xor    %r14d,%r14d
  movl   $0x0,0xc(%rsp)
  call   <scanf@plt>
  nopl   0x0(%rax,%rax,1)
L6:
  mov    %r12d,%esi
  mov    $0x2,%edi
  mov    %ebp,%r15d
  call   <powl@plt>
  cmp    %rax,%rbp
  jg     L171
  movslq 0x10(%rsp),%rax
  movslq 0xc(%rsp),%r9
  mov    %rax,%r8
  mov    %r9,%rsi
  cmp    $0x1,%ebx
  jle    L43
  mov    %r12d,%edi
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L89:
  movslq 0x4(%r13,%rcx,4),%rdx
  mov    %r15d,%r10d
  sar    %cl,%r10d
  lea    (%rax,%rdx,1),%rsi
  sub    %rdx,%rax
  and    $0x1,%r10d
  cmovne %rsi,%rax
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jne    L89
  cmp    %r9,%rax
  je     L149
L173:
  add    $0x1,%rbp
  jmp    L6
  cs nopw 0x0(%rax,%rax,1)
L43:
  cmp    %r9d,%eax
  jne    L173
  cmp    $0x1,%ebx
  jne    L50
  nopw   0x0(%rax,%rax,1)
L149:
  xor    %r14d,%r14d
  mov    %r8d,%esi
  jmp    L91
  nopl   0x0(%rax,%rax,1)
L168:
  bt     %r14d,%r15d
  jae    L83
  mov    $0x2b,%edi
  add    $0x1,%r14
  call   <putchar@plt>
  cmp    %r14d,%ebx
  jle    L8
L9:
  mov    0x0(%r13,%r14,4),%esi
L91:
  xor    %eax,%eax
  lea    D7(%rip),%rdi
  call   <printf@plt>
  cmp    %r14d,%r12d
  jg     L168
L83:
  mov    $0x2d,%edi
  add    $0x1,%r14
  call   <putchar@plt>
  cmp    %r14d,%ebx
  jg     L9
L8:
  mov    0xc(%rsp),%esi
L50:
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%r14d
  call   <printf@plt>
  jmp    L173
  nopl   0x0(%rax)
L171:
  test   %r14b,%r14b
  je     L23
L36:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  jmp    L36
L21:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D41
datatype: string
name: read_data
arguments: tag: D7
datatype: string
name: read_data
arguments: tag: D4
datatype: string
name: read_data
arguments: tag: D49
datatype: string

tool: D41: %c

tool: D7: %d

tool: D4: =%d


tool: D49: -1

assistant: ```c
int main() {
  int a[10] = {0};
  int i;
  for (i = 0; i < 10 && scanf("%c", (char *)&a[i]) > 0; ++i) {
    if (a[i] == 10)
      break;
    else {
      a[i] = a[i] - '0';
    }
  }
  a[i] = 0;
  char ima = 0;
  int rez = 0;
  scanf("%d", &rez);
  long sum = 0;
  for (int j = 0; j <= (long int)powl(2, i - 1); ++j) {
    sum = 0;
    sum = a[0];
    for (int k = 1; k <= i - 1; ++k) {
      if (((j >> (k - 1)) & 1)) {
        sum = sum + a[k];
      } else {
        sum = sum - a[k];
      }
    }
    if ((long int)rez == sum) {
      ima = 1;
      for (int k = 0; k < i; ++k) {
        printf("%d", a[k]);
        if (((j >> k) & 1) && k < i - 1) {
          printf("+");
        } else {
          printf("-");
        }
      }
      printf("\b=%d\n", rez);
    }
  }
  if (ima == 0)
    printf("-1\n");
  return 0;
}
```