user: Demonstrate the C code that generates the assembly output below:

```asm
<helper>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %edx,0x64(%rsp)
  cmp    %esi,%edx
  jl     L246
  movl   $0x0,0xc(%rsp)
  mov    %rdi,%rbp
  mov    %esi,%r12d
  je     L83
  mov    %esi,%r13d
L278:
  mov    0x64(%rsp),%edx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x68(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,0x30(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x54(%rsp)
  cmp    %r13d,%eax
  jl     L357
  movl   $0x0,0x14(%rsp)
  je     L261
  mov    %r13d,%r12d
L7:
  mov    0x54(%rsp),%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x6c(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,0x34(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x58(%rsp)
  cmp    %r12d,%eax
  jl     L173
  movl   $0x0,0x18(%rsp)
  je     L444
  mov    %r12d,%r13d
L387:
  mov    0x58(%rsp),%edx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x70(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,0x38(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x5c(%rsp)
  cmp    %r13d,%eax
  jl     L86
  movl   $0x0,0x1c(%rsp)
  je     L26
  mov    %r13d,%r12d
L64:
  mov    0x5c(%rsp),%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x74(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,0x4c(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x60(%rsp)
  cmp    %r12d,%eax
  jl     L319
  movl   $0x0,0x24(%rsp)
  je     L215
  mov    %r12d,%r13d
L277:
  mov    0x60(%rsp),%edx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x78(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,0x48(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x20(%rsp)
  cmp    %r13d,%eax
  jl     L269
  movl   $0x0,0x8(%rsp)
  je     L227
  mov    %r13d,%r15d
  mov    %rbp,%r13
L122:
  mov    0x20(%rsp),%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x3c(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%r13,%rax,1),%edi
  lea    -0x1(%rbx),%r12d
  call   <digitToValue@plt>
  mov    %eax,0x4(%rsp)
  cmp    %r15d,%r12d
  jl     L63
  mov    $0x0,%ebp
  je     L304
  mov    %ebp,(%rsp)
  mov    %r15d,%r14d
  mov    %r12d,%ebp
L76:
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x40(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%r13,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %eax,%r12d
  lea    -0x1(%rbx),%eax
  mov    %eax,0x44(%rsp)
  cmp    %r14d,%eax
  jl     L247
  mov    $0x0,%r15d
  je     L156
  mov    %r15d,0x10(%rsp)
  mov    %r12d,0x2c(%rsp)
  mov    %ebp,0x28(%rsp)
  mov    %r14d,%ebp
L127:
  mov    0x44(%rsp),%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,0x7c(%rsp)
  mov    %eax,%ebx
  cltq
  movsbl 0x0(%r13,%rax,1),%edi
  call   <digitToValue@plt>
  lea    -0x1(%rbx),%r8d
  mov    %eax,%r12d
  cmp    %ebp,%r8d
  jl     L138
  mov    $0x0,%r15d
  je     L62
  mov    %eax,0x50(%rsp)
  mov    %r8d,%r12d
L281:
  mov    %ebp,%esi
  mov    %r12d,%edx
  mov    %r13,%rdi
  call   <findMaxIndex@plt>
  mov    %eax,%r14d
  cltq
  movsbl 0x0(%r13,%rax,1),%edi
  call   <digitToValue@plt>
  mov    %ebp,%esi
  lea    -0x1(%r14),%edx
  mov    %r13,%rdi
  mov    %eax,%ebx
  lea    0x1(%r14),%ebp
  call   <helper>
  sub    %eax,%ebx
  add    %ebx,%r15d
  cmp    %ebp,%r12d
  jl     L384
  jne    L281
  mov    0x50(%rsp),%r12d
L62:
  movslq %ebp,%rsi
  movsbl 0x0(%r13,%rsi,1),%edi
  call   <digitToValue@plt>
  add    %r15d,%eax
  sub    %eax,%r12d
L138:
  mov    0x7c(%rsp),%ebp
  add    %r12d,0x10(%rsp)
  add    $0x1,%ebp
  cmp    %ebp,0x44(%rsp)
  jl     L170
  jne    L127
  mov    %ebp,%r14d
  mov    0x10(%rsp),%r15d
  mov    0x2c(%rsp),%r12d
  mov    0x28(%rsp),%ebp
L156:
  movslq %r14d,%rsi
  movsbl 0x0(%r13,%rsi,1),%edi
  call   <digitToValue@plt>
  add    %r15d,%eax
  sub    %eax,%r12d
L247:
  mov    0x40(%rsp),%r14d
  add    %r12d,(%rsp)
  add    $0x1,%r14d
  cmp    %r14d,%ebp
  jl     L400
  jne    L76
  mov    (%rsp),%ebp
  mov    %r14d,%r15d
L304:
  movslq %r15d,%rsi
  movsbl 0x0(%r13,%rsi,1),%edi
  call   <digitToValue@plt>
  add    %ebp,%eax
  sub    %eax,0x4(%rsp)
L63:
  mov    0x3c(%rsp),%r15d
  mov    0x4(%rsp),%ecx
  add    %ecx,0x8(%rsp)
  add    $0x1,%r15d
  cmp    %r15d,0x20(%rsp)
  jl     L37
  jne    L122
  mov    %r13,%rbp
  mov    %r15d,%r13d
L227:
  movslq %r13d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    0x8(%rsp),%eax
  sub    %eax,0x48(%rsp)
L269:
  mov    0x78(%rsp),%r13d
  mov    0x48(%rsp),%edx
  add    %edx,0x24(%rsp)
  add    $0x1,%r13d
  cmp    %r13d,0x60(%rsp)
  jl     L302
  jne    L277
  mov    %r13d,%r12d
L215:
  movslq %r12d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    0x24(%rsp),%eax
  sub    %eax,0x4c(%rsp)
L319:
  mov    0x74(%rsp),%r12d
  mov    0x4c(%rsp),%edx
  add    %edx,0x1c(%rsp)
  add    $0x1,%r12d
  cmp    %r12d,0x5c(%rsp)
  jl     L193
  jne    L64
  mov    %r12d,%r13d
L26:
  movslq %r13d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    0x1c(%rsp),%eax
  sub    %eax,0x38(%rsp)
L86:
  mov    0x70(%rsp),%r13d
  mov    0x38(%rsp),%edx
  add    %edx,0x18(%rsp)
  add    $0x1,%r13d
  cmp    %r13d,0x58(%rsp)
  jl     L295
  jne    L387
  mov    %r13d,%r12d
L444:
  movslq %r12d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    0x18(%rsp),%eax
  sub    %eax,0x34(%rsp)
L173:
  mov    0x6c(%rsp),%r12d
  mov    0x34(%rsp),%edx
  add    %edx,0x14(%rsp)
  add    $0x1,%r12d
  cmp    %r12d,0x54(%rsp)
  jl     L264
  jne    L7
  mov    %r12d,%r13d
L261:
  movslq %r13d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    0x14(%rsp),%eax
  sub    %eax,0x30(%rsp)
L357:
  mov    0x68(%rsp),%r13d
  mov    0x30(%rsp),%edx
  add    %edx,0xc(%rsp)
  add    $0x1,%r13d
  cmp    0x64(%rsp),%r13d
  jg     L372
  jne    L278
  mov    %r13d,%r12d
L83:
  movslq %r12d,%rsi
  movsbl 0x0(%rbp,%rsi,1),%edi
  call   <digitToValue@plt>
  add    %eax,0xc(%rsp)
L372:
  mov    0xc(%rsp),%eax
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L170:
  mov    0x10(%rsp),%r15d
  mov    0x2c(%rsp),%r12d
  mov    0x28(%rsp),%ebp
  sub    %r15d,%r12d
  jmp    L247
L37:
  mov    0x8(%rsp),%ecx
  mov    %r13,%rbp
  sub    %ecx,0x48(%rsp)
  jmp    L269
  cs nopw 0x0(%rax,%rax,1)
L384:
  mov    0x50(%rsp),%r12d
  sub    %r15d,%r12d
  jmp    L138
L302:
  mov    0x24(%rsp),%ecx
  sub    %ecx,0x4c(%rsp)
  jmp    L319
L400:
  mov    (%rsp),%ebp
  sub    %ebp,0x4(%rsp)
  jmp    L63
L193:
  mov    0x1c(%rsp),%ecx
  sub    %ecx,0x38(%rsp)
  jmp    L86
L264:
  mov    0x14(%rsp),%ecx
  sub    %ecx,0x30(%rsp)
  jmp    L357
L295:
  mov    0x18(%rsp),%ecx
  sub    %ecx,0x34(%rsp)
  jmp    L173
L246:
  movl   $0x0,0xc(%rsp)
  jmp    L372
```

assistant: ```c
int helper(char str[], int lb, int ub) {
  if (lb > ub) {
    return 0;
  } else if (lb == ub) {
    return digitToValue(str[lb]);
  } else {
    int i = findMaxIndex(str, lb, ub);
    return digitToValue(str[i]) - helper(str, lb, i - 1) + helper(str, i + 1, ub);
  }
}
```