#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*/ Except_raise(char *, char *, int);
int /*<<< orphan*/ assert(int);
void *calloc(long, long);
void *Mem_calloc(long count, long nbytes, const char *file, int line) {
  void *ptr;
  assert(count > 0);
  assert(nbytes > 0);
  ptr = calloc(count, nbytes);
  if (ptr == NULL) {
    Except_raise(
        "Mem_calloc",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/QubeX2/mangolib/refs/heads/master/src/mem.c",
        29);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<Mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119f <Mem_calloc+0x6f>
lea    0xe72(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    $0x1d,%edx
call   1050 <Except_raise@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setg   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setg   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1181 <Mem_calloc+0x51>
lea    0xe90(%rip),%rdi
lea    0xe94(%rip),%rsi
mov    $0x1d,%edx
call   1050 <Except_raise@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Mem_calloc\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/QubeX2/mangolib/refs/heads/master/src/mem.c\00"
define i8* @Mem_calloc(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = icmp sgt i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %6
%15 = icmp sgt i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = call i8* @calloc(i64 %18, i64 %19)
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %25
23: ; preds = %4
%24 = call i32 @Except_raise(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 29)
br label %25
25: ; preds = %23, %4
%26 = load i8*, i8** %9
ret i8* %26
}

LLVM IR (-O2):
@.str = [11 x i8] c"Mem_calloc\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/QubeX2/mangolib/refs/heads/master/src/mem.c\00"
define noalias i8* @Mem_calloc(i64 %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp sgt i64 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp sgt i64 %1, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* @calloc(i64 %0, i64 %1)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = tail call i32 @Except_raise(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 29)
br label %15
15: ; preds = %13, %4
ret i8* %11
}