#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*/ size_mul_check(size_t, size_t);
void *tor_malloc_zero_(size_t);
int /*<<< orphan*/ tor_raw_abort_();
int /*<<< orphan*/ tor_raw_assertion_failed_msg_(char *, int, char *,
                                                 int /*<<< orphan*/ *);
void *tor_calloc_(size_t nmemb, size_t size) {
  (void)({
    if (!(size_mul_check(nmemb, size))) {
      tor_raw_assertion_failed_msg_(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/zcoinofficial/zcoin/refs/heads/master/src/"
          "tor/src/lib/malloc/malloc.c",
          109, "size_mul_check(nmemb, size)", NULL);
      tor_raw_abort_();
    }
  });
  return tor_malloc_zero_((nmemb * size));
}


x86 assembly (clang, -O0):
<tor_calloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <size_mul_check@plt>
cmp    $0x0,%eax
jne    1189 <tor_calloc_+0x49>
lea    0xe93(%rip),%rdi
mov    $0x6d,%esi
lea    0xf27(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <tor_raw_assertion_failed_msg_@plt>
mov    $0x0,%al
call   1040 <tor_raw_abort_@plt>
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1060 <tor_malloc_zero_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_calloc_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <size_mul_check@plt>
test   %eax,%eax
jne    1174 <tor_calloc_+0x34>
lea    0xea6(%rip),%rdi
lea    0xf3f(%rip),%rdx
mov    $0x6d,%esi
xor    %ecx,%ecx
call   1050 <tor_raw_assertion_failed_msg_@plt>
xor    %eax,%eax
call   1040 <tor_raw_abort_@plt>
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <tor_malloc_zero_@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zcoinofficial/zcoin/refs/heads/master/src/tor/src/lib/malloc/malloc.c\00"
@.str.1 = [28 x i8] c"size_mul_check(nmemb, size)\00"
define i8* @tor_calloc_(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @size_mul_check(i64 %5, i64 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = call i32 @tor_raw_assertion_failed_msg_(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32* null)
%11 = call i32 (...) @tor_raw_abort_()
br label %12
12: ; preds = %9, %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = mul i64 %13, %14
%16 = call i8* @tor_malloc_zero_(i64 %15)
ret i8* %16
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zcoinofficial/zcoin/refs/heads/master/src/tor/src/lib/malloc/malloc.c\00"
@.str.1 = [28 x i8] c"size_mul_check(nmemb, size)\00"
define i8* @tor_calloc_(i64 %0, i64 %1) {
%3 = tail call i32 @size_mul_check(i64 %0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @tor_raw_assertion_failed_msg_(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32* null)
%7 = tail call i32 (...) @tor_raw_abort_()
br label %8
8: ; preds = %5, %2
%9 = mul i64 %1, %0
%10 = tail call i8* @tor_malloc_zero_(i64 %9)
ret i8* %10
}