#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;
  int k;
  k = __VERIFIER_nondet_int();
  __VERIFIER_assume(0 <= k && k <= 10);
  for (i = 0; i < 1000000 * k; i += k)
    ;
  __VERIFIER_assert(i == 1000000 * k);
}


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)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     115c <main+0x2c>
cmpl   $0xa,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xf4240,-0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1195 <main+0x65>
jmp    1187 <main+0x57>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <main+0x40>
mov    -0x4(%rbp),%eax
imul   $0xf4240,-0x8(%rbp),%ecx
cmp    %ecx,%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   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0xb,%eax
setb   %dil
call   1050 <__VERIFIER_assume@plt>
imul   $0xf4240,%ebp,%eax
mov    %ebp,%ecx
neg    %ecx
cs nopw 0x0(%rax,%rax,1)
add    %ebp,%ebx
lea    (%rcx,%rbx,1),%edx
cmp    %eax,%edx
jl     1160 <main+0x30>
imul   $0xf4241,%ebp,%eax
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 10
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @__VERIFIER_assume(i32 %11)
store i32 0, i32* %1
br label %13
13: ; preds = %19, %9
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = mul nsw i32 1000000, %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %23
18: ; preds = %13
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = load i32, i32* %1
%22 = add nsw i32 %21, %20
store i32 %22, i32* %1
br label %13
23: ; preds = %13
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = mul nsw i32 1000000, %25
%27 = icmp eq i32 %24, %26
%28 = zext i1 %27 to i32
%29 = call i32 @__VERIFIER_assert(i32 %28)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp ult i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
%5 = mul nsw i32 %1, 1000000
br label %6
6: ; preds = %6, %0
%7 = phi i32 [ 0, %0 ], [ %9, %6 ]
%8 = icmp slt i32 %7, %5
%9 = add nsw i32 %7, %1
br i1 %8, label %6, label %10
10: ; preds = %6
%11 = icmp eq i32 %7, %5
%12 = zext i1 %11 to i32
%13 = tail call i32 @__VERIFIER_assert(i32 %12)
ret void
}