#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__ log(double);
float mrcGetComplexScale();
void mrcComplexSminSmax(float inMin, float inMax, float *outMin,
                        float *outMax) {
  float minSign = 1.;
  float kscale = mrcGetComplexScale();
  if (inMin < 0.) {
    minSign = -1.;
    inMin = -inMin;
  }
  *outMin = minSign * (float)(log((double)(1.0 + kscale * inMin)));
  *outMax = (float)log((double)(1.0 + kscale * inMax));
}


x86 assembly (clang, -O0):
<mrcComplexSminSmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <mrcGetComplexScale@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    118d <mrcComplexSminSmax+0x6d>
movss  0xe93(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe5b(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movss  -0x24(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe26(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
cvtsi2ss %rax,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrcComplexSminSmax>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm1,0xc(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <mrcGetComplexScale@plt>
movaps 0x10(%rsp),%xmm3
movaps %xmm3,%xmm2
xorps  0xeb2(%rip),%xmm2
xorps  %xmm4,%xmm4
movaps %xmm3,%xmm1
cmpltss %xmm4,%xmm1
andps  %xmm1,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
movss  %xmm0,0x8(%rsp)
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  0xe95(%rip),%xmm0
call   1040 <log@plt>
xorpd  %xmm0,%xmm0
ucomiss 0x10(%rsp),%xmm0
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jbe    119a <mrcComplexSminSmax+0x7a>
xorps  0xe66(%rip),%xmm0
movss  %xmm0,(%rbx)
movss  0x8(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe5a(%rip),%xmm0
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mrcComplexSminSmax(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
store float 1.000000e+00, float* %9
%11 = call float (...) @mrcGetComplexScale()
store float %11, float* %10
%12 = load float, float* %5
%13 = fpext float %12 to double
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %4
store float -1.000000e+00, float* %9
%16 = load float, float* %5
%17 = fneg float %16
store float %17, float* %5
br label %18
18: ; preds = %15, %4
%19 = load float, float* %9
%20 = load float, float* %10
%21 = load float, float* %5
%22 = fmul float %20, %21
%23 = fpext float %22 to double
%24 = fadd double 1.000000e+00, %23
%25 = call i64 @log(double %24)
%26 = sitofp i64 %25 to float
%27 = fmul float %19, %26
%28 = load float*, float** %7
store float %27, float* %28
%29 = load float, float* %10
%30 = load float, float* %6
%31 = fmul float %29, %30
%32 = fpext float %31 to double
%33 = fadd double 1.000000e+00, %32
%34 = call i64 @log(double %33)
%35 = sitofp i64 %34 to float
%36 = load float*, float** %8
store float %35, float* %36
ret void
}

LLVM IR (-O2):
define void @mrcComplexSminSmax(float %0, float %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = tail call float (...) @mrcGetComplexScale()
%6 = fcmp olt float %0, 0.000000e+00
%7 = fneg float %0
%8 = select i1 %6, float %7, float %0
%9 = fmul float %8, %5
%10 = fpext float %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = tail call i64 @log(double %11)
%13 = sitofp i64 %12 to float
%14 = fneg float %13
%15 = select i1 %6, float %14, float %13
store float %15, float* %2
%16 = fmul float %5, %1
%17 = fpext float %16 to double
%18 = fadd double %17, 1.000000e+00
%19 = tail call i64 @log(double %18)
%20 = sitofp i64 %19 to float
store float %20, float* %3
ret void
}