int get_key_value(char **key, char **val, const char *key_val) {
  char *ptr;
  if (!strchr(key_val, '='))
    return -1;
  *key =
      __util_strdup(__func__,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/ibm-s390-tools/"
                    "s390-tools/refs/heads/master/zconf/chp/chchp.c",
                    170, key_val);
  ptr = strchr(*key, '=');
  *ptr = '\0';
  ptr += 1;
  *val =
      __util_strdup(__func__,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/ibm-s390-tools/"
                    "s390-tools/refs/heads/master/zconf/chp/chchp.c",
                    174, ptr);
  return 0;
}


x86 assembly (clang, -O0):
<get_key_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    1158 <get_key_value+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    11d7 <get_key_value+0xb7>
mov    -0x20(%rbp),%rcx
lea    0xe9d(%rip),%rdi
lea    0xea4(%rip),%rsi
mov    $0xaa,%edx
mov    $0x0,%al
call   1040 <__util_strdup@plt>
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
lea    0xe4d(%rip),%rdi
lea    0xe54(%rip),%rsi
mov    $0xae,%edx
mov    $0x0,%al
call   1040 <__util_strdup@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key_value>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     119c <get_key_value+0x7c>
lea    0xeb3(%rip),%r12
lea    0xeba(%rip),%r13
xor    %r15d,%r15d
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0xaa,%edx
mov    %rbp,%rcx
xor    %eax,%eax
call   1040 <__util_strdup@plt>
movslq %eax,%rdi
mov    %rdi,(%rbx)
mov    $0x3d,%esi
call   1030 <strchr@plt>
movb   $0x0,(%rax)
lea    0x1(%rax),%rcx
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0xae,%edx
xor    %eax,%eax
call   1040 <__util_strdup@plt>
cltq
mov    %rax,(%r14)
jmp    11a2 <get_key_value+0x82>
mov    $0xffffffff,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.get_key_value = [14 x i8] c"get_key_value\00"
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ibm-s390-tools/s390-tools/refs/heads/master/zconf/chp/chchp.c\00"
define i32 @get_key_value(i8** %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = call i8* @strchr(i8* %9, i32 61)
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 -1, i32* %4
br label %30
13: ; preds = %3
%14 = load i8*, i8** %7
%15 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__util_strdup to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_key_value, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 170, i8* %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load i8**, i8*** %5
store i8* %17, i8** %18
%19 = load i8**, i8*** %5
%20 = load i8*, i8** %19
%21 = call i8* @strchr(i8* %20, i32 61)
store i8* %21, i8** %8
%22 = load i8*, i8** %8
store i8 0, i8* %22
%23 = load i8*, i8** %8
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %24, i8** %8
%25 = load i8*, i8** %8
%26 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__util_strdup to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_key_value, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 174, i8* %25)
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
%29 = load i8**, i8*** %6
store i8* %28, i8** %29
store i32 0, i32* %4
br label %30
30: ; preds = %13, %12
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
@__func__.get_key_value = [14 x i8] c"get_key_value\00"
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ibm-s390-tools/s390-tools/refs/heads/master/zconf/chp/chchp.c\00"
define i32 @get_key_value(i8** nocapture writeonly %0, i8** nocapture writeonly %1, i8* %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %2, i32 61)
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__util_strdup to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_key_value, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 170, i8* %2)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %0
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i32 61)
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__util_strdup to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_key_value, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 174, i8* %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %1
br label %15
15: ; preds = %3, %6
%16 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %16
}