void ses_threshold_helper(const char *pad, const unsigned char *tp, int etype,
                          int p_num, int inner_hex, int verbose) {
  char buff[128];
  char b[128];
  char b2[128];
  if (p_num < 0)
    strcpy(buff, "Overall threshold");
  else
    snprintf(buff, sizeof(buff) - 1,
             "Individual threshold status "
             "element %d",
             p_num + 1);
  if (inner_hex) {
    printf("%s%s (in hex): %02x %02x %02x %02x\n", pad, buff, tp[0], tp[1],
           tp[2], tp[3]);
    return;
  }
  switch (etype) {
  case 0x4:
    printf("%s%s: high critical=%s, high warning=%s\n", pad, buff,
           reserved_or_num(b, 128, tp[0] - 20, -20),
           reserved_or_num(b2, 128, tp[1] - 20, -20));
    printf("%s  low warning=%s, low critical=%s (in degrees Celsius)\n", pad,
           reserved_or_num(b, 128, tp[2] - 20, -20),
           reserved_or_num(b2, 128, tp[3] - 20, -20));
    break;
  case 0xb:
    if (0 == tp[2])
      strcpy(b, "<vendor>");
    else
      snprintf(b, sizeof(b), "%d", tp[2]);
    printf("%s%s: low warning=%s, ", pad, buff, b);
    if (0 == tp[3])
      strcpy(b, "<vendor>");
    else
      snprintf(b, sizeof(b), "%d", tp[3]);
    printf("low critical=%s (in minutes)\n", b);
    break;
  case 0x12:
    printf("%s%s: high critical=%.1f %%, high warning=%.1f %%\n", pad, buff,
           0.5 * tp[0], 0.5 * tp[1]);
    printf("%s  low warning=%.1f %%, low critical=%.1f %% (from nominal "
           "voltage)\n",
           pad, 0.5 * tp[2], 0.5 * tp[3]);
    break;
  case 0x13:
    printf("%s%s: high critical=%.1f %%, high warning=%.1f %%\n", pad, buff,
           0.5 * tp[0], 0.5 * tp[1]);
    printf("%s  (above nominal current)\n", pad);
    break;
  default:
    if (verbose)
      printf("%s<< no thresholds for this element type >>\n", pad);
    break;
  }
}


