#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 fabs(double);
int /*<<< orphan*/ relax_ab(double *, int, int, int, double *, double *);
int /*<<< orphan*/ relax_atb(double *, int, int, int, double *, double *);
void relax_pinvb(double *U, int m, int n, int ustride, double *V, int vstride,
                 double *w, double *b, double *x, double *tmp) {
  int i;
  relax_atb(U, m, n, ustride, b, tmp);
  for (i = 0; i < n; i++)
    if (fabs(w[i]) > 1e-12)
      tmp[i] = tmp[i] / w[i];
  relax_ab(V, n, n, vstride, tmp, x);
}


x86 assembly (clang, -O0):
<relax_pinvb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    0x18(%rbp),%r8
mov    0x28(%rbp),%r9
call   1040 <relax_atb@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ec <relax_pinvb+0xbc>
mov    0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe58(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11d9 <relax_pinvb+0xa9>
mov    0x28(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11de <relax_pinvb+0xae>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    117e <relax_pinvb+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    0x28(%rbp),%r8
mov    0x20(%rbp),%r9
call   1050 <relax_ab@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relax_pinvb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8,0x10(%rsp)
mov    %edx,%r13d
mov    0x68(%rsp),%rbx
mov    0x60(%rsp),%r12
mov    0x50(%rsp),%rbp
mov    0x58(%rsp),%r8
mov    %rbx,%r9
call   1040 <relax_atb@plt>
test   %r13d,%r13d
jle    11ae <relax_pinvb+0x7e>
mov    %r13d,%r14d
xor    %r15d,%r15d
jmp    1189 <relax_pinvb+0x59>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r15
cmp    %r15,%r14
je     11ae <relax_pinvb+0x7e>
movsd  0x0(%rbp,%r15,8),%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    1180 <relax_pinvb+0x50>
movsd  (%rbx,%r15,8),%xmm0
divsd  0x0(%rbp,%r15,8),%xmm0
movsd  %xmm0,(%rbx,%r15,8)
jmp    1180 <relax_pinvb+0x50>
mov    0x10(%rsp),%rdi
mov    %r13d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %rbx,%r8
mov    %r12,%r9
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <relax_ab@plt>

LLVM IR (-O0):
define void @relax_pinvb(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, double* %6, double* %7, double* %8, double* %9) {
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32
store double* %0, double** %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store double* %4, double** %15
store i32 %5, i32* %16
store double* %6, double** %17
store double* %7, double** %18
store double* %8, double** %19
store double* %9, double** %20
%22 = load double*, double** %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load double*, double** %18
%27 = load double*, double** %20
%28 = call i32 @relax_atb(double* %22, i32 %23, i32 %24, i32 %25, double* %26, double* %27)
store i32 0, i32* %21
br label %29
29: ; preds = %59, %10
%30 = load i32, i32* %21
%31 = load i32, i32* %13
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %62
33: ; preds = %29
%34 = load double*, double** %17
%35 = load i32, i32* %21
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = call i32 @fabs(double %38)
%40 = sitofp i32 %39 to double
%41 = fcmp ogt double %40, 0x3D719799812DEA11
br i1 %41, label %42, label %58
42: ; preds = %33
%43 = load double*, double** %20
%44 = load i32, i32* %21
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %17
%49 = load i32, i32* %21
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = fdiv double %47, %52
%54 = load double*, double** %20
%55 = load i32, i32* %21
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %53, double* %57
br label %58
58: ; preds = %42, %33
br label %59
59: ; preds = %58
%60 = load i32, i32* %21
%61 = add nsw i32 %60, 1
store i32 %61, i32* %21
br label %29
62: ; preds = %29
%63 = load double*, double** %15
%64 = load i32, i32* %13
%65 = load i32, i32* %13
%66 = load i32, i32* %16
%67 = load double*, double** %20
%68 = load double*, double** %19
%69 = call i32 @relax_ab(double* %63, i32 %64, i32 %65, i32 %66, double* %67, double* %68)
ret void
}

LLVM IR (-O2):
define void @relax_pinvb(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, double* nocapture %6, double* %7, double* %8, double* %9) {
%11 = tail call i32 @relax_atb(double* %0, i32 %1, i32 %2, i32 %3, double* %7, double* %9)
%12 = icmp sgt i32 %2, 0
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = zext i32 %2 to i64
br label %15
15: ; preds = %13, %26
%16 = phi i64 [ 0, %13 ], [ %27, %26 ]
%17 = getelementptr inbounds double, double* %6, i64 %16
%18 = load double, double* %17
%19 = tail call i32 @fabs(double %18)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %15
%22 = getelementptr inbounds double, double* %9, i64 %16
%23 = load double, double* %22
%24 = load double, double* %17
%25 = fdiv double %23, %24
store double %25, double* %22
br label %26
26: ; preds = %15, %21
%27 = add nuw nsw i64 %16, 1
%28 = icmp eq i64 %27, %14
br i1 %28, label %29, label %15
29: ; preds = %26, %10
%30 = tail call i32 @relax_ab(double* %4, i32 %2, i32 %2, i32 %5, double* %9, double* %8)
ret void
}