user: Translate the below assembly code into C programming language:

```asm
<do_math>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  lea    D42(%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    L64
  lea    -0x1(%rbp),%eax
  xor    %esi,%esi
  lea    0x2e(%rsp),%rbp
  xor    %r13d,%r13d
  lea    0x1(%rbx,%rax,1),%r14
  jmp    L144
  nopl   0x0(%rax)
L44:
  movslq %esi,%rdx
  add    $0x1,%esi
  add    %al,0x2e(%rsp,%rdx,1)
L174:
  add    $0x1,%rbx
  cmp    %r14,%rbx
  je     L202
L144:
  movzbl (%rbx),%edx
  mov    %edx,%eax
  cmp    $0x20,%dl
  je     L180
  lea    -0x31(%rdx),%ecx
  cmp    $0x7,%ecx
  jbe    L44
  cmp    $0x2b,%edx
  jne    L139
  movslq %r13d,%rax
  add    $0x1,%rbx
  movl   $0x2b,(%rsp,%rax,4)
  cmp    %r14,%rbx
  jne    L144
L202:
  test   %r13d,%r13d
  je     L64
  xor    %ebp,%ebp
  cmpl   $0x2b,0x4(%rsp)
  je     L113
  cmp    $0x3,%r13d
  jle    L149
L130:
  cmpl   $0x2b,0x10(%rsp)
  je     L168
L5:
  cmp    $0x6,%r13d
  jle    L149
  cmpl   $0x2b,0x1c(%rsp)
  je     L100
L149:
  add    $0x30,%ebp
L9:
  lea    D46(%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
L52:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L115
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L180:
  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    L174
  nop
L139:
  xor    %eax,%eax
  jmp    L52
L113:
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    (%rsp),%ebp
  add    0x8(%rsp),%ebp
  cmp    $0x3,%r13d
  jg     L130
  jmp    L149
L100:
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    0x20(%rsp),%ebp
  add    0x18(%rsp),%ebp
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L64:
  mov    $0x30,%ebp
  jmp    L9
L168:
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <uart_puts@plt>
  mov    0x14(%rsp),%ebp
  add    0xc(%rsp),%ebp
  jmp    L5
L115:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D42
datatype: string
name: retrieve_data
arguments: label: D46
datatype: string
name: retrieve_data
arguments: label: D30
datatype: string

tool: D42: 


tool: D46: Result is 

tool: D30: Adding 

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;
}
```