#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 */
scalar_t__ u_calloc(int, int, char *, int, char *);
void multi_rectv(double *au_1, int *irow_1, int *jq_1, int n_1, int m_1,
                 double *b, double **v_rp) {
  int irow, i, j;
  double *v_r = NULL, value;
  v_r = (double *)u_calloc(
      (m_1), sizeof(double),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/prool/ccx_prool/refs/heads/master/CalculiX/"
      "ccx_2.16/src/multi_rectv.c",
      43, "v_r");
  for (j = 0; j < m_1; j++) {
    for (i = jq_1[j] - 1; i < jq_1[j + 1] - 1; i++) {
      v_r[j] += au_1[i] * b[irow_1[i] - 1];
    }
  }
  *v_rp = v_r;
  return;
}


x86 assembly (clang, -O0):
<multi_rectv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
lea    0xeb6(%rip),%rdx
mov    $0x2b,%ecx
lea    0xf4a(%rip),%r8
call   1030 <u_calloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1203 <multi_rectv+0xf3>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x34(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11f0 <multi_rectv+0xe0>
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x30(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1183 <multi_rectv+0x73>
jmp    11f5 <multi_rectv+0xe5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1166 <multi_rectv+0x56>
mov    -0x40(%rbp),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multi_rectv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r15
mov    %r8d,%ebp
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
mov    0x40(%rsp),%r13
lea    0xeca(%rip),%rdx
lea    0xf63(%rip),%r8
mov    %ebp,%edi
mov    $0x8,%esi
mov    $0x2b,%ecx
call   1030 <u_calloc@plt>
test   %ebp,%ebp
jle    1221 <multi_rectv+0x111>
mov    %ebp,%r8d
mov    (%r14),%r10d
xor    %r9d,%r9d
jmp    1179 <multi_rectv+0x69>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %r8,%r9
je     1221 <multi_rectv+0x111>
mov    %r9,%rdi
mov    %r10d,%edx
add    $0x1,%r9
mov    0x4(%r14,%rdi,4),%r10d
cmp    %r10d,%edx
jge    1170 <multi_rectv+0x60>
lea    -0x1(%r10),%r11d
lea    -0x1(%rdx),%ecx
movslq %ecx,%rbp
cmp    %r11d,%edx
mov    %r11d,%esi
cmovg  %edx,%esi
movsd  (%rax,%rdi,8),%xmm0
mov    %esi,%ecx
sub    %edx,%ecx
add    $0x1,%ecx
test   $0x1,%cl
je     11ce <multi_rectv+0xbe>
movsd  (%rbx,%rbp,8),%xmm1
movslq (%r12,%rbp,4),%rcx
mulsd  -0x8(%r15,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rdi,8)
add    $0x1,%rbp
cmp    %r11d,%edx
jge    1170 <multi_rectv+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rbx,%rbp,8),%xmm1
movslq (%r12,%rbp,4),%rcx
mulsd  -0x8(%r15,%rcx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rdi,8)
movsd  0x8(%rbx,%rbp,8),%xmm0
movslq 0x4(%r12,%rbp,4),%rcx
mulsd  -0x8(%r15,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rdi,8)
add    $0x2,%rbp
cmp    %ebp,%esi
jne    11e0 <multi_rectv+0xd0>
jmp    1170 <multi_rectv+0x60>
mov    %rax,0x0(%r13)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/prool/ccx_prool/refs/heads/master/CalculiX/ccx_2.16/src/multi_rectv.c\00"
@.str.1 = [4 x i8] c"v_r\00"
define void @multi_rectv(double* %0, i32* %1, i32* %2, i32 %3, i32 %4, double* %5, double** %6) {
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca double**
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
%19 = alloca double
store double* %0, double** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double* %5, double** %13
store double** %6, double*** %14
store double* null, double** %18
%20 = load i32, i32* %12
%21 = call i64 @u_calloc(i32 %20, i32 8, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = inttoptr i64 %21 to double*
store double* %22, double** %18
store i32 0, i32* %17
br label %23
23: ; preds = %70, %7
%24 = load i32, i32* %17
%25 = load i32, i32* %12
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %73
27: ; preds = %23
%28 = load i32*, i32** %10
%29 = load i32, i32* %17
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %16
br label %34
34: ; preds = %66, %27
%35 = load i32, i32* %16
%36 = load i32*, i32** %10
%37 = load i32, i32* %17
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %36, i64 %39
%41 = load i32, i32* %40
%42 = sub nsw i32 %41, 1
%43 = icmp slt i32 %35, %42
br i1 %43, label %44, label %69
44: ; preds = %34
%45 = load double*, double** %8
%46 = load i32, i32* %16
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double*, double** %13
%51 = load i32*, i32** %9
%52 = load i32, i32* %16
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = sub nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %50, i64 %57
%59 = load double, double* %58
%60 = load double*, double** %18
%61 = load i32, i32* %17
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %49, double %59, double %64)
store double %65, double* %63
br label %66
66: ; preds = %44
%67 = load i32, i32* %16
%68 = add nsw i32 %67, 1
store i32 %68, i32* %16
br label %34
69: ; preds = %34
br label %70
70: ; preds = %69
%71 = load i32, i32* %17
%72 = add nsw i32 %71, 1
store i32 %72, i32* %17
br label %23
73: ; preds = %23
%74 = load double*, double** %18
%75 = load double**, double*** %14
store double* %74, double** %75
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/prool/ccx_prool/refs/heads/master/CalculiX/ccx_2.16/src/multi_rectv.c\00"
@.str.1 = [4 x i8] c"v_r\00"
define void @multi_rectv(double* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3, i32 %4, double* nocapture %5, double** nocapture writeonly %6) {
%8 = tail call i64 @u_calloc(i32 %4, i32 8, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = inttoptr i64 %8 to double*
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %74
11: ; preds = %7
%12 = zext i32 %4 to i64
%13 = load i32, i32* %2
br label %16
14: ; preds = %45, %49, %16
%15 = icmp eq i64 %19, %12
br i1 %15, label %74, label %16
16: ; preds = %11, %14
%17 = phi i32 [ %13, %11 ], [ %21, %14 ]
%18 = phi i64 [ 0, %11 ], [ %19, %14 ]
%19 = add nuw nsw i64 %18, 1
%20 = getelementptr inbounds i32, i32* %2, i64 %19
%21 = load i32, i32* %20
%22 = icmp slt i32 %17, %21
br i1 %22, label %23, label %14
23: ; preds = %16
%24 = add nsw i32 %21, -1
%25 = add i32 %17, -1
%26 = getelementptr inbounds double, double* %9, i64 %18
%27 = sext i32 %25 to i64
%28 = call i32 @llvm.smax.i32(i32 %17, i32 %24)
%29 = load double, double* %26
%30 = add i32 %28, 1
%31 = sub i32 %30, %17
%32 = and i32 %31, 1
%33 = icmp eq i32 %32, 0
br i1 %33, label %45, label %34
34: ; preds = %23
%35 = getelementptr inbounds double, double* %0, i64 %27
%36 = load double, double* %35
%37 = getelementptr inbounds i32, i32* %1, i64 %27
%38 = load i32, i32* %37
%39 = add nsw i32 %38, -1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %5, i64 %40
%42 = load double, double* %41
%43 = tail call double @llvm.fmuladd.f64(double %36, double %42, double %29)
store double %43, double* %26
%44 = add nsw i64 %27, 1
br label %45
45: ; preds = %34, %23
%46 = phi double [ %29, %23 ], [ %43, %34 ]
%47 = phi i64 [ %27, %23 ], [ %44, %34 ]
%48 = icmp slt i32 %17, %24
br i1 %48, label %49, label %14
49: ; preds = %45, %49
%50 = phi double [ %70, %49 ], [ %46, %45 ]
%51 = phi i64 [ %71, %49 ], [ %47, %45 ]
%52 = getelementptr inbounds double, double* %0, i64 %51
%53 = load double, double* %52
%54 = getelementptr inbounds i32, i32* %1, i64 %51
%55 = load i32, i32* %54
%56 = add nsw i32 %55, -1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %5, i64 %57
%59 = load double, double* %58
%60 = tail call double @llvm.fmuladd.f64(double %53, double %59, double %50)
store double %60, double* %26
%61 = add nsw i64 %51, 1
%62 = getelementptr inbounds double, double* %0, i64 %61
%63 = load double, double* %62
%64 = getelementptr inbounds i32, i32* %1, i64 %61
%65 = load i32, i32* %64
%66 = add nsw i32 %65, -1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %5, i64 %67
%69 = load double, double* %68
%70 = tail call double @llvm.fmuladd.f64(double %63, double %69, double %60)
store double %70, double* %26
%71 = add nsw i64 %51, 2
%72 = trunc i64 %71 to i32
%73 = icmp eq i32 %28, %72
br i1 %73, label %14, label %49
74: ; preds = %14, %7
store double* %9, double** %6
ret void
}