#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*/ printf(char *);
int /*<<< orphan*/ programHeader1();
int /*<<< orphan*/ programHeader2(int);
int /*<<< orphan*/ programHeader3(int, char *);
int /*<<< orphan*/ programHeader4(int, char *, char *);
int main() {
  char Student[] = "Jeff Jeffries";
  int Assignment = 1;
  printf("Simple Function Example 2\n\n");
  programHeader1();
  programHeader2(3);
  programHeader2(6);
  programHeader3(2, "Fred Jones fred@fred.com");
  programHeader3(Assignment, "Sammy Sams sams@sams.com");
  programHeader4(5, "Don Retzlaff", "donr@unt.edu");
  programHeader4(10, Student, "");
  programHeader4(Assignment, Student, "jeff@jeffry.com");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xe98(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <programHeader1@plt>
mov    $0x3,%edi
call   1040 <programHeader2@plt>
mov    $0x6,%edi
call   1040 <programHeader2@plt>
mov    $0x2,%edi
lea    0xe72(%rip),%rsi
call   1070 <programHeader3@plt>
mov    -0x18(%rbp),%edi
lea    0xe7c(%rip),%rsi
call   1070 <programHeader3@plt>
mov    $0x5,%edi
lea    0xe84(%rip),%rsi
lea    0xe8a(%rip),%rdx
call   1030 <programHeader4@plt>
lea    -0x12(%rbp),%rsi
mov    $0xa,%edi
lea    0xe35(%rip),%rdx
call   1030 <programHeader4@plt>
mov    -0x18(%rbp),%edi
lea    -0x12(%rbp),%rsi
lea    0xe6f(%rip),%rdx
call   1030 <programHeader4@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x73656972666665,%rax
mov    %rax,0x6(%rsp)
movabs $0x66654a206666654a,%rax
4a 65 66
mov    %rax,(%rsp)
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <programHeader1@plt>
mov    $0x3,%edi
call   1050 <programHeader2@plt>
mov    $0x6,%edi
call   1050 <programHeader2@plt>
lea    0xe6e(%rip),%rsi
mov    $0x2,%edi
call   1070 <programHeader3@plt>
lea    0xe76(%rip),%rsi
mov    $0x1,%edi
call   1070 <programHeader3@plt>
lea    0xe7e(%rip),%rsi
lea    0xe84(%rip),%rdx
mov    $0x5,%edi
call   1040 <programHeader4@plt>
lea    0xeaa(%rip),%rdx
mov    %rsp,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <programHeader4@plt>
lea    0xe69(%rip),%rdx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <programHeader4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.Student = [14 x i8] c"Jeff Jeffries\00"
@.str = [28 x i8] c"Simple Function Example 2\0A\0A\00"
@.str.1 = [25 x i8] c"Fred Jones fred@fred.com\00"
@.str.2 = [25 x i8] c"Sammy Sams sams@sams.com\00"
@.str.3 = [13 x i8] c"Don Retzlaff\00"
@.str.4 = [13 x i8] c"donr@unt.edu\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [16 x i8] c"jeff@jeffry.com\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
store i32 1, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @programHeader1()
%7 = call i32 @programHeader2(i32 3)
%8 = call i32 @programHeader2(i32 6)
%9 = call i32 @programHeader3(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = call i32 @programHeader3(i32 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @programHeader4(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%14 = call i32 @programHeader4(i32 10, i8* %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%17 = call i32 @programHeader4(i32 %15, i8* %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.Student = [14 x i8] c"Jeff Jeffries\00"
@.str.1 = [25 x i8] c"Fred Jones fred@fred.com\00"
@.str.2 = [25 x i8] c"Sammy Sams sams@sams.com\00"
@.str.3 = [13 x i8] c"Don Retzlaff\00"
@.str.4 = [13 x i8] c"donr@unt.edu\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [16 x i8] c"jeff@jeffry.com\00"
@str = [27 x i8] c"Simple Function Example 2\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @programHeader1()
%5 = tail call i32 @programHeader2(i32 3)
%6 = tail call i32 @programHeader2(i32 6)
%7 = tail call i32 @programHeader3(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @programHeader3(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @programHeader4(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @programHeader4(i32 10, i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @programHeader4(i32 1, i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}