#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 */
char *findMatch(char *);
int /*<<< orphan*/ getStart(char *, char *);
int /*<<< orphan*/ getString3(char **);
int /*<<< orphan*/ printString(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *line;
  char *result;
  char *c;
  getString3(&line);
  printString(line);
  result = findMatch(line);
  if (result == NULL) {
    printf("Too bad no match\n");
  } else {
    getStart(line, result);
    printf("Yippee a match is found\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1060 <getString3@plt>
mov    -0x18(%rbp),%rdi
call   1050 <printString@plt>
mov    -0x18(%rbp),%rdi
call   1070 <findMatch@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11a1 <main+0x51>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getStart@plt>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1060 <getString3@plt>
mov    (%rsp),%rdi
call   1050 <printString@plt>
mov    (%rsp),%rdi
call   1070 <findMatch@plt>
test   %rax,%rax
je     1185 <main+0x35>
mov    (%rsp),%rdi
mov    %rax,%rsi
call   1040 <getStart@plt>
lea    0xe7d(%rip),%rdi
jmp    118c <main+0x3c>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Too bad no match\0A\00"
@.str.1 = [25 x i8] c"Yippee a match is found\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @getString3(i8** %6)
%10 = load i8*, i8** %6
%11 = call i32 @printString(i8* %10)
%12 = load i8*, i8** %6
%13 = call i8* @findMatch(i8* %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %23
18: ; preds = %2
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = call i32 @getStart(i8* %19, i8* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %18, %16
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@str = [24 x i8] c"Yippee a match is found\00"
@str.2 = [17 x i8] c"Too bad no match\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @getString3(i8** %3)
%6 = load i8*, i8** %3
%7 = call i32 @printString(i8* %6)
%8 = load i8*, i8** %3
%9 = call i8* @findMatch(i8* %8)
%10 = icmp eq i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @getStart(i8* %12, i8* %9)
br label %14
14: ; preds = %2, %11
%15 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), %11 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0), %2 ]
%16 = call i32 @puts(i8* dereferenceable(1) %15)
ret i32 0
}