#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*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
int main() {
  int i = 0, x = 0, y = 0;
  int n = __VERIFIER_nondet_int();
  __VERIFIER_assume(n > 0);
  for (i = 0; i < n; i++) {
    x = x - y;
    __VERIFIER_assert(x == 0);
    y = __VERIFIER_nondet_int();
    __VERIFIER_assume(y != 0);
    x = x + y;
    __VERIFIER_assert(x != 0);
  }
  __VERIFIER_assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11df <main+0xaf>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x46>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1050 <__VERIFIER_assume@plt>
test   %r14d,%r14d
jle    11a0 <main+0x70>
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
sub    %ebp,%ebx
sete   %dil
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1050 <__VERIFIER_assume@plt>
xor    %edi,%edi
add    %ebp,%ebx
setne  %dil
call   1040 <__VERIFIER_assert@plt>
add    $0xffffffff,%r14d
jne    1160 <main+0x30>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
jmp    11a5 <main+0x75>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
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
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @__VERIFIER_assume(i32 %9)
store i32 0, i32* %2
br label %11
11: ; preds = %35, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %38
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assert(i32 %21)
%23 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @__VERIFIER_assume(i32 %26)
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = add nsw i32 %28, %29
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @__VERIFIER_assert(i32 %33)
br label %35
35: ; preds = %15
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %11
38: ; preds = %11
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 0
%41 = zext i1 %40 to i32
%42 = call i32 @__VERIFIER_assert(i32 %41)
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
br i1 %2, label %5, label %26
5: ; preds = %0, %5
%6 = phi i32 [ %21, %5 ], [ 0, %0 ]
%7 = phi i32 [ %13, %5 ], [ 0, %0 ]
%8 = phi i32 [ %17, %5 ], [ 0, %0 ]
%9 = sub nsw i32 %8, %7
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @__VERIFIER_assert(i32 %11)
%13 = tail call i32 (...) @__VERIFIER_nondet_int()
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @__VERIFIER_assume(i32 %15)
%17 = add nsw i32 %13, %9
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @__VERIFIER_assert(i32 %19)
%21 = add nuw nsw i32 %6, 1
%22 = icmp eq i32 %21, %1
br i1 %22, label %23, label %5
23: ; preds = %5
%24 = icmp eq i32 %17, 0
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %23, %0
%27 = phi i32 [ 1, %0 ], [ %25, %23 ]
%28 = tail call i32 @__VERIFIER_assert(i32 %27)
ret i32 0
}