#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ sprintf(char *, char *, char *);
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;
}


x86 assembly (clang, -O0):
<SwitchStateToString1F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11d1 <SwitchStateToString1F+0xc1>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xeb7(%rip),%rsi
lea    0xeb3(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11a1 <SwitchStateToString1F+0x91>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xe7d(%rip),%rsi
lea    0xe86(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    11cc <SwitchStateToString1F+0xbc>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xe4d(%rip),%rsi
lea    0xe6c(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    126b <SwitchStateToString1F+0x15b>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xe1d(%rip),%rsi
lea    0xe53(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     123b <SwitchStateToString1F+0x12b>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xde3(%rip),%rsi
lea    0xe2c(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    1266 <SwitchStateToString1F+0x156>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xdb3(%rip),%rsi
lea    0xe1f(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    126b <SwitchStateToString1F+0x15b>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     12aa <SwitchStateToString1F+0x19a>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xd74(%rip),%rsi
lea    0xdfe(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    12d5 <SwitchStateToString1F+0x1c5>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xd44(%rip),%rsi
lea    0xdfb(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1314 <SwitchStateToString1F+0x204>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xd0a(%rip),%rsi
lea    0xdd3(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    133f <SwitchStateToString1F+0x22f>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xcda(%rip),%rsi
lea    0xdd0(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     137e <SwitchStateToString1F+0x26e>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xca0(%rip),%rsi
lea    0xda8(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    13a9 <SwitchStateToString1F+0x299>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xc70(%rip),%rsi
lea    0xd95(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     13e8 <SwitchStateToString1F+0x2d8>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xc36(%rip),%rsi
lea    0xd77(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    1413 <SwitchStateToString1F+0x303>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xc06(%rip),%rsi
lea    0xd67(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1452 <SwitchStateToString1F+0x342>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xbcc(%rip),%rsi
lea    0xd4b(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    147d <SwitchStateToString1F+0x36d>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xb9c(%rip),%rsi
lea    0xd38(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14bc <SwitchStateToString1F+0x3ac>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xb62(%rip),%rsi
lea    0xd1a(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    14e7 <SwitchStateToString1F+0x3d7>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    0xb32(%rip),%rsi
lea    0xd0a(%rip),%rdx
call   1030 <sprintf@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwitchStateToString1F>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %edi,%r15d
lea    0xedb(%rip),%rsi
test   $0x80,%r15b
jne    1162 <SwitchStateToString1F+0x52>
lea    0xf0b(%rip),%rdx
mov    %r12,%rdi
call   1030 <sprintf@plt>
mov    %rax,%r14
movslq %r14d,%rbx
lea    (%r12,%rbx,1),%rdi
lea    0xeb5(%rip),%rsi
test   $0x40,%r15b
jne    118e <SwitchStateToString1F+0x7e>
lea    0xf1b(%rip),%rdx
call   1030 <sprintf@plt>
add    %r14,%rax
jmp    11a6 <SwitchStateToString1F+0x96>
lea    0xe9a(%rip),%rdx
mov    %r12,%rdi
call   1030 <sprintf@plt>
movslq %eax,%rbx
lea    (%r12,%rbx,1),%rdi
lea    0xe81(%rip),%rsi
test   $0x40,%r15b
jne    1197 <SwitchStateToString1F+0x87>
lea    0xe9a(%rip),%rdx
jmp    119e <SwitchStateToString1F+0x8e>
lea    0xebb(%rip),%rdx
jmp    119e <SwitchStateToString1F+0x8e>
lea    0xe72(%rip),%rdx
call   1030 <sprintf@plt>
add    %rbx,%rax
movslq %eax,%rbx
lea    (%r12,%rbx,1),%rdi
test   $0x20,%r15b
lea    0xf06(%rip),%rcx
lea    0xed2(%rip),%rdx
cmove  %rcx,%rdx
cmove  %rax,%rbx
lea    0xe32(%rip),%r14
mov    %r14,%rsi
call   1030 <sprintf@plt>
mov    %rax,%rbp
add    %rbx,%rbp
test   $0x10,%r15b
lea    0xf16(%rip),%rax
lea    0xee2(%rip),%rdx
cmove  %rax,%rdx
movslq %ebp,%rdi
cmovne %rdi,%rbp
add    %r12,%rdi
mov    %r14,%rsi
call   1030 <sprintf@plt>
mov    %rax,%rbx
add    %rbp,%rbx
test   $0x8,%r15b
lea    0xf17(%rip),%rax
lea    0xef3(%rip),%rdx
cmove  %rax,%rdx
movslq %ebx,%rdi
cmovne %rdi,%rbx
add    %r12,%rdi
mov    %r14,%rsi
call   1030 <sprintf@plt>
mov    %rax,%rbp
add    %rbx,%rbp
test   $0x4,%r15b
lea    0xf25(%rip),%rax
lea    0xefe(%rip),%rdx
cmove  %rax,%rdx
movslq %ebp,%rdi
cmovne %rdi,%rbp
add    %r12,%rdi
mov    %r14,%rsi
call   1030 <sprintf@plt>
mov    %rax,%rbx
add    %rbp,%rbx
test   $0x2,%r15b
lea    0xf32(%rip),%rax
lea    0xf0e(%rip),%rdx
cmove  %rax,%rdx
movslq %ebx,%rdi
cmovne %rdi,%rbx
add    %r12,%rdi
mov    %r14,%rsi
call   1030 <sprintf@plt>
add    %rbx,%rax
test   $0x1,%r15b
movslq %eax,%rbx
lea    0xf40(%rip),%rax
lea    0xf19(%rip),%rdx
cmove  %rax,%rdx
add    %rbx,%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <sprintf@plt>
add    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"Manual mode\0A\00"
@.str.2 = [22 x i8] c"Output transistor on\0A\00"
@.str.3 = [23 x i8] c"Output transistor off\0A\00"
@.str.4 = [19 x i8] c"Auto-control mode\0A\00"
@.str.5 = [35 x i8] c"Output association with Auxillary\0A\00"
@.str.6 = [30 x i8] c"Output association with Main\0A\00"
@.str.7 = [45 x i8] c"Negative edge sensed since inactive on Main\0A\00"
@.str.8 = [18 x i8] c"No event on Main\0A\00"
@.str.9 = [45 x i8] c"Negative edge sensed since inactive on Aux.\0A\00"
@.str.10 = [18 x i8] c"No event on Aux.\0A\00"
@.str.11 = [29 x i8] c"Voltage High on Aux. output\0A\00"
@.str.12 = [28 x i8] c"Voltage Low on Aux. output\0A\00"
@.str.13 = [32 x i8] c"Inactive status of Aux. output\0A\00"
@.str.14 = [30 x i8] c"Active status of Aux. output\0A\00"
@.str.15 = [29 x i8] c"Voltage High on Main output\0A\00"
@.str.16 = [28 x i8] c"Voltage Low on Main output\0A\00"
@.str.17 = [32 x i8] c"Inactive status on Main output\0A\00"
@.str.18 = [30 x i8] c"Active status on Main output\0A\00"
define i32 @SwitchStateToString1F(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %43
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = call i64 @sprintf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = and i32 %19, 64
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %9
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = call i64 @sprintf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = add nsw i64 %29, %27
%31 = trunc i64 %30 to i32
store i32 %31, i32* %5
br label %42
32: ; preds = %9
%33 = load i8*, i8** %4
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = call i64 @sprintf(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = add nsw i64 %39, %37
%41 = trunc i64 %40 to i32
store i32 %41, i32* %5
br label %42
42: ; preds = %32, %22
br label %77
43: ; preds = %2
%44 = load i8*, i8** %4
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = call i64 @sprintf(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = add nsw i64 %50, %48
%52 = trunc i64 %51 to i32
store i32 %52, i32* %5
%53 = load i32, i32* %3
%54 = and i32 %53, 64
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %66
56: ; preds = %43
%57 = load i8*, i8** %4
%58 = load i32, i32* %5
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = call i64 @sprintf(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%62 = load i32, i32* %5
%63 = sext i32 %62 to i64
%64 = add nsw i64 %63, %61
%65 = trunc i64 %64 to i32
store i32 %65, i32* %5
br label %76
66: ; preds = %43
%67 = load i8*, i8** %4
%68 = load i32, i32* %5
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %67, i64 %69
%71 = call i64 @sprintf(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%72 = load i32, i32* %5
%73 = sext i32 %72 to i64
%74 = add nsw i64 %73, %71
%75 = trunc i64 %74 to i32
store i32 %75, i32* %5
br label %76
76: ; preds = %66, %56
br label %77
77: ; preds = %76, %42
%78 = load i32, i32* %3
%79 = and i32 %78, 32
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %91
81: ; preds = %77
%82 = load i8*, i8** %4
%83 = load i32, i32* %5
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = call i64 @sprintf(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%87 = load i32, i32* %5
%88 = sext i32 %87 to i64
%89 = add nsw i64 %88, %86
%90 = trunc i64 %89 to i32
store i32 %90, i32* %5
br label %101
91: ; preds = %77
%92 = load i8*, i8** %4
%93 = load i32, i32* %5
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8, i8* %92, i64 %94
%96 = call i64 @sprintf(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%97 = load i32, i32* %5
%98 = sext i32 %97 to i64
%99 = add nsw i64 %98, %96
%100 = trunc i64 %99 to i32
store i32 %100, i32* %5
br label %101
101: ; preds = %91, %81
%102 = load i32, i32* %3
%103 = and i32 %102, 16
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %115
105: ; preds = %101
%106 = load i8*, i8** %4
%107 = load i32, i32* %5
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %106, i64 %108
%110 = call i64 @sprintf(i8* %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
%111 = load i32, i32* %5
%112 = sext i32 %111 to i64
%113 = add nsw i64 %112, %110
%114 = trunc i64 %113 to i32
store i32 %114, i32* %5
br label %125
115: ; preds = %101
%116 = load i8*, i8** %4
%117 = load i32, i32* %5
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %116, i64 %118
%120 = call i64 @sprintf(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%121 = load i32, i32* %5
%122 = sext i32 %121 to i64
%123 = add nsw i64 %122, %120
%124 = trunc i64 %123 to i32
store i32 %124, i32* %5
br label %125
125: ; preds = %115, %105
%126 = load i32, i32* %3
%127 = and i32 %126, 8
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %139
129: ; preds = %125
%130 = load i8*, i8** %4
%131 = load i32, i32* %5
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %130, i64 %132
%134 = call i64 @sprintf(i8* %133, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%135 = load i32, i32* %5
%136 = sext i32 %135 to i64
%137 = add nsw i64 %136, %134
%138 = trunc i64 %137 to i32
store i32 %138, i32* %5
br label %149
139: ; preds = %125
%140 = load i8*, i8** %4
%141 = load i32, i32* %5
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = call i64 @sprintf(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0))
%145 = load i32, i32* %5
%146 = sext i32 %145 to i64
%147 = add nsw i64 %146, %144
%148 = trunc i64 %147 to i32
store i32 %148, i32* %5
br label %149
149: ; preds = %139, %129
%150 = load i32, i32* %3
%151 = and i32 %150, 4
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %163
153: ; preds = %149
%154 = load i8*, i8** %4
%155 = load i32, i32* %5
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds i8, i8* %154, i64 %156
%158 = call i64 @sprintf(i8* %157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
%159 = load i32, i32* %5
%160 = sext i32 %159 to i64
%161 = add nsw i64 %160, %158
%162 = trunc i64 %161 to i32
store i32 %162, i32* %5
br label %173
163: ; preds = %149
%164 = load i8*, i8** %4
%165 = load i32, i32* %5
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8, i8* %164, i64 %166
%168 = call i64 @sprintf(i8* %167, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%169 = load i32, i32* %5
%170 = sext i32 %169 to i64
%171 = add nsw i64 %170, %168
%172 = trunc i64 %171 to i32
store i32 %172, i32* %5
br label %173
173: ; preds = %163, %153
%174 = load i32, i32* %3
%175 = and i32 %174, 2
%176 = icmp ne i32 %175, 0
br i1 %176, label %177, label %187
177: ; preds = %173
%178 = load i8*, i8** %4
%179 = load i32, i32* %5
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8, i8* %178, i64 %180
%182 = call i64 @sprintf(i8* %181, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%183 = load i32, i32* %5
%184 = sext i32 %183 to i64
%185 = add nsw i64 %184, %182
%186 = trunc i64 %185 to i32
store i32 %186, i32* %5
br label %197
187: ; preds = %173
%188 = load i8*, i8** %4
%189 = load i32, i32* %5
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %188, i64 %190
%192 = call i64 @sprintf(i8* %191, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%193 = load i32, i32* %5
%194 = sext i32 %193 to i64
%195 = add nsw i64 %194, %192
%196 = trunc i64 %195 to i32
store i32 %196, i32* %5
br label %197
197: ; preds = %187, %177
%198 = load i32, i32* %3
%199 = and i32 %198, 1
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %211
201: ; preds = %197
%202 = load i8*, i8** %4
%203 = load i32, i32* %5
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8, i8* %202, i64 %204
%206 = call i64 @sprintf(i8* %205, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0))
%207 = load i32, i32* %5
%208 = sext i32 %207 to i64
%209 = add nsw i64 %208, %206
%210 = trunc i64 %209 to i32
store i32 %210, i32* %5
br label %221
211: ; preds = %197
%212 = load i8*, i8** %4
%213 = load i32, i32* %5
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i8, i8* %212, i64 %214
%216 = call i64 @sprintf(i8* %215, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0))
%217 = load i32, i32* %5
%218 = sext i32 %217 to i64
%219 = add nsw i64 %218, %216
%220 = trunc i64 %219 to i32
store i32 %220, i32* %5
br label %221
221: ; preds = %211, %201
%222 = load i32, i32* %5
ret i32 %222
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"Manual mode\0A\00"
@.str.2 = [22 x i8] c"Output transistor on\0A\00"
@.str.3 = [23 x i8] c"Output transistor off\0A\00"
@.str.4 = [19 x i8] c"Auto-control mode\0A\00"
@.str.5 = [35 x i8] c"Output association with Auxillary\0A\00"
@.str.6 = [30 x i8] c"Output association with Main\0A\00"
@.str.7 = [45 x i8] c"Negative edge sensed since inactive on Main\0A\00"
@.str.8 = [18 x i8] c"No event on Main\0A\00"
@.str.9 = [45 x i8] c"Negative edge sensed since inactive on Aux.\0A\00"
@.str.10 = [18 x i8] c"No event on Aux.\0A\00"
@.str.11 = [29 x i8] c"Voltage High on Aux. output\0A\00"
@.str.12 = [28 x i8] c"Voltage Low on Aux. output\0A\00"
@.str.13 = [32 x i8] c"Inactive status of Aux. output\0A\00"
@.str.14 = [30 x i8] c"Active status of Aux. output\0A\00"
@.str.15 = [29 x i8] c"Voltage High on Main output\0A\00"
@.str.16 = [28 x i8] c"Voltage Low on Main output\0A\00"
@.str.17 = [32 x i8] c"Inactive status on Main output\0A\00"
@.str.18 = [30 x i8] c"Active status on Main output\0A\00"
define i32 @SwitchStateToString1F(i32 %0, i8* %1) {
%3 = and i32 %0, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = tail call i64 @sprintf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = and i32 %0, 64
%8 = icmp eq i32 %7, 0
%9 = shl i64 %6, 32
%10 = ashr exact i64 %9, 32
%11 = getelementptr inbounds i8, i8* %1, i64 %10
br i1 %8, label %15, label %12
12: ; preds = %5
%13 = tail call i64 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%14 = add nsw i64 %13, %10
br label %31
15: ; preds = %5
%16 = tail call i64 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%17 = add nsw i64 %16, %10
br label %31
18: ; preds = %2
%19 = tail call i64 @sprintf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%20 = and i32 %0, 64
%21 = icmp eq i32 %20, 0
%22 = shl i64 %19, 32
%23 = ashr exact i64 %22, 32
%24 = getelementptr inbounds i8, i8* %1, i64 %23
br i1 %21, label %28, label %25
25: ; preds = %18
%26 = tail call i64 @sprintf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%27 = add nsw i64 %26, %23
br label %31
28: ; preds = %18
%29 = tail call i64 @sprintf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%30 = add i64 %29, %19
br label %31
31: ; preds = %25, %28, %12, %15
%32 = phi i64 [ %14, %12 ], [ %17, %15 ], [ %27, %25 ], [ %30, %28 ]
%33 = and i32 %0, 32
%34 = icmp eq i32 %33, 0
%35 = shl i64 %32, 32
%36 = ashr exact i64 %35, 32
%37 = getelementptr inbounds i8, i8* %1, i64 %36
%38 = select i1 %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0)
%39 = select i1 %34, i64 %32, i64 %36
%40 = tail call i64 @sprintf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %38)
%41 = add i64 %40, %39
%42 = and i32 %0, 16
%43 = icmp eq i32 %42, 0
%44 = shl i64 %41, 32
%45 = ashr exact i64 %44, 32
%46 = shl i64 %41, 32
%47 = ashr exact i64 %46, 32
%48 = select i1 %43, i64 %45, i64 %47
%49 = select i1 %43, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0)
%50 = select i1 %43, i64 %41, i64 %47
%51 = getelementptr inbounds i8, i8* %1, i64 %48
%52 = tail call i64 @sprintf(i8* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %49)
%53 = add i64 %52, %50
%54 = and i32 %0, 8
%55 = icmp eq i32 %54, 0
%56 = shl i64 %53, 32
%57 = ashr exact i64 %56, 32
%58 = shl i64 %53, 32
%59 = ashr exact i64 %58, 32
%60 = select i1 %55, i64 %57, i64 %59
%61 = select i1 %55, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0)
%62 = select i1 %55, i64 %53, i64 %59
%63 = getelementptr inbounds i8, i8* %1, i64 %60
%64 = tail call i64 @sprintf(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %61)
%65 = add i64 %64, %62
%66 = and i32 %0, 4
%67 = icmp eq i32 %66, 0
%68 = shl i64 %65, 32
%69 = ashr exact i64 %68, 32
%70 = shl i64 %65, 32
%71 = ashr exact i64 %70, 32
%72 = select i1 %67, i64 %69, i64 %71
%73 = select i1 %67, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0)
%74 = select i1 %67, i64 %65, i64 %71
%75 = getelementptr inbounds i8, i8* %1, i64 %72
%76 = tail call i64 @sprintf(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %73)
%77 = add i64 %76, %74
%78 = and i32 %0, 2
%79 = icmp eq i32 %78, 0
%80 = shl i64 %77, 32
%81 = ashr exact i64 %80, 32
%82 = shl i64 %77, 32
%83 = ashr exact i64 %82, 32
%84 = select i1 %79, i64 %81, i64 %83
%85 = select i1 %79, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0)
%86 = select i1 %79, i64 %77, i64 %83
%87 = getelementptr inbounds i8, i8* %1, i64 %84
%88 = tail call i64 @sprintf(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %85)
%89 = add i64 %88, %86
%90 = and i32 %0, 1
%91 = icmp eq i32 %90, 0
%92 = shl i64 %89, 32
%93 = ashr exact i64 %92, 32
%94 = select i1 %91, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0)
%95 = getelementptr inbounds i8, i8* %1, i64 %93
%96 = tail call i64 @sprintf(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %94)
%97 = add i64 %96, %89
%98 = trunc i64 %97 to i32
ret i32 %98
}