#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 */
int RTLD_GLOBAL;
int RTLD_LAZY;
scalar_t__ dlclose(void *);
char *dlerror();
void *dlopen(char *, int);
void *dlsym(void *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  void *h1;
  void *h2;
  int (*fp)(void);
  int *vp;
  mtrace();
  h1 = dlopen("reldepmod1.so", RTLD_LAZY | RTLD_GLOBAL);
  if (h1 == NULL) {
    printf("cannot open reldepmod1.so: %s\n", dlerror());
    exit(1);
  }
  h2 = dlopen("reldepmod2.so", RTLD_LAZY);
  if (h2 == NULL) {
    printf("cannot open reldepmod2.so: %s\n", dlerror());
    exit(1);
  }
  vp = dlsym(h1, "some_var");
  if (vp == NULL) {
    printf("cannot get address of \"some_var\": %s\n", dlerror());
    exit(1);
  }
  *vp = 42;
  fp = dlsym(h2, "call_me");
  if (fp == NULL) {
    printf("cannot get address of \"call_me\": %s\n", dlerror());
    exit(1);
  }
  if (fp() != 0) {
    puts("function \"call_me\" returned wrong result");
    exit(1);
  }
  if (dlclose(h1) != 0) {
    printf("closing h1 failed: %s\n", dlerror());
    exit(1);
  }
  if (fp() != 0) {
    puts("second call of function \"call_me\" returned wrong result");
    exit(1);
  }
  if (dlclose(h2) != 0) {
    printf("closing h2 failed: %s\n", dlerror());
    exit(1);
  }
  h1 = dlopen("reldepmod1.so", RTLD_LAZY | RTLD_GLOBAL);
  if (h1 == NULL) {
    printf("cannot open reldepmod1.so the second time: %s\n", dlerror());
    exit(1);
  }
  vp = dlsym(h1, "some_var");
  if (vp == NULL) {
    printf("cannot get address of \"some_var\" the second time: %s\n",
           dlerror());
    exit(1);
  }
  if (*vp != 0) {
    puts("variable \"some_var\" not reset");
    exit(1);
  }
  if (dlclose(h1) != 0) {
    printf("closing h1 failed: %s\n", dlerror());
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <mtrace@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%esi
mov    0x2e42(%rip),%rax
or     (%rax),%esi
lea    0xe51(%rip),%rdi
call   1060 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11e3 <main+0x63>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2dee(%rip),%rax
mov    (%rax),%esi
lea    0xe3a(%rip),%rdi
call   1060 <dlopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1227 <main+0xa7>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1070 <dlsym@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1266 <main+0xe6>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xe0c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x28(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x18(%rbp),%rdi
lea    0xe0e(%rip),%rsi
call   1070 <dlsym@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12af <main+0x12f>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xdf1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
call   *-0x20(%rbp)
cmp    $0x0,%eax
je     12d1 <main+0x151>
lea    0xe1a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <dlclose@plt>
cmp    $0x0,%rax
je     1304 <main+0x184>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xdc1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
call   *-0x20(%rbp)
cmp    $0x0,%eax
je     1326 <main+0x1a6>
lea    0xdb6(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <dlclose@plt>
cmp    $0x0,%rax
je     1359 <main+0x1d9>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xdbb(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c78(%rip),%rax
mov    (%rax),%esi
mov    0x2c7f(%rip),%rax
or     (%rax),%esi
lea    0xc8e(%rip),%rdi
call   1060 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    13a6 <main+0x226>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xd85(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xca9(%rip),%rsi
call   1070 <dlsym@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13e5 <main+0x265>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xd75(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     1408 <main+0x288>
lea    0xd88(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <dlclose@plt>
cmp    $0x0,%rax
je     143b <main+0x2bb>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xc8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1080 <mtrace@plt>
mov    0x2e41(%rip),%r12
mov    0x2e4a(%rip),%r13
mov    0x0(%r13),%esi
or     (%r12),%esi
lea    0xe53(%rip),%rdi
call   1060 <dlopen@plt>
test   %rax,%rax
je     12b2 <main+0x132>
mov    %rax,%r15
mov    (%r12),%esi
lea    0xe64(%rip),%rdi
call   1060 <dlopen@plt>
test   %rax,%rax
je     12c2 <main+0x142>
mov    %rax,%r14
lea    0xe79(%rip),%rsi
mov    %r15,%rdi
call   1070 <dlsym@plt>
test   %rax,%rax
je     12d2 <main+0x152>
movl   $0x2a,(%rax)
lea    0xe8a(%rip),%rsi
mov    %r14,%rdi
call   1070 <dlsym@plt>
test   %rax,%rax
je     12e2 <main+0x162>
mov    %rax,%rbx
call   *%rax
test   %eax,%eax
jne    12f2 <main+0x172>
mov    %r15,%rdi
call   10a0 <dlclose@plt>
test   %rax,%rax
jne    129f <main+0x11f>
call   *%rbx
test   %eax,%eax
jne    12fb <main+0x17b>
mov    %r14,%rdi
call   10a0 <dlclose@plt>
test   %rax,%rax
jne    1304 <main+0x184>
mov    0x0(%r13),%esi
or     (%r12),%esi
lea    0xdac(%rip),%rdi
call   1060 <dlopen@plt>
test   %rax,%rax
je     1314 <main+0x194>
mov    %rax,%rbx
lea    0xdee(%rip),%rsi
mov    %rax,%rdi
call   1070 <dlsym@plt>
test   %rax,%rax
je     1324 <main+0x1a4>
cmpl   $0x0,(%rax)
jne    1344 <main+0x1c4>
mov    %rbx,%rdi
call   10a0 <dlclose@plt>
test   %rax,%rax
jne    129f <main+0x11f>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xe09(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xd4e(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xd6b(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xd83(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xda1(%rip),%rdi
jmp    1332 <main+0x1b2>
lea    0xde3(%rip),%rdi
jmp    134b <main+0x1cb>
lea    0xdcb(%rip),%rdi
jmp    134b <main+0x1cb>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xdf3(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xdfa(%rip),%rdi
jmp    1332 <main+0x1b2>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xe19(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xe36(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"reldepmod1.so\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.1 = [31 x i8] c"cannot open reldepmod1.so: %s\0A\00"
@.str.2 = [14 x i8] c"reldepmod2.so\00"
@.str.3 = [31 x i8] c"cannot open reldepmod2.so: %s\0A\00"
@.str.4 = [9 x i8] c"some_var\00"
@.str.5 = [38 x i8] c"cannot get address of \22some_var\22: %s\0A\00"
@.str.6 = [8 x i8] c"call_me\00"
@.str.7 = [37 x i8] c"cannot get address of \22call_me\22: %s\0A\00"
@.str.8 = [41 x i8] c"function \22call_me\22 returned wrong result\00"
@.str.9 = [23 x i8] c"closing h1 failed: %s\0A\00"
@.str.10 = [56 x i8] c"second call of function \22call_me\22 returned wrong result\00"
@.str.11 = [23 x i8] c"closing h2 failed: %s\0A\00"
@.str.12 = [47 x i8] c"cannot open reldepmod1.so the second time: %s\0A\00"
@.str.13 = [54 x i8] c"cannot get address of \22some_var\22 the second time: %s\0A\00"
@.str.14 = [30 x i8] c"variable \22some_var\22 not reset\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32 ()*
%5 = alloca i32*
store i32 0, i32* %1
%6 = call i32 (...) @mtrace()
%7 = load i32, i32* @RTLD_LAZY
%8 = load i32, i32* @RTLD_GLOBAL
%9 = or i32 %7, %8
%10 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = call i8* (...) @dlerror()
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %0
%18 = load i32, i32* @RTLD_LAZY
%19 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i8* %19, i8** %3
%20 = load i8*, i8** %3
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = call i8* (...) @dlerror()
%24 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %17
%27 = load i8*, i8** %2
%28 = call i8* @dlsym(i8* %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%29 = bitcast i8* %28 to i32*
store i32* %29, i32** %5
%30 = load i32*, i32** %5
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = call i8* (...) @dlerror()
%34 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %26
%37 = load i32*, i32** %5
store i32 42, i32* %37
%38 = load i8*, i8** %3
%39 = call i8* @dlsym(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%40 = bitcast i8* %39 to i32 ()*
store i32 ()* %40, i32 ()** %4
%41 = load i32 ()*, i32 ()** %4
%42 = icmp eq i32 ()* %41, null
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = call i8* (...) @dlerror()
%45 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %36
%48 = load i32 ()*, i32 ()** %4
%49 = call i32 %48()
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %47
%55 = load i8*, i8** %2
%56 = call i64 @dlclose(i8* %55)
%57 = icmp ne i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = call i8* (...) @dlerror()
%60 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %59)
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %54
%63 = load i32 ()*, i32 ()** %4
%64 = call i32 %63()
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %62
%70 = load i8*, i8** %3
%71 = call i64 @dlclose(i8* %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %69
%74 = call i8* (...) @dlerror()
%75 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %74)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %69
%78 = load i32, i32* @RTLD_LAZY
%79 = load i32, i32* @RTLD_GLOBAL
%80 = or i32 %78, %79
%81 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %80)
store i8* %81, i8** %2
%82 = load i8*, i8** %2
%83 = icmp eq i8* %82, null
br i1 %83, label %84, label %88
84: ; preds = %77
%85 = call i8* (...) @dlerror()
%86 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0), i8* %85)
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %77
%89 = load i8*, i8** %2
%90 = call i8* @dlsym(i8* %89, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%91 = bitcast i8* %90 to i32*
store i32* %91, i32** %5
%92 = load i32*, i32** %5
%93 = icmp eq i32* %92, null
br i1 %93, label %94, label %98
94: ; preds = %88
%95 = call i8* (...) @dlerror()
%96 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0), i8* %95)
%97 = call i32 @exit(i32 1)
unreachable
98: ; preds = %88
%99 = load i32*, i32** %5
%100 = load i32, i32* %99
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%104 = call i32 @exit(i32 1)
unreachable
105: ; preds = %98
%106 = load i8*, i8** %2
%107 = call i64 @dlclose(i8* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %113
109: ; preds = %105
%110 = call i8* (...) @dlerror()
%111 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %110)
%112 = call i32 @exit(i32 1)
unreachable
113: ; preds = %105
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"reldepmod1.so\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.1 = [31 x i8] c"cannot open reldepmod1.so: %s\0A\00"
@.str.2 = [14 x i8] c"reldepmod2.so\00"
@.str.3 = [31 x i8] c"cannot open reldepmod2.so: %s\0A\00"
@.str.4 = [9 x i8] c"some_var\00"
@.str.5 = [38 x i8] c"cannot get address of \22some_var\22: %s\0A\00"
@.str.6 = [8 x i8] c"call_me\00"
@.str.7 = [37 x i8] c"cannot get address of \22call_me\22: %s\0A\00"
@.str.8 = [41 x i8] c"function \22call_me\22 returned wrong result\00"
@.str.9 = [23 x i8] c"closing h1 failed: %s\0A\00"
@.str.10 = [56 x i8] c"second call of function \22call_me\22 returned wrong result\00"
@.str.11 = [23 x i8] c"closing h2 failed: %s\0A\00"
@.str.12 = [47 x i8] c"cannot open reldepmod1.so the second time: %s\0A\00"
@.str.13 = [54 x i8] c"cannot get address of \22some_var\22 the second time: %s\0A\00"
@.str.14 = [30 x i8] c"variable \22some_var\22 not reset\00"
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = load i32, i32* @RTLD_LAZY
%3 = load i32, i32* @RTLD_GLOBAL
%4 = or i32 %3, %2
%5 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = tail call i8* (...) @dlerror()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load i32, i32* @RTLD_LAZY
%13 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = tail call i8* (...) @dlerror()
%17 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %11
%20 = tail call i8* @dlsym(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = tail call i8* (...) @dlerror()
%24 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %19
%27 = bitcast i8* %20 to i32*
store i32 42, i32* %27
%28 = tail call i8* @dlsym(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%29 = bitcast i8* %28 to i32 ()*
%30 = icmp eq i8* %28, null
br i1 %30, label %31, label %35
31: ; preds = %26
%32 = tail call i8* (...) @dlerror()
%33 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %26
%36 = tail call i32 %29()
%37 = icmp eq i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%40 = tail call i32 @exit(i32 1)
unreachable
41: ; preds = %35
%42 = tail call i64 @dlclose(i8* %5)
%43 = icmp eq i64 %42, 0
br i1 %43, label %48, label %44
44: ; preds = %41
%45 = tail call i8* (...) @dlerror()
%46 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %45)
%47 = tail call i32 @exit(i32 1)
unreachable
48: ; preds = %41
%49 = tail call i32 %29()
%50 = icmp eq i32 %49, 0
br i1 %50, label %54, label %51
51: ; preds = %48
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0))
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %48
%55 = tail call i64 @dlclose(i8* %13)
%56 = icmp eq i64 %55, 0
br i1 %56, label %61, label %57
57: ; preds = %54
%58 = tail call i8* (...) @dlerror()
%59 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %58)
%60 = tail call i32 @exit(i32 1)
unreachable
61: ; preds = %54
%62 = load i32, i32* @RTLD_LAZY
%63 = load i32, i32* @RTLD_GLOBAL
%64 = or i32 %63, %62
%65 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %64)
%66 = icmp eq i8* %65, null
br i1 %66, label %67, label %71
67: ; preds = %61
%68 = tail call i8* (...) @dlerror()
%69 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0), i8* %68)
%70 = tail call i32 @exit(i32 1)
unreachable
71: ; preds = %61
%72 = tail call i8* @dlsym(i8* %65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%73 = icmp eq i8* %72, null
br i1 %73, label %74, label %78
74: ; preds = %71
%75 = tail call i8* (...) @dlerror()
%76 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0), i8* %75)
%77 = tail call i32 @exit(i32 1)
unreachable
78: ; preds = %71
%79 = bitcast i8* %72 to i32*
%80 = load i32, i32* %79
%81 = icmp eq i32 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %78
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%84 = tail call i32 @exit(i32 1)
unreachable
85: ; preds = %78
%86 = tail call i64 @dlclose(i8* %65)
%87 = icmp eq i64 %86, 0
br i1 %87, label %92, label %88
88: ; preds = %85
%89 = tail call i8* (...) @dlerror()
%90 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %89)
%91 = tail call i32 @exit(i32 1)
unreachable
92: ; preds = %85
ret i32 0
}