user: What is the c source code of the assembly code below:

```asm
<getBinaryLength>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,0x1c(%rsp)
  mov    %rsi,%r14
  mov    %rdx,0x8(%rsp)
  mov    %ecx,%r15d
  mov    %r8d,%ebx
  mov    %r9d,%ebp
  mov    %ecx,%edx
  call   <applyOptimisation@plt>
  cmp    $0x1,%ebx
  sete   %bl
  movzbl %bl,%ebx
  shl    $0x2,%ebx
  lea    0xc(%rbx),%eax
  cmp    $0x3,%ebp
  cmovne %eax,%ebx
  mov    %r15d,%eax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%ebp
  mov    $0x20,%edx
  test   %r15d,%r15d
  jg     L21
L148:
  mov    %ebx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  cmp    $0x4e,%al
  jne    L129
  mov    $0xe,%ecx
  mov    $0xc,%edx
  mov    $0xa,%esi
  mov    0x1c(%rsp),%edi
  call   <tribus@plt>
  add    %eax,%ebx
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%ecx
  sub    %ecx,%eax
  cmp    $0x1,%eax
  je     L95
  cmp    $0x2,%eax
  je     L39
  test   %eax,%eax
  jne    L129
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  lea    (%rdx,%rdx,4),%eax
  lea    (%rbx,%rax,2),%ebx
  jmp    L129
L123:
  mov    $0xc,%ecx
  mov    $0xa,%edx
  mov    $0x8,%esi
  mov    0x1c(%rsp),%edi
  call   <tribus@plt>
  lea    (%rbx,%rax,1),%r12d
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  lea    (%rax,%rax,2),%edx
  lea    (%rax,%rdx,4),%ebx
  add    %r12d,%ebx
L129:
  movzbl (%r14,%rbp,1),%edx
L104:
  add    $0x1,%rbp
  cmp    0x10(%rsp),%rbp
  je     L148
L21:
  mov    %ebp,%r13d
  movzbl (%r14,%rbp,1),%eax
  cmp    %dl,%al
  je     L104
  add    $0x4,%ebx
  cmp    $0x4b,%al
  je     L123
  jg     L50
  cmp    $0x41,%al
  je     L1
  cmp    $0x42,%al
  jne    L129
  mov    $0x10,%ecx
  mov    $0x10,%edx
  mov    $0x8,%esi
  mov    0x1c(%rsp),%edi
  call   <tribus@plt>
  add    %eax,%ebx
  mov    %rbp,%r12
  jmp    L94
L31:
  add    $0x8,%ebx
L23:
  add    $0x1,%r12
L94:
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   <blockLength@plt>
  add    %r13d,%eax
  cmp    %r12d,%eax
  jle    L129
  mov    0x8(%rsp),%rax
  cmpl   $0xff,(%rax,%r12,4)
  jle    L31
  add    $0x10,%ebx
  jmp    L23
L1:
  mov    $0xd,%ecx
  mov    $0xb,%edx
  mov    $0x9,%esi
  mov    0x1c(%rsp),%edi
  call   <tribus@plt>
  add    %eax,%ebx
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  lea    (%rax,%rcx,1),%edx
  and    $0x1,%edx
  sub    %ecx,%edx
  test   $0x1,%al
  je     L59
  cmp    $0x1,%edx
  jne    L129
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  lea    -0x1(%rax),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  lea    (%rax,%rax,4),%edx
  lea    (%rax,%rdx,2),%eax
  lea    0x6(%rbx,%rax,1),%ebx
  jmp    L129
L59:
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  mov    %eax,%edx
  shr    $0x1f,%edx
  lea    (%rdx,%rax,1),%eax
  sar    %eax
  lea    (%rax,%rax,4),%edx
  lea    (%rax,%rdx,2),%eax
  add    %eax,%ebx
  jmp    L129
L95:
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  sub    $0x1,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  lea    (%rdx,%rdx,4),%eax
  lea    0x4(%rbx,%rax,2),%ebx
  jmp    L129
L39:
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <blockLength@plt>
  sub    $0x2,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  lea    (%rdx,%rdx,4),%eax
  lea    0x7(%rbx,%rax,2),%ebx
  jmp    L129
```

assistant: ```c
int getBinaryLength(int version, char inputMode[], int inputData[], int inputLength, int gs1, int eci) {
  char currentMode;
  int i, j;
  int count = 0;
  applyOptimisation(version, inputMode, inputLength);
  currentMode = ' ';
  if (gs1 == 1) {
    count += 4;
  }
  if (eci != 3) {
    count += 12;
  }
  for (i = 0; i < inputLength; i++) {
    if (inputMode[i] != currentMode) {
      count += 4;
      switch (inputMode[i]) {
      case 'K':
        count += tribus(version, 8, 10, 12);
        count += (blockLength(i, inputMode, inputLength) * 13);
        break;
      case 'B':
        count += tribus(version, 8, 16, 16);
        for (j = i; j < (i + blockLength(i, inputMode, inputLength)); j++) {
          if (inputData[j] > 0xff) {
            count += 16;
          } else {
            count += 8;
          }
        }
        break;
      case 'A':
        count += tribus(version, 9, 11, 13);
        switch (blockLength(i, inputMode, inputLength) % 2) {
        case 0:
          count += (blockLength(i, inputMode, inputLength) / 2) * 11;
          break;
        case 1:
          count += ((blockLength(i, inputMode, inputLength) - 1) / 2) * 11;
          count += 6;
          break;
        }
        break;
      case 'N':
        count += tribus(version, 10, 12, 14);
        switch (blockLength(i, inputMode, inputLength) % 3) {
        case 0:
          count += (blockLength(i, inputMode, inputLength) / 3) * 10;
          break;
        case 1:
          count += ((blockLength(i, inputMode, inputLength) - 1) / 3) * 10;
          count += 4;
          break;
        case 2:
          count += ((blockLength(i, inputMode, inputLength) - 2) / 3) * 10;
          count += 7;
          break;
        }
        break;
      }
      currentMode = inputMode[i];
    }
  }
  return count;
}
```