#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 *Mem_Alloc(int);
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  int *ptr[9];
  ptr[0] = Mem_Alloc(1);
  ptr[1] = (Mem_Alloc(5));
  ptr[2] = (Mem_Alloc(14));
  ptr[3] = (Mem_Alloc(8));
  ptr[4] = (Mem_Alloc(1));
  ptr[5] = (Mem_Alloc(4));
  ptr[6] = (Mem_Alloc(9));
  ptr[7] = (Mem_Alloc(33));
  ptr[8] = (Mem_Alloc(55));
  assert((int)(ptr[0]) % 4 == 0);
  assert((int)(ptr[1]) % 4 == 0);
  assert((int)(ptr[2]) % 4 == 0);
  assert((int)(ptr[3]) % 4 == 0);
  assert((int)(ptr[4]) % 4 == 0);
  assert((int)(ptr[5]) % 4 == 0);
  assert((int)(ptr[6]) % 4 == 0);
  assert((int)(ptr[7]) % 4 == 0);
  assert((int)(ptr[8]) % 4 == 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x50(%rbp)
mov    $0x5,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0xe,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x8,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x1,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x4,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x9,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x21,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x37,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x50(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x48(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x40(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x38(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x30(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x28(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%r12
mov    $0x5,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%r15
mov    $0xe,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%rbp
mov    $0x1,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,%r13
mov    $0x9,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,(%rsp)
mov    $0x21,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,0x8(%rsp)
mov    $0x37,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,0x10(%rsp)
xor    %edi,%edi
test   $0x3,%r12b
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   $0x3,%r15b
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   $0x3,%r14b
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   $0x3,%bpl
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   $0x3,%bl
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   $0x3,%r13b
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
testb  $0x3,(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
testb  $0x3,0x8(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
testb  $0x3,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32*]
store i32 0, i32* %1
%3 = call i64 @Mem_Init(i32 4096)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32* @Mem_Alloc(i32 1)
%8 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 0
store i32* %7, i32** %8
%9 = call i32* @Mem_Alloc(i32 5)
%10 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 1
store i32* %9, i32** %10
%11 = call i32* @Mem_Alloc(i32 14)
%12 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 2
store i32* %11, i32** %12
%13 = call i32* @Mem_Alloc(i32 8)
%14 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 3
store i32* %13, i32** %14
%15 = call i32* @Mem_Alloc(i32 1)
%16 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 4
store i32* %15, i32** %16
%17 = call i32* @Mem_Alloc(i32 4)
%18 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 5
store i32* %17, i32** %18
%19 = call i32* @Mem_Alloc(i32 9)
%20 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 6
store i32* %19, i32** %20
%21 = call i32* @Mem_Alloc(i32 33)
%22 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 7
store i32* %21, i32** %22
%23 = call i32* @Mem_Alloc(i32 55)
%24 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 8
store i32* %23, i32** %24
%25 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 0
%26 = load i32*, i32** %25
%27 = ptrtoint i32* %26 to i32
%28 = srem i32 %27, 4
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 1
%33 = load i32*, i32** %32
%34 = ptrtoint i32* %33 to i32
%35 = srem i32 %34, 4
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 2
%40 = load i32*, i32** %39
%41 = ptrtoint i32* %40 to i32
%42 = srem i32 %41, 4
%43 = icmp eq i32 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 3
%47 = load i32*, i32** %46
%48 = ptrtoint i32* %47 to i32
%49 = srem i32 %48, 4
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 4
%54 = load i32*, i32** %53
%55 = ptrtoint i32* %54 to i32
%56 = srem i32 %55, 4
%57 = icmp eq i32 %56, 0
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 5
%61 = load i32*, i32** %60
%62 = ptrtoint i32* %61 to i32
%63 = srem i32 %62, 4
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 6
%68 = load i32*, i32** %67
%69 = ptrtoint i32* %68 to i32
%70 = srem i32 %69, 4
%71 = icmp eq i32 %70, 0
%72 = zext i1 %71 to i32
%73 = call i32 @assert(i32 %72)
%74 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 7
%75 = load i32*, i32** %74
%76 = ptrtoint i32* %75 to i32
%77 = srem i32 %76, 4
%78 = icmp eq i32 %77, 0
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = getelementptr inbounds [9 x i32*], [9 x i32*]* %2, i64 0, i64 8
%82 = load i32*, i32** %81
%83 = ptrtoint i32* %82 to i32
%84 = srem i32 %83, 4
%85 = icmp eq i32 %84, 0
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32* @Mem_Alloc(i32 1)
%6 = tail call i32* @Mem_Alloc(i32 5)
%7 = tail call i32* @Mem_Alloc(i32 14)
%8 = tail call i32* @Mem_Alloc(i32 8)
%9 = tail call i32* @Mem_Alloc(i32 1)
%10 = tail call i32* @Mem_Alloc(i32 4)
%11 = tail call i32* @Mem_Alloc(i32 9)
%12 = tail call i32* @Mem_Alloc(i32 33)
%13 = tail call i32* @Mem_Alloc(i32 55)
%14 = ptrtoint i32* %5 to i64
%15 = and i64 %14, 3
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = ptrtoint i32* %6 to i64
%20 = and i64 %19, 3
%21 = icmp eq i64 %20, 0
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = ptrtoint i32* %7 to i64
%25 = and i64 %24, 3
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = ptrtoint i32* %8 to i64
%30 = and i64 %29, 3
%31 = icmp eq i64 %30, 0
%32 = zext i1 %31 to i32
%33 = tail call i32 @assert(i32 %32)
%34 = ptrtoint i32* %9 to i64
%35 = and i64 %34, 3
%36 = icmp eq i64 %35, 0
%37 = zext i1 %36 to i32
%38 = tail call i32 @assert(i32 %37)
%39 = ptrtoint i32* %10 to i64
%40 = and i64 %39, 3
%41 = icmp eq i64 %40, 0
%42 = zext i1 %41 to i32
%43 = tail call i32 @assert(i32 %42)
%44 = ptrtoint i32* %11 to i64
%45 = and i64 %44, 3
%46 = icmp eq i64 %45, 0
%47 = zext i1 %46 to i32
%48 = tail call i32 @assert(i32 %47)
%49 = ptrtoint i32* %12 to i64
%50 = and i64 %49, 3
%51 = icmp eq i64 %50, 0
%52 = zext i1 %51 to i32
%53 = tail call i32 @assert(i32 %52)
%54 = ptrtoint i32* %13 to i64
%55 = and i64 %54, 3
%56 = icmp eq i64 %55, 0
%57 = zext i1 %56 to i32
%58 = tail call i32 @assert(i32 %57)
%59 = tail call i32 @exit(i32 0)
unreachable
}