#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 */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int _check_recovery(size_t, unsigned int, unsigned int, int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int);
void check_recovery(size_t size, unsigned n, unsigned t, int recover_poly) {
  int ret;
  char str[16];
  ret = _check_recovery(size, n, t, recover_poly);
  if (ret == -1) {
    snprintf(str, sizeof(str), "n: %d t: %d", n, t);
    perror(str);
    abort();
  } else if (ret == 1) {
    abort();
  }
}


x86 assembly (clang, -O0):
<check_recovery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1050 <_check_recovery@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    11a0 <check_recovery+0x60>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x10,%esi
lea    0xe75(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x1,-0x18(%rbp)
jne    11b1 <check_recovery+0x71>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11b6 <check_recovery+0x76>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_recovery>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
call   1050 <_check_recovery@plt>
cmp    $0x1,%eax
je     1188 <check_recovery+0x48>
cmp    $0xffffffff,%eax
je     1164 <check_recovery+0x24>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe95(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x10,%esi
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"n: %d t: %d\00"
define void @check_recovery(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [16 x i8]
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i64, i64* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @_check_recovery(i64 %11, i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %26
18: ; preds = %4
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @snprintf(i8* %19, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%24 = call i32 @perror(i8* %23)
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %4
%27 = load i32, i32* %9
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %26
br label %32
32: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"n: %d t: %d\00"
define void @check_recovery(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @_check_recovery(i64 %0, i32 %1, i32 %2, i32 %3)
switch i32 %7, label %14 [
i32 -1, label %8
i32 1, label %12
]
8: ; preds = %4
%9 = call i32 @snprintf(i8* %6, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%10 = call i32 @perror(i8* %6)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %4
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %4
ret void
}