#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;
char *dlerror();
void *dlopen(char *, int);
void *dlsym(void *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, char const *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strstr(char *, char *);
int main(int argc, char **argv) {
  char *lib, *libarg;
  const char *error;
  void *handle;
  void *result;
  char *obj, *sym;
  int i;
  if (argc < 3) {
  usage:
    fprintf(stderr, "Usage: findit [-l<lib> ...] <shared_object> <symbol>\n");
    exit(1);
  }
  sym = argv[argc - 1];
  obj = argv[argc - 2];
  for (i = 1; i < argc - 2; i++) {
    libarg = argv[i];
    if (libarg[0] != '-' || libarg[1] != 'l') {
      fprintf(stderr, "Bad library arg: \"%s\"", libarg);
      goto usage;
    }
    if (i < argc - 3 && strlen(libarg) == 2)
      libarg = argv[++i];
    else
      libarg += 2;
    if (!(lib = malloc(strlen(libarg) + 7 + 0))) {
      fputs("Out of memory!\n", stderr);
      exit(1);
    }
    if (!strstr(libarg, ".so"))
      strcpy(lib, "lib");
    else
      lib[0] = 0;
    strcat(lib, libarg);
    if (!strstr(lib, ".so"))
      strcat(lib, ".so");
    handle = dlopen(lib, RTLD_LAZY | RTLD_GLOBAL);
    if (!handle) {
      obj = lib;
      goto openerr;
    }
    free(lib);
  }
  handle = dlopen(obj, RTLD_LAZY);
  if (!handle) {
  openerr:
    fprintf(stderr, "%s. %s (dlopen)\n", dlerror(), obj);
    exit(1);
  }
  result = dlsym(handle, sym);
  if ((error = dlerror())) {
    printf("%s. (dlsym)\n", error);
    exit(1);
  }
  printf("Found %s in %s at %p\n", sym, obj, result);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1216 <main+0x46>
jmp    11f5 <main+0x25>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    13f2 <main+0x222>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1289 <main+0xb9>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6c,%eax
je     12a9 <main+0xd9>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    11f5 <main+0x25>
mov    -0x4c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    12e9 <main+0x119>
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jne    12e9 <main+0x119>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    12f5 <main+0x125>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
add    $0x7,%eax
add    $0x0,%eax
movslq %eax,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1339 <main+0x169>
mov    0x2cb7(%rip),%rax
mov    (%rax),%esi
lea    0xd22(%rip),%rdi
call   1080 <fputs@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%eax
jne    1367 <main+0x197>
mov    -0x18(%rbp),%rdi
lea    0xd03(%rip),%rsi
call   1050 <strcpy@plt>
jmp    136e <main+0x19e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10d0 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xcd6(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%eax
jne    13a4 <main+0x1d4>
mov    -0x18(%rbp),%rdi
lea    0xcbd(%rip),%rsi
call   10d0 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    0x2c21(%rip),%rax
mov    (%rax),%esi
mov    0x2c30(%rip),%rax
or     (%rax),%esi
call   1090 <dlopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13db <main+0x20b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1418 <main+0x248>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1247 <main+0x77>
mov    -0x40(%rbp),%rdi
mov    0x2bd3(%rip),%rax
mov    (%rax),%esi
call   1090 <dlopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    144d <main+0x27d>
jmp    1418 <main+0x248>
mov    0x2bb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x50(%rbp),%edi
mov    %rax,%rdx
mov    -0x40(%rbp),%rcx
lea    0xc28(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10c0 <dlsym@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     148f <main+0x2bf>
mov    -0x28(%rbp),%rsi
lea    0xbf7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
lea    0xbe0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jg     1204 <main+0x34>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rsi,%r13
lea    -0x1(%rdi),%eax
mov    (%rsi,%rax,8),%rax
mov    %rax,0x8(%rsp)
lea    -0x2(%rdi),%eax
mov    %rax,0x20(%rsp)
mov    (%rsi,%rax,8),%rax
mov    %rax,0x10(%rsp)
cmp    $0x3,%edi
jne    1278 <main+0xa8>
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
mov    0x10(%rsp),%r15
mov    %r15,%rdi
call   1090 <dlopen@plt>
test   %rax,%rax
jne    1388 <main+0x1b8>
mov    0x2d89(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xe05(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
add    $0xfffffffd,%edi
mov    $0x1,%r12d
lea    0xdd4(%rip),%rbx
mov    %rdi,0x18(%rsp)
nopl   (%rax)
movslq %r12d,%rbp
mov    0x0(%r13,%rbp,8),%r14
cmpb   $0x2d,(%r14)
jne    13c5 <main+0x1f5>
cmpb   $0x6c,0x1(%r14)
jne    13c5 <main+0x1f5>
cmp    %edi,%r12d
jge    12d0 <main+0x100>
mov    %r14,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jne    12d0 <main+0x100>
add    $0x1,%r12d
mov    0x8(%r13,%rbp,8),%r14
jmp    12d4 <main+0x104>
nopw   0x0(%rax,%rax,1)
add    $0x2,%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
add    $0x7,%eax
movslq %eax,%rdi
call   10b0 <malloc@plt>
test   %rax,%rax
je     13ff <main+0x22f>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   10f0 <strstr@plt>
test   %eax,%eax
je     1310 <main+0x140>
movb   $0x0,(%r15)
jmp    131f <main+0x14f>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
lea    0xd46(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10d0 <strcat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10f0 <strstr@plt>
test   %eax,%eax
jne    1344 <main+0x174>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10d0 <strcat@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%esi
mov    0x2c7c(%rip),%rax
or     (%rax),%esi
mov    %r15,%rdi
call   1090 <dlopen@plt>
test   %rax,%rax
je     1248 <main+0x78>
mov    %r15,%rdi
call   1040 <free@plt>
add    $0x1,%r12d
cmp    0x20(%rsp),%r12d
mov    0x18(%rsp),%rdi
jl     1290 <main+0xc0>
jmp    1229 <main+0x59>
mov    %rax,%rdi
mov    0x8(%rsp),%rbp
mov    %rbp,%rsi
call   10c0 <dlsym@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
test   %rax,%rax
jne    13e4 <main+0x214>
lea    0xcd4(%rip),%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xc61(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    11e3 <main+0x13>
lea    0xc8a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2bd2(%rip),%rax
mov    (%rax),%esi
lea    0xc3d(%rip),%rdi
call   1080 <fputs@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: findit [-l<lib> ...] <shared_object> <symbol>\0A\00"
@.str.1 = [22 x i8] c"Bad library arg: \22%s\22\00"
@.str.2 = [16 x i8] c"Out of memory!\0A\00"
@.str.3 = [4 x i8] c".so\00"
@.str.4 = [4 x i8] c"lib\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.5 = [17 x i8] c"%s. %s (dlopen)\0A\00"
@.str.6 = [13 x i8] c"%s. (dlsym)\0A\00"
@.str.7 = [22 x i8] c"Found %s in %s at %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %2
br label %17
17: ; preds = %56, %16
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %22, i64 %25
%27 = load i8*, i8** %26
store i8* %27, i8** %12
%28 = load i8**, i8*** %5
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %28, i64 %31
%33 = load i8*, i8** %32
store i8* %33, i8** %11
store i32 1, i32* %13
br label %34
34: ; preds = %124, %21
%35 = load i32, i32* %13
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 2
%38 = icmp slt i32 %35, %37
br i1 %38, label %39, label %127
39: ; preds = %34
%40 = load i8**, i8*** %5
%41 = load i32, i32* %13
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
store i8* %44, i8** %7
%45 = load i8*, i8** %7
%46 = getelementptr inbounds i8, i8* %45, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 45
br i1 %49, label %56, label %50
50: ; preds = %39
%51 = load i8*, i8** %7
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %54, 108
br i1 %55, label %56, label %60
56: ; preds = %50, %39
%57 = load i32, i32* @stderr
%58 = load i8*, i8** %7
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %58)
br label %17
60: ; preds = %50
%61 = load i32, i32* %13
%62 = load i32, i32* %4
%63 = sub nsw i32 %62, 3
%64 = icmp slt i32 %61, %63
br i1 %64, label %65, label %76
65: ; preds = %60
%66 = load i8*, i8** %7
%67 = call i32 @strlen(i8* %66)
%68 = icmp eq i32 %67, 2
br i1 %68, label %69, label %76
69: ; preds = %65
%70 = load i8**, i8*** %5
%71 = load i32, i32* %13
%72 = add nsw i32 %71, 1
store i32 %72, i32* %13
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %70, i64 %73
%75 = load i8*, i8** %74
store i8* %75, i8** %7
br label %79
76: ; preds = %65, %60
%77 = load i8*, i8** %7
%78 = getelementptr inbounds i8, i8* %77, i64 2
store i8* %78, i8** %7
br label %79
79: ; preds = %76, %69
%80 = load i8*, i8** %7
%81 = call i32 @strlen(i8* %80)
%82 = add nsw i32 %81, 7
%83 = add nsw i32 %82, 0
%84 = sext i32 %83 to i64
%85 = call i8* @malloc(i64 %84)
store i8* %85, i8** %6
%86 = icmp ne i8* %85, null
br i1 %86, label %91, label %87
87: ; preds = %79
%88 = load i32, i32* @stderr
%89 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %88)
%90 = call i32 @exit(i32 1)
unreachable
91: ; preds = %79
%92 = load i8*, i8** %7
%93 = call i32 @strstr(i8* %92, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%94 = icmp ne i32 %93, 0
br i1 %94, label %98, label %95
95: ; preds = %91
%96 = load i8*, i8** %6
%97 = call i32 @strcpy(i8* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %101
98: ; preds = %91
%99 = load i8*, i8** %6
%100 = getelementptr inbounds i8, i8* %99, i64 0
store i8 0, i8* %100
br label %101
101: ; preds = %98, %95
%102 = load i8*, i8** %6
%103 = load i8*, i8** %7
%104 = call i32 @strcat(i8* %102, i8* %103)
%105 = load i8*, i8** %6
%106 = call i32 @strstr(i8* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%107 = icmp ne i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %101
%109 = load i8*, i8** %6
%110 = call i32 @strcat(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %111
111: ; preds = %108, %101
%112 = load i8*, i8** %6
%113 = load i32, i32* @RTLD_LAZY
%114 = load i32, i32* @RTLD_GLOBAL
%115 = or i32 %113, %114
%116 = call i8* @dlopen(i8* %112, i32 %115)
store i8* %116, i8** %9
%117 = load i8*, i8** %9
%118 = icmp ne i8* %117, null
br i1 %118, label %121, label %119
119: ; preds = %111
%120 = load i8*, i8** %6
store i8* %120, i8** %11
br label %134
121: ; preds = %111
%122 = load i8*, i8** %6
%123 = call i32 @free(i8* %122)
br label %124
124: ; preds = %121
%125 = load i32, i32* %13
%126 = add nsw i32 %125, 1
store i32 %126, i32* %13
br label %34
127: ; preds = %34
%128 = load i8*, i8** %11
%129 = load i32, i32* @RTLD_LAZY
%130 = call i8* @dlopen(i8* %128, i32 %129)
store i8* %130, i8** %9
%131 = load i8*, i8** %9
%132 = icmp ne i8* %131, null
br i1 %132, label %140, label %133
133: ; preds = %127
br label %134
134: ; preds = %133, %119
%135 = load i32, i32* @stderr
%136 = call i8* (...) @dlerror()
%137 = load i8*, i8** %11
%138 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %136, i8* %137)
%139 = call i32 @exit(i32 1)
unreachable
140: ; preds = %127
%141 = load i8*, i8** %9
%142 = load i8*, i8** %12
%143 = call i8* @dlsym(i8* %141, i8* %142)
store i8* %143, i8** %10
%144 = call i8* (...) @dlerror()
store i8* %144, i8** %8
%145 = icmp ne i8* %144, null
br i1 %145, label %146, label %150
146: ; preds = %140
%147 = load i8*, i8** %8
%148 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %147)
%149 = call i32 @exit(i32 1)
unreachable
150: ; preds = %140
%151 = load i8*, i8** %12
%152 = load i8*, i8** %11
%153 = load i8*, i8** %10
%154 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %151, i8* %152, i8* %153)
%155 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: findit [-l<lib> ...] <shared_object> <symbol>\0A\00"
@.str.1 = [22 x i8] c"Bad library arg: \22%s\22\00"
@.str.2 = [16 x i8] c"Out of memory!\0A\00"
@.str.3 = [4 x i8] c".so\00"
@.str.4 = [4 x i8] c"lib\00"
@RTLD_LAZY = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.5 = [17 x i8] c"%s. %s (dlopen)\0A\00"
@.str.6 = [13 x i8] c"%s. (dlsym)\0A\00"
@.str.7 = [22 x i8] c"Found %s in %s at %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2, %31
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = add nsw i32 %0, -2
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = icmp eq i32 %0, 3
br i1 %17, label %80, label %18
18: ; preds = %8
%19 = add nsw i32 %0, -3
br label %20
20: ; preds = %18, %76
%21 = phi i32 [ 1, %18 ], [ %78, %76 ]
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 45
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = getelementptr inbounds i8, i8* %24, i64 1
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 108
br i1 %30, label %34, label %31
31: ; preds = %27, %20
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %4
34: ; preds = %27
%35 = icmp slt i32 %21, %19
br i1 %35, label %36, label %44
36: ; preds = %34
%37 = tail call i32 @strlen(i8* %24)
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = add nsw i32 %21, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %1, i64 %41
%43 = load i8*, i8** %42
br label %46
44: ; preds = %36, %34
%45 = getelementptr inbounds i8, i8* %24, i64 2
br label %46
46: ; preds = %44, %39
%47 = phi i8* [ %43, %39 ], [ %45, %44 ]
%48 = phi i32 [ %40, %39 ], [ %21, %44 ]
%49 = tail call i32 @strlen(i8* %47)
%50 = add nsw i32 %49, 7
%51 = sext i32 %50 to i64
%52 = tail call i8* @malloc(i64 %51)
%53 = icmp eq i8* %52, null
br i1 %53, label %54, label %58
54: ; preds = %46
%55 = load i32, i32* @stderr
%56 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = tail call i32 @exit(i32 1)
unreachable
58: ; preds = %46
%59 = tail call i32 @strstr(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = tail call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %64
63: ; preds = %58
store i8 0, i8* %52
br label %64
64: ; preds = %63, %61
%65 = tail call i32 @strcat(i8* %52, i8* %47)
%66 = tail call i32 @strstr(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = tail call i32 @strcat(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %70
70: ; preds = %68, %64
%71 = load i32, i32* @RTLD_LAZY
%72 = load i32, i32* @RTLD_GLOBAL
%73 = or i32 %72, %71
%74 = tail call i8* @dlopen(i8* %52, i32 %73)
%75 = icmp eq i8* %74, null
br i1 %75, label %84, label %76
76: ; preds = %70
%77 = tail call i32 @free(i8* %52)
%78 = add nsw i32 %48, 1
%79 = icmp slt i32 %78, %13
br i1 %79, label %20, label %80
80: ; preds = %76, %8
%81 = load i32, i32* @RTLD_LAZY
%82 = tail call i8* @dlopen(i8* %16, i32 %81)
%83 = icmp eq i8* %82, null
br i1 %83, label %84, label %90
84: ; preds = %70, %80
%85 = phi i8* [ %16, %80 ], [ %52, %70 ]
%86 = load i32, i32* @stderr
%87 = tail call i8* (...) @dlerror()
%88 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %87, i8* %85)
%89 = tail call i32 @exit(i32 1)
unreachable
90: ; preds = %80
%91 = tail call i8* @dlsym(i8* %82, i8* %12)
%92 = tail call i8* (...) @dlerror()
%93 = icmp eq i8* %92, null
br i1 %93, label %97, label %94
94: ; preds = %90
%95 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %92)
%96 = tail call i32 @exit(i32 1)
unreachable
97: ; preds = %90
%98 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %12, i8* %16, i8* %91)
%99 = tail call i32 @exit(i32 0)
unreachable
}