#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(int);
void ncov_calc(double gcon[(4)][(4)], double ncov[(4)]) {
  double lapse;
  int i;
  lapse = sqrt(-1. / gcon[0][0]);
  ncov[0] = -lapse;
  for (i = 1; i < (4); i++) {
    ncov[i] = 0.;
  }
  return;
}


x86 assembly (clang, -O0):
<ncov_calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xed4(%rip),%xmm0
divsd  (%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1191 <ncov_calc+0x81>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1169 <ncov_calc+0x59>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncov_calc>:
push   %rbx
mov    %rsi,%rbx
movsd  0xee4(%rip),%xmm0
divsd  (%rdi),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
xorpd  0xedf(%rip),%xmm0
movlpd %xmm0,(%rbx)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rbx)
movq   $0x0,0x18(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ncov_calc([4 x double]* %0, double* %1) {
%3 = alloca [4 x double]*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store [4 x double]* %0, [4 x double]** %3
store double* %1, double** %4
%7 = load [4 x double]*, [4 x double]** %3
%8 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0
%9 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%10 = load double, double* %9
%11 = fdiv double -1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = call double @sqrt(i32 %12)
store double %13, double* %5
%14 = load double, double* %5
%15 = fneg double %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
store double %15, double* %17
store i32 1, i32* %6
br label %18
18: ; preds = %26, %2
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 4
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load double*, double** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double 0.000000e+00, double* %25
br label %26
26: ; preds = %21
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %18
29: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @ncov_calc([4 x double]* nocapture %0, double* nocapture writeonly %1) {
%3 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 0, i64 0
%4 = load double, double* %3
%5 = fdiv double -1.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = tail call double @sqrt(i32 %6)
%8 = fneg double %7
store double %8, double* %1
%9 = getelementptr double, double* %1, i64 1
%10 = bitcast double* %9 to i8*
ret void
}