#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_SetTUnit(char *);
int /*<<< orphan*/ PDQ_SetWUnit(char *);
int /*<<< orphan*/ PDQ_Solve(int);
scalar_t__ ceil(double);
int main(void) {
  int nodes;
  int streams;
  double arrivalRate = 40.0 / 60;
  double browseTime = 45.0;
  double buyingTime = 4.0;
  int cashiers = 3;
  PDQ_Init("Big Book Store Model");
  streams = PDQ_CreateOpen("Customers", arrivalRate);
  PDQ_SetWUnit("Cust");
  PDQ_SetTUnit("Min");
  nodes =
      PDQ_CreateNode("Browsing", (int)ceil(arrivalRate * browseTime) * 100, 6);
  nodes = PDQ_CreateNode("Checkout", cashiers, 6);
  PDQ_SetDemand("Browsing", "Customers", browseTime);
  PDQ_SetDemand("Checkout", "Customers", buyingTime);
  PDQ_Solve(16);
  PDQ_Report();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe5b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe46(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x3,-0x24(%rbp)
lea    0xe4b(%rip),%rdi
call   10a0 <PDQ_Init@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe4f(%rip),%rdi
call   1080 <PDQ_CreateOpen@plt>
mov    %eax,-0x8(%rbp)
lea    0xe4a(%rip),%rdi
call   10b0 <PDQ_SetWUnit@plt>
lea    0xe43(%rip),%rdi
call   1090 <PDQ_SetTUnit@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1060 <ceil@plt>
imul   $0x64,%eax,%esi
lea    0xe29(%rip),%rdi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe1b(%rip),%rdi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x4(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xdf9(%rip),%rdi
lea    0xddf(%rip),%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xdea(%rip),%rdi
lea    0xdc7(%rip),%rsi
call   1050 <PDQ_SetDemand@plt>
mov    $0x10,%edi
call   1070 <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   %r15
push   %r14
push   %rbx
lea    0xe84(%rip),%rdi
call   10a0 <PDQ_Init@plt>
lea    0xe8d(%rip),%r14
movsd  0xe50(%rip),%xmm0
mov    %r14,%rdi
call   1080 <PDQ_CreateOpen@plt>
lea    0xe80(%rip),%rdi
call   10b0 <PDQ_SetWUnit@plt>
lea    0xe79(%rip),%rdi
call   1090 <PDQ_SetTUnit@plt>
movsd  0xe30(%rip),%xmm0
call   1060 <ceil@plt>
imul   $0x64,%eax,%esi
lea    0xe61(%rip),%r15
mov    %r15,%rdi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe56(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1040 <PDQ_CreateNode@plt>
movsd  0xdfb(%rip),%xmm0
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <PDQ_SetDemand@plt>
movsd  0xdf0(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <PDQ_SetDemand@plt>
mov    $0x10,%edi
call   1070 <PDQ_Solve@plt>
xor    %eax,%eax
call   1030 <PDQ_Report@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Big Book Store Model\00"
@.str.1 = [10 x i8] c"Customers\00"
@.str.2 = [5 x i8] c"Cust\00"
@.str.3 = [4 x i8] c"Min\00"
@.str.4 = [9 x i8] c"Browsing\00"
@.str.5 = [9 x i8] c"Checkout\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double 0x3FE5555555555555, double* %3
store double 4.500000e+01, double* %4
store double 4.000000e+00, double* %5
store i32 3, i32* %6
%7 = call i32 @PDQ_Init(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load double, double* %3
%9 = call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %8)
store i32 %9, i32* %2
%10 = call i32 @PDQ_SetWUnit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @PDQ_SetTUnit(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call i64 @ceil(double %14)
%16 = trunc i64 %15 to i32
%17 = mul nsw i32 %16, 100
%18 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 6)
store i32 %18, i32* %1
%19 = load i32, i32* %6
%20 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %19, i32 6)
store i32 %20, i32* %1
%21 = load double, double* %4
%22 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %21)
%23 = load double, double* %5
%24 = call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = call i32 @PDQ_Solve(i32 16)
%26 = call i32 (...) @PDQ_Report()
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Big Book Store Model\00"
@.str.1 = [10 x i8] c"Customers\00"
@.str.2 = [5 x i8] c"Cust\00"
@.str.3 = [4 x i8] c"Min\00"
@.str.4 = [9 x i8] c"Browsing\00"
@.str.5 = [9 x i8] c"Checkout\00"
define i32 @main() {
%1 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 0x3FE5555555555555)
%3 = tail call i32 @PDQ_SetWUnit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @PDQ_SetTUnit(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i64 @ceil(double 3.000000e+01)
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 100
%8 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %7, i32 6)
%9 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 3, i32 6)
%10 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 4.500000e+01)
%11 = tail call i32 @PDQ_SetDemand(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 4.000000e+00)
%12 = tail call i32 @PDQ_Solve(i32 16)
%13 = tail call i32 (...) @PDQ_Report()
ret i32 0
}