#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int RTLD_GLOBAL;
int RTLD_LAZY;
scalar_t__ dlclose(void *);
char *dlerror();
void *dlopen(char *, int);
int /*<<< orphan*/ dlsym(void *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  dlerror();
  void *f1_handle = dlopen("func.shared", RTLD_LAZY | RTLD_GLOBAL);
  if (f1_handle == NULL) {
    fprintf(stderr, "unable to open 'func.shared': %s\n", dlerror());
    return EXIT_FAILURE;
  }
  void (*func)(void) = (void (*)(void))dlsym(f1_handle, "func");
  if (func == NULL) {
    fprintf(stderr, "unable to lookup symbol 'func': %s\n", dlerror());
    return EXIT_FAILURE;
  }
  dlerror();
  void *f2_handle = dlopen("func2.shared", RTLD_LAZY | RTLD_GLOBAL);
  if (f2_handle == NULL) {
    fprintf(stderr, "unable to open 'func2.shared': %s\n", dlerror());
    return EXIT_FAILURE;
  }
  void (*func2)(void) = (void (*)(void))dlsym(f2_handle, "func2");
  if (func2 == NULL) {
    fprintf(stderr, "unable to lookup symbol 'func2': %s\n", dlerror());
    return EXIT_FAILURE;
  }
  func2();
  dlerror();
  void (*gcov_flush1)() = (void (*)())dlsym(f1_handle, "__gcov_flush");
  if (gcov_flush1 == NULL) {
    fprintf(stderr, "unable to find __gcov_flush in func.shared': %s\n",
            dlerror());
    return EXIT_FAILURE;
  }
  dlerror();
  void (*gcov_flush2)() = (void (*)())dlsym(f2_handle, "__gcov_flush");
  if (gcov_flush2 == NULL) {
    fprintf(stderr, "unable to find __gcov_flush in func2.shared': %s\n",
            dlerror());
    return EXIT_FAILURE;
  }
  if (gcov_flush1 == gcov_flush2) {
    fprintf(stderr,
            "Same __gcov_flush found in func.shared and func2.shared\n");
    return EXIT_FAILURE;
  }
  dlerror();
  if (dlclose(f2_handle) != 0) {
    fprintf(stderr, "unable to close 'func2.shared': %s\n", dlerror());
    return EXIT_FAILURE;
  }
  func();
  int g1 = 0;
  int g2 = 0;
  int n = 10;
  if (n % 5 == 0)
    g1++;
  else
    g2++;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
mov    0x2e6b(%rip),%rax
or     (%rax),%esi
lea    0xe7a(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11d2 <main+0x82>
mov    0x2e37(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x50(%rbp),%edi
mov    %rax,%rdx
lea    0xe52(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    -0x18(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1060 <dlsym@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    122b <main+0xdb>
mov    0x2dde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x54(%rbp),%edi
mov    %rax,%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
mov    0x2da6(%rip),%rax
or     (%rax),%esi
lea    0xe0c(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1297 <main+0x147>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x58(%rbp),%edi
mov    %rax,%rdx
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    -0x28(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1060 <dlsym@plt>
cltq
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12f0 <main+0x1a0>
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x5c(%rbp),%edi
mov    %rax,%rdx
lea    0xdb5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
call   *-0x30(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x18(%rbp),%rdi
lea    0xdad(%rip),%rsi
call   1060 <dlsym@plt>
cltq
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1353 <main+0x203>
mov    0x2cb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x60(%rbp),%edi
mov    %rax,%rdx
lea    0xd84(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x28(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   1060 <dlsym@plt>
cltq
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    13b3 <main+0x263>
mov    0x2c56(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x64(%rbp),%edi
mov    %rax,%rdx
lea    0xd55(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    13e9 <main+0x299>
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bf1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x28(%rbp),%rdi
call   1070 <dlclose@plt>
cmp    $0x0,%rax
je     143b <main+0x2eb>
mov    0x2bce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rdx
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    148a <main+0x33a>
call   *-0x20(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0xa,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1475 <main+0x325>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    147e <main+0x32e>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    0x2b43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    0x2e5b(%rip),%r15
mov    0x2e7c(%rip),%rbx
mov    (%rbx),%esi
or     (%r15),%esi
lea    0xe88(%rip),%rdi
call   1040 <dlopen@plt>
test   %rax,%rax
je     1262 <main+0x112>
mov    %rax,%rbp
lea    0xe9e(%rip),%rsi
mov    %rax,%rdi
call   1060 <dlsym@plt>
test   %eax,%eax
je     127b <main+0x12b>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    (%rbx),%esi
or     (%r15),%esi
lea    0xea1(%rip),%rdi
call   1040 <dlopen@plt>
test   %rax,%rax
je     1294 <main+0x144>
mov    %rax,%rbx
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
call   1060 <dlsym@plt>
test   %eax,%eax
je     12ad <main+0x15d>
cltq
call   *%rax
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xec2(%rip),%rsi
mov    %rbp,%rdi
call   1060 <dlsym@plt>
test   %eax,%eax
je     12c6 <main+0x176>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1060 <dlsym@plt>
test   %eax,%eax
je     12df <main+0x18f>
movslq %ebp,%rcx
cltq
cmp    %rax,%rcx
je     1316 <main+0x1c6>
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %rbx,%rdi
call   1070 <dlclose@plt>
test   %rax,%rax
je     132f <main+0x1df>
mov    0x2d8b(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xefe(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2d6f(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xd93(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2d56(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xda1(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2d3d(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xdb9(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2d24(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xdc9(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2d0b(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xde2(%rip),%rsi
jmp    12f6 <main+0x1a6>
mov    0x2cf2(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xdfa(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1302 <main+0x1b2>
movslq %r14d,%rax
call   *%rax
mov    0x2c8d(%rip),%rax
jmp    1309 <main+0x1b9>

LLVM IR (-O0):
@.str = [12 x i8] c"func.shared\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@stderr = global i32 0
@.str.1 = [34 x i8] c"unable to open 'func.shared': %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [5 x i8] c"func\00"
@.str.3 = [36 x i8] c"unable to lookup symbol 'func': %s\0A\00"
@.str.4 = [13 x i8] c"func2.shared\00"
@.str.5 = [35 x i8] c"unable to open 'func2.shared': %s\0A\00"
@.str.6 = [6 x i8] c"func2\00"
@.str.7 = [37 x i8] c"unable to lookup symbol 'func2': %s\0A\00"
@.str.8 = [13 x i8] c"__gcov_flush\00"
@.str.9 = [49 x i8] c"unable to find __gcov_flush in func.shared': %s\0A\00"
@.str.10 = [50 x i8] c"unable to find __gcov_flush in func2.shared': %s\0A\00"
@.str.11 = [57 x i8] c"Same __gcov_flush found in func.shared and func2.shared\0A\00"
@.str.12 = [36 x i8] c"unable to close 'func2.shared': %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca void ()*
%8 = alloca i8*
%9 = alloca void ()*
%10 = alloca void (...)*
%11 = alloca void (...)*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = call i8* (...) @dlerror()
%16 = load i32, i32* @RTLD_LAZY
%17 = load i32, i32* @RTLD_GLOBAL
%18 = or i32 %16, %17
%19 = call i8* @dlopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %18)
store i8* %19, i8** %6
%20 = load i8*, i8** %6
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = call i8* (...) @dlerror()
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
store i32 %26, i32* %3
br label %122
27: ; preds = %2
%28 = load i8*, i8** %6
%29 = call i32 @dlsym(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to void ()*
store void ()* %31, void ()** %7
%32 = load void ()*, void ()** %7
%33 = icmp eq void ()* %32, null
br i1 %33, label %34, label %39
34: ; preds = %27
%35 = load i32, i32* @stderr
%36 = call i8* (...) @dlerror()
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @EXIT_FAILURE
store i32 %38, i32* %3
br label %122
39: ; preds = %27
%40 = call i8* (...) @dlerror()
%41 = load i32, i32* @RTLD_LAZY
%42 = load i32, i32* @RTLD_GLOBAL
%43 = or i32 %41, %42
%44 = call i8* @dlopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %43)
store i8* %44, i8** %8
%45 = load i8*, i8** %8
%46 = icmp eq i8* %45, null
br i1 %46, label %47, label %52
47: ; preds = %39
%48 = load i32, i32* @stderr
%49 = call i8* (...) @dlerror()
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %49)
%51 = load i32, i32* @EXIT_FAILURE
store i32 %51, i32* %3
br label %122
52: ; preds = %39
%53 = load i8*, i8** %8
%54 = call i32 @dlsym(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to void ()*
store void ()* %56, void ()** %9
%57 = load void ()*, void ()** %9
%58 = icmp eq void ()* %57, null
br i1 %58, label %59, label %64
59: ; preds = %52
%60 = load i32, i32* @stderr
%61 = call i8* (...) @dlerror()
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %61)
%63 = load i32, i32* @EXIT_FAILURE
store i32 %63, i32* %3
br label %122
64: ; preds = %52
%65 = load void ()*, void ()** %9
%66 = call i8* (...) @dlerror()
%67 = load i8*, i8** %6
%68 = call i32 @dlsym(i8* %67, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%69 = sext i32 %68 to i64
%70 = inttoptr i64 %69 to void (...)*
store void (...)* %70, void (...)** %10
%71 = load void (...)*, void (...)** %10
%72 = icmp eq void (...)* %71, null
br i1 %72, label %73, label %78
73: ; preds = %64
%74 = load i32, i32* @stderr
%75 = call i8* (...) @dlerror()
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %75)
%77 = load i32, i32* @EXIT_FAILURE
store i32 %77, i32* %3
br label %122
78: ; preds = %64
%79 = call i8* (...) @dlerror()
%80 = load i8*, i8** %8
%81 = call i32 @dlsym(i8* %80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%82 = sext i32 %81 to i64
%83 = inttoptr i64 %82 to void (...)*
store void (...)* %83, void (...)** %11
%84 = load void (...)*, void (...)** %11
%85 = icmp eq void (...)* %84, null
br i1 %85, label %86, label %91
86: ; preds = %78
%87 = load i32, i32* @stderr
%88 = call i8* (...) @dlerror()
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i8* %88)
%90 = load i32, i32* @EXIT_FAILURE
store i32 %90, i32* %3
br label %122
91: ; preds = %78
%92 = load void (...)*, void (...)** %10
%93 = load void (...)*, void (...)** %11
%94 = icmp eq void (...)* %92, %93
br i1 %94, label %95, label %99
95: ; preds = %91
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
%98 = load i32, i32* @EXIT_FAILURE
store i32 %98, i32* %3
br label %122
99: ; preds = %91
%100 = call i8* (...) @dlerror()
%101 = load i8*, i8** %8
%102 = call i64 @dlclose(i8* %101)
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %109
104: ; preds = %99
%105 = load i32, i32* @stderr
%106 = call i8* (...) @dlerror()
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i8* %106)
%108 = load i32, i32* @EXIT_FAILURE
store i32 %108, i32* %3
br label %122
109: ; preds = %99
%110 = load void ()*, void ()** %7
store i32 0, i32* %12
store i32 0, i32* %13
store i32 10, i32* %14
%111 = load i32, i32* %14
%112 = srem i32 %111, 5
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %109
%115 = load i32, i32* %12
%116 = add nsw i32 %115, 1
store i32 %116, i32* %12
br label %120
117: ; preds = %109
%118 = load i32, i32* %13
%119 = add nsw i32 %118, 1
store i32 %119, i32* %13
br label %120
120: ; preds = %117, %114
%121 = load i32, i32* @EXIT_SUCCESS
store i32 %121, i32* %3
br label %122
122: ; preds = %120, %104, %95, %86, %73, %59, %47, %34, %22
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@.str = [12 x i8] c"func.shared\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@stderr = global i32 0
@.str.1 = [34 x i8] c"unable to open 'func.shared': %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [5 x i8] c"func\00"
@.str.3 = [36 x i8] c"unable to lookup symbol 'func': %s\0A\00"
@.str.4 = [13 x i8] c"func2.shared\00"
@.str.5 = [35 x i8] c"unable to open 'func2.shared': %s\0A\00"
@.str.6 = [6 x i8] c"func2\00"
@.str.7 = [37 x i8] c"unable to lookup symbol 'func2': %s\0A\00"
@.str.8 = [13 x i8] c"__gcov_flush\00"
@.str.9 = [49 x i8] c"unable to find __gcov_flush in func.shared': %s\0A\00"
@.str.10 = [50 x i8] c"unable to find __gcov_flush in func2.shared': %s\0A\00"
@.str.11 = [57 x i8] c"Same __gcov_flush found in func.shared and func2.shared\0A\00"
@.str.12 = [36 x i8] c"unable to close 'func2.shared': %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @dlerror()
%4 = load i32, i32* @RTLD_LAZY
%5 = load i32, i32* @RTLD_GLOBAL
%6 = or i32 %5, %4
%7 = tail call i8* @dlopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i8* (...) @dlerror()
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %76
13: ; preds = %2
%14 = tail call i32 @dlsym(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to void ()*
%17 = icmp eq i32 %14, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* @stderr
%20 = tail call i8* (...) @dlerror()
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %76
22: ; preds = %13
%23 = tail call i8* (...) @dlerror()
%24 = load i32, i32* @RTLD_LAZY
%25 = load i32, i32* @RTLD_GLOBAL
%26 = or i32 %25, %24
%27 = tail call i8* @dlopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %33
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = tail call i8* (...) @dlerror()
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %31)
br label %76
33: ; preds = %22
%34 = tail call i32 @dlsym(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* @stderr
%38 = tail call i8* (...) @dlerror()
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %38)
br label %76
40: ; preds = %33
%41 = sext i32 %34 to i64
%42 = inttoptr i64 %41 to void ()*
tail call void %42()
%43 = tail call i8* (...) @dlerror()
%44 = tail call i32 @dlsym(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%45 = sext i32 %44 to i64
%46 = inttoptr i64 %45 to void (...)*
%47 = icmp eq i32 %44, 0
br i1 %47, label %48, label %52
48: ; preds = %40
%49 = load i32, i32* @stderr
%50 = tail call i8* (...) @dlerror()
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %50)
br label %76
52: ; preds = %40
%53 = tail call i8* (...) @dlerror()
%54 = tail call i32 @dlsym(i8* %27, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = load i32, i32* @stderr
%58 = tail call i8* (...) @dlerror()
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i8* %58)
br label %76
60: ; preds = %52
%61 = sext i32 %54 to i64
%62 = inttoptr i64 %61 to void (...)*
%63 = icmp eq void (...)* %46, %62
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load i32, i32* @stderr
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
br label %76
67: ; preds = %60
%68 = tail call i8* (...) @dlerror()
%69 = tail call i64 @dlclose(i8* %27)
%70 = icmp eq i64 %69, 0
br i1 %70, label %75, label %71
71: ; preds = %67
%72 = load i32, i32* @stderr
%73 = tail call i8* (...) @dlerror()
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i8* %73)
br label %76
75: ; preds = %67
tail call void %16()
br label %76
76: ; preds = %18, %36, %56, %64, %71, %75, %48, %29, %9
%77 = phi i32* [ @EXIT_FAILURE, %9 ], [ @EXIT_FAILURE, %18 ], [ @EXIT_FAILURE, %29 ], [ @EXIT_FAILURE, %36 ], [ @EXIT_FAILURE, %48 ], [ @EXIT_FAILURE, %56 ], [ @EXIT_FAILURE, %64 ], [ @EXIT_FAILURE, %71 ], [ @EXIT_SUCCESS, %75 ]
%78 = load i32, i32* %77
ret i32 %78
}