#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 /*<<< orphan*/ printf(char *);
void Jacobitrans(double *Ralpha, double *ralpha, double ma, double mb,
                 double mc, double *Rbeta, double *rbeta, int s) {
  double Xi, lambda;
  Xi = mc / (mb + mc);
  lambda = ma / (ma + mb);
  if (s == 1) {
    *Rbeta = -Xi * (*Ralpha) + (lambda * Xi - 1) * (*ralpha);
    *rbeta = (*Ralpha) - lambda * (*ralpha);
  } else if (s == -1) {
    *Ralpha = -lambda * (*Rbeta) + (1 - lambda * Xi) * (*rbeta);
    *ralpha = -(*Rbeta) - Xi * (*rbeta);
  } else {
    printf("invalid option of transformation! \n");
  }
}


x86 assembly (clang, -O0):
<Jacobitrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8d,-0x3c(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jne    120c <Jacobitrans+0xfc>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movsd  0xe59(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    12ec <Jacobitrans+0x1dc>
cmpl   $0xffffffff,-0x3c(%rbp)
jne    12db <Jacobitrans+0x1cb>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xd99(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    12e7 <Jacobitrans+0x1d7>
lea    0xd2e(%rip),%rdi
call   1030 <printf@plt>
jmp    12ec <Jacobitrans+0x1dc>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jacobitrans>:
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
divsd  %xmm3,%xmm0
cmp    $0xffffffff,%r8d
je     1161 <Jacobitrans+0x51>
cmp    $0x1,%r8d
jne    119a <Jacobitrans+0x8a>
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xec8(%rip),%xmm1
mulsd  (%rsi),%xmm1
mulsd  (%rdi),%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rdx)
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx)
ret
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe8f(%rip),%xmm3
subsd  %xmm1,%xmm3
mulsd  (%rcx),%xmm3
mulsd  (%rdx),%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rdi)
xorpd  0xe83(%rip),%xmm2
mulsd  (%rcx),%xmm2
subsd  (%rdx),%xmm2
movsd  %xmm2,(%rsi)
ret
lea    0xe7f(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"invalid option of transformation! \0A\00"
define void @Jacobitrans(double* %0, double* %1, double %2, double %3, double %4, double* %5, double* %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca double
%18 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double* %5, double** %14
store double* %6, double** %15
store i32 %7, i32* %16
%19 = load double, double* %13
%20 = load double, double* %12
%21 = load double, double* %13
%22 = fadd double %20, %21
%23 = fdiv double %19, %22
store double %23, double* %17
%24 = load double, double* %11
%25 = load double, double* %11
%26 = load double, double* %12
%27 = fadd double %25, %26
%28 = fdiv double %24, %27
store double %28, double* %18
%29 = load i32, i32* %16
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %52
31: ; preds = %8
%32 = load double, double* %17
%33 = fneg double %32
%34 = load double*, double** %9
%35 = load double, double* %34
%36 = load double, double* %18
%37 = load double, double* %17
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double -1.000000e+00)
%39 = load double*, double** %10
%40 = load double, double* %39
%41 = fmul double %38, %40
%42 = call double @llvm.fmuladd.f64(double %33, double %35, double %41)
%43 = load double*, double** %14
store double %42, double* %43
%44 = load double*, double** %9
%45 = load double, double* %44
%46 = load double, double* %18
%47 = load double*, double** %10
%48 = load double, double* %47
%49 = fneg double %46
%50 = call double @llvm.fmuladd.f64(double %49, double %48, double %45)
%51 = load double*, double** %15
store double %50, double* %51
br label %81
52: ; preds = %8
%53 = load i32, i32* %16
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %78
55: ; preds = %52
%56 = load double, double* %18
%57 = fneg double %56
%58 = load double*, double** %14
%59 = load double, double* %58
%60 = load double, double* %18
%61 = load double, double* %17
%62 = fneg double %60
%63 = call double @llvm.fmuladd.f64(double %62, double %61, double 1.000000e+00)
%64 = load double*, double** %15
%65 = load double, double* %64
%66 = fmul double %63, %65
%67 = call double @llvm.fmuladd.f64(double %57, double %59, double %66)
%68 = load double*, double** %9
store double %67, double* %68
%69 = load double*, double** %14
%70 = load double, double* %69
%71 = fneg double %70
%72 = load double, double* %17
%73 = load double*, double** %15
%74 = load double, double* %73
%75 = fneg double %72
%76 = call double @llvm.fmuladd.f64(double %75, double %74, double %71)
%77 = load double*, double** %10
store double %76, double* %77
br label %80
78: ; preds = %52
%79 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %80
80: ; preds = %78, %55
br label %81
81: ; preds = %80, %31
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"invalid option of transformation! \00"
define void @Jacobitrans(double* nocapture %0, double* nocapture %1, double %2, double %3, double %4, double* nocapture %5, double* nocapture %6, i32 %7) {
%9 = fadd double %3, %4
%10 = fdiv double %4, %9
%11 = fadd double %2, %3
%12 = fdiv double %2, %11
switch i32 %7, label %36 [
i32 1, label %13
i32 -1, label %24
]
13: ; preds = %8
%14 = fneg double %10
%15 = load double, double* %0
%16 = tail call double @llvm.fmuladd.f64(double %12, double %10, double -1.000000e+00)
%17 = load double, double* %1
%18 = fmul double %16, %17
%19 = tail call double @llvm.fmuladd.f64(double %14, double %15, double %18)
store double %19, double* %5
%20 = load double, double* %0
%21 = load double, double* %1
%22 = fneg double %12
%23 = tail call double @llvm.fmuladd.f64(double %22, double %21, double %20)
store double %23, double* %6
br label %38
24: ; preds = %8
%25 = fneg double %12
%26 = load double, double* %5
%27 = tail call double @llvm.fmuladd.f64(double %25, double %10, double 1.000000e+00)
%28 = load double, double* %6
%29 = fmul double %27, %28
%30 = tail call double @llvm.fmuladd.f64(double %25, double %26, double %29)
store double %30, double* %0
%31 = load double, double* %5
%32 = fneg double %31
%33 = load double, double* %6
%34 = fneg double %10
%35 = tail call double @llvm.fmuladd.f64(double %34, double %33, double %32)
store double %35, double* %1
br label %38
36: ; preds = %8
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %38
38: ; preds = %24, %36, %13
ret void
}