#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int strlen(char *);
int createProperty(char *instruction) {
  if (instruction == NULL) {
    fprintf(stderr,
            "Cannot get property from non-existent instruction string\n");
    return -1;
  }
  if (strlen(instruction) < 3) {
    fprintf(stderr,
            "Cannot get property as the length of the instruction is not 3\n");
    return -1;
  }
  int property = 0;
  if (instruction[0] == 'C')
    property |= 16;
  if (instruction[1] == 'G')
    property |= 8;
  else if (instruction[1] == 'P')
    property |= 4;
  else if (instruction[1] == 'C')
    property |= 2;
  if (instruction[2] == 'R')
    property |= 1;
  return property;
}


x86 assembly (clang, -O0):
<createProperty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <createProperty+0x38>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    122d <createProperty+0x10d>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jge    118b <createProperty+0x6b>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    122d <createProperty+0x10d>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
jne    11ab <createProperty+0x8b>
mov    -0x14(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x47,%eax
jne    11ca <createProperty+0xaa>
mov    -0x14(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x14(%rbp)
jmp    120d <createProperty+0xed>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x50,%eax
jne    11e9 <createProperty+0xc9>
mov    -0x14(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1208 <createProperty+0xe8>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x43,%eax
jne    1203 <createProperty+0xe3>
mov    -0x14(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1208 <createProperty+0xe8>
jmp    120d <createProperty+0xed>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x52,%eax
jne    1227 <createProperty+0x107>
mov    -0x14(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createProperty>:
push   %rbx
test   %rdi,%rdi
je     1145 <createProperty+0x25>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jg     1161 <createProperty+0x41>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
jmp    1155 <createProperty+0x35>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %ecx,%ecx
cmpb   $0x43,(%rbx)
mov    0x1(%rbx),%al
sete   %cl
shl    $0x4,%ecx
cmp    $0x43,%al
je     1180 <createProperty+0x60>
cmp    $0x50,%al
je     1185 <createProperty+0x65>
cmp    $0x47,%al
jne    1188 <createProperty+0x68>
or     $0x8,%ecx
jmp    1188 <createProperty+0x68>
or     $0x2,%ecx
jmp    1188 <createProperty+0x68>
or     $0x4,%ecx
xor    %eax,%eax
cmpb   $0x52,0x2(%rbx)
sete   %al
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Cannot get property from non-existent instruction string\0A\00"
@.str.1 = [63 x i8] c"Cannot get property as the length of the instruction is not 3\0A\00"
define i32 @createProperty(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %66
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %66
17: ; preds = %10
store i32 0, i32* %4
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 67
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* %4
%25 = or i32 %24, 16
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %17
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 71
br i1 %31, label %32, label %35
32: ; preds = %26
%33 = load i32, i32* %4
%34 = or i32 %33, 8
store i32 %34, i32* %4
br label %55
35: ; preds = %26
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 80
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = load i32, i32* %4
%43 = or i32 %42, 4
store i32 %43, i32* %4
br label %54
44: ; preds = %35
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i64 1
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 67
br i1 %49, label %50, label %53
50: ; preds = %44
%51 = load i32, i32* %4
%52 = or i32 %51, 2
store i32 %52, i32* %4
br label %53
53: ; preds = %50, %44
br label %54
54: ; preds = %53, %41
br label %55
55: ; preds = %54, %32
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i64 2
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 82
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = load i32, i32* %4
%63 = or i32 %62, 1
store i32 %63, i32* %4
br label %64
64: ; preds = %61, %55
%65 = load i32, i32* %4
store i32 %65, i32* %2
br label %66
66: ; preds = %64, %14, %7
%67 = load i32, i32* %2
ret i32 %67
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Cannot get property from non-existent instruction string\0A\00"
@.str.1 = [63 x i8] c"Cannot get property as the length of the instruction is not 3\0A\00"
define i32 @createProperty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %31
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
br label %31
12: ; preds = %6
%13 = load i8, i8* %0
%14 = icmp eq i8 %13, 67
%15 = select i1 %14, i32 16, i32 0
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = load i8, i8* %16
switch i8 %17, label %24 [
i8 71, label %18
i8 80, label %20
i8 67, label %22
]
18: ; preds = %12
%19 = or i32 %15, 8
br label %24
20: ; preds = %12
%21 = or i32 %15, 4
br label %24
22: ; preds = %12
%23 = or i32 %15, 2
br label %24
24: ; preds = %12, %20, %22, %18
%25 = phi i32 [ %19, %18 ], [ %21, %20 ], [ %23, %22 ], [ %15, %12 ]
%26 = getelementptr inbounds i8, i8* %0, i64 2
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 82
%29 = zext i1 %28 to i32
%30 = or i32 %25, %29
br label %31
31: ; preds = %24, %9, %3
%32 = phi i32 [ -1, %3 ], [ -1, %9 ], [ %30, %24 ]
ret i32 %32
}