#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*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *strstr(char *, char *);
main() {
  char input[20];
  printf("Enter a sentence\n");
  gets(input);
  if (strstr(input, "is") != NULL) {
    printf("The string \"is\" was found");
  } else {
    printf("Not found");
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x20(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     118f <main+0x4f>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x5b>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
lea    0xe98(%rip),%rax
lea    0xe77(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a sentence\0A\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [26 x i8] c"The string \22is\22 was found\00"
@.str.3 = [10 x i8] c"Not found\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32* @strstr(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = call i32 (...) @getchar()
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [26 x i8] c"The string \22is\22 was found\00"
@.str.3 = [10 x i8] c"Not found\00"
@str = [17 x i8] c"Enter a sentence\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
%9 = call i32 (...) @getchar()
ret i32 0
}