#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*/ ConnectRoom(int);
int /*<<< orphan*/ InitializeRoomArray();
void PopulateRoomArray() {
  int i;
  int j;
  InitializeRoomArray();
  for (i = 0; i < 7; i++) {
    for (j = 0; j < 3; j++) {
      ConnectRoom(i);
    }
  }
}


x86 assembly (clang, -O0):
<PopulateRoomArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <InitializeRoomArray@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jge    117a <PopulateRoomArray+0x5a>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1167 <PopulateRoomArray+0x47>
mov    -0x4(%rbp),%edi
call   1040 <ConnectRoom@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <PopulateRoomArray+0x27>
jmp    116c <PopulateRoomArray+0x4c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <PopulateRoomArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopulateRoomArray>:
push   %rax
xor    %eax,%eax
call   1030 <InitializeRoomArray@plt>
xor    %edi,%edi
call   1040 <ConnectRoom@plt>
xor    %edi,%edi
call   1040 <ConnectRoom@plt>
xor    %edi,%edi
call   1040 <ConnectRoom@plt>
mov    $0x1,%edi
call   1040 <ConnectRoom@plt>
mov    $0x1,%edi
call   1040 <ConnectRoom@plt>
mov    $0x1,%edi
call   1040 <ConnectRoom@plt>
mov    $0x2,%edi
call   1040 <ConnectRoom@plt>
mov    $0x2,%edi
call   1040 <ConnectRoom@plt>
mov    $0x2,%edi
call   1040 <ConnectRoom@plt>
mov    $0x3,%edi
call   1040 <ConnectRoom@plt>
mov    $0x3,%edi
call   1040 <ConnectRoom@plt>
mov    $0x3,%edi
call   1040 <ConnectRoom@plt>
mov    $0x4,%edi
call   1040 <ConnectRoom@plt>
mov    $0x4,%edi
call   1040 <ConnectRoom@plt>
mov    $0x4,%edi
call   1040 <ConnectRoom@plt>
mov    $0x5,%edi
call   1040 <ConnectRoom@plt>
mov    $0x5,%edi
call   1040 <ConnectRoom@plt>
mov    $0x5,%edi
call   1040 <ConnectRoom@plt>
mov    $0x6,%edi
call   1040 <ConnectRoom@plt>
mov    $0x6,%edi
call   1040 <ConnectRoom@plt>
mov    $0x6,%edi
pop    %rax
jmp    1040 <ConnectRoom@plt>

LLVM IR (-O0):
define void @PopulateRoomArray() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @InitializeRoomArray()
store i32 0, i32* %1
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 7
br i1 %6, label %7, label %21
7: ; preds = %4
store i32 0, i32* %2
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %1
%13 = call i32 @ConnectRoom(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %8
17: ; preds = %8
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @PopulateRoomArray() {
%1 = tail call i32 (...) @InitializeRoomArray()
%2 = tail call i32 @ConnectRoom(i32 0)
%3 = tail call i32 @ConnectRoom(i32 0)
%4 = tail call i32 @ConnectRoom(i32 0)
%5 = tail call i32 @ConnectRoom(i32 1)
%6 = tail call i32 @ConnectRoom(i32 1)
%7 = tail call i32 @ConnectRoom(i32 1)
%8 = tail call i32 @ConnectRoom(i32 2)
%9 = tail call i32 @ConnectRoom(i32 2)
%10 = tail call i32 @ConnectRoom(i32 2)
%11 = tail call i32 @ConnectRoom(i32 3)
%12 = tail call i32 @ConnectRoom(i32 3)
%13 = tail call i32 @ConnectRoom(i32 3)
%14 = tail call i32 @ConnectRoom(i32 4)
%15 = tail call i32 @ConnectRoom(i32 4)
%16 = tail call i32 @ConnectRoom(i32 4)
%17 = tail call i32 @ConnectRoom(i32 5)
%18 = tail call i32 @ConnectRoom(i32 5)
%19 = tail call i32 @ConnectRoom(i32 5)
%20 = tail call i32 @ConnectRoom(i32 6)
%21 = tail call i32 @ConnectRoom(i32 6)
%22 = tail call i32 @ConnectRoom(i32 6)
ret void
}