#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
scalar_t__ superlu_malloc(int);
int *mxCallocInt(int n) {
  register int i;
  int *buf;
  buf = (int *)superlu_malloc(n * sizeof(int));
  if (!buf) {
    {
      char msg[256];
      sprintf(msg, "%s at line %d in file %s\n",
              "SUPERLU_MALLOC fails for buf in mxCallocInt()", 40,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/pawkoz/dyplom/refs/heads/master/"
              "blender/intern/opennl/superlu/sp_coletree.c");
      {
        fprintf(stderr, "%s", msg);
        exit(-1);
      };
    };
  }
  for (i = 0; i < n; i++)
    buf[i] = 0;
  return (buf);
}


x86 assembly (clang, -O0):
<mxCallocInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <superlu_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b8 <mxCallocInt+0x78>
lea    -0x110(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    0xe99(%rip),%rdx
mov    $0x28,%ecx
lea    0xebb(%rip),%r8
call   1050 <sprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    -0x110(%rbp),%rdx
lea    0xf45(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e8 <mxCallocInt+0xa8>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bf <mxCallocInt+0x7f>
mov    -0x10(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mxCallocInt>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1050 <superlu_malloc@plt>
test   %rax,%rax
je     1192 <mxCallocInt+0x42>
mov    %rax,%r14
test   %ebx,%ebx
jle    1184 <mxCallocInt+0x34>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe67(%rip),%rsi
lea    0xe7a(%rip),%rdx
lea    0xea1(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x28,%ecx
call   1060 <sprintf@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xf27(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.1 = [46 x i8] c"SUPERLU_MALLOC fails for buf in mxCallocInt()\00"
@.str.2 = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pawkoz/dyplom/refs/heads/master/blender/intern/opennl/superlu/sp_coletree.c\00"
@stderr = global i32 0
@.str.3 = [3 x i8] c"%s\00"
define i32* @mxCallocInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [256 x i8]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @superlu_malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = icmp ne i32* %12, null
br i1 %13, label %21, label %14
14: ; preds = %1
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%16 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %1
store i32 0, i32* %3
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = load i32*, i32** %4
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 0, i32* %30
br label %31
31: ; preds = %26
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %22
34: ; preds = %22
%35 = load i32*, i32** %4
ret i32* %35
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.1 = [46 x i8] c"SUPERLU_MALLOC fails for buf in mxCallocInt()\00"
@.str.2 = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pawkoz/dyplom/refs/heads/master/blender/intern/opennl/superlu/sp_coletree.c\00"
@stderr = global i32 0
@.str.3 = [3 x i8] c"%s\00"
define i32* @mxCallocInt(i32 %0) {
%2 = alloca [256 x i8]
%3 = shl i32 %0, 2
%4 = tail call i64 @superlu_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %18
9: ; preds = %7
%10 = zext i32 %0 to i64
%11 = shl nuw nsw i64 %10, 2
br label %18
12: ; preds = %1
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%14 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %9, %7
%19 = inttoptr i64 %4 to i32*
ret i32* %19
}