#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_SetDemand(char *, char *, double);
int /*<<< orphan*/ PDQ_Solve(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(void) {
  int nodes;
  int streams;
  double arate = 75.0;
  double stime = 0.20;
  int servers = 30;
  char name[10];
  name[0] = '\0';
  sprintf(name, "mServer%d", servers);
  PDQ_Init("MSQ Test");
  nodes = PDQ_CreateNode(name, servers, 6);
  streams = PDQ_CreateOpen("Work", arate);
  PDQ_SetDemand(name, "Work", stime);
  PDQ_Solve(16);
  PDQ_Report();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1e,-0x1c(%rbp)
movb   $0x0,-0x26(%rbp)
lea    -0x26(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe65(%rip),%rsi
call   1080 <sprintf@plt>
lea    0xe63(%rip),%rdi
call   1090 <PDQ_Init@plt>
lea    -0x26(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe47(%rip),%rdi
call   1070 <PDQ_CreateOpen@plt>
mov    %eax,-0x8(%rbp)
lea    -0x26(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xe2f(%rip),%rsi
call   1050 <PDQ_SetDemand@plt>
mov    $0x10,%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   %r14
push   %rbx
sub    $0x18,%rsp
movb   $0x0,0xe(%rsp)
lea    0xe8d(%rip),%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0x1e,%edx
call   1080 <sprintf@plt>
lea    0xe7e(%rip),%rdi
call   1090 <PDQ_Init@plt>
mov    %r14,%rdi
mov    $0x1e,%esi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe69(%rip),%rbx
movsd  0xe3e(%rip),%xmm0
mov    %rbx,%rdi
call   1070 <PDQ_CreateOpen@plt>
movsd  0xe36(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <PDQ_SetDemand@plt>
mov    $0x10,%edi
call   1060 <PDQ_Solve@plt>
xor    %eax,%eax
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"mServer%d\00"
@.str.1 = [9 x i8] c"MSQ Test\00"
@.str.2 = [5 x i8] c"Work\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca [10 x i8]
store double 7.500000e+01, double* %3
store double 2.000000e-01, double* %4
store i32 30, i32* %5
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
store i8 0, i8* %7
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* %5
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @PDQ_Init(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %5
%14 = call i32 @PDQ_CreateNode(i8* %12, i32 %13, i32 6)
store i32 %14, i32* %1
%15 = load double, double* %3
%16 = call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %15)
store i32 %16, i32* %2
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%18 = load double, double* %4
%19 = call i32 @PDQ_SetDemand(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = call i32 @PDQ_Solve(i32 16)
%21 = call i32 (...) @PDQ_Report()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"mServer%d\00"
@.str.1 = [9 x i8] c"MSQ Test\00"
@.str.2 = [5 x i8] c"Work\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 30)
%4 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @PDQ_CreateNode(i8* %2, i32 30, i32 6)
%6 = call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double 7.500000e+01)
%7 = call i32 @PDQ_SetDemand(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double 2.000000e-01)
%8 = call i32 @PDQ_Solve(i32 16)
%9 = call i32 (...) @PDQ_Report()
ret i32 0
}