int main(int argc, char **argv) {
  char *pos;
  char s0[][80] = {"dysfunctional", "troll"};
  char s1[] = "fun";
  if (pos = strstr(s0[0], s1)) {
    printf("The string \"%s\" has been found inside \"%s\"\n", s1, s0[0]);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0xa0,%edx
call   1040 <memcpy@plt>
mov    0xf39(%rip),%eax
mov    %eax,-0xc4(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0xc4(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11b6 <main+0x86>
lea    -0xc4(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11bd <main+0x8d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
lea    0xec1(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    $0xa0,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
movl   $0x6e7566,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     1187 <main+0x57>
lea    0xf2e(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    118c <main+0x5c>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s0 = [2 x [80 x i8]] [[80 x i8] c"dysfunctional\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"troll\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@__const.main.s1 = [4 x i8] c"fun\00"
@.str = [44 x i8] c"The string \22%s\22 has been found inside \22%s\22\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [2 x [80 x i8]]
%8 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x [80 x i8]]* %7 to i8*
%10 = bitcast [4 x i8]* %8 to i8*
%11 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %7, i64 0, i64 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%14 = call i8* @strstr(i8* %12, i8* %13)
store i8* %14, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %7, i64 0, i64 0
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %19)
store i32 0, i32* %3
br label %22
21: ; preds = %2
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@__const.main.s0 = [2 x [80 x i8]] [[80 x i8] c"dysfunctional\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"troll\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [44 x i8] c"The string \22%s\22 has been found inside \22%s\22\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x [80 x i8]]
%4 = alloca i32
%5 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %3, i64 0, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i32 7239014, i32* %4
%7 = call i8* @strstr(i8* %5, i8* %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %4, i8* %5)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ 0, %9 ], [ -1, %2 ]
ret i32 %12
}