#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 foo(int d) {
  int x, y, k, z = 1;
  int c;
  int input;
L1:
  while (z < k) {
    z = 2 * z;
  }
  __VERIFIER_assert(z >= 1);
L2:
  while (x > 0 && y > 0) {
    c = __VERIFIER_nondet_int();
    if (c) {
    P1:
      x = x - d;
      y = __VERIFIER_nondet_int();
      z = z - 1;
    } else {
      y = y - d;
    }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    1137 <foo+0x17>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1151 <foo+0x31>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <foo+0x17>
cmpl   $0x1,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1167 <foo+0x47>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x1d(%rbp)
jle    1180 <foo+0x60>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1190 <foo+0x70>
jmp    11d8 <foo+0xb8>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11ca <foo+0xaa>
jmp    11a9 <foo+0x89>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d3 <foo+0xb3>
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1167 <foo+0x47>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%edi
jmp    1030 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %6
br label %9
9: ; preds = %1
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %6
%16 = mul nsw i32 2, %15
store i32 %16, i32* %6
br label %10
17: ; preds = %10
%18 = load i32, i32* %6
%19 = icmp sge i32 %18, 1
%20 = zext i1 %19 to i32
%21 = call i32 @__VERIFIER_assert(i32 %20)
br label %22
22: ; preds = %17
br label %23
23: ; preds = %47, %22
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 0
br label %29
29: ; preds = %26, %23
%30 = phi i1 [ false, %23 ], [ %28, %26 ]
br i1 %30, label %31, label %48
31: ; preds = %29
%32 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %31
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = load i32, i32* %2
%39 = sub nsw i32 %37, %38
store i32 %39, i32* %3
%40 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %40, i32* %4
%41 = load i32, i32* %6
%42 = sub nsw i32 %41, 1
store i32 %42, i32* %6
br label %47
43: ; preds = %31
%44 = load i32, i32* %4
%45 = load i32, i32* %2
%46 = sub nsw i32 %44, %45
store i32 %46, i32* %4
br label %47
47: ; preds = %43, %36
br label %23
48: ; preds = %29
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}