#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*/ check_recovery(int, unsigned int, unsigned int, int);
int main(int argc, char **argv) {
  check_recovery(1, 2, 2, 1);
  check_recovery(4096, 3, 2, 1);
  check_recovery(1, 10, 10, 1);
  check_recovery(1, 16, 2, 1);
  check_recovery(4096, 255, 255, 0);
  for (unsigned t = 2; t < 254; t += 64)
    check_recovery(1, t + 2, t, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%ecx
mov    $0x2,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <check_recovery@plt>
mov    $0x1000,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%ecx
mov    $0xa,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <check_recovery@plt>
mov    $0x1,%ecx
mov    $0x10,%esi
mov    $0x2,%edx
mov    %ecx,%edi
call   1030 <check_recovery@plt>
mov    $0x1000,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <check_recovery@plt>
movl   $0x2,-0x14(%rbp)
cmpl   $0xfe,-0x14(%rbp)
jae    11c5 <main+0xb5>
mov    -0x14(%rbp),%esi
add    $0x2,%esi
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x14(%rbp)
jmp    1195 <main+0x85>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <check_recovery@plt>
mov    $0x1000,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0x10,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <check_recovery@plt>
mov    $0x1000,%edi
mov    $0xff,%esi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0x44,%esi
mov    $0x42,%edx
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0x84,%esi
mov    $0x82,%edx
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
mov    $0x1,%edi
mov    $0xc4,%esi
mov    $0xc2,%edx
xor    %ecx,%ecx
call   1030 <check_recovery@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @check_recovery(i32 1, i32 2, i32 2, i32 1)
%8 = call i32 @check_recovery(i32 4096, i32 3, i32 2, i32 1)
%9 = call i32 @check_recovery(i32 1, i32 10, i32 10, i32 1)
%10 = call i32 @check_recovery(i32 1, i32 16, i32 2, i32 1)
%11 = call i32 @check_recovery(i32 4096, i32 255, i32 255, i32 0)
store i32 2, i32* %6
br label %12
12: ; preds = %20, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 254
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %6
%17 = add i32 %16, 2
%18 = load i32, i32* %6
%19 = call i32 @check_recovery(i32 1, i32 %17, i32 %18, i32 0)
br label %20
20: ; preds = %15
%21 = load i32, i32* %6
%22 = add i32 %21, 64
store i32 %22, i32* %6
br label %12
23: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_recovery(i32 1, i32 2, i32 2, i32 1)
%4 = tail call i32 @check_recovery(i32 4096, i32 3, i32 2, i32 1)
%5 = tail call i32 @check_recovery(i32 1, i32 10, i32 10, i32 1)
%6 = tail call i32 @check_recovery(i32 1, i32 16, i32 2, i32 1)
%7 = tail call i32 @check_recovery(i32 4096, i32 255, i32 255, i32 0)
%8 = tail call i32 @check_recovery(i32 1, i32 4, i32 2, i32 0)
%9 = tail call i32 @check_recovery(i32 1, i32 68, i32 66, i32 0)
%10 = tail call i32 @check_recovery(i32 1, i32 132, i32 130, i32 0)
%11 = tail call i32 @check_recovery(i32 1, i32 196, i32 194, i32 0)
ret i32 0
}