#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 p;
  int i;
  int leader_len;
  int bufsize;
  int bufsize_0;
  int ielen;
  leader_len = __VERIFIER_nondet_int();
  bufsize = __VERIFIER_nondet_int();
  ielen = __VERIFIER_nondet_int();
  __VERIFIER_assume(leader_len < 1000000);
  __VERIFIER_assume(bufsize < 1000000);
  __VERIFIER_assume(ielen < 1000000);
  if (leader_len > 0)
    ;
  else
    goto END;
  if (bufsize > 0)
    ;
  else
    goto END;
  if (ielen > 0)
    ;
  else
    goto END;
  if (bufsize < leader_len)
    goto END;
  p = 0;
  bufsize_0 = bufsize;
  bufsize -= leader_len;
  p += leader_len;
  if (bufsize < 2 * ielen)
    goto END;
  for (i = 0; i < ielen && bufsize > 2; i++) {
    __VERIFIER_assert(0 <= p);
    __VERIFIER_assert(p + 1 < bufsize_0);
    p += 2;
  }
END:;
}


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,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xf4240,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0xf4240,-0x14(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0xf4240,-0x1c(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0x0,-0x10(%rbp)
jle    11a8 <main+0x78>
jmp    11ad <main+0x7d>
jmp    1293 <main+0x163>
cmpl   $0x0,-0x14(%rbp)
jle    11bc <main+0x8c>
jmp    11c1 <main+0x91>
jmp    1293 <main+0x163>
cmpl   $0x0,-0x1c(%rbp)
jle    11d0 <main+0xa0>
jmp    11d5 <main+0xa5>
jmp    1293 <main+0x163>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e6 <main+0xb6>
jmp    1293 <main+0x163>
movl   $0x0,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    121d <main+0xed>
jmp    1293 <main+0x163>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    123f <main+0x10f>
cmpl   $0x2,-0x14(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    124f <main+0x11f>
jmp    128e <main+0x15e>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    -0x18(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <main+0xf4>
jmp    1293 <main+0x163>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r15d
xor    %edi,%edi
cmp    $0xf4240,%r12d
setl   %dil
call   1050 <__VERIFIER_assume@plt>
xor    %edi,%edi
cmp    $0xf4240,%r14d
setl   %dil
call   1050 <__VERIFIER_assume@plt>
xor    %edi,%edi
cmp    $0xf4240,%r15d
setl   %dil
call   1050 <__VERIFIER_assume@plt>
test   %r12d,%r12d
jle    11e8 <main+0xb8>
test   %r14d,%r14d
jle    11e8 <main+0xb8>
test   %r15d,%r15d
jle    11e8 <main+0xb8>
mov    %r14d,%eax
sub    %r12d,%eax
jl     11e8 <main+0xb8>
lea    (%r15,%r15,1),%ecx
cmp    %ecx,%eax
jl     11e8 <main+0xb8>
cmp    $0x3,%eax
jl     11e8 <main+0xb8>
lea    0x1(%r12),%ebp
not    %r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r12d,%edi
shr    $0x1f,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %edi,%edi
cmp    %r14d,%ebp
setl   %dil
call   1040 <__VERIFIER_assert@plt>
add    $0x1,%ebx
add    $0x2,%ebp
add    $0xfffffffe,%r12d
cmp    %r15d,%ebx
jl     11c0 <main+0x90>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %4
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %5
%10 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 1000000
%13 = zext i1 %12 to i32
%14 = call i32 @__VERIFIER_assume(i32 %13)
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 1000000
%17 = zext i1 %16 to i32
%18 = call i32 @__VERIFIER_assume(i32 %17)
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 1000000
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assume(i32 %21)
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %0
br label %27
26: ; preds = %0
br label %82
27: ; preds = %25
%28 = load i32, i32* %5
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27
br label %32
31: ; preds = %27
br label %82
32: ; preds = %30
%33 = load i32, i32* %7
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %32
br label %37
36: ; preds = %32
br label %82
37: ; preds = %35
%38 = load i32, i32* %5
%39 = load i32, i32* %4
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %42
41: ; preds = %37
br label %82
42: ; preds = %37
store i32 0, i32* %2
%43 = load i32, i32* %5
store i32 %43, i32* %6
%44 = load i32, i32* %4
%45 = load i32, i32* %5
%46 = sub nsw i32 %45, %44
store i32 %46, i32* %5
%47 = load i32, i32* %4
%48 = load i32, i32* %2
%49 = add nsw i32 %48, %47
store i32 %49, i32* %2
%50 = load i32, i32* %5
%51 = load i32, i32* %7
%52 = mul nsw i32 2, %51
%53 = icmp slt i32 %50, %52
br i1 %53, label %54, label %55
54: ; preds = %42
br label %82
55: ; preds = %42
store i32 0, i32* %3
br label %56
56: ; preds = %78, %55
%57 = load i32, i32* %3
%58 = load i32, i32* %7
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = load i32, i32* %5
%62 = icmp sgt i32 %61, 2
br label %63
63: ; preds = %60, %56
%64 = phi i1 [ false, %56 ], [ %62, %60 ]
br i1 %64, label %65, label %81
65: ; preds = %63
%66 = load i32, i32* %2
%67 = icmp sle i32 0, %66
%68 = zext i1 %67 to i32
%69 = call i32 @__VERIFIER_assert(i32 %68)
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
%72 = load i32, i32* %6
%73 = icmp slt i32 %71, %72
%74 = zext i1 %73 to i32
%75 = call i32 @__VERIFIER_assert(i32 %74)
%76 = load i32, i32* %2
%77 = add nsw i32 %76, 2
store i32 %77, i32* %2
br label %78
78: ; preds = %65
%79 = load i32, i32* %3
%80 = add nsw i32 %79, 1
store i32 %80, i32* %3
br label %56
81: ; preds = %63
br label %82
82: ; preds = %81, %54, %41, %36, %31, %26
%83 = load i32, i32* %1
ret i32 %83
}

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