#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*/ sprintf(char *, char *, char *, int, char *);
int /*<<< orphan*/ superlu_abort_and_exit(char *);
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()", 57,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/dribbroc/HONEI/refs/heads/master/"
              "honei/math/SuperLU_4.1/SRC/sp_coletree.c");
      superlu_abort_and_exit(msg);
    };
  }
  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    118e <mxCallocInt+0x5e>
lea    -0x110(%rbp),%rdi
lea    0xe96(%rip),%rsi
lea    0xea9(%rip),%rdx
mov    $0x39,%ecx
lea    0xecb(%rip),%r8
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <superlu_abort_and_exit@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11be <mxCallocInt+0x8e>
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    1195 <mxCallocInt+0x65>
mov    -0x10(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mxCallocInt>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1050 <superlu_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1186 <mxCallocInt+0x46>
test   %ebx,%ebx
jle    1176 <mxCallocInt+0x36>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe73(%rip),%rsi
lea    0xe86(%rip),%rdx
lea    0xead(%rip),%r8
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x39,%ecx
call   1060 <sprintf@plt>
mov    %r15,%rdi
call   1030 <superlu_abort_and_exit@plt>
test   %ebx,%ebx
jg     1166 <mxCallocInt+0x26>
jmp    1176 <mxCallocInt+0x36>

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 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dribbroc/HONEI/refs/heads/master/honei/math/SuperLU_4.1/SRC/sp_coletree.c\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 %19, 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 57, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%18 = call i32 @superlu_abort_and_exit(i8* %17)
br label %19
19: ; preds = %14, %1
store i32 0, i32* %3
br label %20
20: ; preds = %29, %19
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = load i32*, i32** %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32 0, i32* %28
br label %29
29: ; preds = %24
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %20
32: ; preds = %20
%33 = load i32*, i32** %4
ret i32* %33
}

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 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dribbroc/HONEI/refs/heads/master/honei/math/SuperLU_4.1/SRC/sp_coletree.c\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 %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, 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 57, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @superlu_abort_and_exit(i8* %8)
br label %11
11: ; preds = %7, %1
%12 = icmp sgt i32 %0, 0
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = zext i32 %0 to i64
%15 = shl nuw nsw i64 %14, 2
br label %16
16: ; preds = %13, %11
%17 = inttoptr i64 %4 to i32*
ret i32* %17
}