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

```asm
<append_band_ext>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,%r13
  call   <findExt@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L51
  lea    D14(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  jne    L66
L147:
  mov    %r12,%rdi
  call   <stripExt@plt>
  mov    %rax,%rbp
L101:
  test   %r13,%r13
  je     L58
  mov    %r13,%rcx
  mov    %rbp,%rdx
  lea    D94(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L97:
  test   %rbx,%rbx
  je     L31
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
L31:
  mov    %rbp,%rdi
  call   <free@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L66:
  lea    D113(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D37(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D65(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D108(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D21(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D91(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D111(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp_case@plt>
  test   %rax,%rax
  je     L147
L51:
  mov    $0xff,%edi
  call   <MALLOC@plt>
  mov    %rax,%rbp
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L101
L58:
  mov    %rbp,%rdx
  lea    D16(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L97
```

tool_calls: name: parse_data
arguments: tag: D14
datatype: string
name: parse_data
arguments: tag: D56
datatype: string
name: parse_data
arguments: tag: D94
datatype: string
name: parse_data
arguments: tag: D113
datatype: string
name: parse_data
arguments: tag: D37
datatype: string
name: parse_data
arguments: tag: D65
datatype: string
name: parse_data
arguments: tag: D108
datatype: string
name: parse_data
arguments: tag: D21
datatype: string
name: parse_data
arguments: tag: D91
datatype: string
name: parse_data
arguments: tag: D111
datatype: string
name: parse_data
arguments: tag: D10
datatype: string
name: parse_data
arguments: tag: D16
datatype: string

tool: D14: .IMG

tool: D56: .TIF

tool: D94: %s_%s

tool: D113: .TIFF

tool: D37: .JPG

tool: D65: .JPEG

tool: D108: .PNG

tool: D21: .PGM

tool: D91: .BIN

tool: D111: .NC

tool: D10: .H5

tool: D16: %s

assistant: ```c
void append_band_ext(char *inFile, char *outFile, char *bandExt) {
  char *ext, *base_name;
  ext = findExt(inFile);
  if (ext && (strcmp_case(ext, ".IMG") == 0 || strcmp_case(ext, ".TIF") == 0 || strcmp_case(ext, ".TIFF") == 0 || strcmp_case(ext, ".JPG") == 0 || strcmp_case(ext, ".JPEG") == 0 || strcmp_case(ext, ".PNG") == 0 || strcmp_case(ext, ".PGM") == 0 || strcmp_case(ext, ".BIN") == 0 || strcmp_case(ext, ".NC") == 0 || strcmp_case(ext, ".H5") == 0))
    base_name = stripExt(inFile);
  else {
    base_name = (char *)MALLOC(sizeof(char) * 255);
    strcpy(base_name, inFile);
  }
  if (bandExt)
    sprintf(outFile, "%s_%s", base_name, bandExt);
  else
    sprintf(outFile, "%s", base_name);
  if (ext)
    strcat(outFile, ext);
  free(base_name);
}
```