#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 metric_lapse(double *);
int /*<<< orphan*/ metric_shift(double *, double *);
void frame_U(double x[3], double U[4]) {
  double ia, b[3];
  ia = 1.0 / metric_lapse(x);
  metric_shift(x, b);
  U[0] = ia;
  U[1] = -ia * b[0];
  U[2] = -ia * b[1];
  U[3] = -ia * b[2];
}


x86 assembly (clang, -O0):
<frame_U>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <metric_lapse@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <metric_shift@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frame_U>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <metric_lapse@plt>
movsd  0xec6(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <metric_shift@plt>
movdqa (%rsp),%xmm1
movq   %xmm1,(%r14)
pxor   0xeae(%rip),%xmm1
pshufd $0x44,%xmm1,%xmm0
mulpd  0x10(%rsp),%xmm0
movupd %xmm0,0x8(%r14)
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @frame_U(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = call double @metric_lapse(double* %7)
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %5
%10 = load double*, double** %3
%11 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%12 = call i32 @metric_shift(double* %10, double* %11)
%13 = load double, double* %5
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double, double* %5
%17 = fneg double %16
%18 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%19 = load double, double* %18
%20 = fmul double %17, %19
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 1
store double %20, double* %22
%23 = load double, double* %5
%24 = fneg double %23
%25 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%26 = load double, double* %25
%27 = fmul double %24, %26
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 2
store double %27, double* %29
%30 = load double, double* %5
%31 = fneg double %30
%32 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%33 = load double, double* %32
%34 = fmul double %31, %33
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i64 3
store double %34, double* %36
ret void
}

LLVM IR (-O2):
define void @frame_U(double* %0, double* nocapture writeonly %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = tail call double @metric_lapse(double* %0)
%6 = fdiv double 1.000000e+00, %5
%7 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%8 = call i32 @metric_shift(double* %0, double* %7)
store double %6, double* %1
%9 = fneg double %6
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = bitcast [3 x double]* %3 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = insertelement <2 x double> poison, double %9, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = fmul <2 x double> %12, %14
%16 = bitcast double* %10 to <2 x double>*
store <2 x double> %15, <2 x double>* %16
%17 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%18 = load double, double* %17
%19 = fmul double %18, %9
%20 = getelementptr inbounds double, double* %1, i64 3
store double %19, double* %20
ret void
}