#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*/ printf(char *, int, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
int /*<<< orphan*/ superlu_abort_and_exit(char *);
void dcheck_zero_vec(int pnum, char *msg, int n, double *vec) {
  register int i, nonzero;
  nonzero = 0;
  for (i = 0; i < n; ++i) {
    if (vec[i] != 0.0) {
      printf("(%d) vec[%d] = %.10e; should be zero!\n", pnum, i, vec[i]);
      nonzero = 1;
    }
  }
  if (nonzero) {
    printf("(%d) %s\n", pnum, msg);
    {
      char msg[256];
      sprintf(msg, "%s at line %d in file %s\n", "Not a zero vector.", 268,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/"
              "libsesctherm/SuperLU_MT/SRC/pdutil.c");
      superlu_abort_and_exit(msg);
    };
  }
}


x86 assembly (clang, -O0):
<dcheck_zero_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c3 <dcheck_zero_vec+0x93>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <dcheck_zero_vec+0x58>
jp     1188 <dcheck_zero_vec+0x58>
jmp    11b0 <dcheck_zero_vec+0x80>
mov    -0x4(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x1,-0x28(%rbp)
jmp    11b5 <dcheck_zero_vec+0x85>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <dcheck_zero_vec+0x27>
cmpl   $0x0,-0x28(%rbp)
je     1214 <dcheck_zero_vec+0xe4>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x130(%rbp),%rdi
lea    0xe40(%rip),%rsi
lea    0xe53(%rip),%rdx
mov    $0x10c,%ecx
lea    0xe5a(%rip),%r8
call   1050 <sprintf@plt>
lea    -0x130(%rbp),%rdi
call   1030 <superlu_abort_and_exit@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcheck_zero_vec>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
test   %edx,%edx
jle    11e7 <dcheck_zero_vec+0xb7>
mov    %rcx,%r13
mov    %rsi,%r14
mov    %edi,%r15d
mov    %edx,%ebx
xor    %ebp,%ebp
lea    0xeab(%rip),%r12
xor    %eax,%eax
jmp    1179 <dcheck_zero_vec+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     11a2 <dcheck_zero_vec+0x72>
movsd  0x0(%r13,%rbp,8),%xmm0
ucomisd 0xe78(%rip),%xmm0
jne    118c <dcheck_zero_vec+0x5c>
jnp    1170 <dcheck_zero_vec+0x40>
mov    %r12,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    1170 <dcheck_zero_vec+0x40>
test   %eax,%eax
je     11e7 <dcheck_zero_vec+0xb7>
lea    0xe82(%rip),%rdi
mov    %r15d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe77(%rip),%rsi
lea    0xe8a(%rip),%rdx
lea    0xe96(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10c,%ecx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <superlu_abort_and_exit@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"(%d) vec[%d] = %.10e; should be zero!\0A\00"
@.str.1 = [9 x i8] c"(%d) %s\0A\00"
@.str.2 = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.3 = [19 x i8] c"Not a zero vector.\00"
@.str.4 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/pdutil.c\00"
define void @dcheck_zero_vec(i32 %0, i8* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store double* %3, double** %8
store i32 0, i32* %10
store i32 0, i32* %9
br label %12
12: ; preds = %33, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = load double*, double** %8
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = fcmp une double %21, 0.000000e+00
br i1 %22, label %23, label %32
23: ; preds = %16
%24 = load i32, i32* %5
%25 = load i32, i32* %9
%26 = load double*, double** %8
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, double %30)
store i32 1, i32* %10
br label %32
32: ; preds = %23, %16
br label %33
33: ; preds = %32
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %12
36: ; preds = %12
%37 = load i32, i32* %10
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i32, i32* %5
%41 = load i8*, i8** %6
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %40, i8* %41)
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%44 = call i32 @sprintf(i8* %43, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 268, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.4, i64 0, i64 0))
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%46 = call i32 @superlu_abort_and_exit(i8* %45)
br label %47
47: ; preds = %39, %36
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"(%d) vec[%d] = %.10e; should be zero!\0A\00"
@.str.1 = [9 x i8] c"(%d) %s\0A\00"
@.str.2 = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.3 = [19 x i8] c"Not a zero vector.\00"
@.str.4 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/pdutil.c\00"
define void @dcheck_zero_vec(i32 %0, i8* %1, i32 %2, double* nocapture %3) {
%5 = alloca [256 x i8]
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %29
7: ; preds = %4
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %7, %18
%10 = phi i64 [ 0, %7 ], [ %20, %18 ]
%11 = phi i32 [ 0, %7 ], [ %19, %18 ]
%12 = getelementptr inbounds double, double* %3, i64 %10
%13 = load double, double* %12
%14 = fcmp une double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = trunc i64 %10 to i32
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %16, double %13)
br label %18
18: ; preds = %9, %15
%19 = phi i32 [ 1, %15 ], [ %11, %9 ]
%20 = add nuw nsw i64 %10, 1
%21 = icmp eq i64 %20, %8
br i1 %21, label %22, label %9
22: ; preds = %18
%23 = icmp eq i32 %19, 0
br i1 %23, label %29, label %24
24: ; preds = %22
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %1)
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%27 = call i32 @sprintf(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 268, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 @superlu_abort_and_exit(i8* %26)
br label %29
29: ; preds = %4, %24, %22
ret void
}