#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 *alloca(int);
int main() {
  int *x = alloca(sizeof(int));
  int *y = alloca(sizeof(int));
  int *N = alloca(sizeof(int));
  *x = __VERIFIER_nondet_int();
  *y = __VERIFIER_nondet_int();
  *N = __VERIFIER_nondet_int();
  if (*N >= 536870912 || *x >= 536870912 || *y >= 536870912 ||
      *x < -1073741824) {
    return 0;
  }
  if (*x + *y >= 0) {
    while (*x <= *N) {
      if (__VERIFIER_nondet_int()) {
        *x = 2 * (*x) + *y;
        *y = *y + 1;
      } else {
        *x = *x + 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x20000000,(%rax)
jge    11c6 <main+0xa6>
mov    -0x10(%rbp),%rax
cmpl   $0x20000000,(%rax)
jge    11c6 <main+0xa6>
mov    -0x18(%rbp),%rax
cmpl   $0x20000000,(%rax)
jge    11c6 <main+0xa6>
mov    -0x10(%rbp),%rax
cmpl   $0xc0000000,(%rax)
jge    11d2 <main+0xb2>
movl   $0x0,-0x4(%rbp)
jmp    1257 <main+0x137>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
cmp    $0x0,%eax
jl     1250 <main+0x130>
jmp    11ec <main+0xcc>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jg     124b <main+0x12b>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1237 <main+0x117>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1246 <main+0x126>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    11ec <main+0xcc>
jmp    1250 <main+0x130>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%r14
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,(%r14)
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,(%r15)
cmp    $0x1fffffff,%eax
jg     11c9 <main+0xa9>
mov    (%rbx),%ecx
cmp    $0x1fffffff,%ecx
jg     11c9 <main+0xa9>
mov    (%r14),%edx
cmp    $0x1fffffff,%edx
jg     11c9 <main+0xa9>
cmp    $0xc0000000,%ecx
jl     11c9 <main+0xa9>
add    %ecx,%edx
js     11c9 <main+0xa9>
cmp    %eax,%ecx
jle    11aa <main+0x8a>
jmp    11c9 <main+0xa9>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %ecx,(%rbx)
cmp    (%r15),%ecx
jg     11c9 <main+0xa9>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    (%rbx),%ecx
test   %eax,%eax
je     11a0 <main+0x80>
add    %ecx,%ecx
add    (%r14),%ecx
mov    %ecx,(%rbx)
addl   $0x1,(%r14)
mov    (%rbx),%ecx
cmp    (%r15),%ecx
jle    11aa <main+0x8a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @alloca(i32 4)
%2 = tail call i32* @alloca(i32 4)
%3 = tail call i32* @alloca(i32 4)
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %1
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 536870911
br i1 %7, label %38, label %8
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 536870911
br i1 %10, label %38, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 536870911
%14 = icmp slt i32 %9, -1073741824
%15 = select i1 %13, i1 true, i1 %14
%16 = add nsw i32 %12, %9
%17 = icmp slt i32 %16, 0
%18 = select i1 %15, i1 true, i1 %17
%19 = icmp sgt i32 %9, %6
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %38, label %21
21: ; preds = %11, %34
%22 = tail call i32 (...) @__VERIFIER_nondet_int()
%23 = icmp eq i32 %22, 0
%24 = load i32, i32* %1
br i1 %23, label %32, label %25
25: ; preds = %21
%26 = shl nsw i32 %24, 1
%27 = load i32, i32* %2
%28 = add nsw i32 %26, %27
store i32 %28, i32* %1
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
%31 = load i32, i32* %1
br label %34
32: ; preds = %21
%33 = add nsw i32 %24, 1
store i32 %33, i32* %1
br label %34
34: ; preds = %32, %25
%35 = phi i32 [ %33, %32 ], [ %31, %25 ]
%36 = load i32, i32* %3
%37 = icmp sgt i32 %35, %36
br i1 %37, label %38, label %21
38: ; preds = %34, %0, %8, %11
ret i32 0
}