#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);
float march_singular_raw2(float a, float b, float c, float d, float x,
                          float y) {
  float alpha = 0.5;
  if (x <= alpha * (1 - y)) {
    float ix = a;
    if (alpha > 0) {
      float y0 = (x + alpha * y) / alpha;
      assert(y0 >= 0);
      assert(y0 <= 1);
      ix = b * y0 + a * (1 - y0);
    }
    return ix;
  }
  float gamma = 0.5;
  if (y >= 1 - (1 - gamma) * x) {
    float y0 = y + (1 - gamma) * (x - 1);
    assert(y0 >= 0);
    assert(y0 <= 1);
    float ix = d * y0 + c * (1 - y0);
    return ix;
  }
  return 0;
}


x86 assembly (clang, -O0):
<march_singular_raw2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
movss  %xmm5,-0x1c(%rbp)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
movss  0xeab(%rip),%xmm2
subss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
ucomiss %xmm1,%xmm0
jb     1210 <march_singular_raw2+0x100>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1201 <march_singular_raw2+0xf1>
movss  -0x18(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
divss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  0xe3d(%rip),%xmm0
ucomiss -0x28(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x28(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
movss  0xe15(%rip),%xmm3
subss  -0x28(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ff <march_singular_raw2+0x1ef>
movss  0xdec(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xdd6(%rip),%xmm1
subss  -0x2c(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xdb3(%rip),%xmm2
addss  %xmm2,%xmm1
ucomiss %xmm1,%xmm0
jb     12f7 <march_singular_raw2+0x1e7>
movss  -0x1c(%rbp),%xmm1
movss  0xd99(%rip),%xmm0
subss  -0x2c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  0xd87(%rip),%xmm3
subss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  0xd56(%rip),%xmm0
ucomiss -0x30(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
movss  0xd2e(%rip),%xmm3
subss  -0x30(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ff <march_singular_raw2+0x1ef>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<march_singular_raw2>:
sub    $0x18,%rsp
movss  0xee4(%rip),%xmm7
subss  %xmm5,%xmm7
mulss  0xedc(%rip),%xmm7
ucomiss %xmm4,%xmm7
jae    114e <march_singular_raw2+0x3e>
movss  0xed3(%rip),%xmm0
mulss  %xmm4,%xmm0
addss  0xebf(%rip),%xmm0
ucomiss %xmm0,%xmm5
jae    117e <march_singular_raw2+0x6e>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret
mulss  0xeae(%rip),%xmm5
addss  %xmm4,%xmm5
addss  %xmm5,%xmm5
movss  %xmm5,0xc(%rsp)
xorps  %xmm2,%xmm2
xor    %edi,%edi
ucomiss %xmm2,%xmm5
setae  %dil
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
jmp    11b0 <march_singular_raw2+0xa0>
addss  0xe86(%rip),%xmm4
mulss  0xe76(%rip),%xmm4
addss  %xmm5,%xmm4
movss  %xmm4,0xc(%rsp)
xorps  %xmm0,%xmm0
xor    %edi,%edi
ucomiss %xmm0,%xmm4
setae  %dil
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x10(%rsp)
call   1030 <assert@plt>
xor    %edi,%edi
movss  0xe41(%rip),%xmm0
ucomiss 0xc(%rsp),%xmm0
setae  %dil
call   1030 <assert@plt>
movss  0xe2b(%rip),%xmm0
movss  0xc(%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  0x10(%rsp),%xmm0
movaps %xmm0,%xmm1
movss  0x14(%rsp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @march_singular_raw2(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store float 5.000000e-01, float* %14
%20 = load float, float* %12
%21 = load float, float* %14
%22 = load float, float* %13
%23 = fsub float 1.000000e+00, %22
%24 = fmul float %21, %23
%25 = fcmp ole float %20, %24
br i1 %25, label %26, label %54
26: ; preds = %6
%27 = load float, float* %8
store float %27, float* %15
%28 = load float, float* %14
%29 = fcmp ogt float %28, 0.000000e+00
br i1 %29, label %30, label %52
30: ; preds = %26
%31 = load float, float* %12
%32 = load float, float* %14
%33 = load float, float* %13
%34 = call float @llvm.fmuladd.f32(float %32, float %33, float %31)
%35 = load float, float* %14
%36 = fdiv float %34, %35
store float %36, float* %16
%37 = load float, float* %16
%38 = fcmp oge float %37, 0.000000e+00
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load float, float* %16
%42 = fcmp ole float %41, 1.000000e+00
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load float, float* %9
%46 = load float, float* %16
%47 = load float, float* %8
%48 = load float, float* %16
%49 = fsub float 1.000000e+00, %48
%50 = fmul float %47, %49
%51 = call float @llvm.fmuladd.f32(float %45, float %46, float %50)
store float %51, float* %15
br label %52
52: ; preds = %30, %26
%53 = load float, float* %15
store float %53, float* %7
br label %86
54: ; preds = %6
store float 5.000000e-01, float* %17
%55 = load float, float* %13
%56 = load float, float* %17
%57 = fsub float 1.000000e+00, %56
%58 = load float, float* %12
%59 = fneg float %57
%60 = call float @llvm.fmuladd.f32(float %59, float %58, float 1.000000e+00)
%61 = fcmp oge float %55, %60
br i1 %61, label %62, label %85
62: ; preds = %54
%63 = load float, float* %13
%64 = load float, float* %17
%65 = fsub float 1.000000e+00, %64
%66 = load float, float* %12
%67 = fsub float %66, 1.000000e+00
%68 = call float @llvm.fmuladd.f32(float %65, float %67, float %63)
store float %68, float* %18
%69 = load float, float* %18
%70 = fcmp oge float %69, 0.000000e+00
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load float, float* %18
%74 = fcmp ole float %73, 1.000000e+00
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = load float, float* %11
%78 = load float, float* %18
%79 = load float, float* %10
%80 = load float, float* %18
%81 = fsub float 1.000000e+00, %80
%82 = fmul float %79, %81
%83 = call float @llvm.fmuladd.f32(float %77, float %78, float %82)
store float %83, float* %19
%84 = load float, float* %19
store float %84, float* %7
br label %86
85: ; preds = %54
store float 0.000000e+00, float* %7
br label %86
86: ; preds = %85, %62, %52
%87 = load float, float* %7
ret float %87
}

LLVM IR (-O2):
define float @march_singular_raw2(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fsub float 1.000000e+00, %5
%8 = fmul float %7, 5.000000e-01
%9 = fcmp ult float %8, %4
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = tail call float @llvm.fmuladd.f32(float %5, float 5.000000e-01, float %4)
%12 = fmul float %11, 2.000000e+00
%13 = fcmp oge float %12, 0.000000e+00
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = fcmp ole float %12, 1.000000e+00
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = fsub float 1.000000e+00, %12
%20 = fmul float %19, %0
%21 = tail call float @llvm.fmuladd.f32(float %1, float %12, float %20)
br label %37
22: ; preds = %6
%23 = tail call float @llvm.fmuladd.f32(float %4, float -5.000000e-01, float 1.000000e+00)
%24 = fcmp ugt float %23, %5
br i1 %24, label %37, label %25
25: ; preds = %22
%26 = fadd float %4, -1.000000e+00
%27 = tail call float @llvm.fmuladd.f32(float %26, float 5.000000e-01, float %5)
%28 = fcmp oge float %27, 0.000000e+00
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = fcmp ole float %27, 1.000000e+00
%32 = zext i1 %31 to i32
%33 = tail call i32 @assert(i32 %32)
%34 = fsub float 1.000000e+00, %27
%35 = fmul float %34, %2
%36 = tail call float @llvm.fmuladd.f32(float %3, float %27, float %35)
br label %37
37: ; preds = %25, %22, %10
%38 = phi float [ %21, %10 ], [ %36, %25 ], [ 0.000000e+00, %22 ]
ret float %38
}