#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_Locator_Status(char *report) {
  int pos = 0;
  int code = scanto(report, &pos, 'n');
  const char *show;
  switch (code) {
  case 53:
    show = "No locator";
    break;
  case 50:
    show = "Locator ready";
    break;
  case 58:
    show = "Locator busy";
    break;
  default:
    show = "failed";
  }
  show_result("%s", show);
}


x86 assembly (clang, -O0):
<show_Locator_Status>:
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    $0x32,%eax
je     118e <show_Locator_Status+0x6e>
jmp    115c <show_Locator_Status+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x35,%eax
je     117e <show_Locator_Status+0x5e>
jmp    116d <show_Locator_Status+0x4d>
mov    -0x1c(%rbp),%eax
sub    $0x3a,%eax
je     119e <show_Locator_Status+0x7e>
jmp    11ae <show_Locator_Status+0x8e>
lea    0xe7b(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_Locator_Status+0x99>
lea    0xe76(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_Locator_Status+0x99>
lea    0xe74(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11b9 <show_Locator_Status+0x99>
lea    0xe71(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe69(%rip),%rdi
call   1040 <show_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_Locator_Status>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x6e,%edx
call   1030 <scanto@plt>
cmp    $0x3a,%eax
je     1150 <show_Locator_Status+0x30>
cmp    $0x35,%eax
je     1159 <show_Locator_Status+0x39>
cmp    $0x32,%eax
jne    1162 <show_Locator_Status+0x42>
lea    0xebd(%rip),%rsi
jmp    1169 <show_Locator_Status+0x49>
lea    0xec2(%rip),%rsi
jmp    1169 <show_Locator_Status+0x49>
lea    0xea0(%rip),%rsi
jmp    1169 <show_Locator_Status+0x49>
lea    0xebd(%rip),%rsi
lea    0xebd(%rip),%rdi
call   1040 <show_result@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"No locator\00"
@.str.1 = [14 x i8] c"Locator ready\00"
@.str.2 = [13 x i8] c"Locator busy\00"
@.str.3 = [7 x i8] c"failed\00"
@.str.4 = [3 x i8] c"%s\00"
define void @show_Locator_Status(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 53, label %9
i32 50, label %10
i32 58, label %11
]
9: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %5
br label %13
10: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %13
11: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 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 = [11 x i8] c"No locator\00"
@.str.1 = [14 x i8] c"Locator ready\00"
@.str.2 = [13 x i8] c"Locator busy\00"
@.str.3 = [7 x i8] c"failed\00"
@.str.4 = [3 x i8] c"%s\00"
define void @show_Locator_Status(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)
switch i32 %4, label %7 [
i32 53, label %8
i32 50, label %5
i32 58, label %6
]
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5
%9 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %1 ]
%10 = call i32 @show_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %9)
ret void
}