#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 __VERIFIER_nondet_int();
int /*<<< orphan*/ cleanup();
int getOrigin(int);
int get_nondetMinMax07();
int /*<<< orphan*/ initBottomUp();
int /*<<< orphan*/ initPersonOnFloor(int, int);
int /*<<< orphan*/ initTopDown();
int isBlocked();
int /*<<< orphan*/ timeShift();
void randomSequenceOfActions(void) {
  int maxLength;
  int tmp;
  int counter;
  int action;
  int tmp___0;
  int origin;
  int tmp___1;
  int tmp___2;
  {
    {
      maxLength = 4;
      tmp = __VERIFIER_nondet_int();
    }
    if (tmp) {
      { initTopDown(); }
    } else {
      { initBottomUp(); }
    }
    counter = 0;
    {
      while (1) {
      while_4_continue:;
        if (counter < maxLength) {
        } else {
          goto while_4_break;
        }
        {
          counter = counter + 1;
          tmp___0 = get_nondetMinMax07();
          action = tmp___0;
        }
        if (action < 6) {
          {
            tmp___1 = getOrigin(action);
            origin = tmp___1;
            initPersonOnFloor(action, origin);
          }
        } else {
          if (action == 6) {
            { timeShift(); }
          } else {
            if (action == 7) {
              {
                timeShift();
                timeShift();
                timeShift();
              }
            } else {
            }
          }
        }
        { tmp___2 = isBlocked(); }
        if (tmp___2) {
          return;
        } else {
        }
      }
    while_4_break:;
    }
    { cleanup(); }
    return;
  }
}


