#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 */
scalar_t__ f2();
double f1(double y, double z, double w, double j, double k) {
  double b, c, d, e, f, g;
  if (f2())
    b = 1 / y, c = z / y, d = j / y;
  else
    b = 3 / y, c = w / y, d = k / y;
  e = b / y;
  f = c / y;
  g = d / y;
  return e + f + g;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    $0x0,%al
call   1030 <f2@plt>
cmp    $0x0,%rax
je     1177 <f1+0x67>
movsd  0xebe(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11a7 <f1+0x97>
movsd  0xe81(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x48,%rsp
movaps %xmm4,0x20(%rsp)
movaps %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
movaps %xmm0,0x30(%rsp)
xor    %eax,%eax
call   1030 <f2@plt>
movsd  0x8(%rsp),%xmm2
xor    %ecx,%ecx
test   %rax,%rax
sete   %al
je     114a <f1+0x3a>
movsd  (%rsp),%xmm2
mov    %al,%cl
movd   %ecx,%xmm0
pshufd $0x44,%xmm0,%xmm0
psllq  $0x3f,%xmm0
psrad  $0x1f,%xmm0
movapd 0x20(%rsp),%xmm3
shufpd $0x2,0xe92(%rip),%xmm3
movapd 0x10(%rsp),%xmm4
shufpd $0x2,0xe93(%rip),%xmm4
pshufd $0xf5,%xmm0,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm4,%xmm1
orpd   %xmm3,%xmm1
movapd 0x30(%rsp),%xmm0
divsd  %xmm0,%xmm2
divsd  %xmm0,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @f1(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%17 = call i64 (...) @f2()
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %5
%20 = load double, double* %6
%21 = fdiv double 1.000000e+00, %20
store double %21, double* %11
%22 = load double, double* %7
%23 = load double, double* %6
%24 = fdiv double %22, %23
store double %24, double* %12
%25 = load double, double* %9
%26 = load double, double* %6
%27 = fdiv double %25, %26
store double %27, double* %13
br label %37
28: ; preds = %5
%29 = load double, double* %6
%30 = fdiv double 3.000000e+00, %29
store double %30, double* %11
%31 = load double, double* %8
%32 = load double, double* %6
%33 = fdiv double %31, %32
store double %33, double* %12
%34 = load double, double* %10
%35 = load double, double* %6
%36 = fdiv double %34, %35
store double %36, double* %13
br label %37
37: ; preds = %28, %19
%38 = load double, double* %11
%39 = load double, double* %6
%40 = fdiv double %38, %39
store double %40, double* %14
%41 = load double, double* %12
%42 = load double, double* %6
%43 = fdiv double %41, %42
store double %43, double* %15
%44 = load double, double* %13
%45 = load double, double* %6
%46 = fdiv double %44, %45
store double %46, double* %16
%47 = load double, double* %14
%48 = load double, double* %15
%49 = fadd double %47, %48
%50 = load double, double* %16
%51 = fadd double %49, %50
ret double %51
}

LLVM IR (-O2):
define double @f1(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call i64 (...) @f2()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, double %2, double %1
%9 = insertelement <2 x i1> poison, i1 %7, i64 0
%10 = shufflevector <2 x i1> %9, <2 x i1> poison, <2 x i32> zeroinitializer
%11 = insertelement <2 x double> <double poison, double 3.000000e+00>, double %4, i64 0
%12 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %3, i64 0
%13 = select <2 x i1> %10, <2 x double> %11, <2 x double> %12
%14 = fdiv double %8, %0
%15 = insertelement <2 x double> poison, double %0, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = fdiv <2 x double> %13, %16
%18 = fdiv double %14, %0
%19 = fdiv <2 x double> %17, %16
%20 = extractelement <2 x double> %19, i64 1
%21 = fadd double %20, %18
%22 = extractelement <2 x double> %19, i64 0
%23 = fadd double %22, %21
ret double %23
}