#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 i, n = __VERIFIER_nondet_int(), q = __VERIFIER_nondet_int(), r;
  r = n;
  __VERIFIER_assume(n > q);
  __VERIFIER_assume(q >= 1);
  i = 0;
  while (r > q) {
    r = r - q;
    i = i + 1;
  }
  __VERIFIER_assert(i * q + r == n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11a0 <main+0x70>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117d <main+0x4d>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%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
xor    %edi,%edi
cmp    %eax,%r14d
setg   %dil
call   1050 <__VERIFIER_assume@plt>
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1050 <__VERIFIER_assume@plt>
cmp    %ebp,%r14d
jle    117b <main+0x4b>
xor    %ebx,%ebx
mov    %r14d,%eax
xchg   %ax,%ax
sub    %ebp,%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    %r14d,%ebx
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 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = load i32, i32* %2
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @__VERIFIER_assume(i32 %11)
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @__VERIFIER_assume(i32 %15)
store i32 0, i32* %1
br label %17
17: ; preds = %21, %0
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %4
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
br label %17
27: ; preds = %17
%28 = load i32, i32* %1
%29 = load i32, i32* %3
%30 = mul nsw i32 %28, %29
%31 = load i32, i32* %4
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %2
%34 = icmp eq i32 %32, %33
%35 = zext i1 %34 to i32
%36 = call i32 @__VERIFIER_assert(i32 %35)
ret void
}

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