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

```asm
<do_math>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  lea    D14(%rip),%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  mov    %r12,%rdi
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <uart_puts@plt>
  test   %ebp,%ebp
  jle    L136
  lea    -0x1(%rbp),%eax
  xor    %esi,%esi
  lea    0x2e(%rsp),%rbp
  xor    %r13d,%r13d
  lea    0x1(%rbx,%rax,1),%r14
  jmp    L46
  nopl   0x0(%rax)
L5:
  movslq %esi,%rdx
  add    $0x1,%esi
  add    %al,0x2e(%rsp,%rdx,1)
L81:
  add    $0x1,%rbx
  cmp    %r14,%rbx
  je     L93
L46:
  movzbl (%rbx),%edx
  mov    %edx,%eax
  cmp    $0x20,%dl
  je     L18
  lea    -0x31(%rdx),%ecx
  cmp    $0x7,%ecx
  jbe    L5
  cmp    $0x2b,%edx
  jne    L127
  movslq %r13d,%rax
  add    $0x1,%rbx
  movl   $0x2b,(%rsp,%rax,4)
  cmp    %r14,%rbx
  jne    L46
L93:
  test   %r13d,%r13d
  je     L136
  mov    %rsp,%rbx
  xor    %eax,%eax
  lea    D27(%rip),%r14
  xor    %ebp,%ebp
L118:
  cmpl   $0x2b,0x4(%rbx)
  je     L76
L149:
  add    $0x3,%ebp
  add    $0xc,%rbx
  cmp    %ebp,%r13d
  jg     L118
  lea    0x30(%rax),%ebp
L62:
  lea    D29(%rip),%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    $0x1,%eax
L72:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L107
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L18:
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  movslq %r13d,%rax
  lea    -0x2(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %edx,(%rsp,%rax,4)
  mov    $0xa,%esi
  xor    %eax,%eax
  add    $0x1,%r13d
  call   <reset_string@plt>
  xor    %esi,%esi
  jmp    L81
  nop
L76:
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    0x8(%rbx),%eax
  add    (%rbx),%eax
  jmp    L149
  nopl   0x0(%rax)
L127:
  xor    %eax,%eax
  jmp    L72
  nopl   0x0(%rax)
L136:
  mov    $0x30,%ebp
  jmp    L62
L107:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D14
type_guessed: string
name: unpack_data
arguments: data_tag: D27
type_guessed: string
name: unpack_data
arguments: data_tag: D29
type_guessed: string

tool: D14: 


tool: D27: Adding 

tool: D29: Result is 

assistant: ```c
int do_math(unsigned char instr[], int array_size) {
  int i = 0;
  int j = 0;
  int k = 0;
  int nums[10];
  int res = 0;
  int l;
  char cur_str[10];
  uart_puts("\r\n");
  uart_puts(instr);
  uart_puts("\r\n");
  while (i < array_size) {
    l = (int)instr[i];
    if (l == 32) {
      uart_puts(cur_str);
      nums[j] = cur_str - '0';
      reset_string(cur_str, 10);
      k = 0;
      j++;
    } else if (l > 48 & l < 57) {
      cur_str[k] += instr[i];
      k++;
    } else if (l == 43) {
      nums[j] = 43;
    } else {
      return 0;
    }
    i++;
  }
  i = 0;
  int n1;
  int n2;
  while (i < j) {
    if (nums[i + 1] == 43) {
      uart_puts("Adding ");
      n1 = nums[i];
      n2 = nums[i + 2];
      res = n1 + n2;
    }
    i += 3;
  }
  uart_puts("Result is ");
  uart_puts(res + '0');
  uart_puts("\r\n");
  return 1;
}
```