#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 __VERIFIER_nondet_int();
void main() {
  int tagbuf_len;
  int t;
  tagbuf_len = __VERIFIER_nondet_int();
  if (tagbuf_len >= 1)
    ;
  else
    goto END;
  t = 0;
  --tagbuf_len;
  while (1) {
    if (t == tagbuf_len) {
      __VERIFIER_assert(0 <= t);
      __VERIFIER_assert(t <= tagbuf_len);
      goto END;
    }
    if (__VERIFIER_nondet_int()) {
      break;
    }
    __VERIFIER_assert(0 <= t);
    __VERIFIER_assert(t <= tagbuf_len);
    t++;
  }
  __VERIFIER_assert(0 <= t);
  __VERIFIER_assert(t <= tagbuf_len);
  t++;
  while (1) {
    if (t == tagbuf_len) {
      __VERIFIER_assert(0 <= t);
      __VERIFIER_assert(t <= tagbuf_len);
      goto END;
    }
    if (__VERIFIER_nondet_int()) {
      if (__VERIFIER_nondet_int()) {
        __VERIFIER_assert(0 <= t);
        __VERIFIER_assert(t <= tagbuf_len);
        t++;
        if (t == tagbuf_len) {
          __VERIFIER_assert(0 <= t);
          __VERIFIER_assert(t <= tagbuf_len);
          goto END;
        }
      }
    } else if (__VERIFIER_nondet_int()) {
      break;
    }
    __VERIFIER_assert(0 <= t);
    __VERIFIER_assert(t <= tagbuf_len);
    t++;
  }
  __VERIFIER_assert(0 <= t);
  __VERIFIER_assert(t <= tagbuf_len);
END:
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1141 <main+0x21>
jmp    1146 <main+0x26>
jmp    1338 <main+0x218>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    118c <main+0x6c>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1338 <main+0x218>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11a1 <main+0x81>
jmp    11d4 <main+0xb4>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x36>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1238 <main+0x118>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1338 <main+0x218>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     12c6 <main+0x1a6>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     12c1 <main+0x1a1>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    12bc <main+0x19c>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1338 <main+0x218>
jmp    12c1 <main+0x1a1>
jmp    12e0 <main+0x1c0>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     12db <main+0x1bb>
jmp    1313 <main+0x1f3>
jmp    12e0 <main+0x1c0>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1202 <main+0xe2>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1183 <main+0x63>
mov    %eax,%r15d
mov    %eax,%r14d
add    $0xffffffff,%r14d
je     119b <main+0x7b>
mov    $0x2,%r13d
sub    %r15d,%r13d
mov    $0x1,%ebx
lea    -0x1(%rbx),%r12d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %edi,%edi
cmp    %r15d,%r12d
setl   %dil
call   1040 <__VERIFIER_assert@plt>
test   %ebp,%ebp
jne    1192 <main+0x72>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1150 <main+0x30>
jmp    119b <main+0x7b>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    %ebx,%r13d
cmp    $0x1,%r13d
jne    11eb <main+0xcb>
mov    $0x1,%ebp
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <__VERIFIER_assert@plt>
nop
test   %eax,%eax
jne    1231 <main+0x111>
mov    %ebx,%r12d
mov    %ebx,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %edi,%edi
cmp    %r15d,%ebx
setl   %dil
call   1040 <__VERIFIER_assert@plt>
lea    0x1(%r12),%ebx
cmp    %r14d,%ebx
je     119b <main+0x7b>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebp,%ebp
je     11c0 <main+0xa0>
test   %eax,%eax
je     11c4 <main+0xa4>
xor    %edi,%edi
cmp    $0xffffffff,%r12d
setge  %dil
call   1040 <__VERIFIER_assert@plt>
xor    %edi,%edi
cmp    %r14d,%r12d
setl   %dil
call   1040 <__VERIFIER_assert@plt>
add    $0x2,%r12d
mov    %r12d,%ebx
cmp    %r14d,%r12d
jne    11c4 <main+0xa4>
jmp    119b <main+0x7b>
xor    %edi,%edi
cmp    $0xffffffff,%r12d
setge  %dil
call   1040 <__VERIFIER_assert@plt>
xor    %ebp,%ebp
cmp    %r14d,%r12d
setl   %bpl
jmp    11aa <main+0x8a>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
br label %8
7: ; preds = %0
br label %127
8: ; preds = %6
store i32 0, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %29
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp sle i32 0, %16
%18 = zext i1 %17 to i32
%19 = call i32 @__VERIFIER_assert(i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %1
%22 = icmp sle i32 %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @__VERIFIER_assert(i32 %23)
br label %127
25: ; preds = %11
%26 = call i32 (...) @__VERIFIER_nondet_int()
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
br label %41
29: ; preds = %25
%30 = load i32, i32* %2
%31 = icmp sle i32 0, %30
%32 = zext i1 %31 to i32
%33 = call i32 @__VERIFIER_assert(i32 %32)
%34 = load i32, i32* %2
%35 = load i32, i32* %1
%36 = icmp sle i32 %34, %35
%37 = zext i1 %36 to i32
%38 = call i32 @__VERIFIER_assert(i32 %37)
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %11
41: ; preds = %28
%42 = load i32, i32* %2
%43 = icmp sle i32 0, %42
%44 = zext i1 %43 to i32
%45 = call i32 @__VERIFIER_assert(i32 %44)
%46 = load i32, i32* %2
%47 = load i32, i32* %1
%48 = icmp sle i32 %46, %47
%49 = zext i1 %48 to i32
%50 = call i32 @__VERIFIER_assert(i32 %49)
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %53
53: ; preds = %41, %105
%54 = load i32, i32* %2
%55 = load i32, i32* %1
%56 = icmp eq i32 %54, %55
br i1 %56, label %57, label %67
57: ; preds = %53
%58 = load i32, i32* %2
%59 = icmp sle i32 0, %58
%60 = zext i1 %59 to i32
%61 = call i32 @__VERIFIER_assert(i32 %60)
%62 = load i32, i32* %2
%63 = load i32, i32* %1
%64 = icmp sle i32 %62, %63
%65 = zext i1 %64 to i32
%66 = call i32 @__VERIFIER_assert(i32 %65)
br label %127
67: ; preds = %53
%68 = call i32 (...) @__VERIFIER_nondet_int()
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %100
70: ; preds = %67
%71 = call i32 (...) @__VERIFIER_nondet_int()
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %99
73: ; preds = %70
%74 = load i32, i32* %2
%75 = icmp sle i32 0, %74
%76 = zext i1 %75 to i32
%77 = call i32 @__VERIFIER_assert(i32 %76)
%78 = load i32, i32* %2
%79 = load i32, i32* %1
%80 = icmp sle i32 %78, %79
%81 = zext i1 %80 to i32
%82 = call i32 @__VERIFIER_assert(i32 %81)
%83 = load i32, i32* %2
%84 = add nsw i32 %83, 1
store i32 %84, i32* %2
%85 = load i32, i32* %2
%86 = load i32, i32* %1
%87 = icmp eq i32 %85, %86
br i1 %87, label %88, label %98
88: ; preds = %73
%89 = load i32, i32* %2
%90 = icmp sle i32 0, %89
%91 = zext i1 %90 to i32
%92 = call i32 @__VERIFIER_assert(i32 %91)
%93 = load i32, i32* %2
%94 = load i32, i32* %1
%95 = icmp sle i32 %93, %94
%96 = zext i1 %95 to i32
%97 = call i32 @__VERIFIER_assert(i32 %96)
br label %127
98: ; preds = %73
br label %99
99: ; preds = %98, %70
br label %105
100: ; preds = %67
%101 = call i32 (...) @__VERIFIER_nondet_int()
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %104
103: ; preds = %100
br label %117
104: ; preds = %100
br label %105
105: ; preds = %104, %99
%106 = load i32, i32* %2
%107 = icmp sle i32 0, %106
%108 = zext i1 %107 to i32
%109 = call i32 @__VERIFIER_assert(i32 %108)
%110 = load i32, i32* %2
%111 = load i32, i32* %1
%112 = icmp sle i32 %110, %111
%113 = zext i1 %112 to i32
%114 = call i32 @__VERIFIER_assert(i32 %113)
%115 = load i32, i32* %2
%116 = add nsw i32 %115, 1
store i32 %116, i32* %2
br label %53
117: ; preds = %103
%118 = load i32, i32* %2
%119 = icmp sle i32 0, %118
%120 = zext i1 %119 to i32
%121 = call i32 @__VERIFIER_assert(i32 %120)
%122 = load i32, i32* %2
%123 = load i32, i32* %1
%124 = icmp sle i32 %122, %123
%125 = zext i1 %124 to i32
%126 = call i32 @__VERIFIER_assert(i32 %125)
br label %127
127: ; preds = %117, %88, %57, %15, %7
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %61
3: ; preds = %0
%4 = add nsw i32 %1, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %18, %3
%7 = tail call i32 @__VERIFIER_assert(i32 1)
br label %58
8: ; preds = %3, %18
%9 = phi i32 [ %16, %18 ], [ 0, %3 ]
%10 = tail call i32 (...) @__VERIFIER_nondet_int()
%11 = icmp eq i32 %10, 0
%12 = tail call i32 @__VERIFIER_assert(i32 1)
%13 = icmp slt i32 %9, %1
%14 = zext i1 %13 to i32
%15 = tail call i32 @__VERIFIER_assert(i32 %14)
%16 = add nuw nsw i32 %9, 1
%17 = icmp eq i32 %16, %4
br i1 %11, label %18, label %19
18: ; preds = %8
br i1 %17, label %6, label %8
19: ; preds = %8
br i1 %17, label %20, label %22
20: ; preds = %42, %19
%21 = tail call i32 @__VERIFIER_assert(i32 1)
br label %58
22: ; preds = %19, %42
%23 = phi i32 [ %50, %42 ], [ %16, %19 ]
%24 = phi i32 [ %43, %42 ], [ %9, %19 ]
%25 = tail call i32 (...) @__VERIFIER_nondet_int()
%26 = icmp eq i32 %25, 0
%27 = tail call i32 (...) @__VERIFIER_nondet_int()
%28 = icmp eq i32 %27, 0
br i1 %26, label %41, label %29
29: ; preds = %22
br i1 %28, label %42, label %30
30: ; preds = %29
%31 = icmp sgt i32 %24, -2
%32 = zext i1 %31 to i32
%33 = tail call i32 @__VERIFIER_assert(i32 %32)
%34 = icmp slt i32 %24, %4
%35 = zext i1 %34 to i32
%36 = tail call i32 @__VERIFIER_assert(i32 %35)
%37 = add nsw i32 %24, 2
%38 = icmp eq i32 %37, %4
br i1 %38, label %39, label %42
39: ; preds = %30
%40 = tail call i32 @__VERIFIER_assert(i32 1)
br label %58
41: ; preds = %22
br i1 %28, label %42, label %52
42: ; preds = %41, %29, %30
%43 = phi i32 [ %37, %30 ], [ %23, %29 ], [ %23, %41 ]
%44 = xor i32 %43, -1
%45 = lshr i32 %44, 31
%46 = tail call i32 @__VERIFIER_assert(i32 %45)
%47 = icmp slt i32 %43, %1
%48 = zext i1 %47 to i32
%49 = tail call i32 @__VERIFIER_assert(i32 %48)
%50 = add nsw i32 %43, 1
%51 = icmp eq i32 %50, %4
br i1 %51, label %20, label %22
52: ; preds = %41
%53 = icmp sgt i32 %24, -2
%54 = zext i1 %53 to i32
%55 = tail call i32 @__VERIFIER_assert(i32 %54)
%56 = icmp slt i32 %24, %4
%57 = zext i1 %56 to i32
br label %58
58: ; preds = %6, %20, %39, %52
%59 = phi i32 [ %57, %52 ], [ 1, %39 ], [ 1, %20 ], [ 1, %6 ]
%60 = tail call i32 @__VERIFIER_assert(i32 %59)
br label %61
61: ; preds = %58, %0
ret void
}