#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int seacrchInFile(char const *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, const char *argv[]) {
  int totalOccurence;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s string filename\n", argv[0]);
    return -1;
  }
  if (-1 != (totalOccurence = seacrchInFile(argv[2], argv[1])))
    fprintf(stdout, "Total %d '%s' found\n", totalOccurence, argv[1]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     116a <main+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ba <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <seacrchInFile@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     11b3 <main+0x93>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    115c <main+0x3c>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdi
call   1040 <seacrchInFile@plt>
cmp    $0xffffffff,%eax
je     117d <main+0x5d>
mov    0x2e96(%rip),%rcx
mov    (%rcx),%edi
mov    0x8(%rbx),%rcx
lea    0xecc(%rip),%rsi
xor    %ebx,%ebx
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    117f <main+0x5f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe91(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%ebx
jmp    117f <main+0x5f>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s string filename\0A\00"
@stdout = global i32 0
@.str.1 = [21 x i8] c"Total %d '%s' found\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 -1, i32* %3
br label %32
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @seacrchInFile(i8* %18, i8* %21)
store i32 %22, i32* %6
%23 = icmp ne i32 -1, %22
br i1 %23, label %24, label %31
24: ; preds = %15
%25 = load i32, i32* @stdout
%26 = load i32, i32* %6
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %26, i8* %29)
br label %31
31: ; preds = %24, %15
store i32 0, i32* %3
br label %32
32: ; preds = %31, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s string filename\0A\00"
@stdout = global i32 0
@.str.1 = [21 x i8] c"Total %d '%s' found\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %19
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @seacrchInFile(i8* %10, i8* %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %19, label %15
15: ; preds = %8
%16 = load i32, i32* @stdout
%17 = load i8*, i8** %11
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* %17)
br label %19
19: ; preds = %8, %15, %4
%20 = phi i32 [ -1, %4 ], [ 0, %15 ], [ 0, %8 ]
ret i32 %20
}