#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 main() {
  int i, j, nondetNat, nondetPos;
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  while (i - j >= 1) {
    nondetNat = __VERIFIER_nondet_int();
    if (nondetNat < 0) {
      nondetNat = -nondetNat;
    }
    i = i - nondetNat;
    nondetPos = __VERIFIER_nondet_int();
    if (nondetPos < 0) {
      nondetPos = -nondetPos;
    }
    nondetPos = nondetPos + 1;
    j = j + nondetPos;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jl     119a <main+0x8a>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115e <main+0x4e>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1183 <main+0x73>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %eax,%ebp
jle    1157 <main+0x47>
mov    %eax,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %eax,%ecx
add    %ecx,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
add    %ecx,%ebx
add    $0x1,%ebx
cmp    %ebx,%ebp
jg     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %1, %2
br i1 %3, label %4, label %15
4: ; preds = %0, %4
%5 = phi i32 [ %13, %4 ], [ %2, %0 ]
%6 = phi i32 [ %9, %4 ], [ %1, %0 ]
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = sub nsw i32 %6, %8
%10 = tail call i32 (...) @__VERIFIER_nondet_int()
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
%12 = add nsw i32 %5, 1
%13 = add i32 %12, %11
%14 = icmp sgt i32 %9, %13
br i1 %14, label %4, label %15
15: ; preds = %4, %0
ret i32 0
}