#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 *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
scalar_t__ strncmp(char const *, char *, int);
long strtol(char const *, int /*<<< orphan*/ *, int);
void readProperty(const char *propertyName, const char *propertyValue,
                  void *ptr) {
  long result;
  int isNumeric = 1;
  int isHex = 0;
  for (int i = 0; i < strlen(propertyValue); i++) {
    if (i == 1 && propertyValue[0] == '0' && propertyValue[1] == 'x') {
      isHex = 1;
      isNumeric = 0;
      break;
    } else if (propertyValue[i] < '0' || propertyValue[i] > '9') {
      isNumeric = 0;
      break;
    }
  }
  result = strtol(propertyValue, NULL, 10);
  if (!isNumeric && !isHex) {
    *(char **)ptr = calloc(strlen(propertyValue) + 1, sizeof(char));
    strcpy(*(char **)ptr, propertyValue);
  } else if (isHex) {
    int factor = 1;
    int decimalValue = 0;
    if (strlen(propertyValue) < 3 || strlen(propertyValue) > 6) {
      fprintf(stderr,
              "Length of \"%s\" should be between 1 and 4 hexadecimal digits "
              "(inclusive). Currently: %d.\n",
              propertyName, (int)strlen(propertyValue) - 2);
      exit(1);
    }
    for (int i = strlen(propertyValue) - 1; i >= 2; i--) {
      if (!((propertyValue[i] >= 48 && propertyValue[i] <= 57) ||
            (propertyValue[i] >= 65 && propertyValue[i] <= 70))) {
        fprintf(stderr,
                "\"%s\" should only contain hexadecimal digits (upper case).\n",
                propertyName);
        exit(1);
      }
      if (propertyValue[i] >= 48 && propertyValue[i] <= 57) {
        decimalValue += factor * (propertyValue[i] - 48);
      } else {
        decimalValue += factor * (propertyValue[i] - 55);
      }
      factor *= 16;
    }
    *(int *)ptr = decimalValue;
  } else {
    if (strncmp(propertyName, "pin_", strlen("pin_")) == 0 &&
        (result < 0 || result > 29)) {
      fprintf(stderr,
              "Value for \"%s\" should be in range [0, 29]. Currently: %ld.\n",
              propertyName, result);
      exit(1);
    }
    if (result < 0) {
      fprintf(stderr, "Value for \"%s\" should be > 0. Currently: %ld.\n",
              propertyName, result);
      exit(1);
    }
    *(int *)ptr = (int)result;
  }
}


