#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_SetVisits(char *, char *, double, double);
int /*<<< orphan*/ PDQ_Solve(int);
int main() {
  int noNodes;
  int noStreams;
  double rx_prob = 0.30;
  double inter_arriv_rate = 0.5;
  double service_time = 0.75;
  double mean_visits = 1.0 / (1.0 - rx_prob);
  PDQ_Init("Open Feedback");
  noNodes = PDQ_CreateNode("channel", 4, 8);
  noStreams = PDQ_CreateOpen("message", inter_arriv_rate);
  PDQ_SetVisits("channel", "message", mean_visits, service_time);
  PDQ_Solve(16);
  PDQ_Report();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe62(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xe55(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe65(%rip),%rdi
call   1080 <PDQ_Init@plt>
lea    0xe67(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
mov    %eax,-0x8(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe51(%rip),%rdi
call   1060 <PDQ_CreateOpen@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe30(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1070 <PDQ_SetVisits@plt>
mov    $0x10,%edi
call   1050 <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
push   %rax
lea    0xead(%rip),%rdi
call   1080 <PDQ_Init@plt>
lea    0xeaf(%rip),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <PDQ_CreateNode@plt>
lea    0xe9e(%rip),%rbx
movsd  0xe68(%rip),%xmm0
mov    %rbx,%rdi
call   1060 <PDQ_CreateOpen@plt>
movsd  0xe60(%rip),%xmm0
movsd  0xe60(%rip),%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <PDQ_SetVisits@plt>
mov    $0x10,%edi
call   1050 <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 = [14 x i8] c"Open Feedback\00"
@.str.1 = [8 x i8] c"channel\00"
@.str.2 = [8 x i8] c"message\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 3.000000e-01, double* %4
store double 5.000000e-01, double* %5
store double 7.500000e-01, double* %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = fdiv double 1.000000e+00, %9
store double %10, double* %7
%11 = call i32 @PDQ_Init(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 8)
store i32 %12, i32* %2
%13 = load double, double* %5
%14 = call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %13)
store i32 %14, i32* %3
%15 = load double, double* %7
%16 = load double, double* %6
%17 = call i32 @PDQ_SetVisits(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %15, double %16)
%18 = call i32 @PDQ_Solve(i32 16)
%19 = call i32 (...) @PDQ_Report()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Open Feedback\00"
@.str.1 = [8 x i8] c"channel\00"
@.str.2 = [8 x i8] c"message\00"
define i32 @main() {
%1 = tail call i32 @PDQ_Init(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PDQ_CreateNode(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 8)
%3 = tail call i32 @PDQ_CreateOpen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double 5.000000e-01)
%4 = tail call i32 @PDQ_SetVisits(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double 0x3FF6DB6DB6DB6DB7, double 7.500000e-01)
%5 = tail call i32 @PDQ_Solve(i32 16)
%6 = tail call i32 (...) @PDQ_Report()
ret i32 0
}