#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 /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ *strstri(char *, char *);
int main(int argc, char **argv) {
  char *str = "path_to_file_name.mP4";
  char *subStr = ".mp4";
  if (strstri(str, subStr) != NULL) {
    printf("%s is in %s\n", subStr, str);
  } else {
    printf("%s is not in %s\n", subStr, str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strstri@plt>
cmp    $0x0,%rax
je     117c <main+0x5c>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x70>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0xee4(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strstri@plt>
test   %rax,%rax
lea    0xee1(%rip),%rax
lea    0xecd(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"path_to_file_name.mP4\00"
@.str.1 = [5 x i8] c".mp4\00"
@.str.2 = [13 x i8] c"%s is in %s\0A\00"
@.str.3 = [17 x i8] c"%s is not in %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %6
%9 = load i8*, i8** %7
%10 = call i32* @strstri(i8* %8, i8* %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %7
%14 = load i8*, i8** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %14)
br label %20
16: ; preds = %2
%17 = load i8*, i8** %7
%18 = load i8*, i8** %6
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %17, i8* %18)
br label %20
20: ; preds = %16, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"path_to_file_name.mP4\00"
@.str.1 = [5 x i8] c".mp4\00"
@.str.2 = [13 x i8] c"%s is in %s\0A\00"
@.str.3 = [17 x i8] c"%s is not in %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @strstri(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}