#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");
    printString(result + 4);
  }
}


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    11c7 <main+0x77>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getStart@plt>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
add    $0x4,%rdi
call   1050 <printString@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1060 <getString3@plt>
mov    0x8(%rsp),%rdi
call   1050 <printString@plt>
mov    0x8(%rsp),%rdi
call   1070 <findMatch@plt>
test   %rax,%rax
je     11a2 <main+0x52>
mov    %rax,%rbx
mov    0x8(%rsp),%rdi
mov    %rax,%rsi
call   1040 <getStart@plt>
lea    0xe71(%rip),%rdi
call   1030 <puts@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1050 <printString@plt>
jmp    11ae <main+0x5e>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
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 %26
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))
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i64 4
%25 = call i32 @printString(i8* %24)
br label %26
26: ; preds = %18, %16
%27 = load i32, i32* %3
ret i32 %27
}

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 %11, label %13
11: ; preds = %2
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
br label %19
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 @getStart(i8* %14, i8* %9)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%17 = getelementptr inbounds i8, i8* %9, i64 4
%18 = call i32 @printString(i8* %17)
br label %19
19: ; preds = %13, %11
ret i32 0
}