int main(void) {
  int a[62];
  int i;
  check_vect();
  int ret = liveloop(27, 62, a);
  if (ret != 62 + 27)
    abort();
  for (i = 0; i < 62; i++) {
    __asm__ volatile("");
    if (a[i] != i + 27 + 1)
      abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
lea    -0x100(%rbp),%rdx
mov    $0x1b,%edi
mov    $0x3e,%esi
mov    $0x0,%al
call   1050 <liveloop@plt>
mov    %eax,-0x108(%rbp)
cmpl   $0x59,-0x108(%rbp)
je     1179 <main+0x49>
call   1030 <abort@plt>
movl   $0x0,-0x104(%rbp)
cmpl   $0x3e,-0x104(%rbp)
jge    11d0 <main+0xa0>
movslq -0x104(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
mov    -0x104(%rbp),%ecx
add    $0x1b,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     11b7 <main+0x87>
call   1030 <abort@plt>
jmp    11bc <main+0x8c>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1183 <main+0x53>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xf8,%rsp
xor    %eax,%eax
call   1040 <check_vect@plt>
mov    %rsp,%rdx
mov    $0x1b,%edi
mov    $0x3e,%esi
xor    %eax,%eax
call   1050 <liveloop@plt>
cmp    $0x59,%eax
jne    117d <main+0x4d>
mov    $0x1c,%eax
nopl   0x0(%rax)
mov    -0x70(%rsp,%rax,4),%ecx
cmp    %rcx,%rax
jne    117d <main+0x4d>
add    $0x1,%rax
cmp    $0x5a,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0xf8,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [62 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @check_vect()
%6 = getelementptr inbounds [62 x i32], [62 x i32]* %2, i64 0, i64 0
%7 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @liveloop to i32 (i32, i32, i32*, ...)*)(i32 27, i32 62, i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 89
br i1 %9, label %10, label %11
10: ; preds = %0
unreachable
11: ; preds = %0
store i32 0, i32* %3
br label %12
12: ; preds = %26, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 62
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [62 x i32], [62 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 27
%22 = add nsw i32 %21, 1
%23 = icmp ne i32 %19, %22
br i1 %23, label %24, label %25
24: ; preds = %15
unreachable
25: ; preds = %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %12
29: ; preds = %12
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [62 x i32]
%2 = bitcast [62 x i32]* %1 to i8*
%3 = tail call i32 (...) @check_vect()
%4 = getelementptr inbounds [62 x i32], [62 x i32]* %1, i64 0, i64 0
%5 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @liveloop to i32 (i32, i32, i32*, ...)*)(i32 27, i32 62, i32* %4)
%6 = icmp eq i32 %5, 89
br i1 %6, label %11, label %7
7: ; preds = %0
unreachable
8: ; preds = %11
%9 = add nuw nsw i64 %12, 1
%10 = icmp eq i64 %9, 62
br i1 %10, label %19, label %11
11: ; preds = %0, %8
%12 = phi i64 [ %9, %8 ], [ 0, %0 ]
%13 = getelementptr inbounds [62 x i32], [62 x i32]* %1, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nuw nsw i64 %12, 28
%16 = zext i32 %14 to i64
%17 = icmp eq i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %11
unreachable
19: ; preds = %8
ret i32 0
}