#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*/ WriteSLUErrorMessage(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ sprintf_s(char *, int, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ superlu_abort_and_exit(char *);
void check_repfnz(int n, int w, int jcol, int *repfnz) {
  int jj, k;
  for (jj = jcol; jj < jcol + w; jj++)
    for (k = 0; k < n; k++)
      if (repfnz[(jj - jcol) * n + k] != (-1)) {
        fprintf(stderr, "col %d, repfnz_col[%d] = %d\n", jj, k,
                repfnz[(jj - jcol) * n + k]);
        {
          char msg[256];
          sprintf_s(msg, 256, "Error: %s", "check_repfnz");
          WriteSLUErrorMessage(msg);
          superlu_abort_and_exit(msg);
        };
      }
}


x86 assembly (clang, -O0):
<check_repfnz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1230 <check_repfnz+0xf0>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    121d <check_repfnz+0xdd>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     120a <check_repfnz+0xca>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%esi
sub    -0xc(%rbp),%esi
imul   -0x4(%rbp),%esi
add    -0x20(%rbp),%esi
movslq %esi,%rsi
mov    (%rax,%rsi,4),%r8d
lea    0xe32(%rip),%rsi
call   1060 <fprintf@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
lea    0xe37(%rip),%rdx
lea    0xe3a(%rip),%rcx
call   1030 <sprintf_s@plt>
lea    -0x120(%rbp),%rdi
call   1050 <WriteSLUErrorMessage@plt>
lea    -0x120(%rbp),%rdi
call   1040 <superlu_abort_and_exit@plt>
jmp    120f <check_repfnz+0xcf>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1176 <check_repfnz+0x36>
jmp    1222 <check_repfnz+0xe2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115e <check_repfnz+0x1e>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_repfnz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %edi,0xc(%rsp)
test   %esi,%esi
jle    1206 <check_repfnz+0xc6>
mov    %rcx,%rbx
add    %edx,%esi
movslq %edx,%rbp
movslq 0xc(%rsp),%rax
movslq %esi,%rcx
mov    %rcx,0x10(%rsp)
mov    %eax,%r12d
shl    $0x2,%rax
mov    %rax,0x18(%rsp)
lea    0xea2(%rip),%r13
lea    0x20(%rsp),%r14
jmp    11a0 <check_repfnz+0x60>
nopl   0x0(%rax)
add    $0x1,%rbp
add    0x18(%rsp),%rbx
cmp    0x10(%rsp),%rbp
jge    1206 <check_repfnz+0xc6>
cmpl   $0x0,0xc(%rsp)
jle    1190 <check_repfnz+0x50>
xor    %r15d,%r15d
jmp    11b9 <check_repfnz+0x79>
nopl   0x0(%rax)
add    $0x1,%r15
cmp    %r15,%r12
je     1190 <check_repfnz+0x50>
mov    (%rbx,%r15,4),%r8d
cmp    $0xffffffff,%r8d
je     11b0 <check_repfnz+0x70>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
lea    0xe2d(%rip),%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1060 <fprintf@plt>
mov    %r14,%rdi
mov    $0x100,%esi
lea    0xe31(%rip),%rdx
mov    %r13,%rcx
call   1030 <sprintf_s@plt>
mov    %r14,%rdi
call   1050 <WriteSLUErrorMessage@plt>
mov    %r14,%rdi
call   1040 <superlu_abort_and_exit@plt>
jmp    11b0 <check_repfnz+0x70>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"col %d, repfnz_col[%d] = %d\0A\00"
@.str.1 = [10 x i8] c"Error: %s\00"
@.str.2 = [13 x i8] c"check_repfnz\00"
define void @check_repfnz(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%12 = load i32, i32* %7
store i32 %12, i32* %9
br label %13
13: ; preds = %64, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
%18 = icmp slt i32 %14, %17
br i1 %18, label %19, label %67
19: ; preds = %13
store i32 0, i32* %10
br label %20
20: ; preds = %60, %19
%21 = load i32, i32* %10
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %63
24: ; preds = %20
%25 = load i32*, i32** %8
%26 = load i32, i32* %9
%27 = load i32, i32* %7
%28 = sub nsw i32 %26, %27
%29 = load i32, i32* %5
%30 = mul nsw i32 %28, %29
%31 = load i32, i32* %10
%32 = add nsw i32 %30, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %25, i64 %33
%35 = load i32, i32* %34
%36 = icmp ne i32 %35, -1
br i1 %36, label %37, label %59
37: ; preds = %24
%38 = load i32, i32* @stderr
%39 = load i32, i32* %9
%40 = load i32, i32* %10
%41 = load i32*, i32** %8
%42 = load i32, i32* %9
%43 = load i32, i32* %7
%44 = sub nsw i32 %42, %43
%45 = load i32, i32* %5
%46 = mul nsw i32 %44, %45
%47 = load i32, i32* %10
%48 = add nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %41, i64 %49
%51 = load i32, i32* %50
%52 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %39, i32 %40, i32 %51)
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%54 = call i32 @sprintf_s(i8* %53, i32 256, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%56 = call i32 @WriteSLUErrorMessage(i8* %55)
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%58 = call i32 @superlu_abort_and_exit(i8* %57)
br label %59
59: ; preds = %37, %24
br label %60
60: ; preds = %59
%61 = load i32, i32* %10
%62 = add nsw i32 %61, 1
store i32 %62, i32* %10
br label %20
63: ; preds = %20
br label %64
64: ; preds = %63
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %13
67: ; preds = %13
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"col %d, repfnz_col[%d] = %d\0A\00"
@.str.1 = [10 x i8] c"Error: %s\00"
@.str.2 = [13 x i8] c"check_repfnz\00"
define void @check_repfnz(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = alloca [256 x i8]
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %40
7: ; preds = %4
%8 = add nsw i32 %2, %1
%9 = icmp sgt i32 %0, 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = sext i32 %2 to i64
%12 = sext i32 %0 to i64
%13 = sext i32 %8 to i64
%14 = zext i32 %0 to i64
br label %15
15: ; preds = %7, %37
%16 = phi i64 [ %11, %7 ], [ %38, %37 ]
br i1 %9, label %17, label %37
17: ; preds = %15
%18 = sub nsw i64 %16, %11
%19 = mul nsw i64 %18, %12
%20 = trunc i64 %16 to i32
br label %21
21: ; preds = %17, %34
%22 = phi i64 [ 0, %17 ], [ %35, %34 ]
%23 = add nsw i64 %22, %19
%24 = getelementptr inbounds i32, i32* %3, i64 %23
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, -1
br i1 %26, label %34, label %27
27: ; preds = %21
%28 = load i32, i32* @stderr
%29 = trunc i64 %22 to i32
%30 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %29, i32 %25)
%31 = call i32 @sprintf_s(i8* %10, i32 256, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @WriteSLUErrorMessage(i8* %10)
%33 = call i32 @superlu_abort_and_exit(i8* %10)
br label %34
34: ; preds = %21, %27
%35 = add nuw nsw i64 %22, 1
%36 = icmp eq i64 %35, %14
br i1 %36, label %37, label %21
37: ; preds = %34, %15
%38 = add nsw i64 %16, 1
%39 = icmp slt i64 %38, %13
br i1 %39, label %15, label %40
40: ; preds = %37, %4
ret void
}