x86 assembly (clang, -O0):
<readProperty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    1241 <readProperty+0xd1>
cmpl   $0x1,-0x2c(%rbp)
jne    11f3 <readProperty+0x83>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    11f3 <readProperty+0x83>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    11f3 <readProperty+0x83>
movl   $0x1,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    1241 <readProperty+0xd1>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     121d <readProperty+0xad>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1229 <readProperty+0xb9>
movl   $0x0,-0x24(%rbp)
jmp    1241 <readProperty+0xd1>
jmp    122e <readProperty+0xbe>
jmp    1233 <readProperty+0xc3>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1199 <readProperty+0x29>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    12a2 <readProperty+0x132>
cmpl   $0x0,-0x28(%rbp)
jne    12a2 <readProperty+0x132>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
jmp    14ef <readProperty+0x37f>
cmpl   $0x0,-0x28(%rbp)
je     143b <readProperty+0x2cb>
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
jl     12de <readProperty+0x16e>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x6,%eax
jle    131f <readProperty+0x1af>
mov    0x2cfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %eax,%ecx
sub    $0x2,%ecx
lea    0xcf2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x2,-0x38(%rbp)
jl     142d <readProperty+0x2bd>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1362 <readProperty+0x1f2>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    13b1 <readProperty+0x241>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     138c <readProperty+0x21c>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x46,%eax
jle    13b1 <readProperty+0x241>
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     13fb <readProperty+0x28b>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     13fb <readProperty+0x28b>
mov    -0x30(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1416 <readProperty+0x2a6>
mov    -0x30(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x37,%ecx
imul   %ecx,%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    132e <readProperty+0x1be>
mov    -0x34(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    14ea <readProperty+0x37a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    0xc4a(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%edx
lea    0xc38(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    14aa <readProperty+0x33a>
cmpq   $0x0,-0x20(%rbp)
jl     1481 <readProperty+0x311>
cmpq   $0x1d,-0x20(%rbp)
jle    14aa <readProperty+0x33a>
mov    0x2b58(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xc00(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
jge    14de <readProperty+0x36e>
mov    0x2b24(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xc08(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    14ef <readProperty+0x37f>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readProperty>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11c2 <readProperty+0x52>
xor    %ebp,%ebp
nop
cmp    $0x1,%rbp
jne    11a5 <readProperty+0x35>
cmpb   $0x30,(%rbx)
jne    11a5 <readProperty+0x35>
cmpb   $0x78,0x1(%rbx)
je     124e <readProperty+0xde>
movzbl (%rbx,%rbp,1),%eax
add    $0xc6,%al
cmp    $0xf5,%al
jbe    1214 <readProperty+0xa4>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1190 <readProperty+0x20>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,%rbx
lea    0xeb9(%rip),%r12
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11ff <readProperty+0x8f>
cmp    $0x1d,%rbx
ja     1303 <readProperty+0x193>
test   %rbx,%rbx
js     1315 <readProperty+0x1a5>
mov    %ebx,(%r15)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <strcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
jl     133c <readProperty+0x1cc>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x7,%eax
jge    133c <readProperty+0x1cc>
mov    %rbx,%rdi
call   1050 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
jl     12fb <readProperty+0x18b>
mov    %eax,%eax
add    $0x1,%rax
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    12b4 <readProperty+0x144>
nopl   (%rax)
add    %esi,%edi
imul   %edx,%edi
add    %edi,%ecx
shl    $0x4,%edx
add    $0xffffffffffffffff,%rax
cmp    $0x3,%rax
jbe    12fb <readProperty+0x18b>
lea    -0x2(%rax),%esi
movzbl (%rbx,%rsi,1),%esi
lea    -0x30(%rsi),%ebp
mov    $0xffffffd0,%edi
cmp    $0xa,%bpl
jb     12a0 <readProperty+0x130>
lea    -0x41(%rsi),%ebp
mov    $0xffffffc9,%edi
cmp    $0x6,%bpl
jb     12a0 <readProperty+0x130>
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    %ecx,(%r15)
jmp    120b <readProperty+0x9b>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
lea    0xd86(%rip),%rsi
jmp    1325 <readProperty+0x1b5>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    -0x2(%rax),%ecx
lea    0xca9(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Length of \22%s\22 should be between 1 and 4 hexadecimal digits (inclusive). Currently: %d.\0A\00"
@.str.1 = [59 x i8] c"\22%s\22 should only contain hexadecimal digits (upper case).\0A\00"
@.str.2 = [5 x i8] c"pin_\00"
@.str.3 = [60 x i8] c"Value for \22%s\22 should be in range [0, 29]. Currently: %ld.\0A\00"
@.str.4 = [47 x i8] c"Value for \22%s\22 should be > 0. Currently: %ld.\0A\00"
define void @readProperty(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 1, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
br label %14
14: ; preds = %54, %3
%15 = load i32, i32* %10
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %57
19: ; preds = %14
%20 = load i32, i32* %10
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 48
br i1 %27, label %28, label %35
28: ; preds = %22
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 120
br i1 %33, label %34, label %35
34: ; preds = %28
store i32 1, i32* %9
store i32 0, i32* %8
br label %57
35: ; preds = %28, %22, %19
%36 = load i8*, i8** %5
%37 = load i32, i32* %10
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp slt i32 %41, 48
br i1 %42, label %51, label %43
43: ; preds = %35
%44 = load i8*, i8** %5
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp sgt i32 %49, 57
br i1 %50, label %51, label %52
51: ; preds = %43, %35
store i32 0, i32* %8
br label %57
52: ; preds = %43
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
br label %14
57: ; preds = %51, %34, %14
%58 = load i8*, i8** %5
%59 = call i64 @strtol(i8* %58, i32* null, i32 10)
store i64 %59, i64* %7
%60 = load i32, i32* %8
%61 = icmp ne i32 %60, 0
br i1 %61, label %77, label %62
62: ; preds = %57
%63 = load i32, i32* %9
%64 = icmp ne i32 %63, 0
br i1 %64, label %77, label %65
65: ; preds = %62
%66 = load i8*, i8** %5
%67 = call i32 @strlen(i8* %66)
%68 = add nsw i32 %67, 1
%69 = call i8* @calloc(i32 %68, i32 1)
%70 = load i8*, i8** %6
%71 = bitcast i8* %70 to i8**
store i8* %69, i8** %71
%72 = load i8*, i8** %6
%73 = bitcast i8* %72 to i8**
%74 = load i8*, i8** %73
%75 = load i8*, i8** %5
%76 = call i32 @strcpy(i8* %74, i8* %75)
br label %222
77: ; preds = %62, %57
%78 = load i32, i32* %9
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %190
80: ; preds = %77
store i32 1, i32* %11
store i32 0, i32* %12
%81 = load i8*, i8** %5
%82 = call i32 @strlen(i8* %81)
%83 = icmp slt i32 %82, 3
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = load i8*, i8** %5
%86 = call i32 @strlen(i8* %85)
%87 = icmp sgt i32 %86, 6
br i1 %87, label %88, label %96
88: ; preds = %84, %80
%89 = load i32, i32* @stderr
%90 = load i8*, i8** %4
%91 = load i8*, i8** %5
%92 = call i32 @strlen(i8* %91)
%93 = sub nsw i32 %92, 2
%94 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %90, i32 %93)
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %84
%97 = load i8*, i8** %5
%98 = call i32 @strlen(i8* %97)
%99 = sub nsw i32 %98, 1
store i32 %99, i32* %13
br label %100
100: ; preds = %183, %96
%101 = load i32, i32* %13
%102 = icmp sge i32 %101, 2
br i1 %102, label %103, label %186
103: ; preds = %100
%104 = load i8*, i8** %5
%105 = load i32, i32* %13
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %104, i64 %106
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp sge i32 %109, 48
br i1 %110, label %111, label %119
111: ; preds = %103
%112 = load i8*, i8** %5
%113 = load i32, i32* %13
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp sle i32 %117, 57
br i1 %118, label %140, label %119
119: ; preds = %111, %103
%120 = load i8*, i8** %5
%121 = load i32, i32* %13
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %120, i64 %122
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = icmp sge i32 %125, 65
br i1 %126, label %127, label %135
127: ; preds = %119
%128 = load i8*, i8** %5
%129 = load i32, i32* %13
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8, i8* %128, i64 %130
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp sle i32 %133, 70
br i1 %134, label %140, label %135
135: ; preds = %127, %119
%136 = load i32, i32* @stderr
%137 = load i8*, i8** %4
%138 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %137)
%139 = call i32 @exit(i32 1)
unreachable
140: ; preds = %127, %111
%141 = load i8*, i8** %5
%142 = load i32, i32* %13
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8, i8* %141, i64 %143
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp sge i32 %146, 48
br i1 %147, label %148, label %168
148: ; preds = %140
%149 = load i8*, i8** %5
%150 = load i32, i32* %13
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %149, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp sle i32 %154, 57
br i1 %155, label %156, label %168
156: ; preds = %148
%157 = load i32, i32* %11
%158 = load i8*, i8** %5
%159 = load i32, i32* %13
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %158, i64 %160
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = sub nsw i32 %163, 48
%165 = mul nsw i32 %157, %164
%166 = load i32, i32* %12
%167 = add nsw i32 %166, %165
store i32 %167, i32* %12
br label %180
168: ; preds = %148, %140
%169 = load i32, i32* %11
%170 = load i8*, i8** %5
%171 = load i32, i32* %13
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i8, i8* %170, i64 %172
%174 = load i8, i8* %173
%175 = sext i8 %174 to i32
%176 = sub nsw i32 %175, 55
%177 = mul nsw i32 %169, %176
%178 = load i32, i32* %12
%179 = add nsw i32 %178, %177
store i32 %179, i32* %12
br label %180
180: ; preds = %168, %156
%181 = load i32, i32* %11
%182 = mul nsw i32 %181, 16
store i32 %182, i32* %11
br label %183
183: ; preds = %180
%184 = load i32, i32* %13
%185 = add nsw i32 %184, -1
store i32 %185, i32* %13
br label %100
186: ; preds = %100
%187 = load i32, i32* %12
%188 = load i8*, i8** %6
%189 = bitcast i8* %188 to i32*
store i32 %187, i32* %189
br label %221
190: ; preds = %77
%191 = load i8*, i8** %4
%192 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%193 = call i64 @strncmp(i8* %191, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %192)
%194 = icmp eq i64 %193, 0
br i1 %194, label %195, label %207
195: ; preds = %190
%196 = load i64, i64* %7
%197 = icmp slt i64 %196, 0
br i1 %197, label %201, label %198
198: ; preds = %195
%199 = load i64, i64* %7
%200 = icmp sgt i64 %199, 29
br i1 %200, label %201, label %207
201: ; preds = %198, %195
%202 = load i32, i32* @stderr
%203 = load i8*, i8** %4
%204 = load i64, i64* %7
%205 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %202, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %203, i64 %204)
%206 = call i32 @exit(i32 1)
unreachable
207: ; preds = %198, %190
%208 = load i64, i64* %7
%209 = icmp slt i64 %208, 0
br i1 %209, label %210, label %216
210: ; preds = %207
%211 = load i32, i32* @stderr
%212 = load i8*, i8** %4
%213 = load i64, i64* %7
%214 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %211, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i8* %212, i64 %213)
%215 = call i32 @exit(i32 1)
unreachable
216: ; preds = %207
%217 = load i64, i64* %7
%218 = trunc i64 %217 to i32
%219 = load i8*, i8** %6
%220 = bitcast i8* %219 to i32*
store i32 %218, i32* %220
br label %221
221: ; preds = %216, %186
br label %222
222: ; preds = %221, %65
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Length of \22%s\22 should be between 1 and 4 hexadecimal digits (inclusive). Currently: %d.\0A\00"
@.str.1 = [59 x i8] c"\22%s\22 should only contain hexadecimal digits (upper case).\0A\00"
@.str.2 = [5 x i8] c"pin_\00"
@.str.3 = [60 x i8] c"Value for \22%s\22 should be in range [0, 29]. Currently: %ld.\0A\00"
@.str.4 = [47 x i8] c"Value for \22%s\22 should be > 0. Currently: %ld.\0A\00"
define void @readProperty(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %34
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %1, i64 1
br label %12
8: ; preds = %21
%9 = tail call i32 @strlen(i8* %1)
%10 = sext i32 %9 to i64
%11 = icmp slt i64 %26, %10
br i1 %11, label %12, label %34
12: ; preds = %6, %8
%13 = phi i64 [ 0, %6 ], [ %26, %8 ]
%14 = icmp eq i64 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i8, i8* %1
%17 = icmp eq i8 %16, 48
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i8, i8* %7
%20 = icmp eq i8 %19, 120
br i1 %20, label %41, label %21
21: ; preds = %18, %15, %12
%22 = getelementptr inbounds i8, i8* %1, i64 %13
%23 = load i8, i8* %22
%24 = add i8 %23, -58
%25 = icmp ult i8 %24, -10
%26 = add nuw nsw i64 %13, 1
br i1 %25, label %27, label %8
27: ; preds = %21
%28 = tail call i64 @strtol(i8* nocapture %1, i32* null, i32 10)
%29 = tail call i32 @strlen(i8* %1)
%30 = add nsw i32 %29, 1
%31 = tail call i8* @calloc(i32 %30, i32 1)
%32 = bitcast i8* %2 to i8**
store i8* %31, i8** %32
%33 = tail call i32 @strcpy(i8* %31, i8* %1)
br label %100
34: ; preds = %8, %3
%35 = tail call i64 @strtol(i8* nocapture %1, i32* null, i32 10)
%36 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%37 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = icmp eq i64 %37, 0
%39 = icmp ugt i64 %35, 29
%40 = select i1 %38, i1 %39, i1 false
br i1 %40, label %87, label %91
41: ; preds = %18
%42 = tail call i64 @strtol(i8* nocapture %1, i32* null, i32 10)
%43 = tail call i32 @strlen(i8* %1)
%44 = icmp slt i32 %43, 3
br i1 %44, label %48, label %45
45: ; preds = %41
%46 = tail call i32 @strlen(i8* %1)
%47 = icmp sgt i32 %46, 6
br i1 %47, label %48, label %54
48: ; preds = %45, %41
%49 = load i32, i32* @stderr
%50 = tail call i32 @strlen(i8* %1)
%51 = add nsw i32 %50, -2
%52 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %51)
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %45
%55 = tail call i32 @strlen(i8* %1)
%56 = icmp sgt i32 %55, 2
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = zext i32 %55 to i64
br label %62
59: ; preds = %79, %54
%60 = phi i32 [ 0, %54 ], [ %84, %79 ]
%61 = bitcast i8* %2 to i32*
store i32 %60, i32* %61
br label %100
62: ; preds = %57, %79
%63 = phi i64 [ %58, %57 ], [ %66, %79 ]
%64 = phi i32 [ 0, %57 ], [ %84, %79 ]
%65 = phi i32 [ 1, %57 ], [ %85, %79 ]
%66 = add nsw i64 %63, -1
%67 = and i64 %66, 4294967295
%68 = getelementptr inbounds i8, i8* %1, i64 %67
%69 = load i8, i8* %68
%70 = add i8 %69, -48
%71 = icmp ult i8 %70, 10
br i1 %71, label %79, label %72
72: ; preds = %62
%73 = add i8 %69, -65
%74 = icmp ult i8 %73, 6
br i1 %74, label %79, label %75
75: ; preds = %72
%76 = load i32, i32* @stderr
%77 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%78 = tail call i32 @exit(i32 1)
unreachable
79: ; preds = %72, %62
%80 = phi i32 [ -48, %62 ], [ -55, %72 ]
%81 = zext i8 %69 to i32
%82 = add nsw i32 %80, %81
%83 = mul nsw i32 %82, %65
%84 = add nsw i32 %83, %64
%85 = shl nsw i32 %65, 4
%86 = icmp ugt i64 %63, 3
br i1 %86, label %62, label %59
87: ; preds = %34
%88 = load i32, i32* @stderr
%89 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %0, i64 %35)
%90 = tail call i32 @exit(i32 1)
unreachable
91: ; preds = %34
%92 = icmp slt i64 %35, 0
br i1 %92, label %93, label %97
93: ; preds = %91
%94 = load i32, i32* @stderr
%95 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i8* %0, i64 %35)
%96 = tail call i32 @exit(i32 1)
unreachable
97: ; preds = %91
%98 = trunc i64 %35 to i32
%99 = bitcast i8* %2 to i32*
store i32 %98, i32* %99
br label %100
100: ; preds = %59, %97, %27
ret void
}