x86 assembly (clang, -O0):
<randomSequenceOfActions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
mov    $0x0,%al
call   1070 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11bf <randomSequenceOfActions+0x2f>
mov    $0x0,%al
call   1080 <initTopDown@plt>
jmp    11c6 <randomSequenceOfActions+0x36>
mov    $0x0,%al
call   10a0 <initBottomUp@plt>
movl   $0x0,-0xc(%rbp)
jmp    11d2 <randomSequenceOfActions+0x42>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e3 <randomSequenceOfActions+0x53>
jmp    11e8 <randomSequenceOfActions+0x58>
jmp    1298 <randomSequenceOfActions+0x108>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_nondetMinMax07@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    122c <randomSequenceOfActions+0x9c>
mov    -0x10(%rbp),%edi
call   1040 <getOrigin@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <initPersonOnFloor@plt>
jmp    1275 <randomSequenceOfActions+0xe5>
cmpl   $0x6,-0x10(%rbp)
jne    1242 <randomSequenceOfActions+0xb2>
mov    $0x0,%al
call   10b0 <timeShift@plt>
jmp    1270 <randomSequenceOfActions+0xe0>
cmpl   $0x7,-0x10(%rbp)
jne    1266 <randomSequenceOfActions+0xd6>
mov    $0x0,%al
call   10b0 <timeShift@plt>
mov    $0x0,%al
call   10b0 <timeShift@plt>
mov    $0x0,%al
call   10b0 <timeShift@plt>
jmp    126b <randomSequenceOfActions+0xdb>
jmp    126b <randomSequenceOfActions+0xdb>
jmp    1270 <randomSequenceOfActions+0xe0>
jmp    1275 <randomSequenceOfActions+0xe5>
mov    $0x0,%al
call   1050 <isBlocked@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     128e <randomSequenceOfActions+0xfe>
jmp    129f <randomSequenceOfActions+0x10f>
jmp    1293 <randomSequenceOfActions+0x103>
jmp    11cd <randomSequenceOfActions+0x3d>
mov    $0x0,%al
call   1090 <cleanup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSequenceOfActions>:
push   %rbx
xor    %eax,%eax
call   1070 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     11a5 <randomSequenceOfActions+0x15>
xor    %eax,%eax
call   1080 <initTopDown@plt>
jmp    11ac <randomSequenceOfActions+0x1c>
xor    %eax,%eax
call   10a0 <initBottomUp@plt>
xor    %eax,%eax
call   1030 <get_nondetMinMax07@plt>
mov    %eax,%ebx
cmp    $0x5,%eax
jg     11cc <randomSequenceOfActions+0x3c>
mov    %ebx,%edi
call   1040 <getOrigin@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <initPersonOnFloor@plt>
jmp    11ed <randomSequenceOfActions+0x5d>
cmp    $0x7,%ebx
je     11d8 <randomSequenceOfActions+0x48>
cmp    $0x6,%ebx
je     11e6 <randomSequenceOfActions+0x56>
jmp    11ed <randomSequenceOfActions+0x5d>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   1050 <isBlocked@plt>
test   %eax,%eax
jne    12d5 <randomSequenceOfActions+0x145>
xor    %eax,%eax
call   1030 <get_nondetMinMax07@plt>
mov    %eax,%ebx
cmp    $0x6,%eax
jge    121c <randomSequenceOfActions+0x8c>
mov    %ebx,%edi
call   1040 <getOrigin@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <initPersonOnFloor@plt>
jmp    1238 <randomSequenceOfActions+0xa8>
je     1231 <randomSequenceOfActions+0xa1>
cmp    $0x7,%ebx
jne    1238 <randomSequenceOfActions+0xa8>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   1050 <isBlocked@plt>
test   %eax,%eax
jne    12d5 <randomSequenceOfActions+0x145>
xor    %eax,%eax
call   1030 <get_nondetMinMax07@plt>
mov    %eax,%ebx
cmp    $0x6,%eax
jge    1267 <randomSequenceOfActions+0xd7>
mov    %ebx,%edi
call   1040 <getOrigin@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <initPersonOnFloor@plt>
jmp    1283 <randomSequenceOfActions+0xf3>
je     127c <randomSequenceOfActions+0xec>
cmp    $0x7,%ebx
jne    1283 <randomSequenceOfActions+0xf3>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   1050 <isBlocked@plt>
test   %eax,%eax
jne    12d5 <randomSequenceOfActions+0x145>
xor    %eax,%eax
call   1030 <get_nondetMinMax07@plt>
mov    %eax,%ebx
cmp    $0x6,%eax
jge    12ae <randomSequenceOfActions+0x11e>
mov    %ebx,%edi
call   1040 <getOrigin@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <initPersonOnFloor@plt>
jmp    12ca <randomSequenceOfActions+0x13a>
je     12c3 <randomSequenceOfActions+0x133>
cmp    $0x7,%ebx
jne    12ca <randomSequenceOfActions+0x13a>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   10b0 <timeShift@plt>
xor    %eax,%eax
call   1050 <isBlocked@plt>
test   %eax,%eax
je     12d7 <randomSequenceOfActions+0x147>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1090 <cleanup@plt>

LLVM IR (-O0):
define void @randomSequenceOfActions() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 4, i32* %1
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @initTopDown()
br label %16
14: ; preds = %0
%15 = call i32 (...) @initBottomUp()
br label %16
16: ; preds = %14, %12
store i32 0, i32* %3
br label %17
17: ; preds = %16, %59
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = load i32, i32* %1
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
br label %24
23: ; preds = %18
br label %60
24: ; preds = %22
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = call i32 (...) @get_nondetMinMax07()
store i32 %27, i32* %5
%28 = load i32, i32* %5
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 6
br i1 %30, label %31, label %38
31: ; preds = %24
%32 = load i32, i32* %4
%33 = call i32 @getOrigin(i32 %32)
store i32 %33, i32* %7
%34 = load i32, i32* %7
store i32 %34, i32* %6
%35 = load i32, i32* %4
%36 = load i32, i32* %6
%37 = call i32 @initPersonOnFloor(i32 %35, i32 %36)
br label %53
38: ; preds = %24
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, 6
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (...) @timeShift()
br label %52
43: ; preds = %38
%44 = load i32, i32* %4
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = call i32 (...) @timeShift()
%48 = call i32 (...) @timeShift()
%49 = call i32 (...) @timeShift()
br label %51
50: ; preds = %43
br label %51
51: ; preds = %50, %46
br label %52
52: ; preds = %51, %41
br label %53
53: ; preds = %52, %31
%54 = call i32 (...) @isBlocked()
store i32 %54, i32* %8
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53
br label %62
58: ; preds = %53
br label %59
59: ; preds = %58
br label %17
60: ; preds = %23
%61 = call i32 (...) @cleanup()
br label %62
62: ; preds = %60, %57
ret void
}

