#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 */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mk2r_set_hfocus_value(int /*<<< orphan*/ *, char *, int);
int strlen(char const *);
int frd_to_hfocus(uint8_t hfocus[8], const char *frd_arg) {
  int i;
  if (strlen(frd_arg) != 12)
    return -1;
  for (i = 0; i < 12; i++)
    if (frd_arg[i] != '0' && frd_arg[i] != '1')
      return -1;
  i = 0;
  mk2r_set_hfocus_value(hfocus, "ears.left.r1Main", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.left.r1Sub", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.left.scLeft", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.left.scRight", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.left.r2Main", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.left.r2Sub", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.r1Main", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.r1Sub", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.scLeft", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.scRight", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.r2Main", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "ears.right.r2Sub", frd_arg[i++] == '1');
  mk2r_set_hfocus_value(hfocus, "directControl", 1);
  return 0;
}


x86 assembly (clang, -O0):
<frd_to_hfocus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xc,%eax
je     114e <frd_to_hfocus+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <frd_to_hfocus+0x2f7>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jge    11a8 <frd_to_hfocus+0x88>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     1195 <frd_to_hfocus+0x75>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
je     1195 <frd_to_hfocus+0x75>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <frd_to_hfocus+0x2f7>
jmp    119a <frd_to_hfocus+0x7a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <frd_to_hfocus+0x35>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xe25(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xe05(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xde4(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xdc4(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xda5(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xd85(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xd64(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xd45(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xd25(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xd06(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xce8(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xcc9(%rip),%rsi
call   1040 <mk2r_set_hfocus_value@plt>
mov    -0x10(%rbp),%rdi
lea    0xcca(%rip),%rsi
mov    $0x1,%edx
call   1040 <mk2r_set_hfocus_value@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frd_to_hfocus>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0xc,%ecx
jne    132c <frd_to_hfocus+0x20c>
mov    (%rbx),%cl
mov    %ecx,%edx
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x1(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x2(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x3(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x4(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x5(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x6(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x7(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x8(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0x9(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0xa(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
mov    0xb(%rbx),%dl
and    $0xfe,%dl
cmp    $0x30,%dl
jne    132c <frd_to_hfocus+0x20c>
xor    %edx,%edx
cmp    $0x31,%cl
sete   %dl
lea    0xdfa(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x1(%rbx)
sete   %dl
lea    0xdf3(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x2(%rbx)
sete   %dl
lea    0xdeb(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x3(%rbx)
sete   %dl
lea    0xde4(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x4(%rbx)
sete   %dl
lea    0xdde(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x5(%rbx)
sete   %dl
lea    0xdd7(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x6(%rbx)
sete   %dl
lea    0xdcf(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x7(%rbx)
sete   %dl
lea    0xdc9(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x8(%rbx)
sete   %dl
lea    0xdc2(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0x9(%rbx)
sete   %dl
lea    0xdbc(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0xa(%rbx)
sete   %dl
lea    0xdb7(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
xor    %edx,%edx
cmpb   $0x31,0xb(%rbx)
sete   %dl
lea    0xdb1(%rip),%rsi
mov    %r14,%rdi
call   1040 <mk2r_set_hfocus_value@plt>
lea    0xdb3(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <mk2r_set_hfocus_value@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ears.left.r1Main\00"
@.str.1 = [16 x i8] c"ears.left.r1Sub\00"
@.str.2 = [17 x i8] c"ears.left.scLeft\00"
@.str.3 = [18 x i8] c"ears.left.scRight\00"
@.str.4 = [17 x i8] c"ears.left.r2Main\00"
@.str.5 = [16 x i8] c"ears.left.r2Sub\00"
@.str.6 = [18 x i8] c"ears.right.r1Main\00"
@.str.7 = [17 x i8] c"ears.right.r1Sub\00"
@.str.8 = [18 x i8] c"ears.right.scLeft\00"
@.str.9 = [19 x i8] c"ears.right.scRight\00"
@.str.10 = [18 x i8] c"ears.right.r2Main\00"
@.str.11 = [17 x i8] c"ears.right.r2Sub\00"
@.str.12 = [14 x i8] c"directControl\00"
define i32 @frd_to_hfocus(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
%9 = icmp ne i32 %8, 12
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %171
11: ; preds = %2
store i32 0, i32* %6
br label %12
12: ; preds = %33, %11
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 12
br i1 %14, label %15, label %36
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 48
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i8*, i8** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 49
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 -1, i32* %3
br label %171
32: ; preds = %23, %15
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %12
36: ; preds = %12
store i32 0, i32* %6
%37 = load i32*, i32** %4
%38 = load i8*, i8** %5
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
%41 = sext i32 %39 to i64
%42 = getelementptr inbounds i8, i8* %38, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 49
%46 = zext i1 %45 to i32
%47 = call i32 @mk2r_set_hfocus_value(i32* %37, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = load i32*, i32** %4
%49 = load i8*, i8** %5
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds i8, i8* %49, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 49
%57 = zext i1 %56 to i32
%58 = call i32 @mk2r_set_hfocus_value(i32* %48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = load i32*, i32** %4
%60 = load i8*, i8** %5
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds i8, i8* %60, i64 %63
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 49
%68 = zext i1 %67 to i32
%69 = call i32 @mk2r_set_hfocus_value(i32* %59, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %68)
%70 = load i32*, i32** %4
%71 = load i8*, i8** %5
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds i8, i8* %71, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 49
%79 = zext i1 %78 to i32
%80 = call i32 @mk2r_set_hfocus_value(i32* %70, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%81 = load i32*, i32** %4
%82 = load i8*, i8** %5
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
%85 = sext i32 %83 to i64
%86 = getelementptr inbounds i8, i8* %82, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 49
%90 = zext i1 %89 to i32
%91 = call i32 @mk2r_set_hfocus_value(i32* %81, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %90)
%92 = load i32*, i32** %4
%93 = load i8*, i8** %5
%94 = load i32, i32* %6
%95 = add nsw i32 %94, 1
store i32 %95, i32* %6
%96 = sext i32 %94 to i64
%97 = getelementptr inbounds i8, i8* %93, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 49
%101 = zext i1 %100 to i32
%102 = call i32 @mk2r_set_hfocus_value(i32* %92, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %101)
%103 = load i32*, i32** %4
%104 = load i8*, i8** %5
%105 = load i32, i32* %6
%106 = add nsw i32 %105, 1
store i32 %106, i32* %6
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 49
%112 = zext i1 %111 to i32
%113 = call i32 @mk2r_set_hfocus_value(i32* %103, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %112)
%114 = load i32*, i32** %4
%115 = load i8*, i8** %5
%116 = load i32, i32* %6
%117 = add nsw i32 %116, 1
store i32 %117, i32* %6
%118 = sext i32 %116 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 49
%123 = zext i1 %122 to i32
%124 = call i32 @mk2r_set_hfocus_value(i32* %114, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %123)
%125 = load i32*, i32** %4
%126 = load i8*, i8** %5
%127 = load i32, i32* %6
%128 = add nsw i32 %127, 1
store i32 %128, i32* %6
%129 = sext i32 %127 to i64
%130 = getelementptr inbounds i8, i8* %126, i64 %129
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %132, 49
%134 = zext i1 %133 to i32
%135 = call i32 @mk2r_set_hfocus_value(i32* %125, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %134)
%136 = load i32*, i32** %4
%137 = load i8*, i8** %5
%138 = load i32, i32* %6
%139 = add nsw i32 %138, 1
store i32 %139, i32* %6
%140 = sext i32 %138 to i64
%141 = getelementptr inbounds i8, i8* %137, i64 %140
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
%144 = icmp eq i32 %143, 49
%145 = zext i1 %144 to i32
%146 = call i32 @mk2r_set_hfocus_value(i32* %136, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %145)
%147 = load i32*, i32** %4
%148 = load i8*, i8** %5
%149 = load i32, i32* %6
%150 = add nsw i32 %149, 1
store i32 %150, i32* %6
%151 = sext i32 %149 to i64
%152 = getelementptr inbounds i8, i8* %148, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %154, 49
%156 = zext i1 %155 to i32
%157 = call i32 @mk2r_set_hfocus_value(i32* %147, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %156)
%158 = load i32*, i32** %4
%159 = load i8*, i8** %5
%160 = load i32, i32* %6
%161 = add nsw i32 %160, 1
store i32 %161, i32* %6
%162 = sext i32 %160 to i64
%163 = getelementptr inbounds i8, i8* %159, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp eq i32 %165, 49
%167 = zext i1 %166 to i32
%168 = call i32 @mk2r_set_hfocus_value(i32* %158, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %167)
%169 = load i32*, i32** %4
%170 = call i32 @mk2r_set_hfocus_value(i32* %169, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 1)
store i32 0, i32* %3
br label %171
171: ; preds = %36, %31, %10
%172 = load i32, i32* %3
ret i32 %172
}

LLVM IR (-O2):
@.str = [17 x i8] c"ears.left.r1Main\00"
@.str.1 = [16 x i8] c"ears.left.r1Sub\00"
@.str.2 = [17 x i8] c"ears.left.scLeft\00"
@.str.3 = [18 x i8] c"ears.left.scRight\00"
@.str.4 = [17 x i8] c"ears.left.r2Main\00"
@.str.5 = [16 x i8] c"ears.left.r2Sub\00"
@.str.6 = [18 x i8] c"ears.right.r1Main\00"
@.str.7 = [17 x i8] c"ears.right.r1Sub\00"
@.str.8 = [18 x i8] c"ears.right.scLeft\00"
@.str.9 = [19 x i8] c"ears.right.scRight\00"
@.str.10 = [18 x i8] c"ears.right.r2Main\00"
@.str.11 = [17 x i8] c"ears.right.r2Sub\00"
@.str.12 = [14 x i8] c"directControl\00"
define i32 @frd_to_hfocus(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp eq i32 %3, 12
br i1 %4, label %5, label %113
5: ; preds = %2
%6 = load i8, i8* %1
%7 = and i8 %6, -2
%8 = icmp eq i8 %7, 48
br i1 %8, label %9, label %113
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %1, i64 1
%11 = load i8, i8* %10
%12 = and i8 %11, -2
%13 = icmp eq i8 %12, 48
br i1 %13, label %14, label %113
14: ; preds = %9
%15 = getelementptr inbounds i8, i8* %1, i64 2
%16 = load i8, i8* %15
%17 = and i8 %16, -2
%18 = icmp eq i8 %17, 48
br i1 %18, label %19, label %113
19: ; preds = %14
%20 = getelementptr inbounds i8, i8* %1, i64 3
%21 = load i8, i8* %20
%22 = and i8 %21, -2
%23 = icmp eq i8 %22, 48
br i1 %23, label %24, label %113
24: ; preds = %19
%25 = getelementptr inbounds i8, i8* %1, i64 4
%26 = load i8, i8* %25
%27 = and i8 %26, -2
%28 = icmp eq i8 %27, 48
br i1 %28, label %29, label %113
29: ; preds = %24
%30 = getelementptr inbounds i8, i8* %1, i64 5
%31 = load i8, i8* %30
%32 = and i8 %31, -2
%33 = icmp eq i8 %32, 48
br i1 %33, label %34, label %113
34: ; preds = %29
%35 = getelementptr inbounds i8, i8* %1, i64 6
%36 = load i8, i8* %35
%37 = and i8 %36, -2
%38 = icmp eq i8 %37, 48
br i1 %38, label %39, label %113
39: ; preds = %34
%40 = getelementptr inbounds i8, i8* %1, i64 7
%41 = load i8, i8* %40
%42 = and i8 %41, -2
%43 = icmp eq i8 %42, 48
br i1 %43, label %44, label %113
44: ; preds = %39
%45 = getelementptr inbounds i8, i8* %1, i64 8
%46 = load i8, i8* %45
%47 = and i8 %46, -2
%48 = icmp eq i8 %47, 48
br i1 %48, label %49, label %113
49: ; preds = %44
%50 = getelementptr inbounds i8, i8* %1, i64 9
%51 = load i8, i8* %50
%52 = and i8 %51, -2
%53 = icmp eq i8 %52, 48
br i1 %53, label %54, label %113
54: ; preds = %49
%55 = getelementptr inbounds i8, i8* %1, i64 10
%56 = load i8, i8* %55
%57 = and i8 %56, -2
%58 = icmp eq i8 %57, 48
br i1 %58, label %59, label %113
59: ; preds = %54
%60 = getelementptr inbounds i8, i8* %1, i64 11
%61 = load i8, i8* %60
%62 = and i8 %61, -2
%63 = icmp eq i8 %62, 48
br i1 %63, label %64, label %113
64: ; preds = %59
%65 = icmp eq i8 %6, 49
%66 = zext i1 %65 to i32
%67 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %66)
%68 = load i8, i8* %10
%69 = icmp eq i8 %68, 49
%70 = zext i1 %69 to i32
%71 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %70)
%72 = load i8, i8* %15
%73 = icmp eq i8 %72, 49
%74 = zext i1 %73 to i32
%75 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %74)
%76 = load i8, i8* %20
%77 = icmp eq i8 %76, 49
%78 = zext i1 %77 to i32
%79 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %78)
%80 = load i8, i8* %25
%81 = icmp eq i8 %80, 49
%82 = zext i1 %81 to i32
%83 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %82)
%84 = load i8, i8* %30
%85 = icmp eq i8 %84, 49
%86 = zext i1 %85 to i32
%87 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %86)
%88 = load i8, i8* %35
%89 = icmp eq i8 %88, 49
%90 = zext i1 %89 to i32
%91 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %90)
%92 = load i8, i8* %40
%93 = icmp eq i8 %92, 49
%94 = zext i1 %93 to i32
%95 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %94)
%96 = load i8, i8* %45
%97 = icmp eq i8 %96, 49
%98 = zext i1 %97 to i32
%99 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %98)
%100 = load i8, i8* %50
%101 = icmp eq i8 %100, 49
%102 = zext i1 %101 to i32
%103 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %102)
%104 = load i8, i8* %55
%105 = icmp eq i8 %104, 49
%106 = zext i1 %105 to i32
%107 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %106)
%108 = load i8, i8* %60
%109 = icmp eq i8 %108, 49
%110 = zext i1 %109 to i32
%111 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %110)
%112 = tail call i32 @mk2r_set_hfocus_value(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 1)
br label %113
113: ; preds = %5, %9, %14, %19, %24, %29, %34, %39, %44, %49, %54, %59, %2, %64
%114 = phi i32 [ 0, %64 ], [ -1, %2 ], [ -1, %59 ], [ -1, %54 ], [ -1, %49 ], [ -1, %44 ], [ -1, %39 ], [ -1, %34 ], [ -1, %29 ], [ -1, %24 ], [ -1, %19 ], [ -1, %14 ], [ -1, %9 ], [ -1, %5 ]
ret i32 %114
}