#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*/ clang_analyzer_eval(int);
void loop_which_iterates_limit_times_not_widened() {
  int i;
  int x = 1;
  for (i = 0; i < 1; ++i) {
  }
  clang_analyzer_eval(x == 1);
  for (i = 0; i < 2; ++i) {
  }
  clang_analyzer_eval(x == 1);
  for (i = 0; i < 3; ++i) {
  }
  clang_analyzer_eval(x == 1);
}


x86 assembly (clang, -O0):
<loop_which_iterates_limit_times_not_widened>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1143 <loop_which_iterates_limit_times_not_widened+0x33>
jmp    1135 <loop_which_iterates_limit_times_not_widened+0x25>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <loop_which_iterates_limit_times_not_widened+0x16>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1178 <loop_which_iterates_limit_times_not_widened+0x68>
jmp    116a <loop_which_iterates_limit_times_not_widened+0x5a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <loop_which_iterates_limit_times_not_widened+0x4b>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    11ad <loop_which_iterates_limit_times_not_widened+0x9d>
jmp    119f <loop_which_iterates_limit_times_not_widened+0x8f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <loop_which_iterates_limit_times_not_widened+0x80>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_which_iterates_limit_times_not_widened>:
push   %rax
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <clang_analyzer_eval@plt>

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

LLVM IR (-O2):
define void @loop_which_iterates_limit_times_not_widened() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}