void *MP_data_type_function(const void *lib_handle, const char *func_name,
                            const char *dtype_name, short quiet) {
  if (!(func_name != (void *)0)) {
    MP_printLog("LOG_MEPINTA_ERROR", 10,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/joaduo/mepinta/refs/heads/"
                "master/backend/c_and_cpp/backend_api_c/props_client_common.c",
                132,
                "Failed assert:'"
                "func_name != NULL"
                "'.\n");
    return (void *)0;
  };
  if (dtype_name == (void *)0) {
    dtype_name = MP_data_type_name(lib_handle);
    if (dtype_name == (void *)0) {
      MP_printLog(
          "LOG_MEPINTA_ERROR", 10,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/joaduo/mepinta/refs/heads/master/backend/"
          "c_and_cpp/backend_api_c/props_client_common.c",
          137, "Couldn't find data type name for lib handle at %p.\n",
          lib_handle);
      return (void *)0;
    }
  }
  void *func_ptr;
  const char *fmt_str = "MP_%s_%s";
  char *lib_symbol = MP_malloc_wrap_gc(strlen(fmt_str) + strlen(dtype_name) +
                                       strlen(func_name));
  sprintf(lib_symbol, fmt_str, dtype_name, func_name);
  if (quiet == 1) {
    func_ptr = mepinta_solve_symbol_quiet(lib_handle, lib_symbol);
  } else {
    func_ptr = mepinta_solve_symbol(lib_handle, lib_symbol);
  }
  return func_ptr;
}


x86 assembly (clang, -O0):
<MP_data_type_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %cx,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11c9 <MP_data_type_function+0x59>
lea    0xe63(%rip),%rdi
mov    $0xa,%esi
lea    0xe69(%rip),%rdx
mov    $0x84,%ecx
lea    0xf0e(%rip),%r8
mov    $0x0,%al
call   1040 <MP_printLog@plt>
movq   $0x0,-0x8(%rbp)
jmp    12d3 <MP_data_type_function+0x163>
cmpq   $0x0,-0x20(%rbp)
jne    122c <MP_data_type_function+0xbc>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <MP_data_type_name@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1227 <MP_data_type_function+0xb7>
mov    -0x10(%rbp),%r9
lea    0xe05(%rip),%rdi
mov    $0xa,%esi
lea    0xe0b(%rip),%rdx
mov    $0x89,%ecx
lea    0xed4(%rip),%r8
mov    $0x0,%al
call   1040 <MP_printLog@plt>
movq   $0x0,-0x8(%rbp)
jmp    12d3 <MP_data_type_function+0x163>
jmp    122c <MP_data_type_function+0xbc>
lea    0xee8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48(%rbp),%rdi
add    %rax,%rdi
mov    $0x0,%al
call   1080 <MP_malloc_wrap_gc@plt>
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1070 <sprintf@plt>
movswl -0x22(%rbp),%eax
cmp    $0x1,%eax
jne    12b6 <MP_data_type_function+0x146>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <mepinta_solve_symbol_quiet@plt>
cltq
mov    %rax,-0x30(%rbp)
jmp    12cb <MP_data_type_function+0x15b>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1090 <mepinta_solve_symbol@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MP_data_type_function>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %rsi,%rsi
je     11f5 <MP_data_type_function+0x85>
mov    %ecx,%r15d
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rdx,%rdx
jne    11a3 <MP_data_type_function+0x33>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <MP_data_type_name@plt>
test   %eax,%eax
je     1233 <MP_data_type_function+0xc3>
movslq %eax,%rbp
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    (%r12,%rax,1),%rdi
add    $0x8,%rdi
xor    %eax,%eax
call   1080 <MP_malloc_wrap_gc@plt>
movslq %eax,%r12
lea    0xf4c(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
cmp    $0x1,%r15w
jne    121f <MP_data_type_function+0xaf>
call   1050 <mepinta_solve_symbol_quiet@plt>
jmp    1224 <MP_data_type_function+0xb4>
lea    0xe04(%rip),%rdi
lea    0xe0f(%rip),%rdx
lea    0xeb9(%rip),%r8
xor    %ebx,%ebx
mov    $0xa,%esi
mov    $0x84,%ecx
xor    %eax,%eax
call   1040 <MP_printLog@plt>
jmp    1227 <MP_data_type_function+0xb7>
call   1090 <mepinta_solve_symbol@plt>
movslq %eax,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdc6(%rip),%rdi
lea    0xdd1(%rip),%rdx
lea    0xe9f(%rip),%r8
xor    %ebx,%ebx
mov    $0xa,%esi
mov    $0x89,%ecx
mov    %r14,%r9
xor    %eax,%eax
call   1040 <MP_printLog@plt>
jmp    1227 <MP_data_type_function+0xb7>

LLVM IR (-O0):
@.str = [18 x i8] c"LOG_MEPINTA_ERROR\00"
@.str.1 = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joaduo/mepinta/refs/heads/master/backend/c_and_cpp/backend_api_c/props_client_common.c\00"
@.str.2 = [36 x i8] c"Failed assert:'func_name != NULL'.\0A\00"
@.str.3 = [52 x i8] c"Couldn't find data type name for lib handle at %p.\0A\00"
@.str.4 = [9 x i8] c"MP_%s_%s\00"
define i8* @MP_data_type_function(i8* %0, i8* %1, i8* %2, i16 signext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i16
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i16 %3, i16* %9
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %4
%16 = call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @MP_printLog to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.1, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
store i8* null, i8** %5
br label %65
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %31
20: ; preds = %17
%21 = load i8*, i8** %6
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @MP_data_type_name to i32 (i8*, ...)*)(i8* %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i8*
store i8* %24, i8** %8
%25 = load i8*, i8** %8
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = load i8*, i8** %6
%29 = call i32 (i8*, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @MP_printLog to i32 (i8*, i32, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %28)
store i8* null, i8** %5
br label %65
30: ; preds = %20
br label %31
31: ; preds = %30, %17
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %11
%32 = load i8*, i8** %11
%33 = call i64 @strlen(i8* %32)
%34 = load i8*, i8** %8
%35 = call i64 @strlen(i8* %34)
%36 = add i64 %33, %35
%37 = load i8*, i8** %7
%38 = call i64 @strlen(i8* %37)
%39 = add i64 %36, %38
%40 = call i32 (i64, ...) bitcast (i32 (...)* @MP_malloc_wrap_gc to i32 (i64, ...)*)(i64 %39)
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i8*
store i8* %42, i8** %12
%43 = load i8*, i8** %12
%44 = load i8*, i8** %11
%45 = load i8*, i8** %8
%46 = load i8*, i8** %7
%47 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* %44, i8* %45, i8* %46)
%48 = load i16, i16* %9
%49 = sext i16 %48 to i32
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %57
51: ; preds = %31
%52 = load i8*, i8** %6
%53 = load i8*, i8** %12
%54 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mepinta_solve_symbol_quiet to i32 (i8*, i8*, ...)*)(i8* %52, i8* %53)
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to i8*
store i8* %56, i8** %10
br label %63
57: ; preds = %31
%58 = load i8*, i8** %6
%59 = load i8*, i8** %12
%60 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mepinta_solve_symbol to i32 (i8*, i8*, ...)*)(i8* %58, i8* %59)
%61 = sext i32 %60 to i64
%62 = inttoptr i64 %61 to i8*
store i8* %62, i8** %10
br label %63
63: ; preds = %57, %51
%64 = load i8*, i8** %10
store i8* %64, i8** %5
br label %65
65: ; preds = %63, %27, %15
%66 = load i8*, i8** %5
ret i8* %66
}

