#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();
int main() {
  int i;
  int k;
  k = __VERIFIER_nondet_int();
  __VERIFIER_assume(1 <= k && k <= 10);
  for (i = 0; i < 1000000 * k; i += k)
    ;
  __VERIFIER_assert(i <= 1000000 * k);
  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)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1166 <main+0x36>
cmpl   $0xa,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xf4240,-0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    119f <main+0x6f>
jmp    1191 <main+0x61>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x4a>
mov    -0x8(%rbp),%eax
imul   $0xf4240,-0xc(%rbp),%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
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
lea    -0x1(%rbx),%eax
xor    %edi,%edi
cmp    $0xa,%eax
setb   %dil
call   1050 <__VERIFIER_assume@plt>
imul   $0xf4240,%ebx,%eax
mov    %ebx,%ecx
neg    %ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    %ebx,%ecx
cmp    %eax,%ecx
jl     1160 <main+0x30>
setle  %al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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