#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 */
char strtol(char *, int /*<<< orphan*/ *, int);
char Info_DecodeChar(unsigned char *encodedchr) {
  char decoded;
  char encoded[4];
  encoded[0] = encodedchr[0];
  encoded[1] = encodedchr[1];
  encoded[2] = encodedchr[2];
  encoded[3] = encodedchr[3];
  if (encoded[0] != '%') {
    return ' ';
  }
  decoded = strtol(&encoded[1], NULL, 16);
  return decoded;
}


x86 assembly (clang, -O0):
<Info_DecodeChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x25,%eax
je     1159 <Info_DecodeChar+0x49>
movb   $0x20,-0x1(%rbp)
jmp    1178 <Info_DecodeChar+0x68>
lea    -0x15(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_DecodeChar>:
push   %rax
mov    (%rdi),%cl
mov    %cl,0x4(%rsp)
mov    0x1(%rdi),%al
mov    %al,0x5(%rsp)
mov    0x2(%rdi),%al
mov    %al,0x6(%rsp)
mov    0x3(%rdi),%al
mov    %al,0x7(%rsp)
mov    $0x20,%al
cmp    $0x25,%cl
jne    1144 <Info_DecodeChar+0x34>
lea    0x5(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @Info_DecodeChar(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [4 x i8]
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %16, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %20, i8* %21
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 37
br i1 %25, label %26, label %27
26: ; preds = %1
store i8 32, i8* %2
br label %31
27: ; preds = %1
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
%29 = call signext i8 @strtol(i8* %28, i32* null, i32 16)
store i8 %29, i8* %4
%30 = load i8, i8* %4
store i8 %30, i8* %2
br label %31
31: ; preds = %27, %26
%32 = load i8, i8* %2
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @Info_DecodeChar(i8* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
store i8 %4, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 %12, i8* %13
%14 = icmp eq i8 %4, 37
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call signext i8 @strtol(i8* nocapture %7, i32* null, i32 16)
br label %17
17: ; preds = %1, %15
%18 = phi i8 [ %16, %15 ], [ 32, %1 ]
ret i8 %18
}