#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ _cleanup();
int /*<<< orphan*/ crypt_get_error(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, char const *, int, char *);
void check_ok(int status, int line, const char *func) {
  char buf[256];
  if (status) {
    crypt_get_error(buf, sizeof(buf));
    printf("FAIL line %d [%s]: code %d, %s\n", line, func, status, buf);
    _cleanup();
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     119e <check_ok+0x5e>
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1050 <crypt_get_error@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    -0x110(%rbp),%r8
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <_cleanup@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ok>:
test   %edi,%edi
jne    1145 <check_ok+0x5>
ret
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x100,%esi
call   1050 <crypt_get_error@plt>
lea    0xe90(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <_cleanup@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"FAIL line %d [%s]: code %d, %s\0A\00"
define void @check_ok(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [256 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%12 = call i32 @crypt_get_error(i8* %11, i32 256)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %4
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14, i32 %15, i8* %16)
%18 = call i32 (...) @_cleanup()
%19 = call i32 @exit(i32 -1)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"FAIL line %d [%s]: code %d, %s\0A\00"
define void @check_ok(i32 %0, i32 %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %0, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = call i32 @crypt_get_error(i8* %5, i32 256)
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i32 %0, i8* %5)
%10 = call i32 (...) @_cleanup()
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %3
ret void
}