#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);
float PDQ_GetUtilization(char *, char *, int);
int /*<<< orphan*/ PDQ_Init(char *);
int /*<<< orphan*/ PDQ_SetDemand(char *, char *, double);
int /*<<< orphan*/ PDQ_Solve(int);
float GetProdU(void) {
  int noNodes;
  int noStreams;
  PDQ_Init("");
  noStreams = PDQ_CreateClosed("Production", 11, 20.0, 20.0);
  noNodes = PDQ_CreateNode("CPU", 4, 8);
  noNodes = PDQ_CreateNode("DK1", 4, 8);
  noNodes = PDQ_CreateNode("DK2", 4, 8);
  PDQ_SetDemand("CPU", "Production", 0.30);
  PDQ_SetDemand("DK1", "Production", 0.08);
  PDQ_SetDemand("DK2", "Production", 0.10);
  PDQ_Solve(15);
  return (PDQ_GetUtilization("CPU", "Production", 11));
}


x86 assembly (clang, -O0):
<GetProdU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec3(%rip),%rdi
call   1080 <PDQ_Init@plt>
lea    0xea5(%rip),%rdi
mov    $0xb,%esi
movsd  0xe90(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <PDQ_CreateClosed@plt>
mov    %eax,-0x8(%rbp)
lea    0xe91(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
lea    0xe7c(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
lea    0xe67(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
lea    0xe46(%rip),%rdi
lea    0xe34(%rip),%rsi
movsd  0xe1c(%rip),%xmm0
call   1040 <PDQ_SetDemand@plt>
lea    0xe2f(%rip),%rdi
lea    0xe19(%rip),%rsi
movsd  0xdf9(%rip),%xmm0
call   1040 <PDQ_SetDemand@plt>
lea    0xe18(%rip),%rdi
lea    0xdfe(%rip),%rsi
movsd  0xdd6(%rip),%xmm0
call   1040 <PDQ_SetDemand@plt>
mov    $0xf,%edi
call   1050 <PDQ_Solve@plt>
lea    0xdeb(%rip),%rdi
lea    0xdd9(%rip),%rsi
mov    $0xb,%edx
call   1070 <PDQ_GetUtilization@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetProdU>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec3(%rip),%rdi
call   1080 <PDQ_Init@plt>
lea    0xea5(%rip),%rbx
movsd  0xe7d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xb,%esi
movaps %xmm0,%xmm1
call   1060 <PDQ_CreateClosed@plt>
lea    0xe91(%rip),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
lea    0xe7c(%rip),%r15
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
lea    0xe67(%rip),%r12
mov    %r12,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <PDQ_CreateNode@plt>
movsd  0xe22(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <PDQ_SetDemand@plt>
movsd  0xe17(%rip),%xmm0
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <PDQ_SetDemand@plt>
movsd  0xe0c(%rip),%xmm0
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <PDQ_SetDemand@plt>
mov    $0xf,%edi
call   1050 <PDQ_Solve@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xb,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1070 <PDQ_GetUtilization@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c"Production\00"
@.str.2 = [4 x i8] c"CPU\00"
@.str.3 = [4 x i8] c"DK1\00"
@.str.4 = [4 x i8] c"DK2\00"
define float @GetProdU() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @PDQ_Init(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 11, double 2.000000e+01, double 2.000000e+01)
store i32 %4, i32* %2
%5 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
store i32 %5, i32* %1
%6 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 8)
store i32 %6, i32* %1
%7 = 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 %7, i32* %1
%8 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 3.000000e-01)
%9 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 8.000000e-02)
%10 = 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.1, i64 0, i64 0), double 1.000000e-01)
%11 = call i32 @PDQ_Solve(i32 15)
%12 = call float @PDQ_GetUtilization(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 11)
ret float %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c"Production\00"
@.str.2 = [4 x i8] c"CPU\00"
@.str.3 = [4 x i8] c"DK1\00"
@.str.4 = [4 x i8] c"DK2\00"
define float @GetProdU() {
%1 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PDQ_CreateClosed(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 11, double 2.000000e+01, double 2.000000e+01)
%3 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
%4 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 8)
%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_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 3.000000e-01)
%7 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 8.000000e-02)
%8 = 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.1, i64 0, i64 0), double 1.000000e-01)
%9 = tail call i32 @PDQ_Solve(i32 15)
%10 = tail call float @PDQ_GetUtilization(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 11)
ret float %10
}