#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*/ initialize();
int /*<<< orphan*/ kfork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tswitch();
main() {
  printf("\nWelcome to the CS460 Multitasking System New User!\n");
  printf("initializing...");
  initialize();
  printf("forking...");
  kfork();
  printf("switching...");
  tswitch();
  printf("\nGoodbye User!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <initialize@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <kfork@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <tswitch@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <initialize@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <kfork@plt>
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <tswitch@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"\0AWelcome to the CS460 Multitasking System New User!\0A\00"
@.str.1 = [16 x i8] c"initializing...\00"
@.str.2 = [11 x i8] c"forking...\00"
@.str.3 = [13 x i8] c"switching...\00"
@.str.4 = [16 x i8] c"\0AGoodbye User!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @initialize()
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @kfork()
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (...) @tswitch()
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"initializing...\00"
@.str.2 = [11 x i8] c"forking...\00"
@.str.3 = [13 x i8] c"switching...\00"
@str = [52 x i8] c"\0AWelcome to the CS460 Multitasking System New User!\00"
@str.5 = [15 x i8] c"\0AGoodbye User!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @initialize()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @kfork()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 (...) @tswitch()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}