#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*/ create_inv_cov_V(double *, double, double, double *, int,
                                    int, int);
int /*<<< orphan*/ create_m_V(double *, float *, double *, double *, double *,
                              int, int, int, int, float *, int);
scalar_t__ isnan(double);
int /*<<< orphan*/ print_error_global(char *, int /*<<< orphan*/ *,
                                      int /*<<< orphan*/);
int /*<<< orphan*/ rand_V(double *, double *, double *, double, int, int, int);
void update_V(double *C, float *dat, double *U, double *V, double *beta,
              double *m_V, double *inv_cov_V, double alpha_V, double alpha_R,
              int M, int N, int K, int D, int num_thrd) {
  create_m_V(U, dat, C, beta, m_V, M, N, D, K, dat, num_thrd);
  create_inv_cov_V(inv_cov_V, alpha_V, alpha_R, U, K, N, num_thrd);
  rand_V(V, m_V, inv_cov_V, alpha_R, K, M, num_thrd);
  if (isnan(V[0]))
    print_error_global("nan", NULL, 0);
}


x86 assembly (clang, -O0):
<update_V>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movsd  %xmm0,-0x48(%rbp)
movsd  %xmm1,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%r14d
mov    0x30(%rbp),%ebx
mov    0x28(%rbp),%r11d
mov    -0x20(%rbp),%r10
mov    0x38(%rbp),%eax
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1070 <create_m_V@plt>
mov    0x10(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rsi
mov    0x28(%rbp),%edx
mov    0x20(%rbp),%ecx
mov    0x38(%rbp),%r8d
call   1040 <create_inv_cov_V@plt>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    0x10(%rbp),%rdx
movsd  -0x50(%rbp),%xmm0
mov    0x28(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    0x38(%rbp),%r9d
call   1060 <rand_V@plt>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1240 <update_V+0xf0>
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <print_error_global@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_V>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %r9,%rbp
mov    %r9,0x10(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,%r14
mov    %rdi,%rdx
mov    0x60(%rsp),%r13
mov    0x68(%rsp),%r9d
mov    %r9d,0x4(%rsp)
mov    0x70(%rsp),%r15d
mov    0x80(%rsp),%eax
mov    0x78(%rsp),%ebx
mov    0x88(%rsp),%r12d
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r8,%rcx
mov    %rbp,%r8
push   %r12
push   %rsi
push   %rbx
push   %rax
push   %r15
call   1070 <create_m_V@plt>
add    $0x30,%rsp
mov    %r13,%rdi
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1040 <create_inv_cov_V@plt>
mov    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    0x10(%rsp),%rsi
mov    %r13,%rdx
movsd  0x8(%rsp),%xmm0
mov    %ebx,%ecx
mov    0x4(%rsp),%r8d
mov    %r12d,%r9d
call   1060 <rand_V@plt>
movsd  0x0(%rbp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
je     1232 <update_V+0xe2>
lea    0xde5(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <print_error_global@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"nan\00"
define void @update_V(double* %0, float* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double %7, double %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13) {
%15 = alloca double*
%16 = alloca float*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double
%23 = alloca double
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store double* %0, double** %15
store float* %1, float** %16
store double* %2, double** %17
store double* %3, double** %18
store double* %4, double** %19
store double* %5, double** %20
store double* %6, double** %21
store double %7, double* %22
store double %8, double* %23
store i32 %9, i32* %24
store i32 %10, i32* %25
store i32 %11, i32* %26
store i32 %12, i32* %27
store i32 %13, i32* %28
%29 = load double*, double** %17
%30 = load float*, float** %16
%31 = load double*, double** %15
%32 = load double*, double** %19
%33 = load double*, double** %20
%34 = load i32, i32* %24
%35 = load i32, i32* %25
%36 = load i32, i32* %27
%37 = load i32, i32* %26
%38 = load float*, float** %16
%39 = load i32, i32* %28
%40 = call i32 @create_m_V(double* %29, float* %30, double* %31, double* %32, double* %33, i32 %34, i32 %35, i32 %36, i32 %37, float* %38, i32 %39)
%41 = load double*, double** %21
%42 = load double, double* %22
%43 = load double, double* %23
%44 = load double*, double** %17
%45 = load i32, i32* %26
%46 = load i32, i32* %25
%47 = load i32, i32* %28
%48 = call i32 @create_inv_cov_V(double* %41, double %42, double %43, double* %44, i32 %45, i32 %46, i32 %47)
%49 = load double*, double** %18
%50 = load double*, double** %20
%51 = load double*, double** %21
%52 = load double, double* %23
%53 = load i32, i32* %26
%54 = load i32, i32* %24
%55 = load i32, i32* %28
%56 = call i32 @rand_V(double* %49, double* %50, double* %51, double %52, i32 %53, i32 %54, i32 %55)
%57 = load double*, double** %18
%58 = getelementptr inbounds double, double* %57, i64 0
%59 = load double, double* %58
%60 = call i64 @isnan(double %59)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %14
%63 = call i32 @print_error_global(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null, i32 0)
br label %64
64: ; preds = %62, %14
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"nan\00"
define void @update_V(double* %0, float* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double %7, double %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13) {
%15 = tail call i32 @create_m_V(double* %2, float* %1, double* %0, double* %4, double* %5, i32 %9, i32 %10, i32 %12, i32 %11, float* %1, i32 %13)
%16 = tail call i32 @create_inv_cov_V(double* %6, double %7, double %8, double* %2, i32 %11, i32 %10, i32 %13)
%17 = tail call i32 @rand_V(double* %3, double* %5, double* %6, double %8, i32 %11, i32 %9, i32 %13)
%18 = load double, double* %3
%19 = tail call i64 @isnan(double %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %14
%22 = tail call i32 @print_error_global(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null, i32 0)
br label %23
23: ; preds = %21, %14
ret void
}