#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 PDQ_CreateClosed(char *, int, double, double);
int PDQ_CreateNode(char *, int, int);
int /*<<< orphan*/ PDQ_Init(char *);
int /*<<< orphan*/ PDQ_Report();
int /*<<< orphan*/ PDQ_SetDemand(char *, char *, double);
int /*<<< orphan*/ PDQ_Solve(int);
int main() {
  int noNodes;
  int noStreams;
  char *noPri = "CPU Scheduler - No Pri";
  char *priOn = "CPU Scheduler - Pri On";
  float Ucpu_prod;
  float GetProdU();
  if (1) {
    Ucpu_prod = GetProdU();
  }
  PDQ_Init(1 ? priOn : noPri);
  noStreams = PDQ_CreateClosed("Production", 11, 20.0, 20.0);
  noStreams = PDQ_CreateClosed("Developmnt", 11, 15.0, 15.0);
  noNodes = PDQ_CreateNode("CPU", 4, 8);
  if (1) {
    noNodes = PDQ_CreateNode("shadCPU", 4, 8);
  }
  noNodes = PDQ_CreateNode("DK1", 4, 8);
  noNodes = PDQ_CreateNode("DK2", 4, 8);
  PDQ_SetDemand("CPU", "Production", 0.30);
  if (1) {
    PDQ_SetDemand("shadCPU", "Developmnt", 1.00 / (1 - Ucpu_prod));
  } else {
    PDQ_SetDemand("CPU", "Developmnt", 1.00);
  }
  PDQ_SetDemand("DK1", "Production", 0.08);
  PDQ_SetDemand("DK1", "Developmnt", 0.05);
  PDQ_SetDemand("DK2", "Production", 0.10);
  PDQ_SetDemand("DK2", "Developmnt", 0.06);
  PDQ_Solve(15);
  PDQ_Report();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <GetProdU@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <PDQ_Init@plt>
lea    0xec1(%rip),%rdi
mov    $0xb,%esi
movsd  0xe7a(%rip),%xmm1
movaps %xmm1,%xmm0
call   1070 <PDQ_CreateClosed@plt>
mov    %eax,-0xc(%rbp)
lea    0xead(%rip),%rdi
mov    $0xb,%esi
movsd  0xe53(%rip),%xmm1
movaps %xmm1,%xmm0
call   1070 <PDQ_CreateClosed@plt>
mov    %eax,-0xc(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x8(%rbp)
lea    0xe80(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x8(%rbp)
lea    0xe6f(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x8(%rbp)
lea    0xe5a(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x8(%rbp)
lea    0xe39(%rip),%rdi
lea    0xe18(%rip),%rsi
movsd  0xdc6(%rip),%xmm0
call   1050 <PDQ_SetDemand@plt>
movss  0xdd1(%rip),%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xda0(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xdfd(%rip),%rdi
lea    0xdeb(%rip),%rsi
call   1050 <PDQ_SetDemand@plt>
lea    0xdf2(%rip),%rdi
lea    0xdcd(%rip),%rsi
movsd  0xd6b(%rip),%xmm0
call   1050 <PDQ_SetDemand@plt>
lea    0xdd7(%rip),%rdi
lea    0xdbd(%rip),%rsi
movsd  0xd48(%rip),%xmm0
call   1050 <PDQ_SetDemand@plt>
lea    0xdc0(%rip),%rdi
lea    0xd97(%rip),%rsi
movsd  0xd25(%rip),%xmm0
call   1050 <PDQ_SetDemand@plt>
lea    0xda5(%rip),%rdi
lea    0xd87(%rip),%rsi
movsd  0xd02(%rip),%xmm0
call   1050 <PDQ_SetDemand@plt>
mov    $0xf,%edi
call   1060 <PDQ_Solve@plt>
mov    $0x0,%al
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1080 <GetProdU@plt>
movss  %xmm0,0x4(%rsp)
lea    0xeb5(%rip),%rdi
call   1090 <PDQ_Init@plt>
lea    0xec0(%rip),%r14
movsd  0xe5d(%rip),%xmm0
mov    %r14,%rdi
mov    $0xb,%esi
movaps %xmm0,%xmm1
call   1070 <PDQ_CreateClosed@plt>
lea    0xeac(%rip),%r15
movsd  0xe46(%rip),%xmm0
mov    %r15,%rdi
mov    $0xb,%esi
movaps %xmm0,%xmm1
call   1070 <PDQ_CreateClosed@plt>
lea    0xe9c(%rip),%rbp
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe7f(%rip),%r13
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe6e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe59(%rip),%r12
mov    %r12,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
movsd  0xdd2(%rip),%xmm0
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <PDQ_SetDemand@plt>
movss  0xdef(%rip),%xmm0
subss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdb2(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  0xda3(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  0xd98(%rip),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  0xd8d(%rip),%xmm0
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  0xd82(%rip),%xmm0
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <PDQ_SetDemand@plt>
mov    $0xf,%edi
call   1060 <PDQ_Solve@plt>
xor    %eax,%eax
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"CPU Scheduler - No Pri\00"
@.str.1 = [23 x i8] c"CPU Scheduler - Pri On\00"
@.str.2 = [11 x i8] c"Production\00"
@.str.3 = [11 x i8] c"Developmnt\00"
@.str.4 = [4 x i8] c"CPU\00"
@.str.5 = [8 x i8] c"shadCPU\00"
@.str.6 = [4 x i8] c"DK1\00"
@.str.7 = [4 x i8] c"DK2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
store i32 0, i32* %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %5
%7 = call float (...) @GetProdU()
store float %7, float* %6
%8 = load i8*, i8** %5
%9 = call i32 @PDQ_Init(i8* %8)
%10 = call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 11, double 2.000000e+01, double 2.000000e+01)
store i32 %10, i32* %3
%11 = call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 11, double 1.500000e+01, double 1.500000e+01)
store i32 %11, i32* %3
%12 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 4, i32 8)
store i32 %12, i32* %2
%13 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 8)
store i32 %13, i32* %2
%14 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 8)
store i32 %14, i32* %2
%15 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 4, i32 8)
store i32 %15, i32* %2
%16 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 3.000000e-01)
%17 = load float, float* %6
%18 = fsub float 1.000000e+00, %17
%19 = fpext float %18 to double
%20 = fdiv double 1.000000e+00, %19
%21 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %20)
%22 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 8.000000e-02)
%23 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double 5.000000e-02)
%24 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 1.000000e-01)
%25 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double 6.000000e-02)
%26 = call i32 @PDQ_Solve(i32 15)
%27 = call i32 (...) @PDQ_Report()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"CPU Scheduler - Pri On\00"
@.str.2 = [11 x i8] c"Production\00"
@.str.3 = [11 x i8] c"Developmnt\00"
@.str.4 = [4 x i8] c"CPU\00"
@.str.5 = [8 x i8] c"shadCPU\00"
@.str.6 = [4 x i8] c"DK1\00"
@.str.7 = [4 x i8] c"DK2\00"
define i32 @main() {
%1 = tail call float (...) @GetProdU()
%2 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 11, double 2.000000e+01, double 2.000000e+01)
%4 = tail call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 11, double 1.500000e+01, double 1.500000e+01)
%5 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 4, i32 8)
%6 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 8)
%7 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 8)
%8 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 4, i32 8)
%9 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 3.000000e-01)
%10 = fsub float 1.000000e+00, %1
%11 = fpext float %10 to double
%12 = fdiv double 1.000000e+00, %11
%13 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %12)
%14 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 8.000000e-02)
%15 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double 5.000000e-02)
%16 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 1.000000e-01)
%17 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double 6.000000e-02)
%18 = tail call i32 @PDQ_Solve(i32 15)
%19 = tail call i32 (...) @PDQ_Report()
ret i32 0
}