#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 *, ...);
void finishPrint(int scheduleType, int quantumInteger, int totalTime,
                 int turnaroundTime, int cpuUtilization) {
  if (scheduleType == 0) {
    printf("Round Robin (quantum = %d time units):\n\n", quantumInteger);
  } else {
    printf("FCFS:\n\n");
  }
  printf("Total Time required is %d time units\nAverage Turnaround Time is %d "
         "time units\n CPU Utilization is %d%%\n",
         totalTime, turnaroundTime, cpuUtilization);
}


x86 assembly (clang, -O0):
<finishPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <finishPrint+0x38>
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1156 <finishPrint+0x46>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finishPrint>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edx,%ebx
test   %edi,%edi
je     113d <finishPrint+0x1d>
lea    0xf5b(%rip),%rdi
call   1030 <puts@plt>
jmp    114b <finishPrint+0x2b>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Round Robin (quantum = %d time units):\0A\0A\00"
@.str.1 = [8 x i8] c"FCFS:\0A\0A\00"
@.str.2 = [104 x i8] c"Total Time required is %d time units\0AAverage Turnaround Time is %d time units\0A CPU Utilization is %d%%\0A\00"
define void @finishPrint(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Round Robin (quantum = %d time units):\0A\0A\00"
@.str.2 = [104 x i8] c"Total Time required is %d time units\0AAverage Turnaround Time is %d time units\0A CPU Utilization is %d%%\0A\00"
@str = [7 x i8] c"FCFS:\0A\00"
define void @finishPrint(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %11
9: ; preds = %5
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
ret void
}