#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 */
scalar_t__ nondet();
int /*<<< orphan*/ popBottom();
int /*<<< orphan*/ pushBottom();
void *owner(void *arg) {
  int i;
  for (i = 0; i < 10; ++i) {
    if (nondet()) {
      popBottom();
    } else {
      pushBottom();
    }
  }
}


x86 assembly (clang, -O0):
<owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1184 <owner+0x54>
mov    $0x0,%al
call   1050 <nondet@plt>
cmp    $0x0,%rax
je     116a <owner+0x3a>
mov    $0x0,%al
call   1030 <popBottom@plt>
jmp    1171 <owner+0x41>
mov    $0x0,%al
call   1040 <pushBottom@plt>
jmp    1176 <owner+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <owner+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owner>:
push   %rax
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     1146 <owner+0x16>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    114d <owner+0x1d>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     1162 <owner+0x32>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    1169 <owner+0x39>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     117e <owner+0x4e>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    1185 <owner+0x55>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     119a <owner+0x6a>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    11a1 <owner+0x71>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     11b6 <owner+0x86>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    11bd <owner+0x8d>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     11d2 <owner+0xa2>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    11d9 <owner+0xa9>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     11ee <owner+0xbe>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    11f5 <owner+0xc5>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     120a <owner+0xda>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    1211 <owner+0xe1>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     1226 <owner+0xf6>
xor    %eax,%eax
call   1030 <popBottom@plt>
jmp    122d <owner+0xfd>
xor    %eax,%eax
call   1040 <pushBottom@plt>
xor    %eax,%eax
call   1050 <nondet@plt>
test   %rax,%rax
je     1242 <owner+0x112>
xor    %eax,%eax
call   1030 <popBottom@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <pushBottom@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @owner(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @nondet()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @popBottom()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @pushBottom()
br label %8
8: ; preds = %4, %6
%9 = tail call i64 (...) @nondet()
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (...) @popBottom()
br label %15
13: ; preds = %8
%14 = tail call i32 (...) @pushBottom()
br label %15
15: ; preds = %13, %11
%16 = tail call i64 (...) @nondet()
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @popBottom()
br label %22
20: ; preds = %15
%21 = tail call i32 (...) @pushBottom()
br label %22
22: ; preds = %20, %18
%23 = tail call i64 (...) @nondet()
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (...) @popBottom()
br label %29
27: ; preds = %22
%28 = tail call i32 (...) @pushBottom()
br label %29
29: ; preds = %27, %25
%30 = tail call i64 (...) @nondet()
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = tail call i32 (...) @popBottom()
br label %36
34: ; preds = %29
%35 = tail call i32 (...) @pushBottom()
br label %36
36: ; preds = %34, %32
%37 = tail call i64 (...) @nondet()
%38 = icmp eq i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = tail call i32 (...) @popBottom()
br label %43
41: ; preds = %36
%42 = tail call i32 (...) @pushBottom()
br label %43
43: ; preds = %41, %39
%44 = tail call i64 (...) @nondet()
%45 = icmp eq i64 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = tail call i32 (...) @popBottom()
br label %50
48: ; preds = %43
%49 = tail call i32 (...) @pushBottom()
br label %50
50: ; preds = %48, %46
%51 = tail call i64 (...) @nondet()
%52 = icmp eq i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = tail call i32 (...) @popBottom()
br label %57
55: ; preds = %50
%56 = tail call i32 (...) @pushBottom()
br label %57
57: ; preds = %55, %53
%58 = tail call i64 (...) @nondet()
%59 = icmp eq i64 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = tail call i32 (...) @popBottom()
br label %64
62: ; preds = %57
%63 = tail call i32 (...) @pushBottom()
br label %64
64: ; preds = %62, %60
%65 = tail call i64 (...) @nondet()
%66 = icmp eq i64 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %64
%68 = tail call i32 (...) @popBottom()
br label %71
69: ; preds = %64
%70 = tail call i32 (...) @pushBottom()
br label %71
71: ; preds = %69, %67
ret i8* undef
}