#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 *intMalloc(int n) {
  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 intMalloc()", 137,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Narrat/eispice/refs/heads/master/libs/"
              "superlu/SRC/memory.c");
      superlu_abort_and_exit(msg);
    };
  }
  return (buf);
}


x86 assembly (clang, -O0):
<intMalloc>:
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 <intMalloc+0x5e>
lea    -0x110(%rbp),%rdi
lea    0xe96(%rip),%rsi
lea    0xea9(%rip),%rdx
mov    $0x89,%ecx
lea    0xec9(%rip),%r8
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <superlu_abort_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intMalloc>:
push   %r14
push   %rbx
sub    $0x108,%rsp
shl    $0x2,%edi
call   1040 <superlu_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1177 <intMalloc+0x47>
lea    0xeaf(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xee7(%rip),%r8
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x89,%ecx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <superlu_abort_and_exit@plt>
mov    %rbx,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.1 = [44 x i8] c"SUPERLU_MALLOC fails for buf in intMalloc()\00"
@.str.2 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Narrat/eispice/refs/heads/master/libs/superlu/SRC/memory.c\00"
define i32* @intMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [256 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i64 @superlu_malloc(i32 %8)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = icmp ne i32* %11, null
br i1 %12, label %18, label %13
13: ; preds = %1
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%17 = call i32 @superlu_abort_and_exit(i8* %16)
br label %18
18: ; preds = %13, %1
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s at line %d in file %s\0A\00"
@.str.1 = [44 x i8] c"SUPERLU_MALLOC fails for buf in intMalloc()\00"
@.str.2 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Narrat/eispice/refs/heads/master/libs/superlu/SRC/memory.c\00"
define i32* @intMalloc(i32 %0) {
%2 = alloca [256 x i8]
%3 = shl i32 %0, 2
%4 = tail call i64 @superlu_malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @superlu_abort_and_exit(i8* %7)
br label %10
10: ; preds = %6, %1
%11 = inttoptr i64 %4 to i32*
ret i32* %11
}