#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 */
double sqrt(double);
int wcspih_vsource(double *zsource, double vsource) {
  double beta, c = 299792458.0;
  if ((*zsource == 987654321.0e99)) {
    beta = vsource / c;
    *zsource = (1.0 + beta) / sqrt(1.0 - beta * beta) - 1.0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<wcspih_vsource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xedf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xec2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11c5 <wcspih_vsource+0xb5>
jp     11c5 <wcspih_vsource+0xb5>
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeab(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe57(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcspih_vsource>:
push   %rbx
sub    $0x10,%rsp
movsd  (%rdi),%xmm1
ucomisd 0xedf(%rip),%xmm1
jne    1180 <wcspih_vsource+0x70>
jp     1180 <wcspih_vsource+0x70>
mov    %rdi,%rbx
divsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     115b <wcspih_vsource+0x4b>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1170 <wcspih_vsource+0x60>
movapd %xmm1,%xmm0
movsd  %xmm2,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
divsd  %xmm0,%xmm2
addsd  0xe9c(%rip),%xmm2
movsd  %xmm2,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wcspih_vsource(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double %1, double* %4
store double 0x41B1DE784A000000, double* %6
%7 = load double*, double** %3
%8 = load double, double* %7
%9 = fcmp oeq double %8, 0x565AEA1D6E56E1C8
br i1 %9, label %10, label %24
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fdiv double %11, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = fadd double 1.000000e+00, %14
%16 = load double, double* %5
%17 = load double, double* %5
%18 = fneg double %16
%19 = call double @llvm.fmuladd.f64(double %18, double %17, double 1.000000e+00)
%20 = call double @sqrt(double %19)
%21 = fdiv double %15, %20
%22 = fsub double %21, 1.000000e+00
%23 = load double*, double** %3
store double %22, double* %23
br label %24
24: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @wcspih_vsource(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp oeq double %3, 0x565AEA1D6E56E1C8
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = fdiv double %1, 0x41B1DE784A000000
%7 = fadd double %6, 1.000000e+00
%8 = fneg double %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double 1.000000e+00)
%10 = tail call double @sqrt(double %9)
%11 = fdiv double %7, %10
%12 = fadd double %11, -1.000000e+00
store double %12, double* %0
br label %13
13: ; preds = %5, %2
ret i32 0
}