LLVM IR (-O2):
@.str = [18 x i8] c"LOG_MEPINTA_ERROR\00"
@.str.1 = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joaduo/mepinta/refs/heads/master/backend/c_and_cpp/backend_api_c/props_client_common.c\00"
@.str.2 = [36 x i8] c"Failed assert:'func_name != NULL'.\0A\00"
@.str.3 = [52 x i8] c"Couldn't find data type name for lib handle at %p.\0A\00"
@.str.4 = [9 x i8] c"MP_%s_%s\00"
define i8* @MP_data_type_function(i8* %0, i8* %1, i8* %2, i16 signext %3) {
%5 = icmp eq i8* %1, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @MP_printLog to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.1, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %36
8: ; preds = %4
%9 = icmp eq i8* %2, null
br i1 %9, label %10, label %17
10: ; preds = %8
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @MP_data_type_name to i32 (i8*, ...)*)(i8* %0)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = tail call i32 (i8*, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @MP_printLog to i32 (i8*, i32, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %36
17: ; preds = %10, %8
%18 = phi i8* [ %13, %10 ], [ %2, %8 ]
%19 = tail call i64 @strlen(i8* dereferenceable(1) %18)
%20 = add i64 %19, 8
%21 = tail call i64 @strlen(i8* %1)
%22 = add i64 %20, %21
%23 = tail call i32 (i64, ...) bitcast (i32 (...)* @MP_malloc_wrap_gc to i32 (i64, ...)*)(i64 %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
%26 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %25, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %18, i8* %1)
%27 = icmp eq i16 %3, 1
br i1 %27, label %28, label %30
28: ; preds = %17
%29 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mepinta_solve_symbol_quiet to i32 (i8*, i8*, ...)*)(i8* %0, i8* %25)
br label %32
30: ; preds = %17
%31 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mepinta_solve_symbol to i32 (i8*, i8*, ...)*)(i8* %0, i8* %25)
br label %32
32: ; preds = %30, %28
%33 = phi i32 [ %29, %28 ], [ %31, %30 ]
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i8*
br label %36
36: ; preds = %32, %15, %6
%37 = phi i8* [ null, %15 ], [ %35, %32 ], [ null, %6 ]
ret i8* %37
}