#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*/ getQuotes(char *);
char *newQuote();
int /*<<< orphan*/ parseQuotes();
int /*<<< orphan*/ puts(char const *);
int /*<<< orphan*/ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  srand(time(0));
  rand();
  getQuotes("THEMETER");
  getQuotes("QUOTES");
  getQuotes("/usr/lib/Wisdom/THEMETER");
  getQuotes("/usr/lib/Wisdom/QUOTES");
  parseQuotes();
  const char *q = newQuote();
  if (!q) {
    puts("nothing to report - no wisdom today!\n");
    return 1;
  }
  puts(q);
  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)
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
lea    0xe6e(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe7b(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe46(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe53(%rip),%rdi
call   1030 <getQuotes@plt>
mov    $0x0,%al
call   1050 <parseQuotes@plt>
mov    $0x0,%al
call   1060 <newQuote@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1200 <main+0x90>
lea    0xe41(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1210 <main+0xa0>
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
lea    0xe81(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe8e(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe59(%rip),%rdi
call   1030 <getQuotes@plt>
lea    0xe66(%rip),%rdi
call   1030 <getQuotes@plt>
xor    %eax,%eax
call   1050 <parseQuotes@plt>
xor    %eax,%eax
call   1060 <newQuote@plt>
test   %rax,%rax
je     11d5 <main+0x65>
mov    %rax,%rdi
call   1040 <puts@plt>
jmp    11e6 <main+0x76>
lea    0xe54(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"THEMETER\00"
@.str.1 = [7 x i8] c"QUOTES\00"
@.str.2 = [25 x i8] c"/usr/lib/Wisdom/THEMETER\00"
@.str.3 = [23 x i8] c"/usr/lib/Wisdom/QUOTES\00"
@.str.4 = [38 x i8] c"nothing to report - no wisdom today!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @time(i32 0)
%8 = call i32 @srand(i32 %7)
%9 = call i32 (...) @rand()
%10 = call i32 @getQuotes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @getQuotes(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @getQuotes(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @getQuotes(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (...) @parseQuotes()
%15 = call i8* (...) @newQuote()
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %23
20: ; preds = %2
%21 = load i8*, i8** %6
%22 = call i32 @puts(i8* %21)
store i32 0, i32* %3
br label %23
23: ; preds = %20, %18
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [9 x i8] c"THEMETER\00"
@.str.1 = [7 x i8] c"QUOTES\00"
@.str.2 = [25 x i8] c"/usr/lib/Wisdom/THEMETER\00"
@.str.3 = [23 x i8] c"/usr/lib/Wisdom/QUOTES\00"
@.str.4 = [38 x i8] c"nothing to report - no wisdom today!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @getQuotes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @getQuotes(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @getQuotes(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @getQuotes(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 (...) @parseQuotes()
%11 = tail call i8* (...) @newQuote()
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = tail call i32 @puts(i8* %11)
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ 0, %15 ], [ 1, %13 ]
ret i32 %18
}