#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();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  if (y > 0) {
    while (x > 0) {
      if (x > y) {
        x = y;
      } else {
        x = x - 1;
      }
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%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   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1186 <main+0x76>
jmp    1149 <main+0x39>
cmpl   $0x0,-0xc(%rbp)
jle    1181 <main+0x71>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116a <main+0x5a>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <main+0x63>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x39>
jmp    1186 <main+0x76>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    113e <main+0x2e>
test   %ebx,%ebx
jle    113e <main+0x2e>
nopl   0x0(%rax)
cmp    %eax,%ebx
lea    -0x1(%rbx),%ecx
cmovg  %eax,%ecx
mov    %ecx,%ebx
test   %ecx,%ecx
jg     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
store i32 0, i32* %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %26
9: ; preds = %0
br label %10
10: ; preds = %22, %9
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %22
19: ; preds = %13
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %17
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %10
25: ; preds = %10
br label %26
26: ; preds = %25, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %2, 0
%4 = icmp sgt i32 %1, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %1, %0 ]
%8 = icmp sgt i32 %7, %2
%9 = add nsw i32 %7, -1
%10 = select i1 %8, i32 %2, i32 %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}