user: Please show me the C implementation that matches the assembly code listed below:

```asm
<SwitchStateToString1F>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rsi,%rbp
  test   $0x80,%dil
  je     L149
  lea    D319(%rip),%rdx
  lea    D112(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rax,%rbx
  test   $0x40,%r12b
  je     L127
  movslq %eax,%rdi
  add    %rbp,%rdi
  lea    D49(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L155:
  test   $0x20,%r12b
  je     L86
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D305(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L38:
  test   $0x10,%r12b
  je     L60
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D3(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L20:
  test   $0x8,%r12b
  je     L70
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D288(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L171:
  test   $0x4,%r12b
  je     L47
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D70(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L91:
  test   $0x2,%r12b
  je     L170
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D26(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
L87:
  test   $0x1,%r12b
  je     L146
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D307(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %ebx,%eax
L34:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L127:
  movslq %eax,%rdi
  add    %rbp,%rdi
  lea    D274(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L155
L149:
  lea    D150(%rip),%rdx
  lea    D112(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rax,%rbx
  test   $0x40,%r12b
  je     L35
  movslq %eax,%rdi
  add    %rbp,%rdi
  lea    D330(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L155
L35:
  movslq %eax,%rdi
  add    %rbp,%rdi
  lea    D127(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L155
L86:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D119(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L38
L60:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D254(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L20
L70:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D317(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L171
L47:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D278(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L91
L170:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D109(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  jmp    L87
L146:
  movslq %ebx,%rax
  lea    0x0(%rbp,%rax,1),%rdi
  lea    D67(%rip),%rdx
  lea    D112(%rip),%rsi
  call   <sprintf@plt>
  add    %ebx,%eax
  jmp    L34
```

tool_calls: name: parse_data
arguments: data_label: D319
data_type: string
name: parse_data
arguments: data_label: D112
data_type: string
name: parse_data
arguments: data_label: D49
data_type: string
name: parse_data
arguments: data_label: D305
data_type: string
name: parse_data
arguments: data_label: D3
data_type: string
name: parse_data
arguments: data_label: D288
data_type: string
name: parse_data
arguments: data_label: D70
data_type: string
name: parse_data
arguments: data_label: D26
data_type: string
name: parse_data
arguments: data_label: D307
data_type: string
name: parse_data
arguments: data_label: D274
data_type: string
name: parse_data
arguments: data_label: D150
data_type: string
name: parse_data
arguments: data_label: D330
data_type: string
name: parse_data
arguments: data_label: D127
data_type: string
name: parse_data
arguments: data_label: D119
data_type: string
name: parse_data
arguments: data_label: D254
data_type: string
name: parse_data
arguments: data_label: D317
data_type: string
name: parse_data
arguments: data_label: D278
data_type: string
name: parse_data
arguments: data_label: D109
data_type: string
name: parse_data
arguments: data_label: D67
data_type: string

tool: D319: Manual mode


tool: D112: %s

tool: D49: Output transistor on


tool: D305: Negative edge sensed since inactive on Main


tool: D3: Negative edge sensed since inactive on Aux.


tool: D288: Voltage High on Aux. output


tool: D70: Inactive status of Aux. output


tool: D26: Voltage High on Main output


tool: D307: Inactive status on Main output


tool: D274: Output transistor off


tool: D150: Auto-control mode


tool: D330: Output association with Auxillary


tool: D127: Output association with Main


tool: D119: No event on Main


tool: D254: No event on Aux.


tool: D317: Voltage Low on Aux. output


tool: D278: Active status of Aux. output


tool: D109: Voltage Low on Main output


tool: D67: Active status on Main output


assistant: ```c
int SwitchStateToString1F(int infobyte, char *outstr) {
  int cnt = 0;
  if (infobyte & 0x80) {
    cnt += sprintf(outstr + cnt, "%s", "Manual mode\n");
    if (infobyte & 0x40)
      cnt += sprintf(outstr + cnt, "%s", "Output transistor on\n");
    else
      cnt += sprintf(outstr + cnt, "%s", "Output transistor off\n");
  } else {
    cnt += sprintf(outstr + cnt, "%s", "Auto-control mode\n");
    if (infobyte & 0x40)
      cnt += sprintf(outstr + cnt, "%s", "Output association with Auxillary\n");
    else
      cnt += sprintf(outstr + cnt, "%s", "Output association with Main\n");
  }
  if (infobyte & 0x20)
    cnt += sprintf(outstr + cnt, "%s", "Negative edge sensed since inactive on Main\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "No event on Main\n");
  if (infobyte & 0x10)
    cnt += sprintf(outstr + cnt, "%s", "Negative edge sensed since inactive on Aux.\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "No event on Aux.\n");
  if (infobyte & 0x08)
    cnt += sprintf(outstr + cnt, "%s", "Voltage High on Aux. output\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "Voltage Low on Aux. output\n");
  if (infobyte & 0x04)
    cnt += sprintf(outstr + cnt, "%s", "Inactive status of Aux. output\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "Active status of Aux. output\n");
  if (infobyte & 0x02)
    cnt += sprintf(outstr + cnt, "%s", "Voltage High on Main output\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "Voltage Low on Main output\n");
  if (infobyte & 0x01)
    cnt += sprintf(outstr + cnt, "%s", "Inactive status on Main output\n");
  else
    cnt += sprintf(outstr + cnt, "%s", "Active status on Main output\n");
  return cnt;
}
```