x86 assembly (clang, -O0):
<ses_threshold_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1183 <ses_threshold_helper+0x43>
lea    -0xa0(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11a3 <ses_threshold_helper+0x63>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
mov    $0x7f,%esi
lea    0xebe(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11ef <ses_threshold_helper+0xaf>
mov    -0x8(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%r8d
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%r9d
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
lea    0xea1(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
mov    -0x14(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x1a8(%rbp)
sub    $0xf,%eax
ja     14e0 <ses_threshold_helper+0x3a0>
mov    -0x1a8(%rbp),%rax
lea    0xdf3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl (%rax),%edx
sub    $0x14,%edx
mov    $0x80,%esi
mov    $0xffffffec,%ecx
mov    $0x0,%al
call   1060 <reserved_or_num@plt>
mov    %eax,-0x1bc(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edx
sub    $0x14,%edx
mov    $0x80,%esi
mov    $0xffffffec,%ecx
mov    $0x0,%al
call   1060 <reserved_or_num@plt>
mov    -0x1d0(%rbp),%rsi
mov    -0x1c8(%rbp),%rdx
mov    -0x1bc(%rbp),%ecx
mov    %eax,%r8d
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x1b8(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edx
sub    $0x14,%edx
mov    $0x80,%esi
mov    $0xffffffec,%ecx
mov    $0x0,%al
call   1060 <reserved_or_num@plt>
mov    %eax,-0x1ac(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%edx
sub    $0x14,%edx
mov    $0x80,%esi
mov    $0xffffffec,%ecx
mov    $0x0,%al
call   1060 <reserved_or_num@plt>
mov    -0x1b8(%rbp),%rsi
mov    -0x1ac(%rbp),%edx
mov    %eax,%ecx
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    134a <ses_threshold_helper+0x20a>
lea    -0x120(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    136c <ses_threshold_helper+0x22c>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%ecx
mov    $0x80,%esi
lea    0xd19(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    -0x8(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    13b6 <ses_threshold_helper+0x276>
lea    -0x120(%rbp),%rdi
lea    0xd5c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    13d8 <ses_threshold_helper+0x298>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
mov    $0x80,%esi
lea    0xcad(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
lea    -0x120(%rbp),%rsi
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
mov    -0x8(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cvtsi2sd %eax,%xmm1
movsd  0xbf0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cvtsi2sd %eax,%xmm2
movsd  0xbd8(%rip),%xmm1
mulsd  %xmm2,%xmm1
lea    0xd13(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cvtsi2sd %eax,%xmm1
movsd  0xbae(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cvtsi2sd %eax,%xmm2
movsd  0xb96(%rip),%xmm1
mulsd  %xmm2,%xmm1
lea    0xd04(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
mov    -0x8(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cvtsi2sd %eax,%xmm1
movsd  0xb61(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cvtsi2sd %eax,%xmm2
movsd  0xb49(%rip),%xmm1
mulsd  %xmm2,%xmm1
lea    0xc84(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
cmpl   $0x0,-0x20(%rbp)
je     14fc <ses_threshold_helper+0x3bc>
mov    -0x8(%rbp),%rsi
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1501 <ses_threshold_helper+0x3c1>
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ses_threshold_helper>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x190,%rsp
mov    %r9d,%r15d
mov    %r8d,%ebx
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%r14
test   %ecx,%ecx
js     11b6 <ses_threshold_helper+0x86>
add    $0x1,%ecx
lea    0xeff(%rip),%rdx
lea    0x90(%rsp),%rdi
mov    $0x7f,%esi
xor    %eax,%eax
call   1040 <snprintf@plt>
test   %ebx,%ebx
je     11d5 <ses_threshold_helper+0xa5>
movzbl (%r12),%ecx
movzbl 0x1(%r12),%r8d
movzbl 0x2(%r12),%r9d
movzbl 0x3(%r12),%eax
mov    %eax,(%rsp)
lea    0xeed(%rip),%rdi
lea    0x90(%rsp),%rdx
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movupd 0xe8a(%rip),%xmm0
movapd %xmm0,0x90(%rsp)
movw   $0x64,0xa0(%rsp)
test   %ebx,%ebx
jne    1173 <ses_threshold_helper+0x43>
add    $0xfffffffc,%ebp
cmp    $0xf,%ebp
ja     12ad <ses_threshold_helper+0x17d>
lea    0xe20(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movzbl (%r12),%edx
add    $0xffffffec,%edx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x80,%esi
mov    $0xffffffec,%ecx
xor    %eax,%eax
call   1050 <reserved_or_num@plt>
mov    %eax,%ebx
movzbl 0x1(%r12),%edx
add    $0xffffffec,%edx
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    $0xffffffec,%ecx
xor    %eax,%eax
call   1050 <reserved_or_num@plt>
lea    0xe65(%rip),%rdi
lea    0x90(%rsp),%rdx
mov    %r14,%rsi
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x2(%r12),%edx
add    $0xffffffec,%edx
mov    %r15,%rdi
mov    $0x80,%esi
mov    $0xffffffec,%ecx
xor    %eax,%eax
call   1050 <reserved_or_num@plt>
mov    %eax,%ebx
movzbl 0x3(%r12),%edx
add    $0xffffffec,%edx
mov    %rbp,%rdi
mov    $0x80,%esi
mov    $0xffffffec,%ecx
xor    %eax,%eax
call   1050 <reserved_or_num@plt>
lea    0xe34(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11a6 <ses_threshold_helper+0x76>
test   %r15d,%r15d
je     11a6 <ses_threshold_helper+0x76>
lea    0xf1f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
movzbl 0x2(%r12),%ecx
test   %ecx,%ecx
je     13cb <ses_threshold_helper+0x29b>
lea    0xd93(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1040 <snprintf@plt>
jmp    13df <ses_threshold_helper+0x2af>
movzbl (%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xceb(%rip),%xmm2
mulsd  %xmm2,%xmm0
movzbl 0x1(%r12),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm2,%xmm1
lea    0xe18(%rip),%rdi
lea    0x90(%rsp),%rdx
mov    %r14,%rsi
mov    $0x2,%al
call   1030 <printf@plt>
movzbl 0x2(%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xcab(%rip),%xmm2
mulsd  %xmm2,%xmm0
movzbl 0x3(%r12),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  %xmm2,%xmm1
lea    0xe08(%rip),%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11a6 <ses_threshold_helper+0x76>
movzbl (%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xc6c(%rip),%xmm2
mulsd  %xmm2,%xmm0
movzbl 0x1(%r12),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm2,%xmm1
lea    0xd99(%rip),%rdi
lea    0x90(%rsp),%rdx
mov    %r14,%rsi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    %r14,%rsi
jmp    1441 <ses_threshold_helper+0x311>
movabs $0x3e726f646e65763c,%rax
6f 72 3e
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
lea    0xd2b(%rip),%rdi
lea    0x90(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x3(%r12),%ecx
test   %ecx,%ecx
je     1421 <ses_threshold_helper+0x2f1>
lea    0xc70(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1040 <snprintf@plt>
jmp    1435 <ses_threshold_helper+0x305>
movabs $0x3e726f646e65763c,%rax
6f 72 3e
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
lea    0xcec(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11a6 <ses_threshold_helper+0x76>

LLVM IR (-O0):
@.str = [18 x i8] c"Overall threshold\00"
@.str.1 = [39 x i8] c"Individual threshold status element %d\00"
@.str.2 = [36 x i8] c"%s%s (in hex): %02x %02x %02x %02x\0A\00"
@.str.3 = [41 x i8] c"%s%s: high critical=%s, high warning=%s\0A\00"
@.str.4 = [58 x i8] c"%s low warning=%s, low critical=%s (in degrees Celsius)\0A\00"
@.str.5 = [9 x i8] c"<vendor>\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [23 x i8] c"%s%s: low warning=%s, \00"
@.str.8 = [30 x i8] c"low critical=%s (in minutes)\0A\00"
@.str.9 = [51 x i8] c"%s%s: high critical=%.1f %%, high warning=%.1f %%\0A\00"
@.str.10 = [70 x i8] c"%s low warning=%.1f %%, low critical=%.1f %% (from nominal voltage)\0A\00"
@.str.11 = [29 x i8] c"%s (above nominal current)\0A\00"
@.str.12 = [45 x i8] c"%s<< no thresholds for this element type >>\0A\00"
define void @ses_threshold_helper(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [128 x i8]
%14 = alloca [128 x i8]
%15 = alloca [128 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %6
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%20 = call i8* @strcpy(i8* %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %26
21: ; preds = %6
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%23 = load i32, i32* %10
%24 = add nsw i32 %23, 1
%25 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %22, i64 127, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %21, %18
%27 = load i32, i32* %11
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = load i8*, i8** %7
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%32 = load i8*, i8** %8
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8*, i8** %8
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8*, i8** %8
%41 = getelementptr inbounds i8, i8* %40, i64 2
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8*, i8** %8
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %30, i8* %31, i32 %35, i32 %39, i32 %43, i32 %47)
br label %179
49: ; preds = %26
%50 = load i32, i32* %9
switch i32 %50, label %172 [
i32 4, label %51
i32 11, label %85
i32 18, label %124
i32 19, label %154
]
51: ; preds = %49
%52 = load i8*, i8** %7
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%55 = load i8*, i8** %8
%56 = getelementptr inbounds i8, i8* %55, i64 0
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = sub nsw i32 %58, 20
%60 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %54, i32 128, i32 %59, i32 -20)
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%62 = load i8*, i8** %8
%63 = getelementptr inbounds i8, i8* %62, i64 1
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = sub nsw i32 %65, 20
%67 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %61, i32 128, i32 %66, i32 -20)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %52, i8* %53, i32 %60, i32 %67)
%69 = load i8*, i8** %7
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%71 = load i8*, i8** %8
%72 = getelementptr inbounds i8, i8* %71, i64 2
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = sub nsw i32 %74, 20
%76 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %70, i32 128, i32 %75, i32 -20)
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%78 = load i8*, i8** %8
%79 = getelementptr inbounds i8, i8* %78, i64 3
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = sub nsw i32 %81, 20
%83 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %77, i32 128, i32 %82, i32 -20)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i8* %69, i32 %76, i32 %83)
br label %179
85: ; preds = %49
%86 = load i8*, i8** %8
%87 = getelementptr inbounds i8, i8* %86, i64 2
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = icmp eq i32 0, %89
br i1 %90, label %91, label %94
91: ; preds = %85
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%93 = call i8* @strcpy(i8* %92, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %101
94: ; preds = %85
%95 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%96 = load i8*, i8** %8
%97 = getelementptr inbounds i8, i8* %96, i64 2
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %95, i64 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %94, %91
%102 = load i8*, i8** %7
%103 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%104 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %102, i8* %103, i8* %104)
%106 = load i8*, i8** %8
%107 = getelementptr inbounds i8, i8* %106, i64 3
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = icmp eq i32 0, %109
br i1 %110, label %111, label %114
111: ; preds = %101
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%113 = call i8* @strcpy(i8* %112, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %121
114: ; preds = %101
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%116 = load i8*, i8** %8
%117 = getelementptr inbounds i8, i8* %116, i64 3
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %115, i64 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %114, %111
%122 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %122)
br label %179
124: ; preds = %49
%125 = load i8*, i8** %7
%126 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%127 = load i8*, i8** %8
%128 = getelementptr inbounds i8, i8* %127, i64 0
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = sitofp i32 %130 to double
%132 = fmul double 5.000000e-01, %131
%133 = load i8*, i8** %8
%134 = getelementptr inbounds i8, i8* %133, i64 1
%135 = load i8, i8* %134
%136 = zext i8 %135 to i32
%137 = sitofp i32 %136 to double
%138 = fmul double 5.000000e-01, %137
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %125, i8* %126, double %132, double %138)
%140 = load i8*, i8** %7
%141 = load i8*, i8** %8
%142 = getelementptr inbounds i8, i8* %141, i64 2
%143 = load i8, i8* %142
%144 = zext i8 %143 to i32
%145 = sitofp i32 %144 to double
%146 = fmul double 5.000000e-01, %145
%147 = load i8*, i8** %8
%148 = getelementptr inbounds i8, i8* %147, i64 3
%149 = load i8, i8* %148
%150 = zext i8 %149 to i32
%151 = sitofp i32 %150 to double
%152 = fmul double 5.000000e-01, %151
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.10, i64 0, i64 0), i8* %140, double %146, double %152)
br label %179
154: ; preds = %49
%155 = load i8*, i8** %7
%156 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%157 = load i8*, i8** %8
%158 = getelementptr inbounds i8, i8* %157, i64 0
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = sitofp i32 %160 to double
%162 = fmul double 5.000000e-01, %161
%163 = load i8*, i8** %8
%164 = getelementptr inbounds i8, i8* %163, i64 1
%165 = load i8, i8* %164
%166 = zext i8 %165 to i32
%167 = sitofp i32 %166 to double
%168 = fmul double 5.000000e-01, %167
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %155, i8* %156, double %162, double %168)
%170 = load i8*, i8** %7
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %170)
br label %179
172: ; preds = %49
%173 = load i32, i32* %12
%174 = icmp ne i32 %173, 0
br i1 %174, label %175, label %178
175: ; preds = %172
%176 = load i8*, i8** %7
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i8* %176)
br label %178
178: ; preds = %175, %172
br label %179
179: ; preds = %29, %178, %154, %124, %121, %51
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Overall threshold\00"
@.str.1 = [39 x i8] c"Individual threshold status element %d\00"
@.str.2 = [36 x i8] c"%s%s (in hex): %02x %02x %02x %02x\0A\00"
@.str.3 = [41 x i8] c"%s%s: high critical=%s, high warning=%s\0A\00"
@.str.4 = [58 x i8] c"%s low warning=%s, low critical=%s (in degrees Celsius)\0A\00"
@.str.5 = [9 x i8] c"<vendor>\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [23 x i8] c"%s%s: low warning=%s, \00"
@.str.8 = [30 x i8] c"low critical=%s (in minutes)\0A\00"
@.str.9 = [51 x i8] c"%s%s: high critical=%.1f %%, high warning=%.1f %%\0A\00"
@.str.10 = [70 x i8] c"%s low warning=%.1f %%, low critical=%.1f %% (from nominal voltage)\0A\00"
@.str.11 = [29 x i8] c"%s (above nominal current)\0A\00"
@.str.12 = [45 x i8] c"%s<< no thresholds for this element type >>\0A\00"
define void @ses_threshold_helper(i8* %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [128 x i8]
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%13 = icmp slt i32 %3, 0
br i1 %13, label %14, label %15
14: ; preds = %6
br label %18
15: ; preds = %6
%16 = add nuw nsw i32 %3, 1
%17 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %10, i64 127, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %14
%19 = icmp eq i32 %4, 0
br i1 %19, label %33, label %20
20: ; preds = %18
%21 = load i8, i8* %1
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds i8, i8* %1, i64 1
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = getelementptr inbounds i8, i8* %1, i64 2
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = getelementptr inbounds i8, i8* %1, i64 3
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %10, i32 %22, i32 %25, i32 %28, i32 %31)
br label %107
33: ; preds = %18
switch i32 %2, label %103 [
i32 4, label %34
i32 11, label %56
i32 18, label %75
i32 19, label %93
]
34: ; preds = %33
%35 = load i8, i8* %1
%36 = zext i8 %35 to i32
%37 = add nsw i32 %36, -20
%38 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %11, i32 128, i32 %37, i32 -20)
%39 = getelementptr inbounds i8, i8* %1, i64 1
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = add nsw i32 %41, -20
%43 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %12, i32 128, i32 %42, i32 -20)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %10, i32 %38, i32 %43)
%45 = getelementptr inbounds i8, i8* %1, i64 2
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = add nsw i32 %47, -20
%49 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %11, i32 128, i32 %48, i32 -20)
%50 = getelementptr inbounds i8, i8* %1, i64 3
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = add nsw i32 %52, -20
%54 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @reserved_or_num to i32 (i8*, i32, i32, i32, ...)*)(i8* %12, i32 128, i32 %53, i32 -20)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i8* %0, i32 %49, i32 %54)
br label %107
56: ; preds = %33
%57 = getelementptr inbounds i8, i8* %1, i64 2
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %56
br label %64
61: ; preds = %56
%62 = zext i8 %58 to i32
%63 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %11, i64 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %61, %60
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %0, i8* %10, i8* %11)
%66 = getelementptr inbounds i8, i8* %1, i64 3
%67 = load i8, i8* %66
%68 = icmp eq i8 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %64
br label %73
70: ; preds = %64
%71 = zext i8 %67 to i32
%72 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %11, i64 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %71)
br label %73
73: ; preds = %70, %69
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %11)
br label %107
75: ; preds = %33
%76 = load i8, i8* %1
%77 = uitofp i8 %76 to double
%78 = fmul double %77, 5.000000e-01
%79 = getelementptr inbounds i8, i8* %1, i64 1
%80 = load i8, i8* %79
%81 = uitofp i8 %80 to double
%82 = fmul double %81, 5.000000e-01
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %0, i8* %10, double %78, double %82)
%84 = getelementptr inbounds i8, i8* %1, i64 2
%85 = load i8, i8* %84
%86 = uitofp i8 %85 to double
%87 = fmul double %86, 5.000000e-01
%88 = getelementptr inbounds i8, i8* %1, i64 3
%89 = load i8, i8* %88
%90 = uitofp i8 %89 to double
%91 = fmul double %90, 5.000000e-01
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.10, i64 0, i64 0), i8* %0, double %87, double %91)
br label %107
93: ; preds = %33
%94 = load i8, i8* %1
%95 = uitofp i8 %94 to double
%96 = fmul double %95, 5.000000e-01
%97 = getelementptr inbounds i8, i8* %1, i64 1
%98 = load i8, i8* %97
%99 = uitofp i8 %98 to double
%100 = fmul double %99, 5.000000e-01
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %0, i8* %10, double %96, double %100)
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %0)
br label %107
103: ; preds = %33
%104 = icmp eq i32 %5, 0
br i1 %104, label %107, label %105
105: ; preds = %103
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i8* %0)
br label %107
107: ; preds = %34, %73, %75, %93, %105, %103, %20
ret void
}