#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*/ assert(int);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int ofc_getCount();
int /*<<< orphan*/ stdout;
void test_calloc(void) {
  char *ptr;
  int i;
  do {
    fprintf(stdout, "[TEST] calloc_01 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 8);
  for (i = 0; i < 16; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_02 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(2, 4);
  for (i = 0; i < 16; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_03 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 5);
  for (i = 0; i < 16; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 11);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_03 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(5, 1);
  for (i = 0; i < 16; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_04 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 1024);
  for (i = 0; i < 1032; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_05 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 256 * 1024);
  for (i = 0; i < (256 * 1024) + 8; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_06 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 8);
  for (i = 0; i < 8; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 0);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_07 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 1024);
  for (i = 0; i < 1024; i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 0);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_08 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(1, 256 * 1024);
  for (i = 0; i < (256 * 1024); i++)
    ptr[i] = 'z';
  free(ptr);
  assert(ofc_getCount() == 0);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_09 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(6, 0);
  for (i = 0; i < 8; i++)
    ptr[i] = 'b';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_10 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(0, 6);
  for (i = 0; i < 8; i++)
    ptr[i] = 'b';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  do {
    fprintf(stdout, "[TEST] calloc_10 ...\n");
    fflush(stdout);
  } while (0);
  ptr = (char *)calloc(0, 0);
  for (i = 0; i < 8; i++)
    ptr[i] = 'b';
  free(ptr);
  assert(ofc_getCount() == 8);
  do {
    fprintf(stdout, "passed\n");
    fflush(stdout);
  } while (0);
  return;
}


x86 assembly (clang, -O0):
<test_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    11c9 <test_calloc+0x69>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a5 <test_calloc+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
lea    0xe1d(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    1211 <test_calloc+0xb1>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
lea    0xdfd(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1272 <test_calloc+0x112>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    124e <test_calloc+0xee>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
lea    0xd74(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    12ba <test_calloc+0x15a>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
lea    0xd6a(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    131b <test_calloc+0x1bb>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12f7 <test_calloc+0x197>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
lea    0xccb(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    1363 <test_calloc+0x203>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
lea    0xcc1(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    13c4 <test_calloc+0x264>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13a0 <test_calloc+0x240>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
lea    0xc22(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2be0(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    140c <test_calloc+0x2ac>
mov    0x2bcd(%rip),%rax
mov    (%rax),%edi
lea    0xc2e(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x400,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x408,-0xc(%rbp)
jge    1470 <test_calloc+0x310>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1449 <test_calloc+0x2e9>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2b49(%rip),%rax
mov    (%rax),%edi
lea    0xb76(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2b34(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    14b8 <test_calloc+0x358>
mov    0x2b21(%rip),%rax
mov    (%rax),%edi
lea    0xb98(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2b0c(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x40000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40008,-0xc(%rbp)
jge    151c <test_calloc+0x3bc>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14f5 <test_calloc+0x395>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2a9d(%rip),%rax
mov    (%rax),%edi
lea    0xaca(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2a88(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    1564 <test_calloc+0x404>
mov    0x2a75(%rip),%rax
mov    (%rax),%edi
lea    0xb02(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2a60(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    15c5 <test_calloc+0x465>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    15a1 <test_calloc+0x441>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x29f4(%rip),%rax
mov    (%rax),%edi
lea    0xa21(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x29df(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    160d <test_calloc+0x4ad>
mov    0x29cc(%rip),%rax
mov    (%rax),%edi
lea    0xa6f(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x29b7(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x400,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    1671 <test_calloc+0x511>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    164a <test_calloc+0x4ea>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2948(%rip),%rax
mov    (%rax),%edi
lea    0x975(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2933(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16b9 <test_calloc+0x559>
mov    0x2920(%rip),%rax
mov    (%rax),%edi
lea    0x9d9(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x290b(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
mov    $0x40000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40000,-0xc(%rbp)
jge    171d <test_calloc+0x5bd>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    16f6 <test_calloc+0x596>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x289c(%rip),%rax
mov    (%rax),%edi
lea    0x8c9(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2887(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    1765 <test_calloc+0x605>
mov    0x2874(%rip),%rax
mov    (%rax),%edi
lea    0x943(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x285f(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    17c3 <test_calloc+0x663>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    179f <test_calloc+0x63f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x27f6(%rip),%rax
mov    (%rax),%edi
lea    0x823(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x27e1(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    180b <test_calloc+0x6ab>
mov    0x27ce(%rip),%rax
mov    (%rax),%edi
lea    0x8b3(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x27b9(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1869 <test_calloc+0x709>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1845 <test_calloc+0x6e5>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2750(%rip),%rax
mov    (%rax),%edi
lea    0x77d(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x273b(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    18b1 <test_calloc+0x751>
mov    0x2728(%rip),%rax
mov    (%rax),%edi
lea    0x80d(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2713(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    190c <test_calloc+0x7ac>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    18e8 <test_calloc+0x788>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1080 <ofc_getCount@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x26ad(%rip),%rax
mov    (%rax),%edi
lea    0x6da(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2698(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_calloc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e61(%rip),%r15
mov    (%r15),%edi
lea    0xe87(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
movaps 0xe54(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
lea    0xe50(%rip),%r14
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xe3e(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
movaps 0xded(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xdf4(%rip),%rbx
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1050 <calloc@plt>
movaps 0xd8a(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
movaps 0xd2e(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xd4b(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x400,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    $0x408,%edx
mov    %rax,%rdi
mov    $0x7a,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xcf6(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x40000,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    $0x40008,%edx
mov    %rax,%rdi
mov    $0x7a,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xca1(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
movabs $0x7a7a7a7a7a7a7a7a,%rcx
7a 7a 7a
mov    %rcx,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xc55(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x400,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    $0x400,%edx
mov    %rax,%rdi
mov    $0x7a,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xc01(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
mov    $0x40000,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    $0x40000,%edx
mov    %rax,%rdi
mov    $0x7a,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xbad(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1050 <calloc@plt>
movabs $0x6262626262626262,%r12
62 62 62
mov    %r12,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
lea    0xb63(%rip),%rbx
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1050 <calloc@plt>
mov    %r12,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
call   1080 <fflush@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <calloc@plt>
mov    %r12,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1090 <ofc_getCount@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1070 <fprintf@plt>
mov    (%r15),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1080 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"[TEST] calloc_01 ...\0A\00"
@.str.1 = [8 x i8] c"passed\0A\00"
@.str.2 = [22 x i8] c"[TEST] calloc_02 ...\0A\00"
@.str.3 = [22 x i8] c"[TEST] calloc_03 ...\0A\00"
@.str.4 = [22 x i8] c"[TEST] calloc_04 ...\0A\00"
@.str.5 = [22 x i8] c"[TEST] calloc_05 ...\0A\00"
@.str.6 = [22 x i8] c"[TEST] calloc_06 ...\0A\00"
@.str.7 = [22 x i8] c"[TEST] calloc_07 ...\0A\00"
@.str.8 = [22 x i8] c"[TEST] calloc_08 ...\0A\00"
@.str.9 = [22 x i8] c"[TEST] calloc_09 ...\0A\00"
@.str.10 = [22 x i8] c"[TEST] calloc_10 ...\0A\00"
define void @test_calloc() {
%1 = alloca i8*
%2 = alloca i32
br label %3
3: ; preds = %0
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
br label %8
8: ; preds = %3
%9 = call i64 @calloc(i32 1, i32 8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %1
store i32 0, i32* %2
br label %11
11: ; preds = %19, %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i8*, i8** %1
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 122, i8* %18
br label %19
19: ; preds = %14
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %11
22: ; preds = %11
%23 = load i8*, i8** %1
%24 = call i32 @free(i8* %23)
%25 = call i32 (...) @ofc_getCount()
%26 = icmp eq i32 %25, 8
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
br label %29
29: ; preds = %22
%30 = load i32, i32* @stdout
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%32 = load i32, i32* @stdout
%33 = call i32 @fflush(i32 %32)
br label %34
34: ; preds = %29
br label %35
35: ; preds = %34
%36 = load i32, i32* @stdout
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* @stdout
%39 = call i32 @fflush(i32 %38)
br label %40
40: ; preds = %35
%41 = call i64 @calloc(i32 2, i32 4)
%42 = inttoptr i64 %41 to i8*
store i8* %42, i8** %1
store i32 0, i32* %2
br label %43
43: ; preds = %51, %40
%44 = load i32, i32* %2
%45 = icmp slt i32 %44, 16
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load i8*, i8** %1
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
store i8 122, i8* %50
br label %51
51: ; preds = %46
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
store i32 %53, i32* %2
br label %43
54: ; preds = %43
%55 = load i8*, i8** %1
%56 = call i32 @free(i8* %55)
%57 = call i32 (...) @ofc_getCount()
%58 = icmp eq i32 %57, 8
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
br label %61
61: ; preds = %54
%62 = load i32, i32* @stdout
%63 = call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%64 = load i32, i32* @stdout
%65 = call i32 @fflush(i32 %64)
br label %66
66: ; preds = %61
br label %67
67: ; preds = %66
%68 = load i32, i32* @stdout
%69 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%70 = load i32, i32* @stdout
%71 = call i32 @fflush(i32 %70)
br label %72
72: ; preds = %67
%73 = call i64 @calloc(i32 1, i32 5)
%74 = inttoptr i64 %73 to i8*
store i8* %74, i8** %1
store i32 0, i32* %2
br label %75
75: ; preds = %83, %72
%76 = load i32, i32* %2
%77 = icmp slt i32 %76, 16
br i1 %77, label %78, label %86
78: ; preds = %75
%79 = load i8*, i8** %1
%80 = load i32, i32* %2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
store i8 122, i8* %82
br label %83
83: ; preds = %78
%84 = load i32, i32* %2
%85 = add nsw i32 %84, 1
store i32 %85, i32* %2
br label %75
86: ; preds = %75
%87 = load i8*, i8** %1
%88 = call i32 @free(i8* %87)
%89 = call i32 (...) @ofc_getCount()
%90 = icmp eq i32 %89, 11
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
br label %93
93: ; preds = %86
%94 = load i32, i32* @stdout
%95 = call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%96 = load i32, i32* @stdout
%97 = call i32 @fflush(i32 %96)
br label %98
98: ; preds = %93
br label %99
99: ; preds = %98
%100 = load i32, i32* @stdout
%101 = call i32 @fprintf(i32 %100, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%102 = load i32, i32* @stdout
%103 = call i32 @fflush(i32 %102)
br label %104
104: ; preds = %99
%105 = call i64 @calloc(i32 5, i32 1)
%106 = inttoptr i64 %105 to i8*
store i8* %106, i8** %1
store i32 0, i32* %2
br label %107
107: ; preds = %115, %104
%108 = load i32, i32* %2
%109 = icmp slt i32 %108, 16
br i1 %109, label %110, label %118
110: ; preds = %107
%111 = load i8*, i8** %1
%112 = load i32, i32* %2
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
store i8 122, i8* %114
br label %115
115: ; preds = %110
%116 = load i32, i32* %2
%117 = add nsw i32 %116, 1
store i32 %117, i32* %2
br label %107
118: ; preds = %107
%119 = load i8*, i8** %1
%120 = call i32 @free(i8* %119)
%121 = call i32 (...) @ofc_getCount()
%122 = icmp eq i32 %121, 8
%123 = zext i1 %122 to i32
%124 = call i32 @assert(i32 %123)
br label %125
125: ; preds = %118
%126 = load i32, i32* @stdout
%127 = call i32 @fprintf(i32 %126, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%128 = load i32, i32* @stdout
%129 = call i32 @fflush(i32 %128)
br label %130
130: ; preds = %125
br label %131
131: ; preds = %130
%132 = load i32, i32* @stdout
%133 = call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%134 = load i32, i32* @stdout
%135 = call i32 @fflush(i32 %134)
br label %136
136: ; preds = %131
%137 = call i64 @calloc(i32 1, i32 1024)
%138 = inttoptr i64 %137 to i8*
store i8* %138, i8** %1
store i32 0, i32* %2
br label %139
139: ; preds = %147, %136
%140 = load i32, i32* %2
%141 = icmp slt i32 %140, 1032
br i1 %141, label %142, label %150
142: ; preds = %139
%143 = load i8*, i8** %1
%144 = load i32, i32* %2
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %143, i64 %145
store i8 122, i8* %146
br label %147
147: ; preds = %142
%148 = load i32, i32* %2
%149 = add nsw i32 %148, 1
store i32 %149, i32* %2
br label %139
150: ; preds = %139
%151 = load i8*, i8** %1
%152 = call i32 @free(i8* %151)
%153 = call i32 (...) @ofc_getCount()
%154 = icmp eq i32 %153, 8
%155 = zext i1 %154 to i32
%156 = call i32 @assert(i32 %155)
br label %157
157: ; preds = %150
%158 = load i32, i32* @stdout
%159 = call i32 @fprintf(i32 %158, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%160 = load i32, i32* @stdout
%161 = call i32 @fflush(i32 %160)
br label %162
162: ; preds = %157
br label %163
163: ; preds = %162
%164 = load i32, i32* @stdout
%165 = call i32 @fprintf(i32 %164, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%166 = load i32, i32* @stdout
%167 = call i32 @fflush(i32 %166)
br label %168
168: ; preds = %163
%169 = call i64 @calloc(i32 1, i32 262144)
%170 = inttoptr i64 %169 to i8*
store i8* %170, i8** %1
store i32 0, i32* %2
br label %171
171: ; preds = %179, %168
%172 = load i32, i32* %2
%173 = icmp slt i32 %172, 262152
br i1 %173, label %174, label %182
174: ; preds = %171
%175 = load i8*, i8** %1
%176 = load i32, i32* %2
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i8, i8* %175, i64 %177
store i8 122, i8* %178
br label %179
179: ; preds = %174
%180 = load i32, i32* %2
%181 = add nsw i32 %180, 1
store i32 %181, i32* %2
br label %171
182: ; preds = %171
%183 = load i8*, i8** %1
%184 = call i32 @free(i8* %183)
%185 = call i32 (...) @ofc_getCount()
%186 = icmp eq i32 %185, 8
%187 = zext i1 %186 to i32
%188 = call i32 @assert(i32 %187)
br label %189
189: ; preds = %182
%190 = load i32, i32* @stdout
%191 = call i32 @fprintf(i32 %190, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%192 = load i32, i32* @stdout
%193 = call i32 @fflush(i32 %192)
br label %194
194: ; preds = %189
br label %195
195: ; preds = %194
%196 = load i32, i32* @stdout
%197 = call i32 @fprintf(i32 %196, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%198 = load i32, i32* @stdout
%199 = call i32 @fflush(i32 %198)
br label %200
200: ; preds = %195
%201 = call i64 @calloc(i32 1, i32 8)
%202 = inttoptr i64 %201 to i8*
store i8* %202, i8** %1
store i32 0, i32* %2
br label %203
203: ; preds = %211, %200
%204 = load i32, i32* %2
%205 = icmp slt i32 %204, 8
br i1 %205, label %206, label %214
206: ; preds = %203
%207 = load i8*, i8** %1
%208 = load i32, i32* %2
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i8, i8* %207, i64 %209
store i8 122, i8* %210
br label %211
211: ; preds = %206
%212 = load i32, i32* %2
%213 = add nsw i32 %212, 1
store i32 %213, i32* %2
br label %203
214: ; preds = %203
%215 = load i8*, i8** %1
%216 = call i32 @free(i8* %215)
%217 = call i32 (...) @ofc_getCount()
%218 = icmp eq i32 %217, 0
%219 = zext i1 %218 to i32
%220 = call i32 @assert(i32 %219)
br label %221
221: ; preds = %214
%222 = load i32, i32* @stdout
%223 = call i32 @fprintf(i32 %222, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%224 = load i32, i32* @stdout
%225 = call i32 @fflush(i32 %224)
br label %226
226: ; preds = %221
br label %227
227: ; preds = %226
%228 = load i32, i32* @stdout
%229 = call i32 @fprintf(i32 %228, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%230 = load i32, i32* @stdout
%231 = call i32 @fflush(i32 %230)
br label %232
232: ; preds = %227
%233 = call i64 @calloc(i32 1, i32 1024)
%234 = inttoptr i64 %233 to i8*
store i8* %234, i8** %1
store i32 0, i32* %2
br label %235
235: ; preds = %243, %232
%236 = load i32, i32* %2
%237 = icmp slt i32 %236, 1024
br i1 %237, label %238, label %246
238: ; preds = %235
%239 = load i8*, i8** %1
%240 = load i32, i32* %2
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i8, i8* %239, i64 %241
store i8 122, i8* %242
br label %243
243: ; preds = %238
%244 = load i32, i32* %2
%245 = add nsw i32 %244, 1
store i32 %245, i32* %2
br label %235
246: ; preds = %235
%247 = load i8*, i8** %1
%248 = call i32 @free(i8* %247)
%249 = call i32 (...) @ofc_getCount()
%250 = icmp eq i32 %249, 0
%251 = zext i1 %250 to i32
%252 = call i32 @assert(i32 %251)
br label %253
253: ; preds = %246
%254 = load i32, i32* @stdout
%255 = call i32 @fprintf(i32 %254, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%256 = load i32, i32* @stdout
%257 = call i32 @fflush(i32 %256)
br label %258
258: ; preds = %253
br label %259
259: ; preds = %258
%260 = load i32, i32* @stdout
%261 = call i32 @fprintf(i32 %260, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%262 = load i32, i32* @stdout
%263 = call i32 @fflush(i32 %262)
br label %264
264: ; preds = %259
%265 = call i64 @calloc(i32 1, i32 262144)
%266 = inttoptr i64 %265 to i8*
store i8* %266, i8** %1
store i32 0, i32* %2
br label %267
267: ; preds = %275, %264
%268 = load i32, i32* %2
%269 = icmp slt i32 %268, 262144
br i1 %269, label %270, label %278
270: ; preds = %267
%271 = load i8*, i8** %1
%272 = load i32, i32* %2
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8, i8* %271, i64 %273
store i8 122, i8* %274
br label %275
275: ; preds = %270
%276 = load i32, i32* %2
%277 = add nsw i32 %276, 1
store i32 %277, i32* %2
br label %267
278: ; preds = %267
%279 = load i8*, i8** %1
%280 = call i32 @free(i8* %279)
%281 = call i32 (...) @ofc_getCount()
%282 = icmp eq i32 %281, 0
%283 = zext i1 %282 to i32
%284 = call i32 @assert(i32 %283)
br label %285
285: ; preds = %278
%286 = load i32, i32* @stdout
%287 = call i32 @fprintf(i32 %286, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%288 = load i32, i32* @stdout
%289 = call i32 @fflush(i32 %288)
br label %290
290: ; preds = %285
br label %291
291: ; preds = %290
%292 = load i32, i32* @stdout
%293 = call i32 @fprintf(i32 %292, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%294 = load i32, i32* @stdout
%295 = call i32 @fflush(i32 %294)
br label %296
296: ; preds = %291
%297 = call i64 @calloc(i32 6, i32 0)
%298 = inttoptr i64 %297 to i8*
store i8* %298, i8** %1
store i32 0, i32* %2
br label %299
299: ; preds = %307, %296
%300 = load i32, i32* %2
%301 = icmp slt i32 %300, 8
br i1 %301, label %302, label %310
302: ; preds = %299
%303 = load i8*, i8** %1
%304 = load i32, i32* %2
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds i8, i8* %303, i64 %305
store i8 98, i8* %306
br label %307
307: ; preds = %302
%308 = load i32, i32* %2
%309 = add nsw i32 %308, 1
store i32 %309, i32* %2
br label %299
310: ; preds = %299
%311 = load i8*, i8** %1
%312 = call i32 @free(i8* %311)
%313 = call i32 (...) @ofc_getCount()
%314 = icmp eq i32 %313, 8
%315 = zext i1 %314 to i32
%316 = call i32 @assert(i32 %315)
br label %317
317: ; preds = %310
%318 = load i32, i32* @stdout
%319 = call i32 @fprintf(i32 %318, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%320 = load i32, i32* @stdout
%321 = call i32 @fflush(i32 %320)
br label %322
322: ; preds = %317
br label %323
323: ; preds = %322
%324 = load i32, i32* @stdout
%325 = call i32 @fprintf(i32 %324, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%326 = load i32, i32* @stdout
%327 = call i32 @fflush(i32 %326)
br label %328
328: ; preds = %323
%329 = call i64 @calloc(i32 0, i32 6)
%330 = inttoptr i64 %329 to i8*
store i8* %330, i8** %1
store i32 0, i32* %2
br label %331
331: ; preds = %339, %328
%332 = load i32, i32* %2
%333 = icmp slt i32 %332, 8
br i1 %333, label %334, label %342
334: ; preds = %331
%335 = load i8*, i8** %1
%336 = load i32, i32* %2
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds i8, i8* %335, i64 %337
store i8 98, i8* %338
br label %339
339: ; preds = %334
%340 = load i32, i32* %2
%341 = add nsw i32 %340, 1
store i32 %341, i32* %2
br label %331
342: ; preds = %331
%343 = load i8*, i8** %1
%344 = call i32 @free(i8* %343)
%345 = call i32 (...) @ofc_getCount()
%346 = icmp eq i32 %345, 8
%347 = zext i1 %346 to i32
%348 = call i32 @assert(i32 %347)
br label %349
349: ; preds = %342
%350 = load i32, i32* @stdout
%351 = call i32 @fprintf(i32 %350, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%352 = load i32, i32* @stdout
%353 = call i32 @fflush(i32 %352)
br label %354
354: ; preds = %349
br label %355
355: ; preds = %354
%356 = load i32, i32* @stdout
%357 = call i32 @fprintf(i32 %356, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%358 = load i32, i32* @stdout
%359 = call i32 @fflush(i32 %358)
br label %360
360: ; preds = %355
%361 = call i64 @calloc(i32 0, i32 0)
%362 = inttoptr i64 %361 to i8*
store i8* %362, i8** %1
store i32 0, i32* %2
br label %363
363: ; preds = %371, %360
%364 = load i32, i32* %2
%365 = icmp slt i32 %364, 8
br i1 %365, label %366, label %374
366: ; preds = %363
%367 = load i8*, i8** %1
%368 = load i32, i32* %2
%369 = sext i32 %368 to i64
%370 = getelementptr inbounds i8, i8* %367, i64 %369
store i8 98, i8* %370
br label %371
371: ; preds = %366
%372 = load i32, i32* %2
%373 = add nsw i32 %372, 1
store i32 %373, i32* %2
br label %363
374: ; preds = %363
%375 = load i8*, i8** %1
%376 = call i32 @free(i8* %375)
%377 = call i32 (...) @ofc_getCount()
%378 = icmp eq i32 %377, 8
%379 = zext i1 %378 to i32
%380 = call i32 @assert(i32 %379)
br label %381
381: ; preds = %374
%382 = load i32, i32* @stdout
%383 = call i32 @fprintf(i32 %382, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%384 = load i32, i32* @stdout
%385 = call i32 @fflush(i32 %384)
br label %386
386: ; preds = %381
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"[TEST] calloc_01 ...\0A\00"
@.str.1 = [8 x i8] c"passed\0A\00"
@.str.2 = [22 x i8] c"[TEST] calloc_02 ...\0A\00"
@.str.3 = [22 x i8] c"[TEST] calloc_03 ...\0A\00"
@.str.4 = [22 x i8] c"[TEST] calloc_04 ...\0A\00"
@.str.5 = [22 x i8] c"[TEST] calloc_05 ...\0A\00"
@.str.6 = [22 x i8] c"[TEST] calloc_06 ...\0A\00"
@.str.7 = [22 x i8] c"[TEST] calloc_07 ...\0A\00"
@.str.8 = [22 x i8] c"[TEST] calloc_08 ...\0A\00"
@.str.9 = [22 x i8] c"[TEST] calloc_09 ...\0A\00"
@.str.10 = [22 x i8] c"[TEST] calloc_10 ...\0A\00"
define void @test_calloc() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i64 @calloc(i32 1, i32 8)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @free(i8* %6)
%8 = tail call i32 (...) @ofc_getCount()
%9 = icmp eq i32 %8, 8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = tail call i32 @fflush(i32 %14)
%16 = load i32, i32* @stdout
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
%20 = tail call i64 @calloc(i32 2, i32 4)
%21 = inttoptr i64 %20 to i8*
%22 = tail call i32 @free(i8* %21)
%23 = tail call i32 (...) @ofc_getCount()
%24 = icmp eq i32 %23, 8
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
%27 = load i32, i32* @stdout
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @stdout
%30 = tail call i32 @fflush(i32 %29)
%31 = load i32, i32* @stdout
%32 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%33 = load i32, i32* @stdout
%34 = tail call i32 @fflush(i32 %33)
%35 = tail call i64 @calloc(i32 1, i32 5)
%36 = inttoptr i64 %35 to i8*
%37 = tail call i32 @free(i8* %36)
%38 = tail call i32 (...) @ofc_getCount()
%39 = icmp eq i32 %38, 11
%40 = zext i1 %39 to i32
%41 = tail call i32 @assert(i32 %40)
%42 = load i32, i32* @stdout
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%44 = load i32, i32* @stdout
%45 = tail call i32 @fflush(i32 %44)
%46 = load i32, i32* @stdout
%47 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%48 = load i32, i32* @stdout
%49 = tail call i32 @fflush(i32 %48)
%50 = tail call i64 @calloc(i32 5, i32 1)
%51 = inttoptr i64 %50 to i8*
%52 = tail call i32 @free(i8* %51)
%53 = tail call i32 (...) @ofc_getCount()
%54 = icmp eq i32 %53, 8
%55 = zext i1 %54 to i32
%56 = tail call i32 @assert(i32 %55)
%57 = load i32, i32* @stdout
%58 = tail call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%59 = load i32, i32* @stdout
%60 = tail call i32 @fflush(i32 %59)
%61 = load i32, i32* @stdout
%62 = tail call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%63 = load i32, i32* @stdout
%64 = tail call i32 @fflush(i32 %63)
%65 = tail call i64 @calloc(i32 1, i32 1024)
%66 = inttoptr i64 %65 to i8*
%67 = tail call i32 @free(i8* %66)
%68 = tail call i32 (...) @ofc_getCount()
%69 = icmp eq i32 %68, 8
%70 = zext i1 %69 to i32
%71 = tail call i32 @assert(i32 %70)
%72 = load i32, i32* @stdout
%73 = tail call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%74 = load i32, i32* @stdout
%75 = tail call i32 @fflush(i32 %74)
%76 = load i32, i32* @stdout
%77 = tail call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%78 = load i32, i32* @stdout
%79 = tail call i32 @fflush(i32 %78)
%80 = tail call i64 @calloc(i32 1, i32 262144)
%81 = inttoptr i64 %80 to i8*
%82 = tail call i32 @free(i8* %81)
%83 = tail call i32 (...) @ofc_getCount()
%84 = icmp eq i32 %83, 8
%85 = zext i1 %84 to i32
%86 = tail call i32 @assert(i32 %85)
%87 = load i32, i32* @stdout
%88 = tail call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%89 = load i32, i32* @stdout
%90 = tail call i32 @fflush(i32 %89)
%91 = load i32, i32* @stdout
%92 = tail call i32 @fprintf(i32 %91, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%93 = load i32, i32* @stdout
%94 = tail call i32 @fflush(i32 %93)
%95 = tail call i64 @calloc(i32 1, i32 8)
%96 = inttoptr i64 %95 to i8*
%97 = inttoptr i64 %95 to i64*
store i64 8825501086245354106, i64* %97
%98 = tail call i32 @free(i8* %96)
%99 = tail call i32 (...) @ofc_getCount()
%100 = icmp eq i32 %99, 0
%101 = zext i1 %100 to i32
%102 = tail call i32 @assert(i32 %101)
%103 = load i32, i32* @stdout
%104 = tail call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%105 = load i32, i32* @stdout
%106 = tail call i32 @fflush(i32 %105)
%107 = load i32, i32* @stdout
%108 = tail call i32 @fprintf(i32 %107, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%109 = load i32, i32* @stdout
%110 = tail call i32 @fflush(i32 %109)
%111 = tail call i64 @calloc(i32 1, i32 1024)
%112 = inttoptr i64 %111 to i8*
%113 = tail call i32 @free(i8* %112)
%114 = tail call i32 (...) @ofc_getCount()
%115 = icmp eq i32 %114, 0
%116 = zext i1 %115 to i32
%117 = tail call i32 @assert(i32 %116)
%118 = load i32, i32* @stdout
%119 = tail call i32 @fprintf(i32 %118, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%120 = load i32, i32* @stdout
%121 = tail call i32 @fflush(i32 %120)
%122 = load i32, i32* @stdout
%123 = tail call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%124 = load i32, i32* @stdout
%125 = tail call i32 @fflush(i32 %124)
%126 = tail call i64 @calloc(i32 1, i32 262144)
%127 = inttoptr i64 %126 to i8*
%128 = tail call i32 @free(i8* %127)
%129 = tail call i32 (...) @ofc_getCount()
%130 = icmp eq i32 %129, 0
%131 = zext i1 %130 to i32
%132 = tail call i32 @assert(i32 %131)
%133 = load i32, i32* @stdout
%134 = tail call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%135 = load i32, i32* @stdout
%136 = tail call i32 @fflush(i32 %135)
%137 = load i32, i32* @stdout
%138 = tail call i32 @fprintf(i32 %137, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%139 = load i32, i32* @stdout
%140 = tail call i32 @fflush(i32 %139)
%141 = tail call i64 @calloc(i32 6, i32 0)
%142 = inttoptr i64 %141 to i8*
%143 = inttoptr i64 %141 to i64*
store i64 7089336938131513954, i64* %143
%144 = tail call i32 @free(i8* %142)
%145 = tail call i32 (...) @ofc_getCount()
%146 = icmp eq i32 %145, 8
%147 = zext i1 %146 to i32
%148 = tail call i32 @assert(i32 %147)
%149 = load i32, i32* @stdout
%150 = tail call i32 @fprintf(i32 %149, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%151 = load i32, i32* @stdout
%152 = tail call i32 @fflush(i32 %151)
%153 = load i32, i32* @stdout
%154 = tail call i32 @fprintf(i32 %153, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%155 = load i32, i32* @stdout
%156 = tail call i32 @fflush(i32 %155)
%157 = tail call i64 @calloc(i32 0, i32 6)
%158 = inttoptr i64 %157 to i8*
%159 = inttoptr i64 %157 to i64*
store i64 7089336938131513954, i64* %159
%160 = tail call i32 @free(i8* %158)
%161 = tail call i32 (...) @ofc_getCount()
%162 = icmp eq i32 %161, 8
%163 = zext i1 %162 to i32
%164 = tail call i32 @assert(i32 %163)
%165 = load i32, i32* @stdout
%166 = tail call i32 @fprintf(i32 %165, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%167 = load i32, i32* @stdout
%168 = tail call i32 @fflush(i32 %167)
%169 = load i32, i32* @stdout
%170 = tail call i32 @fprintf(i32 %169, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%171 = load i32, i32* @stdout
%172 = tail call i32 @fflush(i32 %171)
%173 = tail call i64 @calloc(i32 0, i32 0)
%174 = inttoptr i64 %173 to i8*
%175 = inttoptr i64 %173 to i64*
store i64 7089336938131513954, i64* %175
%176 = tail call i32 @free(i8* %174)
%177 = tail call i32 (...) @ofc_getCount()
%178 = icmp eq i32 %177, 8
%179 = zext i1 %178 to i32
%180 = tail call i32 @assert(i32 %179)
%181 = load i32, i32* @stdout
%182 = tail call i32 @fprintf(i32 %181, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%183 = load i32, i32* @stdout
%184 = tail call i32 @fflush(i32 %183)
ret void
}