#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_u_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 = n; i >= 1; i--) {
    temp = x[i];
    beg = U_ptr[i], end = U_ptr[i + 1];
    for (t = beg; t < end; t++)
      temp -= U_val[t] * x[U_ind[t]];
    ((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",
                 875),
             1)));
    x[i] = temp / U_diag[i];
  }
  return;
}


x86 assembly (clang, -O0):
<_glp_mat_u_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)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
jl     124f <_glp_mat_u_solve+0x13f>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
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    11dd <_glp_mat_u_solve+0xcd>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1178 <_glp_mat_u_solve+0x68>
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    121f <_glp_mat_u_solve+0x10f>
jp     121f <_glp_mat_u_solve+0x10f>
lea    0xdf7(%rip),%rdi
lea    0xe01(%rip),%rsi
mov    $0x36b,%edx
call   1030 <_glp_lib_xassert@plt>
mov    $0x1,%al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1135 <_glp_mat_u_solve+0x25>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_mat_u_solve>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1226 <_glp_mat_u_solve+0x116>
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%ebp
xorpd  %xmm2,%xmm2
jmp    1168 <_glp_mat_u_solve+0x58>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rbp,8),%xmm0
ucomisd %xmm2,%xmm0
jne    114e <_glp_mat_u_solve+0x3e>
jnp    1190 <_glp_mat_u_solve+0x80>
divsd  %xmm0,%xmm3
movsd  %xmm3,(%rbx,%rbp,8)
lea    -0x1(%rbp),%rax
cmp    $0x1,%rbp
mov    %rax,%rbp
jle    1226 <_glp_mat_u_solve+0x116>
movsd  (%rbx,%rbp,8),%xmm3
movslq 0x0(%r13,%rbp,4),%rdx
movslq 0x4(%r13,%rbp,4),%rax
cmp    %eax,%edx
jge    1140 <_glp_mat_u_solve+0x30>
mov    %eax,%ecx
sub    %edx,%ecx
test   $0x1,%cl
jne    11c0 <_glp_mat_u_solve+0xb0>
mov    %rdx,%rcx
jmp    11d7 <_glp_mat_u_solve+0xc7>
nopl   0x0(%rax)
lea    0xe69(%rip),%rdi
lea    0xe73(%rip),%rsi
mov    $0x36b,%edx
movsd  %xmm3,(%rsp)
call   1030 <_glp_lib_xassert@plt>
movsd  (%rsp),%xmm3
xorpd  %xmm2,%xmm2
movsd  (%r14,%rbp,8),%xmm0
jmp    114e <_glp_mat_u_solve+0x3e>
xchg   %ax,%ax
movsd  (%r15,%rdx,8),%xmm0
movslq (%r12,%rdx,4),%rcx
mulsd  (%rbx,%rcx,8),%xmm0
subsd  %xmm0,%xmm3
lea    0x1(%rdx),%rcx
not    %rdx
add    %rax,%rdx
je     1140 <_glp_mat_u_solve+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq (%r12,%rcx,4),%rdx
movsd  (%r15,%rcx,8),%xmm0
mulsd  (%rbx,%rdx,8),%xmm0
movsd  0x8(%r15,%rcx,8),%xmm1
movslq 0x4(%r12,%rcx,4),%rdx
mulsd  (%rbx,%rdx,8),%xmm1
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm3
add    $0x2,%rcx
cmp    %rcx,%rax
jne    11f0 <_glp_mat_u_solve+0xe0>
jmp    1140 <_glp_mat_u_solve+0x30>
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_u_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
%18 = load i32, i32* %7
store i32 %18, i32* %13
br label %19
19: ; preds = %88, %6
%20 = load i32, i32* %13
%21 = icmp sge i32 %20, 1
br i1 %21, label %22, label %91
22: ; preds = %19
%23 = load double*, double** %12
%24 = load i32, i32* %13
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
store double %27, double* %17
%28 = load i32*, i32** %8
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
store i32 %32, i32* %15
%33 = load i32*, i32** %8
%34 = load i32, i32* %13
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %33, i64 %36
%38 = load i32, i32* %37
store i32 %38, i32* %16
%39 = load i32, i32* %15
store i32 %39, i32* %14
br label %40
40: ; preds = %62, %22
%41 = load i32, i32* %14
%42 = load i32, i32* %16
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %65
44: ; preds = %40
%45 = load double*, double** %10
%46 = load i32, i32* %14
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double*, double** %12
%51 = load i32*, i32** %9
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %50, i64 %56
%58 = load double, double* %57
%59 = load double, double* %17
%60 = fneg double %49
%61 = call double @llvm.fmuladd.f64(double %60, double %58, double %59)
store double %61, double* %17
br label %62
62: ; preds = %44
%63 = load i32, i32* %14
%64 = add nsw i32 %63, 1
store i32 %64, i32* %14
br label %40
65: ; preds = %40
%66 = load double*, double** %11
%67 = load i32, i32* %13
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = fcmp une double %70, 0.000000e+00
br i1 %71, label %74, label %72
72: ; preds = %65
%73 = 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 875)
br label %74
74: ; preds = %72, %65
%75 = phi i1 [ true, %65 ], [ true, %72 ]
%76 = zext i1 %75 to i32
%77 = load double, double* %17
%78 = load double*, double** %11
%79 = load i32, i32* %13
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %78, i64 %80
%82 = load double, double* %81
%83 = fdiv double %77, %82
%84 = load double*, double** %12
%85 = load i32, i32* %13
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
store double %83, double* %87
br label %88
88: ; preds = %74
%89 = load i32, i32* %13
%90 = add nsw i32 %89, -1
store i32 %90, i32* %13
br label %19
91: ; preds = %19
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_u_solve(i32 %0, i32* nocapture %1, i32* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %81
8: ; preds = %6
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %76
%11 = phi i64 [ %9, %8 ], [ %79, %76 ]
%12 = getelementptr inbounds double, double* %5, i64 %11
%13 = load double, double* %12
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = add nuw nsw i64 %11, 1
%17 = getelementptr inbounds i32, i32* %1, i64 %16
%18 = load i32, i32* %17
%19 = icmp slt i32 %15, %18
br i1 %19, label %20, label %68
20: ; preds = %10
%21 = sext i32 %15 to i64
%22 = sext i32 %18 to i64
%23 = sub nsw i64 %22, %21
%24 = xor i64 %21, -1
%25 = and i64 %23, 1
%26 = icmp eq i64 %25, 0
br i1 %26, label %38, label %27
27: ; preds = %20
%28 = getelementptr inbounds double, double* %3, i64 %21
%29 = load double, double* %28
%30 = getelementptr inbounds i32, i32* %2, i64 %21
%31 = load i32, i32* %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %5, i64 %32
%34 = load double, double* %33
%35 = fneg double %29
%36 = tail call double @llvm.fmuladd.f64(double %35, double %34, double %13)
%37 = add nsw i64 %21, 1
br label %38
38: ; preds = %27, %20
%39 = phi double [ undef, %20 ], [ %36, %27 ]
%40 = phi i64 [ %21, %20 ], [ %37, %27 ]
%41 = phi double [ %13, %20 ], [ %36, %27 ]
%42 = sub nsw i64 0, %22
%43 = icmp eq i64 %24, %42
br i1 %43, label %68, label %44
44: ; preds = %38, %44
%45 = phi i64 [ %66, %44 ], [ %40, %38 ]
%46 = phi double [ %65, %44 ], [ %41, %38 ]
%47 = getelementptr inbounds double, double* %3, i64 %45
%48 = load double, double* %47
%49 = getelementptr inbounds i32, i32* %2, i64 %45
%50 = load i32, i32* %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %5, i64 %51
%53 = load double, double* %52
%54 = fneg double %48
%55 = tail call double @llvm.fmuladd.f64(double %54, double %53, double %46)
%56 = add nsw i64 %45, 1
%57 = getelementptr inbounds double, double* %3, i64 %56
%58 = load double, double* %57
%59 = getelementptr inbounds i32, i32* %2, i64 %56
%60 = load i32, i32* %59
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %5, i64 %61
%63 = load double, double* %62
%64 = fneg double %58
%65 = tail call double @llvm.fmuladd.f64(double %64, double %63, double %55)
%66 = add nsw i64 %45, 2
%67 = icmp eq i64 %66, %22
br i1 %67, label %68, label %44
68: ; preds = %38, %44, %10
%69 = phi double [ %13, %10 ], [ %39, %38 ], [ %65, %44 ]
%70 = getelementptr inbounds double, double* %4, i64 %11
%71 = load double, double* %70
%72 = fcmp une double %71, 0.000000e+00
br i1 %72, label %76, label %73
73: ; preds = %68
%74 = 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 875)
%75 = load double, double* %70
br label %76
76: ; preds = %73, %68
%77 = phi double [ %75, %73 ], [ %71, %68 ]
%78 = fdiv double %69, %77
store double %78, double* %12
%79 = add nsw i64 %11, -1
%80 = icmp sgt i64 %11, 1
br i1 %80, label %10, label %81
81: ; preds = %76, %6
ret void
}