#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 /*<<< orphan*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void ReportDummySelection(const char *const varnames_[], const double *Pvar,
                          double t, int m, int n, int printevent) {
  int i, j, first = 1;
  m = n - m;
  for (i = 0; i < n; ++i) {
    int selected = 0;
    for (j = 0; j < m; ++j)
      selected = selected || Pvar[j * n + i];
    if (selected) {
      if (printevent & ((1 << 13) + (1 << 14))) {
        char str[1000];
        if (first)
          sprintf(str, "Selected at %g:\n %s.stateSelect=StateSelect.always", t,
                  varnames_[i]);
        else
          sprintf(str, ", %s.stateSelect=StateSelect.always", varnames_[i]);
        DymosimMessage(str);
        first = 0;
      }
      if (printevent & ((1 << 1) + (1 << 2))) {
        0;
      }
    }
  }
}


x86 assembly (clang, -O0):
<ReportDummySelection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1288 <ReportDummySelection+0x168>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d8 <ReportDummySelection+0xb8>
mov    $0x1,%al
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0x421(%rbp)
jne    11bc <ReportDummySelection+0x9c>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x421(%rbp)
mov    -0x421(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1173 <ReportDummySelection+0x53>
cmpl   $0x0,-0x34(%rbp)
je     1275 <ReportDummySelection+0x155>
mov    -0x24(%rbp),%eax
and    $0x6000,%eax
cmp    $0x0,%eax
je     125c <ReportDummySelection+0x13c>
cmpl   $0x0,-0x30(%rbp)
je     1228 <ReportDummySelection+0x108>
lea    -0x420(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xde4(%rip),%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
jmp    1249 <ReportDummySelection+0x129>
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <DymosimMessage@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
and    $0x6,%eax
cmp    $0x0,%eax
je     1270 <ReportDummySelection+0x150>
jmp    1270 <ReportDummySelection+0x150>
jmp    1275 <ReportDummySelection+0x155>
jmp    127a <ReportDummySelection+0x15a>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1159 <ReportDummySelection+0x39>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReportDummySelection>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %r8d,0xc(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rsi,0x10(%rsp)
mov    %rdi,0x28(%rsp)
test   %ecx,%ecx
jle    128a <ReportDummySelection+0x16a>
mov    %ecx,%ebp
mov    %ecx,%r13d
sub    %edx,%ebp
mov    %ebp,%r9d
mov    %r9d,%r14d
and    $0xfffffffe,%r14d
mov    %r13,%r12
shl    $0x4,%r12
mov    $0x1,%r8d
andl   $0x6000,0xc(%rsp)
lea    0x30(%rsp),%rdi
xorpd  %xmm1,%xmm1
mov    0x10(%rsp),%rbx
xor    %r15d,%r15d
mov    %r9,0x20(%rsp)
jmp    11c6 <ReportDummySelection+0xa6>
lea    0xea0(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0x30(%rsp),%rdi
call   1030 <DymosimMessage@plt>
lea    0x30(%rsp),%rdi
xor    %r8d,%r8d
mov    0x20(%rsp),%r9
xorpd  %xmm1,%xmm1
add    $0x1,%r15
add    $0x8,%rbx
cmp    %r13,%r15
je     128a <ReportDummySelection+0x16a>
test   %ebp,%ebp
jle    11b5 <ReportDummySelection+0x95>
xor    %ecx,%ecx
cmp    $0x1,%ebp
jne    1240 <ReportDummySelection+0x120>
xor    %eax,%eax
test   $0x1,%r9b
je     1200 <ReportDummySelection+0xe0>
mov    $0x1,%dl
test   %eax,%eax
jne    1200 <ReportDummySelection+0xe0>
imul   %r13,%rcx
add    %r15,%rcx
mov    0x10(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rdx
and    $0x1,%edx
nopl   (%rax)
test   $0x1,%dl
je     11b5 <ReportDummySelection+0x95>
cmpl   $0x0,0xc(%rsp)
je     11b5 <ReportDummySelection+0x95>
mov    0x28(%rsp),%rcx
mov    (%rcx,%r15,8),%rdx
test   %r8d,%r8d
je     118c <ReportDummySelection+0x6c>
lea    0xddb(%rip),%rsi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <sprintf@plt>
jmp    119a <ReportDummySelection+0x7a>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rsi
xor    %eax,%eax
jmp    1263 <ReportDummySelection+0x143>
nopw   0x0(%rax,%rax,1)
movzbl %dl,%eax
add    $0x2,%rcx
add    %r12,%rsi
cmp    %rcx,%r14
je     11d3 <ReportDummySelection+0xb3>
mov    $0x1,%dl
test   %eax,%eax
jne    1250 <ReportDummySelection+0x130>
movsd  (%rsi),%xmm0
ucomisd %xmm1,%xmm0
jne    1250 <ReportDummySelection+0x130>
jp     1250 <ReportDummySelection+0x130>
movsd  (%rsi,%r13,8),%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rdx
and    $0x1,%edx
jmp    1250 <ReportDummySelection+0x130>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Selected at %g:\0A %s.stateSelect=StateSelect.always\00"
@.str.1 = [36 x i8] c", %s.stateSelect=StateSelect.always\00"
define void @ReportDummySelection(i8** %0, double* %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8**
%8 = alloca double*
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [1000 x i8]
store i8** %0, i8*** %7
store double* %1, double** %8
store double %2, double* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 1, i32* %15
%18 = load i32, i32* %11
%19 = load i32, i32* %10
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %10
store i32 0, i32* %13
br label %21
21: ; preds = %87, %6
%22 = load i32, i32* %13
%23 = load i32, i32* %11
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %90
25: ; preds = %21
store i32 0, i32* %16
store i32 0, i32* %14
br label %26
26: ; preds = %47, %25
%27 = load i32, i32* %14
%28 = load i32, i32* %10
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %50
30: ; preds = %26
%31 = load i32, i32* %16
%32 = icmp ne i32 %31, 0
br i1 %32, label %44, label %33
33: ; preds = %30
%34 = load double*, double** %8
%35 = load i32, i32* %14
%36 = load i32, i32* %11
%37 = mul nsw i32 %35, %36
%38 = load i32, i32* %13
%39 = add nsw i32 %37, %38
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %34, i64 %40
%42 = load double, double* %41
%43 = fcmp une double %42, 0.000000e+00
br label %44
44: ; preds = %33, %30
%45 = phi i1 [ true, %30 ], [ %43, %33 ]
%46 = zext i1 %45 to i32
store i32 %46, i32* %16
br label %47
47: ; preds = %44
%48 = load i32, i32* %14
%49 = add nsw i32 %48, 1
store i32 %49, i32* %14
br label %26
50: ; preds = %26
%51 = load i32, i32* %16
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %86
53: ; preds = %50
%54 = load i32, i32* %12
%55 = and i32 %54, 24576
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %80
57: ; preds = %53
%58 = load i32, i32* %15
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %69
60: ; preds = %57
%61 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%62 = load double, double* %9
%63 = load i8**, i8*** %7
%64 = load i32, i32* %13
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 (i8*, i8*, ...) @sprintf(i8* %61, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %62, i8* %67)
br label %77
69: ; preds = %57
%70 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%71 = load i8**, i8*** %7
%72 = load i32, i32* %13
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
%76 = call i32 (i8*, i8*, ...) @sprintf(i8* %70, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %69, %60
%78 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%79 = call i32 @DymosimMessage(i8* %78)
store i32 0, i32* %15
br label %80
80: ; preds = %77, %53
%81 = load i32, i32* %12
%82 = and i32 %81, 6
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %80
br label %85
85: ; preds = %84, %80
br label %86
86: ; preds = %85, %50
br label %87
87: ; preds = %86
%88 = load i32, i32* %13
%89 = add nsw i32 %88, 1
store i32 %89, i32* %13
br label %21
90: ; preds = %21
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Selected at %g:\0A %s.stateSelect=StateSelect.always\00"
@.str.1 = [36 x i8] c", %s.stateSelect=StateSelect.always\00"
define void @ReportDummySelection(i8** nocapture %0, double* nocapture %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [1000 x i8]
%8 = sub i32 %4, %3
%9 = icmp sgt i32 %4, 0
br i1 %9, label %10, label %79
10: ; preds = %6
%11 = icmp sgt i32 %8, 0
%12 = and i32 %5, 24576
%13 = icmp ne i32 %12, 0
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%15 = zext i32 %4 to i64
%16 = zext i32 %4 to i64
%17 = zext i32 %8 to i64
%18 = and i64 %17, 1
%19 = icmp eq i32 %8, 1
%20 = and i64 %17, 4294967294
%21 = icmp eq i64 %18, 0
br label %22
22: ; preds = %10, %75
%23 = phi i64 [ 0, %10 ], [ %77, %75 ]
%24 = phi i32 [ 1, %10 ], [ %76, %75 ]
br i1 %11, label %25, label %75
25: ; preds = %22
br i1 %19, label %50, label %26
26: ; preds = %25, %44
%27 = phi i64 [ %47, %44 ], [ 0, %25 ]
%28 = phi i32 [ %46, %44 ], [ 0, %25 ]
%29 = phi i64 [ %48, %44 ], [ 0, %25 ]
%30 = icmp eq i32 %28, 0
br i1 %30, label %31, label %44
31: ; preds = %26
%32 = mul nsw i64 %27, %15
%33 = add nuw nsw i64 %32, %23
%34 = getelementptr inbounds double, double* %1, i64 %33
%35 = load double, double* %34
%36 = fcmp une double %35, 0.000000e+00
br i1 %36, label %44, label %37
37: ; preds = %31
%38 = or i64 %27, 1
%39 = mul nsw i64 %38, %15
%40 = add nuw nsw i64 %39, %23
%41 = getelementptr inbounds double, double* %1, i64 %40
%42 = load double, double* %41
%43 = fcmp une double %42, 0.000000e+00
br label %44
44: ; preds = %26, %37, %31
%45 = phi i1 [ true, %31 ], [ %43, %37 ], [ true, %26 ]
%46 = zext i1 %45 to i32
%47 = add nuw nsw i64 %27, 2
%48 = add i64 %29, 2
%49 = icmp eq i64 %48, %20
br i1 %49, label %50, label %26
50: ; preds = %44, %25
%51 = phi i1 [ undef, %25 ], [ %45, %44 ]
%52 = phi i64 [ 0, %25 ], [ %47, %44 ]
%53 = phi i32 [ 0, %25 ], [ %46, %44 ]
br i1 %21, label %62, label %54
54: ; preds = %50
%55 = icmp eq i32 %53, 0
br i1 %55, label %56, label %62
56: ; preds = %54
%57 = mul nsw i64 %52, %15
%58 = add nuw nsw i64 %57, %23
%59 = getelementptr inbounds double, double* %1, i64 %58
%60 = load double, double* %59
%61 = fcmp une double %60, 0.000000e+00
br label %62
62: ; preds = %54, %56, %50
%63 = phi i1 [ %51, %50 ], [ true, %54 ], [ %61, %56 ]
%64 = and i1 %63, %13
br i1 %64, label %65, label %75
65: ; preds = %62
%66 = icmp eq i32 %24, 0
%67 = getelementptr inbounds i8*, i8** %0, i64 %23
%68 = load i8*, i8** %67
br i1 %66, label %71, label %69
69: ; preds = %65
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %2, i8* %68)
br label %73
71: ; preds = %65
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %68)
br label %73
73: ; preds = %71, %69
%74 = call i32 @DymosimMessage(i8* %14)
br label %75
75: ; preds = %22, %73, %62
%76 = phi i32 [ %24, %62 ], [ 0, %73 ], [ %24, %22 ]
%77 = add nuw nsw i64 %23, 1
%78 = icmp eq i64 %77, %16
br i1 %78, label %79, label %22
79: ; preds = %75, %6
ret void
}