#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__ exp(float);
scalar_t__ log(scalar_t__);
float max_star4(float delta1, float delta2) {
  if (delta1 > delta2) {
    return ((float)(delta1 + log(1 + exp(delta2 - delta1))));
  } else {
    return ((float)(delta2 + log(1 + exp(delta1 - delta2))));
  }
}


x86 assembly (clang, -O0):
<max_star4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    117e <max_star4+0x5e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <log@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b6 <max_star4+0x96>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <log@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_star4>:
push   %rax
movaps %xmm0,%xmm4
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movaps %xmm1,%xmm3
subss  %xmm0,%xmm3
movaps %xmm1,%xmm0
cmpltss %xmm4,%xmm0
andps  %xmm0,%xmm3
andnps %xmm2,%xmm0
orps   %xmm3,%xmm0
maxss  %xmm1,%xmm4
movss  %xmm4,0x4(%rsp)
call   1030 <exp@plt>
lea    0x1(%rax),%rdi
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @max_star4(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* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = call i64 @exp(float %13)
%15 = add nsw i64 1, %14
%16 = call i64 @log(i64 %15)
%17 = sitofp i64 %16 to float
%18 = fadd float %10, %17
store float %18, float* %3
br label %29
19: ; preds = %2
%20 = load float, float* %5
%21 = load float, float* %4
%22 = load float, float* %5
%23 = fsub float %21, %22
%24 = call i64 @exp(float %23)
%25 = add nsw i64 1, %24
%26 = call i64 @log(i64 %25)
%27 = sitofp i64 %26 to float
%28 = fadd float %20, %27
store float %28, float* %3
br label %29
29: ; preds = %19, %9
%30 = load float, float* %3
ret float %30
}

LLVM IR (-O2):
define float @max_star4(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = fsub float %0, %1
%5 = fsub float %1, %0
%6 = select i1 %3, float %5, float %4
%7 = select i1 %3, float %0, float %1
%8 = tail call i64 @exp(float %6)
%9 = add nsw i64 %8, 1
%10 = tail call i64 @log(i64 %9)
%11 = sitofp i64 %10 to float
%12 = fadd float %7, %11
ret float %12
}