#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_U(double *, double, double, double *, int,
                                    int, int);
int /*<<< orphan*/ create_m_U(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_U(double *, double *, double *, double, int, int, int);
void update_U(double *C, float *dat, double *U, double *V, double *beta,
              double *m_U, double *inv_cov_U, double alpha_U, double alpha_R,
              int M, int N, int K, int D, int num_thrd) {
  create_m_U(V, dat, C, beta, m_U, M, N, D, K, dat, num_thrd);
  create_inv_cov_U(inv_cov_U, alpha_U, alpha_R, V, K, M, num_thrd);
  rand_U(U, m_U, inv_cov_U, alpha_R, K, N, num_thrd);
  if (isnan(U[0]))
    print_error_global("nan", NULL, 0);
}


x86 assembly (clang, -O0):
<update_U>:
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    -0x30(%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   1050 <create_m_U@plt>
mov    0x10(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mov    -0x30(%rbp),%rsi
mov    0x28(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    0x38(%rbp),%r8d
call   1030 <create_inv_cov_U@plt>
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    0x10(%rbp),%rdx
movsd  -0x50(%rbp),%xmm0
mov    0x28(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x38(%rbp),%r9d
call   1040 <rand_U@plt>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <isnan@plt>
cmp    $0x0,%rax
je     1240 <update_U+0xf0>
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <print_error_global@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_U>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %r9,0x10(%rsp)
mov    %rcx,%r14
mov    %rdx,0x20(%rsp)
mov    %rdi,%rdx
mov    0x60(%rsp),%r13
mov    0x68(%rsp),%r15d
mov    0x70(%rsp),%ebx
mov    %rbx,0x8(%rsp)
mov    0x80(%rsp),%eax
mov    0x78(%rsp),%ebp
mov    0x88(%rsp),%r12d
sub    $0x8,%rsp
mov    %rcx,%rdi
mov    %r8,%rcx
mov    %r9,%r8
mov    %r15d,%r9d
push   %r12
push   %rsi
push   %rbp
push   %rax
push   %rbx
call   1050 <create_m_U@plt>
add    $0x30,%rsp
mov    %r13,%rdi
movsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <create_inv_cov_U@plt>
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    0x10(%rsp),%rsi
mov    %r13,%rdx
movsd  (%rsp),%xmm0
mov    %ebp,%ecx
mov    0x8(%rsp),%r8
mov    %r12d,%r9d
call   1040 <rand_U@plt>
movsd  (%rbx),%xmm0
call   1060 <isnan@plt>
test   %rax,%rax
je     122c <update_U+0xdc>
lea    0xdeb(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <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_U(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** %18
%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_U(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** %18
%45 = load i32, i32* %26
%46 = load i32, i32* %24
%47 = load i32, i32* %28
%48 = call i32 @create_inv_cov_U(double* %41, double %42, double %43, double* %44, i32 %45, i32 %46, i32 %47)
%49 = load double*, double** %17
%50 = load double*, double** %20
%51 = load double*, double** %21
%52 = load double, double* %23
%53 = load i32, i32* %26
%54 = load i32, i32* %25
%55 = load i32, i32* %28
%56 = call i32 @rand_U(double* %49, double* %50, double* %51, double %52, i32 %53, i32 %54, i32 %55)
%57 = load double*, double** %17
%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_U(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_U(double* %3, 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_U(double* %6, double %7, double %8, double* %3, i32 %11, i32 %9, i32 %13)
%17 = tail call i32 @rand_U(double* %2, double* %5, double* %6, double %8, i32 %11, i32 %10, i32 %13)
%18 = load double, double* %2
%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
}