#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 */
scalar_t__ isspace(char);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char *strstr(char const *, char *);
char *find_sharedlib_section_start(const char *input) {
  char *result = strstr(input, "From");
  for (; result; result = strstr(result + 1, "From")) {
    if (result != input && *(result - 1) != '\n')
      continue;
    char *tmp = result + strlen("From");
    while (isspace(*tmp))
      ++tmp;
    if (strncmp("To", tmp, strlen("To")) != 0)
      continue;
    tmp += strlen("To");
    while (isspace(*tmp))
      ++tmp;
    if (strncmp("Syms Read", tmp, strlen("Syms Read")) != 0)
      continue;
    tmp += strlen("Syms Read");
    while (isspace(*tmp))
      ++tmp;
    if (strncmp("Shared Object Library\n", tmp,
                strlen("Shared Object Library\n")) != 0)
      continue;
    return tmp + strlen("Shared Object Library\n");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<find_sharedlib_section_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1345 <find_sharedlib_section_start+0x205>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     118f <find_sharedlib_section_start+0x4f>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
je     118f <find_sharedlib_section_start+0x4f>
jmp    1328 <find_sharedlib_section_start+0x1e8>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xe62(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     11da <find_sharedlib_section_start+0x9a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11b3 <find_sharedlib_section_start+0x73>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xe1c(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
lea    0xe0a(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     120f <find_sharedlib_section_start+0xcf>
jmp    1328 <find_sharedlib_section_start+0x1e8>
lea    0xdef(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     1252 <find_sharedlib_section_start+0x112>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    122b <find_sharedlib_section_start+0xeb>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    0xda7(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
lea    0xd95(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1287 <find_sharedlib_section_start+0x147>
jmp    1328 <find_sharedlib_section_start+0x1e8>
lea    0xd7a(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     12ca <find_sharedlib_section_start+0x18a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    12a3 <find_sharedlib_section_start+0x163>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    0xd39(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
lea    0xd27(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     12ff <find_sharedlib_section_start+0x1bf>
jmp    1328 <find_sharedlib_section_start+0x1e8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xd04(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    134d <find_sharedlib_section_start+0x20d>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
lea    0xcc9(%rip),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x18(%rbp)
jmp    1160 <find_sharedlib_section_start+0x20>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_sharedlib_section_start>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeab(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     12af <find_sharedlib_section_start+0x16f>
mov    %rax,%rbx
lea    0xe93(%rip),%r15
jmp    118b <find_sharedlib_section_start+0x4b>
nop
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     12af <find_sharedlib_section_start+0x16f>
cmp    %r14,%rbx
je     1196 <find_sharedlib_section_start+0x56>
cmpb   $0xa,-0x1(%rbx)
jne    1170 <find_sharedlib_section_start+0x30>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rbp
add    $0xffffffffffffffff,%rbp
nopl   0x0(%rax,%rax,1)
mov    %rbp,%r13
add    $0x1,%rbp
movsbl 0x1(%r13),%edi
call   1050 <isspace@plt>
test   %rax,%rax
jne    11b0 <find_sharedlib_section_start+0x70>
lea    0xe38(%rip),%r12
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1170 <find_sharedlib_section_start+0x30>
lea    0xe17(%rip),%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%rbp
add    %rax,%r13
nopl   0x0(%rax,%rax,1)
mov    %r13,%r12
movsbl 0x0(%rbp),%edi
call   1050 <isspace@plt>
add    $0x1,%rbp
add    $0x1,%r13
test   %rax,%rax
jne    1200 <find_sharedlib_section_start+0xc0>
lea    0xde8(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1170 <find_sharedlib_section_start+0x30>
lea    0xdc3(%rip),%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r13
add    %rax,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x0(%r13),%edi
call   1050 <isspace@plt>
add    $0x1,%r13
add    $0x1,%r12
test   %rax,%rax
jne    1260 <find_sharedlib_section_start+0x120>
lea    0xd94(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1170 <find_sharedlib_section_start+0x30>
lea    0xd6f(%rip),%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r12
jmp    12b2 <find_sharedlib_section_start+0x172>
xor    %r12d,%r12d
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"From\00"
@.str.1 = [3 x i8] c"To\00"
@.str.2 = [10 x i8] c"Syms Read\00"
@.str.3 = [23 x i8] c"Shared Object Library\0A\00"
define i8* @find_sharedlib_section_start(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
br label %8
8: ; preds = %84, %1
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %88
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = icmp ne i8* %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 -1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %22
21: ; preds = %15
br label %84
22: ; preds = %15, %11
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8* %26, i8** %5
br label %27
27: ; preds = %32, %22
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = call i64 @isspace(i8 signext %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %5
br label %27
35: ; preds = %27
%36 = load i8*, i8** %5
%37 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%38 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %36, i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %35
br label %84
41: ; preds = %35
%42 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%43 = load i8*, i8** %5
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds i8, i8* %43, i64 %44
store i8* %45, i8** %5
br label %46
46: ; preds = %51, %41
%47 = load i8*, i8** %5
%48 = load i8, i8* %47
%49 = call i64 @isspace(i8 signext %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i8*, i8** %5
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %5
br label %46
54: ; preds = %46
%55 = load i8*, i8** %5
%56 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%57 = call i64 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %55, i32 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %54
br label %84
60: ; preds = %54
%61 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%62 = load i8*, i8** %5
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds i8, i8* %62, i64 %63
store i8* %64, i8** %5
br label %65
65: ; preds = %70, %60
%66 = load i8*, i8** %5
%67 = load i8, i8* %66
%68 = call i64 @isspace(i8 signext %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = load i8*, i8** %5
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %5
br label %65
73: ; preds = %65
%74 = load i8*, i8** %5
%75 = call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%76 = call i64 @strncmp(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %74, i32 %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %73
br label %84
79: ; preds = %73
%80 = load i8*, i8** %5
%81 = call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %80, i64 %82
store i8* %83, i8** %2
br label %89
84: ; preds = %78, %59, %40, %21
%85 = load i8*, i8** %4
%86 = getelementptr inbounds i8, i8* %85, i64 1
%87 = call i8* @strstr(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %87, i8** %4
br label %8
88: ; preds = %8
store i8* null, i8** %2
br label %89
89: ; preds = %88, %79
%90 = load i8*, i8** %2
ret i8* %90
}

LLVM IR (-O2):
@.str = [5 x i8] c"From\00"
@.str.1 = [3 x i8] c"To\00"
@.str.2 = [10 x i8] c"Syms Read\00"
@.str.3 = [23 x i8] c"Shared Object Library\0A\00"
define i8* @find_sharedlib_section_start(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %61, label %4
4: ; preds = %1, %57
%5 = phi i8* [ %59, %57 ], [ %2, %1 ]
%6 = icmp eq i8* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %57
11: ; preds = %7, %4
%12 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %5, i64 %13
br label %15
15: ; preds = %15, %11
%16 = phi i8* [ %14, %11 ], [ %20, %15 ]
%17 = load i8, i8* %16
%18 = tail call i64 @isspace(i8 signext %17)
%19 = icmp eq i64 %18, 0
%20 = getelementptr inbounds i8, i8* %16, i64 1
br i1 %19, label %21, label %15
21: ; preds = %15
%22 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16, i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %57
25: ; preds = %21
%26 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %16, i64 %27
br label %29
29: ; preds = %29, %25
%30 = phi i8* [ %28, %25 ], [ %34, %29 ]
%31 = load i8, i8* %30
%32 = tail call i64 @isspace(i8 signext %31)
%33 = icmp eq i64 %32, 0
%34 = getelementptr inbounds i8, i8* %30, i64 1
br i1 %33, label %35, label %29
35: ; preds = %29
%36 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%37 = tail call i64 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %30, i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %57
39: ; preds = %35
%40 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %30, i64 %41
br label %43
43: ; preds = %43, %39
%44 = phi i8* [ %42, %39 ], [ %48, %43 ]
%45 = load i8, i8* %44
%46 = tail call i64 @isspace(i8 signext %45)
%47 = icmp eq i64 %46, 0
%48 = getelementptr inbounds i8, i8* %44, i64 1
br i1 %47, label %49, label %43
49: ; preds = %43
%50 = tail call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%51 = tail call i64 @strncmp(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %44, i32 %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = tail call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %44, i64 %55
br label %61
57: ; preds = %49, %35, %21, %7
%58 = getelementptr inbounds i8, i8* %5, i64 1
%59 = tail call i8* @strstr(i8* %58, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %4
61: ; preds = %57, %1, %53
%62 = phi i8* [ %56, %53 ], [ null, %1 ], [ null, %57 ]
ret i8* %62
}