#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*/ assert(int);
void main() {
  int i = 0;
  while (1) {
    i++;
    for (int j = 0; j < 10; j++) {
      assert(0 >= i);
      assert(i <= 10);
    }
    if (i > 9)
      i = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116a <main+0x5a>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xa,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x1f>
cmpl   $0x9,-0x4(%rbp)
jle    117b <main+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebp,%ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
cmp    $0x9,%ebp
lea    0x1(%rbp),%eax
cmovge %r14d,%eax
mov    %eax,%ebp
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %26, %1 ]
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 %3)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 %3)
%9 = tail call i32 @assert(i32 1)
%10 = tail call i32 @assert(i32 %3)
%11 = tail call i32 @assert(i32 1)
%12 = tail call i32 @assert(i32 %3)
%13 = tail call i32 @assert(i32 1)
%14 = tail call i32 @assert(i32 %3)
%15 = tail call i32 @assert(i32 1)
%16 = tail call i32 @assert(i32 %3)
%17 = tail call i32 @assert(i32 1)
%18 = tail call i32 @assert(i32 %3)
%19 = tail call i32 @assert(i32 1)
%20 = tail call i32 @assert(i32 %3)
%21 = tail call i32 @assert(i32 1)
%22 = tail call i32 @assert(i32 %3)
%23 = tail call i32 @assert(i32 1)
%24 = add nsw i32 %2, 1
%25 = icmp sgt i32 %2, 8
%26 = select i1 %25, i32 0, i32 %24
br label %1
}