#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 */
struct KeyVal {
  int dummy;
};

/* Variables and functions */
unsigned char KeyVal_delete(struct KeyVal *);
unsigned char KeyVal_getValue(char **, struct KeyVal *, char *, int);
unsigned char KeyVal_new(struct KeyVal **);
unsigned char KeyVal_setValue(struct KeyVal *, char *, char *);
int /*<<< orphan*/ _check_err(unsigned char, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ ok(int, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void test8() {
  struct KeyVal *kv;
  _check_err(KeyVal_new(&kv), "KeyVal_new");
  _check_err(KeyVal_setValue(kv, "k1", "2"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k2", "asdf${k1}zxcv"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k3", "${k1}zxcv"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k4", "asdf${k1}"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k5", "a${k1}b${k1}${k1}c"),
             "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k6", "${k${k1}}"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k7", "}${"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k8", "${}"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k9", "${k10}"), "KeyVal_setValue");
  _check_err(KeyVal_setValue(kv, "k10", "${k9}"), "KeyVal_setValue");
  char *value;
  _check_err(KeyVal_getValue(&value, kv, "k2", 1), "KeyVal_getValue");
  if (!ok(strcmp(value, "asdf2zxcv") == 0,
          "8a. variable in middle of string")) {
    printf(" - got '%s' instead of 'asdf2zxcv'\n", value);
  }
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k3", 1), "KeyVal_getValue");
  ok(strcmp(value, "2zxcv") == 0, "8b. variable at beginning of string");
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k4", 1), "KeyVal_getValue");
  ok(strcmp(value, "asdf2") == 0, "8c. variable at end of string");
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k5", 1), "KeyVal_getValue");
  ok(strcmp(value, "a2b22c") == 0, "8d. multiple variables in the string");
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k6", 1), "KeyVal_getValue");
  ok(strcmp(value, "asdf2zxcv") == 0, "8e. embedded variables");
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k7", 1), "KeyVal_getValue");
  ok(strcmp(value, "}${") == 0, "8f. weird initial closing brace");
  free(value);
  _check_err(KeyVal_getValue(&value, kv, "k8", 1), "KeyVal_getValue");
  ok(strcmp(value, "${}") == 0, "8g. empty variable name");
  free(value);
  unsigned char getvalue_res = KeyVal_getValue(&value, kv, "k9", 1);
  ok(getvalue_res == 2, "8h. recursive variables detected");
  _check_err(KeyVal_delete(kv), "KeyVal_delete");
}


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1070 <KeyVal_new@plt>
lea    0xe58(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xe50(%rip),%rsi
lea    0xf49(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xe40(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3d(%rip),%rsi
lea    0xe39(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xe1a(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xe28(%rip),%rsi
lea    0xe17(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xdf4(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xe05(%rip),%rsi
lea    0xe01(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xdce(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xdec(%rip),%rsi
lea    0xde8(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xda8(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xddc(%rip),%rsi
lea    0xdd8(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xd82(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc3(%rip),%rsi
lea    0xdbf(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xd5c(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xda4(%rip),%rsi
lea    0xda0(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xd36(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xd85(%rip),%rsi
lea    0xd81(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xd10(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rdi
lea    0xd69(%rip),%rsi
lea    0xd66(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
lea    0xcea(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xce3(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xd38(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xd35(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd27(%rip),%rsi
call   1050 <ok@plt>
cmp    $0x0,%eax
jne    1395 <test8+0x205>
mov    -0x10(%rbp),%rsi
lea    0xd2f(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xc82(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xcc6(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xcc7(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xcfa(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xc2c(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xc6d(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xcdd(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xccb(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xbe0(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xc14(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xca8(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xc97(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xb9d(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xbbb(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xbb8(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xc63(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xb51(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xb62(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xb30(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xc21(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xaff(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
lea    0xb09(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
mov    -0x10(%rbp),%rdi
lea    0xade(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xbe8(%rip),%rsi
call   1050 <ok@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
lea    0xaad(%rip),%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xbc0(%rip),%rsi
call   1050 <ok@plt>
mov    -0x8(%rbp),%rdi
call   10a0 <KeyVal_delete@plt>
lea    0xbcc(%rip),%rsi
movzbl %al,%edi
call   1040 <_check_err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1070 <KeyVal_new@plt>
movzbl %al,%edi
lea    0xe55(%rip),%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xe4f(%rip),%rsi
lea    0xf48(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
lea    0xe3c(%rip),%rbx
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xe38(%rip),%r14
lea    0xe34(%rip),%rdx
mov    %r14,%rsi
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xe23(%rip),%rsi
lea    0xe12(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xe03(%rip),%rsi
lea    0xdff(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xded(%rip),%rsi
lea    0xde9(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xde0(%rip),%rsi
lea    0xddc(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xdca(%rip),%rsi
lea    0xdc6(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xdae(%rip),%rsi
lea    0xdaa(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xd92(%rip),%rsi
lea    0xd8e(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rdi
lea    0xd79(%rip),%rsi
lea    0xd76(%rip),%rdx
call   1090 <KeyVal_setValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdi
mov    %r14,%rdx
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
lea    0xd4b(%rip),%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xd4a(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xd3f(%rip),%rsi
call   1050 <ok@plt>
test   %eax,%eax
jne    1379 <test8+0x1e9>
mov    0x10(%rsp),%rsi
lea    0xd4b(%rip),%rdi
call   1060 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xca0(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
lea    0xcd9(%rip),%rbx
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xcd9(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xd0f(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xc43(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xcf4(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xce5(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xbfc(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xcc4(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xcb6(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xbbe(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xbd9(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xc87(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xb77(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xb56(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xc4a(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xb2a(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <_check_err@plt>
mov    0x10(%rsp),%rdi
lea    0xb09(%rip),%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xc16(%rip),%rsi
call   1050 <ok@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xadd(%rip),%rdx
mov    %r14,%rdi
mov    $0x1,%ecx
call   10b0 <KeyVal_getValue@plt>
xor    %edi,%edi
cmp    $0x2,%al
sete   %dil
lea    0xbf7(%rip),%rsi
call   1050 <ok@plt>
mov    0x8(%rsp),%rdi
call   10a0 <KeyVal_delete@plt>
movzbl %al,%edi
lea    0xbff(%rip),%rsi
call   1040 <_check_err@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.KeyVal = type { i32 }
@.str = [11 x i8] c"KeyVal_new\00"
@.str.1 = [3 x i8] c"k1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [16 x i8] c"KeyVal_setValue\00"
@.str.4 = [3 x i8] c"k2\00"
@.str.5 = [14 x i8] c"asdf${k1}zxcv\00"
@.str.6 = [3 x i8] c"k3\00"
@.str.7 = [10 x i8] c"${k1}zxcv\00"
@.str.8 = [3 x i8] c"k4\00"
@.str.9 = [10 x i8] c"asdf${k1}\00"
@.str.10 = [3 x i8] c"k5\00"
@.str.11 = [19 x i8] c"a${k1}b${k1}${k1}c\00"
@.str.12 = [3 x i8] c"k6\00"
@.str.13 = [10 x i8] c"${k${k1}}\00"
@.str.14 = [3 x i8] c"k7\00"
@.str.15 = [4 x i8] c"}${\00"
@.str.16 = [3 x i8] c"k8\00"
@.str.17 = [4 x i8] c"${}\00"
@.str.18 = [3 x i8] c"k9\00"
@.str.19 = [7 x i8] c"${k10}\00"
@.str.20 = [4 x i8] c"k10\00"
@.str.21 = [6 x i8] c"${k9}\00"
@.str.22 = [16 x i8] c"KeyVal_getValue\00"
@.str.23 = [10 x i8] c"asdf2zxcv\00"
@.str.24 = [33 x i8] c"8a. variable in middle of string\00"
@.str.25 = [36 x i8] c" - got '%s' instead of 'asdf2zxcv'\0A\00"
@.str.26 = [6 x i8] c"2zxcv\00"
@.str.27 = [36 x i8] c"8b. variable at beginning of string\00"
@.str.28 = [6 x i8] c"asdf2\00"
@.str.29 = [30 x i8] c"8c. variable at end of string\00"
@.str.30 = [7 x i8] c"a2b22c\00"
@.str.31 = [37 x i8] c"8d. multiple variables in the string\00"
@.str.32 = [23 x i8] c"8e. embedded variables\00"
@.str.33 = [32 x i8] c"8f. weird initial closing brace\00"
@.str.34 = [24 x i8] c"8g. empty variable name\00"
@.str.35 = [33 x i8] c"8h. recursive variables detected\00"
@.str.36 = [14 x i8] c"KeyVal_delete\00"
define void @test8() {
%1 = alloca %struct.KeyVal*
%2 = alloca i8*
%3 = alloca i8
%4 = call zeroext i8 @KeyVal_new(%struct.KeyVal** %1)
%5 = call i32 @_check_err(i8 zeroext %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.KeyVal*, %struct.KeyVal** %1
%7 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @_check_err(i8 zeroext %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%9 = load %struct.KeyVal*, %struct.KeyVal** %1
%10 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @_check_err(i8 zeroext %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%12 = load %struct.KeyVal*, %struct.KeyVal** %1
%13 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @_check_err(i8 zeroext %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%15 = load %struct.KeyVal*, %struct.KeyVal** %1
%16 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%17 = call i32 @_check_err(i8 zeroext %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%18 = load %struct.KeyVal*, %struct.KeyVal** %1
%19 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%20 = call i32 @_check_err(i8 zeroext %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%21 = load %struct.KeyVal*, %struct.KeyVal** %1
%22 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 @_check_err(i8 zeroext %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%24 = load %struct.KeyVal*, %struct.KeyVal** %1
%25 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%26 = call i32 @_check_err(i8 zeroext %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%27 = load %struct.KeyVal*, %struct.KeyVal** %1
%28 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%29 = call i32 @_check_err(i8 zeroext %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%30 = load %struct.KeyVal*, %struct.KeyVal** %1
%31 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%32 = call i32 @_check_err(i8 zeroext %31, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%33 = load %struct.KeyVal*, %struct.KeyVal** %1
%34 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%35 = call i32 @_check_err(i8 zeroext %34, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%36 = load %struct.KeyVal*, %struct.KeyVal** %1
%37 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 1)
%38 = call i32 @_check_err(i8 zeroext %37, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%39 = load i8*, i8** %2
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
%42 = zext i1 %41 to i32
%43 = call i32 @ok(i32 %42, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %0
%46 = load i8*, i8** %2
%47 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.25, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %45, %0
%49 = load i8*, i8** %2
%50 = call i32 @free(i8* %49)
%51 = load %struct.KeyVal*, %struct.KeyVal** %1
%52 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 1)
%53 = call i32 @_check_err(i8 zeroext %52, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%54 = load i8*, i8** %2
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
%57 = zext i1 %56 to i32
%58 = call i32 @ok(i32 %57, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.27, i64 0, i64 0))
%59 = load i8*, i8** %2
%60 = call i32 @free(i8* %59)
%61 = load %struct.KeyVal*, %struct.KeyVal** %1
%62 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 1)
%63 = call i32 @_check_err(i8 zeroext %62, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%64 = load i8*, i8** %2
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
%67 = zext i1 %66 to i32
%68 = call i32 @ok(i32 %67, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0))
%69 = load i8*, i8** %2
%70 = call i32 @free(i8* %69)
%71 = load %struct.KeyVal*, %struct.KeyVal** %1
%72 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 1)
%73 = call i32 @_check_err(i8 zeroext %72, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%74 = load i8*, i8** %2
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.30, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
%77 = zext i1 %76 to i32
%78 = call i32 @ok(i32 %77, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.31, i64 0, i64 0))
%79 = load i8*, i8** %2
%80 = call i32 @free(i8* %79)
%81 = load %struct.KeyVal*, %struct.KeyVal** %1
%82 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 1)
%83 = call i32 @_check_err(i8 zeroext %82, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%84 = load i8*, i8** %2
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
%87 = zext i1 %86 to i32
%88 = call i32 @ok(i32 %87, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.32, i64 0, i64 0))
%89 = load i8*, i8** %2
%90 = call i32 @free(i8* %89)
%91 = load %struct.KeyVal*, %struct.KeyVal** %1
%92 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 1)
%93 = call i32 @_check_err(i8 zeroext %92, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%94 = load i8*, i8** %2
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
%97 = zext i1 %96 to i32
%98 = call i32 @ok(i32 %97, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.33, i64 0, i64 0))
%99 = load i8*, i8** %2
%100 = call i32 @free(i8* %99)
%101 = load %struct.KeyVal*, %struct.KeyVal** %1
%102 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 1)
%103 = call i32 @_check_err(i8 zeroext %102, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%104 = load i8*, i8** %2
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
%107 = zext i1 %106 to i32
%108 = call i32 @ok(i32 %107, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.34, i64 0, i64 0))
%109 = load i8*, i8** %2
%110 = call i32 @free(i8* %109)
%111 = load %struct.KeyVal*, %struct.KeyVal** %1
%112 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i32 1)
store i8 %112, i8* %3
%113 = load i8, i8* %3
%114 = zext i8 %113 to i32
%115 = icmp eq i32 %114, 2
%116 = zext i1 %115 to i32
%117 = call i32 @ok(i32 %116, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.35, i64 0, i64 0))
%118 = load %struct.KeyVal*, %struct.KeyVal** %1
%119 = call zeroext i8 @KeyVal_delete(%struct.KeyVal* %118)
%120 = call i32 @_check_err(i8 zeroext %119, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.36, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.KeyVal = type { i32 }
@.str = [11 x i8] c"KeyVal_new\00"
@.str.1 = [3 x i8] c"k1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [16 x i8] c"KeyVal_setValue\00"
@.str.4 = [3 x i8] c"k2\00"
@.str.5 = [14 x i8] c"asdf${k1}zxcv\00"
@.str.6 = [3 x i8] c"k3\00"
@.str.7 = [10 x i8] c"${k1}zxcv\00"
@.str.8 = [3 x i8] c"k4\00"
@.str.9 = [10 x i8] c"asdf${k1}\00"
@.str.10 = [3 x i8] c"k5\00"
@.str.11 = [19 x i8] c"a${k1}b${k1}${k1}c\00"
@.str.12 = [3 x i8] c"k6\00"
@.str.13 = [10 x i8] c"${k${k1}}\00"
@.str.14 = [3 x i8] c"k7\00"
@.str.15 = [4 x i8] c"}${\00"
@.str.16 = [3 x i8] c"k8\00"
@.str.17 = [4 x i8] c"${}\00"
@.str.18 = [3 x i8] c"k9\00"
@.str.19 = [7 x i8] c"${k10}\00"
@.str.20 = [4 x i8] c"k10\00"
@.str.21 = [6 x i8] c"${k9}\00"
@.str.22 = [16 x i8] c"KeyVal_getValue\00"
@.str.23 = [10 x i8] c"asdf2zxcv\00"
@.str.24 = [33 x i8] c"8a. variable in middle of string\00"
@.str.25 = [36 x i8] c" - got '%s' instead of 'asdf2zxcv'\0A\00"
@.str.26 = [6 x i8] c"2zxcv\00"
@.str.27 = [36 x i8] c"8b. variable at beginning of string\00"
@.str.28 = [6 x i8] c"asdf2\00"
@.str.29 = [30 x i8] c"8c. variable at end of string\00"
@.str.30 = [7 x i8] c"a2b22c\00"
@.str.31 = [37 x i8] c"8d. multiple variables in the string\00"
@.str.32 = [23 x i8] c"8e. embedded variables\00"
@.str.33 = [32 x i8] c"8f. weird initial closing brace\00"
@.str.34 = [24 x i8] c"8g. empty variable name\00"
@.str.35 = [33 x i8] c"8h. recursive variables detected\00"
@.str.36 = [14 x i8] c"KeyVal_delete\00"
define void @test8() {
%1 = alloca %struct.KeyVal*
%2 = alloca i8*
%3 = bitcast %struct.KeyVal** %1 to i8*
%4 = call zeroext i8 @KeyVal_new(%struct.KeyVal** %1)
%5 = call i32 @_check_err(i8 zeroext %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.KeyVal*, %struct.KeyVal** %1
%7 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @_check_err(i8 zeroext %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%9 = load %struct.KeyVal*, %struct.KeyVal** %1
%10 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @_check_err(i8 zeroext %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%12 = load %struct.KeyVal*, %struct.KeyVal** %1
%13 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @_check_err(i8 zeroext %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%15 = load %struct.KeyVal*, %struct.KeyVal** %1
%16 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%17 = call i32 @_check_err(i8 zeroext %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%18 = load %struct.KeyVal*, %struct.KeyVal** %1
%19 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%20 = call i32 @_check_err(i8 zeroext %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%21 = load %struct.KeyVal*, %struct.KeyVal** %1
%22 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 @_check_err(i8 zeroext %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%24 = load %struct.KeyVal*, %struct.KeyVal** %1
%25 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%26 = call i32 @_check_err(i8 zeroext %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%27 = load %struct.KeyVal*, %struct.KeyVal** %1
%28 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%29 = call i32 @_check_err(i8 zeroext %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%30 = load %struct.KeyVal*, %struct.KeyVal** %1
%31 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%32 = call i32 @_check_err(i8 zeroext %31, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%33 = load %struct.KeyVal*, %struct.KeyVal** %1
%34 = call zeroext i8 @KeyVal_setValue(%struct.KeyVal* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%35 = call i32 @_check_err(i8 zeroext %34, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%36 = bitcast i8** %2 to i8*
%37 = load %struct.KeyVal*, %struct.KeyVal** %1
%38 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 1)
%39 = call i32 @_check_err(i8 zeroext %38, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%40 = load i8*, i8** %2
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
%43 = zext i1 %42 to i32
%44 = call i32 @ok(i32 %43, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %0
%47 = load i8*, i8** %2
%48 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.25, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %46, %0
%50 = load i8*, i8** %2
%51 = call i32 @free(i8* %50)
%52 = load %struct.KeyVal*, %struct.KeyVal** %1
%53 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 1)
%54 = call i32 @_check_err(i8 zeroext %53, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%55 = load i8*, i8** %2
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
%58 = zext i1 %57 to i32
%59 = call i32 @ok(i32 %58, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.27, i64 0, i64 0))
%60 = load i8*, i8** %2
%61 = call i32 @free(i8* %60)
%62 = load %struct.KeyVal*, %struct.KeyVal** %1
%63 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 1)
%64 = call i32 @_check_err(i8 zeroext %63, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%65 = load i8*, i8** %2
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
%68 = zext i1 %67 to i32
%69 = call i32 @ok(i32 %68, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0))
%70 = load i8*, i8** %2
%71 = call i32 @free(i8* %70)
%72 = load %struct.KeyVal*, %struct.KeyVal** %1
%73 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 1)
%74 = call i32 @_check_err(i8 zeroext %73, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%75 = load i8*, i8** %2
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.30, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
%78 = zext i1 %77 to i32
%79 = call i32 @ok(i32 %78, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.31, i64 0, i64 0))
%80 = load i8*, i8** %2
%81 = call i32 @free(i8* %80)
%82 = load %struct.KeyVal*, %struct.KeyVal** %1
%83 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 1)
%84 = call i32 @_check_err(i8 zeroext %83, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%85 = load i8*, i8** %2
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
%88 = zext i1 %87 to i32
%89 = call i32 @ok(i32 %88, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.32, i64 0, i64 0))
%90 = load i8*, i8** %2
%91 = call i32 @free(i8* %90)
%92 = load %struct.KeyVal*, %struct.KeyVal** %1
%93 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 1)
%94 = call i32 @_check_err(i8 zeroext %93, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%95 = load i8*, i8** %2
%96 = call i64 @strcmp(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%97 = icmp eq i64 %96, 0
%98 = zext i1 %97 to i32
%99 = call i32 @ok(i32 %98, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.33, i64 0, i64 0))
%100 = load i8*, i8** %2
%101 = call i32 @free(i8* %100)
%102 = load %struct.KeyVal*, %struct.KeyVal** %1
%103 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 1)
%104 = call i32 @_check_err(i8 zeroext %103, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.22, i64 0, i64 0))
%105 = load i8*, i8** %2
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
%108 = zext i1 %107 to i32
%109 = call i32 @ok(i32 %108, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.34, i64 0, i64 0))
%110 = load i8*, i8** %2
%111 = call i32 @free(i8* %110)
%112 = load %struct.KeyVal*, %struct.KeyVal** %1
%113 = call zeroext i8 @KeyVal_getValue(i8** %2, %struct.KeyVal* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i32 1)
%114 = icmp eq i8 %113, 2
%115 = zext i1 %114 to i32
%116 = call i32 @ok(i32 %115, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.35, i64 0, i64 0))
%117 = load %struct.KeyVal*, %struct.KeyVal** %1
%118 = call zeroext i8 @KeyVal_delete(%struct.KeyVal* %117)
%119 = call i32 @_check_err(i8 zeroext %118, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.36, i64 0, i64 0))
ret void
}