#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*/ _glp_lib_xassert(char *, char *, int);
void _glp_mat_ut_solve(int n, int U_ptr[], int U_ind[], double U_val[],
                       double U_diag[], double x[]) {
  int i, t, beg, end;
  double temp;
  for (i = 1; i <= n; i++) {
    ((void)((U_diag[i] != 0.0) ||
            (_glp_lib_xassert(
                 "U_diag[i] != 0.0",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/"
                 "refs/heads/master/glpk-4.40/src/glpmat.c",
                 913),
             1)));
    temp = (x[i] /= U_diag[i]);
    if (temp == 0.0)
      continue;
    beg = U_ptr[i], end = U_ptr[i + 1];
    for (t = beg; t < end; t++)
      x[U_ind[t]] -= U_val[t] * temp;
  }
  return;
}


x86 assembly (clang, -O0):
<_glp_mat_ut_solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     126b <_glp_mat_ut_solve+0x15b>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x49(%rbp)
jne    1184 <_glp_mat_ut_solve+0x74>
jp     1184 <_glp_mat_ut_solve+0x74>
lea    0xe92(%rip),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x391,%edx
call   1030 <_glp_lib_xassert@plt>
mov    $0x1,%al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11cc <_glp_mat_ut_solve+0xbc>
jp     11cc <_glp_mat_ut_solve+0xbc>
jmp    125d <_glp_mat_ut_solve+0x14d>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1258 <_glp_mat_ut_solve+0x148>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x48(%rbp),%xmm2
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11f3 <_glp_mat_ut_solve+0xe3>
jmp    125d <_glp_mat_ut_solve+0x14d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <_glp_mat_ut_solve+0x26>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_mat_ut_solve>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
test   %edi,%edi
jle    1248 <_glp_mat_ut_solve+0x138>
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %edi,%ebp
add    $0x1,%ebp
mov    $0x1,%r13d
xorpd  %xmm3,%xmm3
jmp    115d <_glp_mat_ut_solve+0x4d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13
cmp    %rbp,%r13
je     1248 <_glp_mat_ut_solve+0x138>
movsd  (%r14,%r13,8),%xmm1
ucomisd %xmm3,%xmm1
jne    118d <_glp_mat_ut_solve+0x7d>
jp     118d <_glp_mat_ut_solve+0x7d>
lea    0xe8e(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x391,%edx
call   1030 <_glp_lib_xassert@plt>
xorpd  %xmm3,%xmm3
movsd  (%r14,%r13,8),%xmm1
movsd  (%rbx,%r13,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%r13,8)
ucomisd %xmm3,%xmm0
jne    11a5 <_glp_mat_ut_solve+0x95>
jnp    1150 <_glp_mat_ut_solve+0x40>
mov    (%rsp),%rax
movslq (%rax,%r13,4),%rdx
movslq 0x4(%rax,%r13,4),%rax
add    $0x1,%r13
cmp    %eax,%edx
jge    1154 <_glp_mat_ut_solve+0x44>
mov    %eax,%esi
sub    %edx,%esi
mov    %rdx,%rcx
test   $0x1,%sil
je     11e7 <_glp_mat_ut_solve+0xd7>
movslq (%r12,%rdx,4),%rcx
movsd  (%rbx,%rcx,8),%xmm1
movsd  (%r15,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
lea    0x1(%rdx),%rcx
not    %rdx
add    %rax,%rdx
je     1154 <_glp_mat_ut_solve+0x44>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq (%r12,%rcx,4),%rdx
movsd  (%rbx,%rdx,8),%xmm1
movsd  (%r15,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rdx,8)
movslq 0x4(%r12,%rcx,4),%rdx
movsd  (%rbx,%rdx,8),%xmm1
movsd  0x8(%r15,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rdx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1200 <_glp_mat_ut_solve+0xf0>
jmp    1154 <_glp_mat_ut_solve+0x44>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"U_diag[i] != 0.0\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c\00"
define void @_glp_mat_ut_solve(i32 %0, i32* %1, i32* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i32 1, i32* %13
br label %18
18: ; preds = %87, %6
%19 = load i32, i32* %13
%20 = load i32, i32* %7
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %90
22: ; preds = %18
%23 = load double*, double** %11
%24 = load i32, i32* %13
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = fcmp une double %27, 0.000000e+00
br i1 %28, label %31, label %29
29: ; preds = %22
%30 = call i32 @_glp_lib_xassert(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 913)
br label %31
31: ; preds = %29, %22
%32 = phi i1 [ true, %22 ], [ true, %29 ]
%33 = zext i1 %32 to i32
%34 = load double*, double** %11
%35 = load i32, i32* %13
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = load double*, double** %12
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
%43 = load double, double* %42
%44 = fdiv double %43, %38
store double %44, double* %42
store double %44, double* %17
%45 = load double, double* %17
%46 = fcmp oeq double %45, 0.000000e+00
br i1 %46, label %47, label %48
47: ; preds = %31
br label %87
48: ; preds = %31
%49 = load i32*, i32** %8
%50 = load i32, i32* %13
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = load i32, i32* %52
store i32 %53, i32* %15
%54 = load i32*, i32** %8
%55 = load i32, i32* %13
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %54, i64 %57
%59 = load i32, i32* %58
store i32 %59, i32* %16
%60 = load i32, i32* %15
store i32 %60, i32* %14
br label %61
61: ; preds = %83, %48
%62 = load i32, i32* %14
%63 = load i32, i32* %16
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %86
65: ; preds = %61
%66 = load double*, double** %10
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = load double, double* %17
%72 = load double*, double** %12
%73 = load i32*, i32** %9
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %73, i64 %75
%77 = load i32, i32* %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %72, i64 %78
%80 = load double, double* %79
%81 = fneg double %70
%82 = call double @llvm.fmuladd.f64(double %81, double %71, double %80)
store double %82, double* %79
br label %83
83: ; preds = %65
%84 = load i32, i32* %14
%85 = add nsw i32 %84, 1
store i32 %85, i32* %14
br label %61
86: ; preds = %61
br label %87
87: ; preds = %86, %47
%88 = load i32, i32* %13
%89 = add nsw i32 %88, 1
store i32 %89, i32* %13
br label %18
90: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"U_diag[i] != 0.0\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c\00"
define void @_glp_mat_ut_solve(i32 %0, i32* nocapture %1, i32* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = icmp slt i32 %0, 1
br i1 %7, label %82, label %8
8: ; preds = %6
%9 = add nuw i32 %0, 1
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %8, %79
%12 = phi i64 [ 1, %8 ], [ %80, %79 ]
%13 = getelementptr inbounds double, double* %4, i64 %12
%14 = load double, double* %13
%15 = fcmp une double %14, 0.000000e+00
br i1 %15, label %19, label %16
16: ; preds = %11
%17 = tail call i32 @_glp_lib_xassert(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 913)
%18 = load double, double* %13
br label %19
19: ; preds = %16, %11
%20 = phi double [ %18, %16 ], [ %14, %11 ]
%21 = getelementptr inbounds double, double* %5, i64 %12
%22 = load double, double* %21
%23 = fdiv double %22, %20
store double %23, double* %21
%24 = fcmp oeq double %23, 0.000000e+00
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = add nuw nsw i64 %12, 1
br label %79
27: ; preds = %19
%28 = getelementptr inbounds i32, i32* %1, i64 %12
%29 = load i32, i32* %28
%30 = add nuw nsw i64 %12, 1
%31 = getelementptr inbounds i32, i32* %1, i64 %30
%32 = load i32, i32* %31
%33 = icmp slt i32 %29, %32
br i1 %33, label %34, label %79
34: ; preds = %27
%35 = sext i32 %29 to i64
%36 = sext i32 %32 to i64
%37 = sub nsw i64 %36, %35
%38 = xor i64 %35, -1
%39 = and i64 %37, 1
%40 = icmp eq i64 %39, 0
br i1 %40, label %52, label %41
41: ; preds = %34
%42 = getelementptr inbounds double, double* %3, i64 %35
%43 = load double, double* %42
%44 = getelementptr inbounds i32, i32* %2, i64 %35
%45 = load i32, i32* %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %5, i64 %46
%48 = load double, double* %47
%49 = fneg double %43
%50 = tail call double @llvm.fmuladd.f64(double %49, double %23, double %48)
store double %50, double* %47
%51 = add nsw i64 %35, 1
br label %52
52: ; preds = %41, %34
%53 = phi i64 [ %35, %34 ], [ %51, %41 ]
%54 = sub nsw i64 0, %36
%55 = icmp eq i64 %38, %54
br i1 %55, label %79, label %56
56: ; preds = %52, %56
%57 = phi i64 [ %77, %56 ], [ %53, %52 ]
%58 = getelementptr inbounds double, double* %3, i64 %57
%59 = load double, double* %58
%60 = getelementptr inbounds i32, i32* %2, i64 %57
%61 = load i32, i32* %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %5, i64 %62
%64 = load double, double* %63
%65 = fneg double %59
%66 = tail call double @llvm.fmuladd.f64(double %65, double %23, double %64)
store double %66, double* %63
%67 = add nsw i64 %57, 1
%68 = getelementptr inbounds double, double* %3, i64 %67
%69 = load double, double* %68
%70 = getelementptr inbounds i32, i32* %2, i64 %67
%71 = load i32, i32* %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %5, i64 %72
%74 = load double, double* %73
%75 = fneg double %69
%76 = tail call double @llvm.fmuladd.f64(double %75, double %23, double %74)
store double %76, double* %73
%77 = add nsw i64 %57, 2
%78 = icmp eq i64 %77, %36
br i1 %78, label %79, label %56
79: ; preds = %52, %56, %25, %27
%80 = phi i64 [ %26, %25 ], [ %30, %27 ], [ %30, %56 ], [ %30, %52 ]
%81 = icmp eq i64 %80, %10
br i1 %81, label %82, label %11
82: ; preds = %79, %6
ret void
}