#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*/ assert(int);
double elCollV1(int, int, int, int);
double elCollV2(int, int, int, int);
int posAfter(int, int /*<<< orphan*/, int, int);
int posAfterNoMax(int, int /*<<< orphan*/, int);
int main() {
  assert(posAfter(10, 0, 1, 15) == 10);
  assert(posAfter(16, 0, 1, 15) == 1);
  assert(posAfter(10, 0, -1, 15) == 5);
  assert(posAfterNoMax(10, 0, -1) == -10);
  assert(elCollV1(4, -6, 3, 5) == -8.5);
  assert(elCollV2(4, -6, 3, 5) == 1.5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <posAfterNoMax@plt>
cmp    $0xfffffff6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x4,%edi
mov    $0xfffffffa,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1070 <elCollV1@plt>
movsd  0xdf5(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x4,%edi
mov    $0xfffffffa,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1050 <elCollV2@plt>
movsd  0xdb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1060 <assert@plt>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf,%ecx
call   1040 <posAfter@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1060 <assert@plt>
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <posAfterNoMax@plt>
xor    %edi,%edi
cmp    $0xfffffff6,%eax
sete   %dil
call   1060 <assert@plt>
mov    $0x4,%edi
mov    $0xfffffffa,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1070 <elCollV1@plt>
cmpeqsd 0xe02(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1060 <assert@plt>
mov    $0x4,%edi
mov    $0xfffffffa,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1050 <elCollV2@plt>
cmpeqsd 0xddb(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1060 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @posAfter(i32 10, i32 0, i32 1, i32 15)
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @posAfter(i32 16, i32 0, i32 1, i32 15)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @posAfter(i32 10, i32 0, i32 -1, i32 15)
%11 = icmp eq i32 %10, 5
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @posAfterNoMax(i32 10, i32 0, i32 -1)
%15 = icmp eq i32 %14, -10
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call double @elCollV1(i32 4, i32 -6, i32 3, i32 5)
%19 = fcmp oeq double %18, -8.500000e+00
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call double @elCollV2(i32 4, i32 -6, i32 3, i32 5)
%23 = fcmp oeq double %22, 1.500000e+00
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @posAfter(i32 10, i32 0, i32 1, i32 15)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @posAfter(i32 16, i32 0, i32 1, i32 15)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @posAfter(i32 10, i32 0, i32 -1, i32 15)
%10 = icmp eq i32 %9, 5
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @posAfterNoMax(i32 10, i32 0, i32 -1)
%14 = icmp eq i32 %13, -10
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call double @elCollV1(i32 4, i32 -6, i32 3, i32 5)
%18 = fcmp oeq double %17, -8.500000e+00
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call double @elCollV2(i32 4, i32 -6, i32 3, i32 5)
%22 = fcmp oeq double %21, 1.500000e+00
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
ret i32 0
}