#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 fSign(float);
float fDiv(float f1, float f2) {
  if (f2 == 0.0f) {
    if (f1 == 0.0f) {
      return 0.0f;
    } else {
      return (float)(100000000 * fSign(f1));
    }
  } else {
    if (f1 == 0.0f) {
      return 0.0f;
    } else {
      if ((f1 + f2) == f1) {
        return (float)100000000 * (float)fSign(f1) * (float)fSign(f2);
      } else {
        return f1 / f2;
      }
    }
  }
}


x86 assembly (clang, -O0):
<fDiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    117b <fDiv+0x6b>
jp     117b <fDiv+0x6b>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    115d <fDiv+0x4d>
jp     115d <fDiv+0x4d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1208 <fDiv+0xf8>
movss  -0x8(%rbp),%xmm0
call   1030 <fSign@plt>
imul   $0x5f5e100,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1208 <fDiv+0xf8>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119f <fDiv+0x8f>
jp     119f <fDiv+0x8f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1208 <fDiv+0xf8>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    11f9 <fDiv+0xe9>
jp     11f9 <fDiv+0xe9>
movss  -0x8(%rbp),%xmm0
call   1030 <fSign@plt>
cvtsi2ss %eax,%xmm1
movss  0xe31(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fSign@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1208 <fDiv+0xf8>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fDiv>:
push   %rax
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    1139 <fDiv+0x29>
jp     1139 <fDiv+0x29>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    1125 <fDiv+0x15>
jnp    118d <fDiv+0x7d>
call   1030 <fSign@plt>
imul   $0x5f5e100,%eax,%eax
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
jmp    118d <fDiv+0x7d>
ucomiss %xmm2,%xmm0
jne    1140 <fDiv+0x30>
jnp    118d <fDiv+0x7d>
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
ucomiss %xmm0,%xmm2
jne    1186 <fDiv+0x76>
jp     1186 <fDiv+0x76>
movss  %xmm1,0x4(%rsp)
call   1030 <fSign@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xe98(%rip),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <fSign@plt>
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
mulss  (%rsp),%xmm2
jmp    118d <fDiv+0x7d>
divss  %xmm1,%xmm0
movaps %xmm0,%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fDiv(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store float 0.000000e+00, float* %3
br label %40
12: ; preds = %8
%13 = load float, float* %4
%14 = call i32 @fSign(float %13)
%15 = mul nsw i32 100000000, %14
%16 = sitofp i32 %15 to float
store float %16, float* %3
br label %40
17: ; preds = %2
%18 = load float, float* %4
%19 = fcmp oeq float %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store float 0.000000e+00, float* %3
br label %40
21: ; preds = %17
%22 = load float, float* %4
%23 = load float, float* %5
%24 = fadd float %22, %23
%25 = load float, float* %4
%26 = fcmp oeq float %24, %25
br i1 %26, label %27, label %36
27: ; preds = %21
%28 = load float, float* %4
%29 = call i32 @fSign(float %28)
%30 = sitofp i32 %29 to float
%31 = fmul float 1.000000e+08, %30
%32 = load float, float* %5
%33 = call i32 @fSign(float %32)
%34 = sitofp i32 %33 to float
%35 = fmul float %31, %34
store float %35, float* %3
br label %40
36: ; preds = %21
%37 = load float, float* %4
%38 = load float, float* %5
%39 = fdiv float %37, %38
store float %39, float* %3
br label %40
40: ; preds = %36, %27, %20, %12, %11
%41 = load float, float* %3
ret float %41
}

LLVM IR (-O2):
define float @fDiv(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
%4 = fcmp oeq float %0, 0.000000e+00
br i1 %3, label %5, label %10
5: ; preds = %2
br i1 %4, label %23, label %6
6: ; preds = %5
%7 = tail call i32 @fSign(float %0)
%8 = mul nsw i32 %7, 100000000
%9 = sitofp i32 %8 to float
br label %23
10: ; preds = %2
br i1 %4, label %23, label %11
11: ; preds = %10
%12 = fadd float %0, %1
%13 = fcmp oeq float %12, %0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = tail call i32 @fSign(float %0)
%16 = sitofp i32 %15 to float
%17 = fmul float %16, 1.000000e+08
%18 = tail call i32 @fSign(float %1)
%19 = sitofp i32 %18 to float
%20 = fmul float %17, %19
br label %23
21: ; preds = %11
%22 = fdiv float %0, %1
br label %23
23: ; preds = %10, %5, %21, %14, %6
%24 = phi float [ %9, %6 ], [ %20, %14 ], [ %22, %21 ], [ 0.000000e+00, %5 ], [ 0.000000e+00, %10 ]
ret float %24
}