LLVM IR (-O2):
define void @randomSequenceOfActions() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @initTopDown()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @initBottomUp()
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (...) @get_nondetMinMax07()
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = tail call i32 @getOrigin(i32 %8)
%12 = tail call i32 @initPersonOnFloor(i32 %8, i32 %11)
br label %20
13: ; preds = %7
switch i32 %8, label %20 [
i32 6, label %14
i32 7, label %16
]
14: ; preds = %13
%15 = tail call i32 (...) @timeShift()
br label %20
16: ; preds = %13
%17 = tail call i32 (...) @timeShift()
%18 = tail call i32 (...) @timeShift()
%19 = tail call i32 (...) @timeShift()
br label %20
20: ; preds = %13, %14, %16, %10
%21 = tail call i32 (...) @isBlocked()
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %73
23: ; preds = %20
%24 = tail call i32 (...) @get_nondetMinMax07()
%25 = icmp slt i32 %24, 6
br i1 %25, label %33, label %26
26: ; preds = %23
switch i32 %24, label %36 [
i32 6, label %31
i32 7, label %27
]
27: ; preds = %26
%28 = tail call i32 (...) @timeShift()
%29 = tail call i32 (...) @timeShift()
%30 = tail call i32 (...) @timeShift()
br label %36
31: ; preds = %26
%32 = tail call i32 (...) @timeShift()
br label %36
33: ; preds = %23
%34 = tail call i32 @getOrigin(i32 %24)
%35 = tail call i32 @initPersonOnFloor(i32 %24, i32 %34)
br label %36
36: ; preds = %33, %31, %27, %26
%37 = tail call i32 (...) @isBlocked()
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %73
39: ; preds = %36
%40 = tail call i32 (...) @get_nondetMinMax07()
%41 = icmp slt i32 %40, 6
br i1 %41, label %49, label %42
42: ; preds = %39
switch i32 %40, label %52 [
i32 6, label %47
i32 7, label %43
]
43: ; preds = %42
%44 = tail call i32 (...) @timeShift()
%45 = tail call i32 (...) @timeShift()
%46 = tail call i32 (...) @timeShift()
br label %52
47: ; preds = %42
%48 = tail call i32 (...) @timeShift()
br label %52
49: ; preds = %39
%50 = tail call i32 @getOrigin(i32 %40)
%51 = tail call i32 @initPersonOnFloor(i32 %40, i32 %50)
br label %52
52: ; preds = %49, %47, %43, %42
%53 = tail call i32 (...) @isBlocked()
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %73
55: ; preds = %52
%56 = tail call i32 (...) @get_nondetMinMax07()
%57 = icmp slt i32 %56, 6
br i1 %57, label %65, label %58
58: ; preds = %55
switch i32 %56, label %68 [
i32 6, label %63
i32 7, label %59
]
59: ; preds = %58
%60 = tail call i32 (...) @timeShift()
%61 = tail call i32 (...) @timeShift()
%62 = tail call i32 (...) @timeShift()
br label %68
63: ; preds = %58
%64 = tail call i32 (...) @timeShift()
br label %68
65: ; preds = %55
%66 = tail call i32 @getOrigin(i32 %56)
%67 = tail call i32 @initPersonOnFloor(i32 %56, i32 %66)
br label %68
68: ; preds = %65, %63, %59, %58
%69 = tail call i32 (...) @isBlocked()
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = tail call i32 (...) @cleanup()
br label %73
73: ; preds = %20, %36, %52, %68, %71
ret void
}