#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_UDK_Status(char *report) {
  int pos = 0;
  int code = scanto(report, &pos, 'n');
  const char *show;
  switch (code) {
  case 20:
    show = "UDKs unlocked";
    break;
  case 21:
    show = "UDKs locked";
    break;
  default:
    show = "failed";
  }
  show_result("%s", show);
}


x86 assembly (clang, -O0):
<show_UDK_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    $0x14,%eax
je     116d <show_UDK_Status+0x4d>
jmp    115c <show_UDK_Status+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x15,%eax
je     117d <show_UDK_Status+0x5d>
jmp    118d <show_UDK_Status+0x6d>
lea    0xe8c(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1198 <show_UDK_Status+0x78>
lea    0xe8a(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1198 <show_UDK_Status+0x78>
lea    0xe86(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <show_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_UDK_Status>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x6e,%edx
call   1030 <scanto@plt>
cmp    $0x15,%eax
lea    0xecc(%rip),%rcx
lea    0xed1(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x14,%eax
lea    0xea9(%rip),%rsi
cmovne %rdx,%rsi
lea    0xebf(%rip),%rdi
call   1040 <show_result@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"UDKs unlocked\00"
@.str.1 = [12 x i8] c"UDKs locked\00"
@.str.2 = [7 x i8] c"failed\00"
@.str.3 = [3 x i8] c"%s\00"
define void @show_UDK_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 %11 [
i32 20, label %9
i32 21, label %10
]
9: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %5
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %5
br label %12
12: ; preds = %11, %10, %9
%13 = load i8*, i8** %5
%14 = call i32 @show_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"UDKs unlocked\00"
@.str.1 = [12 x i8] c"UDKs locked\00"
@.str.2 = [7 x i8] c"failed\00"
@.str.3 = [3 x i8] c"%s\00"
define void @show_UDK_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)
%5 = icmp eq i32 %4, 21
%6 = select i1 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%7 = icmp eq i32 %4, 20
%8 = select i1 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6
%9 = call i32 @show_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
ret void
}