#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 */
int scanto(char *, int *, char);
int /*<<< orphan*/ show_result(char *, char const *);
void show_DataIntegrity(char *report) {
  int pos = 0;
  int code = scanto(report, &pos, 'n');
  const char *show;
  switch (code) {
  case 70:
    show = "No communication errors";
    break;
  case 71:
    show = "Communication errors";
    break;
  case 73:
    show = "Not reported since last power-up or RIS";
    break;
  default:
    show = "failed";
  }
  show_result("%s", show);
}


x86 assembly (clang, -O0):
<show_DataIntegrity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x6e,%edx
call   1030 <scanto@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x46,%eax
je     117e <show_DataIntegrity+0x5e>
jmp    115c <show_DataIntegrity+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x47,%eax
je     118e <show_DataIntegrity+0x6e>
jmp    116d <show_DataIntegrity+0x4d>
mov    -0x1c(%rbp),%eax
sub    $0x49,%eax
je     119e <show_DataIntegrity+0x7e>
jmp    11ae <show_DataIntegrity+0x8e>
lea    0xe7b(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_DataIntegrity+0x99>
lea    0xe83(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_DataIntegrity+0x99>
lea    0xe88(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_DataIntegrity+0x99>
lea    0xea0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <show_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_DataIntegrity>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x6e,%edx
call   1030 <scanto@plt>
add    $0xffffffba,%eax
cmp    $0x3,%eax
ja     1152 <show_DataIntegrity+0x32>
cltq
lea    0xf17(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1159 <show_DataIntegrity+0x39>
lea    0xefc(%rip),%rsi
lea    0xefc(%rip),%rdi
call   1040 <show_result@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"No communication errors\00"
@.str.1 = [21 x i8] c"Communication errors\00"
@.str.2 = [40 x i8] c"Not reported since last power-up or RIS\00"
@.str.3 = [7 x i8] c"failed\00"
@.str.4 = [3 x i8] c"%s\00"
define void @show_DataIntegrity(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @scanto(i8* %6, i32* %3, i8 signext 110)
store i32 %7, i32* %4
%8 = load i32, i32* %4
switch i32 %8, label %12 [
i32 70, label %9
i32 71, label %10
i32 73, label %11
]
9: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %5
br label %13
10: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %13
11: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8** %5
br label %13
12: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %5
br label %13
13: ; preds = %12, %11, %10, %9
%14 = load i8*, i8** %5
%15 = call i32 @show_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"No communication errors\00"
@.str.1 = [21 x i8] c"Communication errors\00"
@.str.2 = [40 x i8] c"Not reported since last power-up or RIS\00"
@.str.3 = [7 x i8] c"failed\00"
@.str.4 = [3 x i8] c"%s\00"
@reltable.show_DataIntegrity = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.show_DataIntegrity to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.show_DataIntegrity to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.show_DataIntegrity to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.show_DataIntegrity to i64)) to i32)]
define void @show_DataIntegrity(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @scanto(i8* %0, i32* %2, i8 signext 110)
%5 = add i32 %4, -70
%6 = icmp ult i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.show_DataIntegrity to i8*), i64 %9)
br label %11
11: ; preds = %1, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %1 ]
%13 = call i32 @show_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %12)
ret void
}