#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_CreateNode(char *, int, int);
int PDQ_CreateOpen(char *, double);
int /*<<< orphan*/ PDQ_Init(char *);
int /*<<< orphan*/ PDQ_Report();
int /*<<< orphan*/ PDQ_SetComment(char *);
int /*<<< orphan*/ PDQ_SetDemand(char *, char *, double);
int /*<<< orphan*/ PDQ_SetTUnit(char *);
int /*<<< orphan*/ PDQ_SetWUnit(char *);
int /*<<< orphan*/ PDQ_Solve(int);
int main() {
  int nodes;
  int streams;
  double arrivRate = 0.75;
  double service_time = 1.0;
  PDQ_Init("OpenCenter");
  PDQ_SetComment("This is just a simple M/M/1 queue.");
  nodes = PDQ_CreateNode("server", 4, 8);
  streams = PDQ_CreateOpen("work", arrivRate);
  PDQ_SetDemand("server", "work", service_time);
  PDQ_SetWUnit("Customers");
  PDQ_SetTUnit("Seconds");
  PDQ_Solve(16);
  PDQ_Report();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xe68(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe53(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe57(%rip),%rdi
call   10a0 <PDQ_Init@plt>
lea    0xe56(%rip),%rdi
call   1080 <PDQ_SetComment@plt>
lea    0xe6d(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe56(%rip),%rdi
call   1070 <PDQ_CreateOpen@plt>
mov    %eax,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe3b(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   1050 <PDQ_SetDemand@plt>
lea    0xe34(%rip),%rdi
call   10b0 <PDQ_SetWUnit@plt>
lea    0xe32(%rip),%rdi
call   1090 <PDQ_SetTUnit@plt>
mov    $0x10,%edi
call   1060 <PDQ_Solve@plt>
mov    $0x0,%al
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe75(%rip),%rdi
call   10a0 <PDQ_Init@plt>
lea    0xe74(%rip),%rdi
call   1080 <PDQ_SetComment@plt>
lea    0xe8b(%rip),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe79(%rip),%rbx
movsd  0xe2c(%rip),%xmm0
mov    %rbx,%rdi
call   1070 <PDQ_CreateOpen@plt>
movsd  0xe24(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <PDQ_SetDemand@plt>
lea    0xe54(%rip),%rdi
call   10b0 <PDQ_SetWUnit@plt>
lea    0xe52(%rip),%rdi
call   1090 <PDQ_SetTUnit@plt>
mov    $0x10,%edi
call   1060 <PDQ_Solve@plt>
xor    %eax,%eax
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"OpenCenter\00"
@.str.1 = [35 x i8] c"This is just a simple M/M/1 queue.\00"
@.str.2 = [7 x i8] c"server\00"
@.str.3 = [5 x i8] c"work\00"
@.str.4 = [10 x i8] c"Customers\00"
@.str.5 = [8 x i8] c"Seconds\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double 7.500000e-01, double* %3
store double 1.000000e+00, double* %4
%5 = call i32 @PDQ_Init(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @PDQ_SetComment(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
store i32 %7, i32* %1
%8 = load double, double* %3
%9 = call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %8)
store i32 %9, i32* %2
%10 = load double, double* %4
%11 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %10)
%12 = call i32 @PDQ_SetWUnit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @PDQ_SetTUnit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @PDQ_Solve(i32 16)
%15 = call i32 (...) @PDQ_Report()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"OpenCenter\00"
@.str.1 = [35 x i8] c"This is just a simple M/M/1 queue.\00"
@.str.2 = [7 x i8] c"server\00"
@.str.3 = [5 x i8] c"work\00"
@.str.4 = [10 x i8] c"Customers\00"
@.str.5 = [8 x i8] c"Seconds\00"
define i32 @main() {
%1 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PDQ_SetComment(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
%4 = tail call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double 7.500000e-01)
%5 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double 1.000000e+00)
%6 = tail call i32 @PDQ_SetWUnit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @PDQ_SetTUnit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @PDQ_Solve(i32 16)
%9 = tail call i32 (...) @PDQ_Report()
ret i32 0
}