#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();
void main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int q = 0;
  int r = x;
  __VERIFIER_assume(y >= 0);
  while (r > y) {
    int tmp;
    tmp = y;
    while (tmp > 0) {
      tmp = tmp - 1;
      r = r - 1;
    }
    q = q + 1;
  }
  __VERIFIER_assert(x == q * y + r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11ab <main+0x7b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    119d <main+0x6d>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117c <main+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x3a>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <__VERIFIER_assume@plt>
cmp    %ebp,%r14d
jle    117b <main+0x4b>
xor    %ebx,%ebx
test   %ebp,%ebp
mov    $0x0,%ecx
cmovns %ebp,%ecx
mov    %r14d,%eax
nopl   0x0(%rax)
sub    %ecx,%eax
add    $0x1,%ebx
cmp    %ebp,%eax
jg     1170 <main+0x40>
jmp    117e <main+0x4e>
mov    %r14d,%eax
imul   %ebp,%ebx
add    %eax,%ebx
xor    %edi,%edi
cmp    %ebx,%r14d
sete   %dil
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %2
store i32 0, i32* %3
%8 = load i32, i32* %1
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @__VERIFIER_assume(i32 %11)
br label %13
13: ; preds = %27, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i32, i32* %2
store i32 %18, i32* %5
br label %19
19: ; preds = %22, %17
%20 = load i32, i32* %5
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %5
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %5
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %4
br label %19
27: ; preds = %19
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %13
30: ; preds = %13
%31 = load i32, i32* %1
%32 = load i32, i32* %3
%33 = load i32, i32* %2
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %4
%36 = add nsw i32 %34, %35
%37 = icmp eq i32 %31, %36
%38 = zext i1 %37 to i32
%39 = call i32 @__VERIFIER_assert(i32 %38)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @__VERIFIER_assume(i32 %4)
%6 = icmp sgt i32 %1, %2
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = icmp sgt i32 %2, 0
%9 = select i1 %8, i32 %2, i32 0
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ %1, %7 ], [ %13, %10 ]
%12 = phi i32 [ 0, %7 ], [ %14, %10 ]
%13 = sub i32 %11, %9
%14 = add nuw nsw i32 %12, 1
%15 = icmp sgt i32 %13, %2
br i1 %15, label %10, label %16
16: ; preds = %10, %0
%17 = phi i32 [ 0, %0 ], [ %14, %10 ]
%18 = phi i32 [ %1, %0 ], [ %13, %10 ]
%19 = mul nsw i32 %17, %2
%20 = add nsw i32 %19, %18
%21 = icmp eq i32 %1, %20
%22 = zext i1 %21 to i32
%23 = tail call i32 @__VERIFIER_assert(i32 %22)
ret void
}