#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();
void f(int d) {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int k = __VERIFIER_nondet_int();
  int z = 1;
  if (k > 1073741823) {
    return;
  }
L1:
  while (z < k) {
    z = 2 * z;
  }
L2:
  while (x > 0 && y > 0) {
    if (__VERIFIER_nondet_int()) {
    P1:
      x = x - d;
      y = __VERIFIER_nondet_int();
      z = z - 1;
    } else {
      y = y - d;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-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    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3fffffff,-0x10(%rbp)
jle    1152 <f+0x42>
jmp    11ed <f+0xdd>
jmp    1157 <f+0x47>
jmp    115c <f+0x4c>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1176 <f+0x66>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <f+0x4c>
jmp    117b <f+0x6b>
jmp    1180 <f+0x70>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jle    1199 <f+0x89>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11a9 <f+0x99>
jmp    11ed <f+0xdd>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11df <f+0xcf>
jmp    11be <f+0xae>
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    11e8 <f+0xd8>
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <f+0x70>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x3fffffff,%eax
jle    114c <f+0x3c>
jmp    1166 <f+0x56>
nopl   0x0(%rax)
sub    %r14d,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
test   %ebp,%ebp
jle    1166 <f+0x56>
test   %ebx,%ebx
jle    1166 <f+0x56>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1140 <f+0x30>
sub    %r14d,%ebx
test   %ebp,%ebp
jg     1150 <f+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %4
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %5
store i32 1, i32* %6
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 1073741823
br i1 %11, label %12, label %13
12: ; preds = %1
br label %48
13: ; preds = %1
br label %14
14: ; preds = %13
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %6
%21 = mul nsw i32 2, %20
store i32 %21, i32* %6
br label %15
22: ; preds = %15
br label %23
23: ; preds = %22
br label %24
24: ; preds = %47, %23
%25 = load i32, i32* %3
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br label %30
30: ; preds = %27, %24
%31 = phi i1 [ false, %24 ], [ %29, %27 ]
br i1 %31, label %32, label %48
32: ; preds = %30
%33 = call i32 (...) @__VERIFIER_nondet_int()
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %32
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 = %32
%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 %24
48: ; preds = %12, %30
ret void
}

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