#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*/ printf(char *, ...);
int main() {
  int check = 0;
  int test = 1;
  int i;
  for (i = 10; i >= 1; i--) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (int j = 10; j > 0; j--) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 0; i < 10; i++) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 1; i <= 10; i++) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 10; i > 0; --i) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 1; i <= 10; ++i) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 1; i <= 10; i = i + 1) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 10; i > 0; i = i - 1) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  for (i = 10; i >= 1; i = -1 + i) {
    check++;
  }
  if (check != 10) {
    printf("ERROR TEST %d(c: %d)\n", test, check);
    return -1;
  }
  check = 0;
  test++;
  printf("OK!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
cmpl   $0xa,-0x8(%rbp)
je     117f <main+0x6f>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11b7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <main+0x86>
cmpl   $0xa,-0x8(%rbp)
je     11e1 <main+0xd1>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1219 <main+0x109>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f8 <main+0xe8>
cmpl   $0xa,-0x8(%rbp)
je     1243 <main+0x133>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     127b <main+0x16b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    125a <main+0x14a>
cmpl   $0xa,-0x8(%rbp)
je     12a5 <main+0x195>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    12dd <main+0x1cd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    12bc <main+0x1ac>
cmpl   $0xa,-0x8(%rbp)
je     1307 <main+0x1f7>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     133f <main+0x22f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    131e <main+0x20e>
cmpl   $0xa,-0x8(%rbp)
je     1369 <main+0x259>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     13a1 <main+0x291>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1380 <main+0x270>
cmpl   $0xa,-0x8(%rbp)
je     13cb <main+0x2bb>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1403 <main+0x2f3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13e2 <main+0x2d2>
cmpl   $0xa,-0x8(%rbp)
je     142d <main+0x31d>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1467 <main+0x357>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1444 <main+0x334>
cmpl   $0xa,-0x8(%rbp)
je     1491 <main+0x381>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x3a6>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xb6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"ERROR TEST %d(c: %d)\0A\00"
@.str.1 = [5 x i8] c"OK!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 10, i32* %4
br label %6
6: ; preds = %12, %0
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
store i32 -1, i32* %1
br label %178
22: ; preds = %15
store i32 0, i32* %2
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
store i32 10, i32* %5
br label %25
25: ; preds = %31, %22
%26 = load i32, i32* %5
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %31
31: ; preds = %28
%32 = load i32, i32* %5
%33 = add nsw i32 %32, -1
store i32 %33, i32* %5
br label %25
34: ; preds = %25
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 10
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* %3
%39 = load i32, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %39)
store i32 -1, i32* %1
br label %178
41: ; preds = %34
store i32 0, i32* %2
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
store i32 0, i32* %4
br label %44
44: ; preds = %50, %41
%45 = load i32, i32* %4
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %53
47: ; preds = %44
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %50
50: ; preds = %47
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
br label %44
53: ; preds = %44
%54 = load i32, i32* %2
%55 = icmp ne i32 %54, 10
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = load i32, i32* %3
%58 = load i32, i32* %2
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %57, i32 %58)
store i32 -1, i32* %1
br label %178
60: ; preds = %53
store i32 0, i32* %2
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
store i32 1, i32* %4
br label %63
63: ; preds = %69, %60
%64 = load i32, i32* %4
%65 = icmp sle i32 %64, 10
br i1 %65, label %66, label %72
66: ; preds = %63
%67 = load i32, i32* %2
%68 = add nsw i32 %67, 1
store i32 %68, i32* %2
br label %69
69: ; preds = %66
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %63
72: ; preds = %63
%73 = load i32, i32* %2
%74 = icmp ne i32 %73, 10
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = load i32, i32* %3
%77 = load i32, i32* %2
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %76, i32 %77)
store i32 -1, i32* %1
br label %178
79: ; preds = %72
store i32 0, i32* %2
%80 = load i32, i32* %3
%81 = add nsw i32 %80, 1
store i32 %81, i32* %3
store i32 10, i32* %4
br label %82
82: ; preds = %88, %79
%83 = load i32, i32* %4
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %82
%86 = load i32, i32* %2
%87 = add nsw i32 %86, 1
store i32 %87, i32* %2
br label %88
88: ; preds = %85
%89 = load i32, i32* %4
%90 = add nsw i32 %89, -1
store i32 %90, i32* %4
br label %82
91: ; preds = %82
%92 = load i32, i32* %2
%93 = icmp ne i32 %92, 10
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load i32, i32* %3
%96 = load i32, i32* %2
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %95, i32 %96)
store i32 -1, i32* %1
br label %178
98: ; preds = %91
store i32 0, i32* %2
%99 = load i32, i32* %3
%100 = add nsw i32 %99, 1
store i32 %100, i32* %3
store i32 1, i32* %4
br label %101
101: ; preds = %107, %98
%102 = load i32, i32* %4
%103 = icmp sle i32 %102, 10
br i1 %103, label %104, label %110
104: ; preds = %101
%105 = load i32, i32* %2
%106 = add nsw i32 %105, 1
store i32 %106, i32* %2
br label %107
107: ; preds = %104
%108 = load i32, i32* %4
%109 = add nsw i32 %108, 1
store i32 %109, i32* %4
br label %101
110: ; preds = %101
%111 = load i32, i32* %2
%112 = icmp ne i32 %111, 10
br i1 %112, label %113, label %117
113: ; preds = %110
%114 = load i32, i32* %3
%115 = load i32, i32* %2
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %114, i32 %115)
store i32 -1, i32* %1
br label %178
117: ; preds = %110
store i32 0, i32* %2
%118 = load i32, i32* %3
%119 = add nsw i32 %118, 1
store i32 %119, i32* %3
store i32 1, i32* %4
br label %120
120: ; preds = %126, %117
%121 = load i32, i32* %4
%122 = icmp sle i32 %121, 10
br i1 %122, label %123, label %129
123: ; preds = %120
%124 = load i32, i32* %2
%125 = add nsw i32 %124, 1
store i32 %125, i32* %2
br label %126
126: ; preds = %123
%127 = load i32, i32* %4
%128 = add nsw i32 %127, 1
store i32 %128, i32* %4
br label %120
129: ; preds = %120
%130 = load i32, i32* %2
%131 = icmp ne i32 %130, 10
br i1 %131, label %132, label %136
132: ; preds = %129
%133 = load i32, i32* %3
%134 = load i32, i32* %2
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %133, i32 %134)
store i32 -1, i32* %1
br label %178
136: ; preds = %129
store i32 0, i32* %2
%137 = load i32, i32* %3
%138 = add nsw i32 %137, 1
store i32 %138, i32* %3
store i32 10, i32* %4
br label %139
139: ; preds = %145, %136
%140 = load i32, i32* %4
%141 = icmp sgt i32 %140, 0
br i1 %141, label %142, label %148
142: ; preds = %139
%143 = load i32, i32* %2
%144 = add nsw i32 %143, 1
store i32 %144, i32* %2
br label %145
145: ; preds = %142
%146 = load i32, i32* %4
%147 = sub nsw i32 %146, 1
store i32 %147, i32* %4
br label %139
148: ; preds = %139
%149 = load i32, i32* %2
%150 = icmp ne i32 %149, 10
br i1 %150, label %151, label %155
151: ; preds = %148
%152 = load i32, i32* %3
%153 = load i32, i32* %2
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %152, i32 %153)
store i32 -1, i32* %1
br label %178
155: ; preds = %148
store i32 0, i32* %2
%156 = load i32, i32* %3
%157 = add nsw i32 %156, 1
store i32 %157, i32* %3
store i32 10, i32* %4
br label %158
158: ; preds = %164, %155
%159 = load i32, i32* %4
%160 = icmp sge i32 %159, 1
br i1 %160, label %161, label %167
161: ; preds = %158
%162 = load i32, i32* %2
%163 = add nsw i32 %162, 1
store i32 %163, i32* %2
br label %164
164: ; preds = %161
%165 = load i32, i32* %4
%166 = add nsw i32 -1, %165
store i32 %166, i32* %4
br label %158
167: ; preds = %158
%168 = load i32, i32* %2
%169 = icmp ne i32 %168, 10
br i1 %169, label %170, label %174
170: ; preds = %167
%171 = load i32, i32* %3
%172 = load i32, i32* %2
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %171, i32 %172)
store i32 -1, i32* %1
br label %178
174: ; preds = %167
store i32 0, i32* %2
%175 = load i32, i32* %3
%176 = add nsw i32 %175, 1
store i32 %176, i32* %3
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %178
178: ; preds = %174, %170, %151, %132, %113, %94, %75, %56, %37, %18
%179 = load i32, i32* %1
ret i32 %179
}

LLVM IR (-O2):
@str = [4 x i8] c"OK!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}