#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*/ init_line();
int /*<<< orphan*/ init_param();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printfinal();
int /*<<< orphan*/ update();
int main(int argc, char *argv[]) {
  printf("Starting serial version of wave equation...\n");
  init_param();
  printf("Initializing points on the line...\n");
  init_line();
  printf("Updating all points for all time steps...\n");
  update();
  printf("Printing final results...\n");
  printfinal();
  printf("\nDone.\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <init_param@plt>
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <init_line@plt>
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <update@plt>
lea    0xedd(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <printfinal@plt>
lea    0xee5(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <init_param@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <init_line@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <update@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <printfinal@plt>
lea    0xeef(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Starting serial version of wave equation...\0A\00"
@.str.1 = [36 x i8] c"Initializing points on the line...\0A\00"
@.str.2 = [43 x i8] c"Updating all points for all time steps...\0A\00"
@.str.3 = [27 x i8] c"Printing final results...\0A\00"
@.str.4 = [9 x i8] c"\0ADone.\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @init_param()
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @init_line()
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @update()
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (...) @printfinal()
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"Starting serial version of wave equation...\00"
@str.5 = [35 x i8] c"Initializing points on the line...\00"
@str.6 = [42 x i8] c"Updating all points for all time steps...\00"
@str.7 = [26 x i8] c"Printing final results...\00"
@str.8 = [8 x i8] c"\0ADone.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @init_param()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 (...) @init_line()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%8 = tail call i32 (...) @update()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%10 = tail call i32 (...) @printfinal()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}