#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*/ ASYNC_is_capable();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_ASYNC_WAIT_CTX_get_all_fds();
int /*<<< orphan*/ test_ASYNC_block_pause();
int /*<<< orphan*/ test_ASYNC_callback_status();
int /*<<< orphan*/ test_ASYNC_get_current_job();
int /*<<< orphan*/ test_ASYNC_init_thread();
int /*<<< orphan*/ test_ASYNC_start_job();
int /*<<< orphan*/ test_ASYNC_start_job_ex();
int main(int argc, char **argv) {
  if (!ASYNC_is_capable()) {
    fprintf(stderr,
            "OpenSSL build is not ASYNC capable - skipping async tests\n");
  } else {
    if (!test_ASYNC_init_thread() || !test_ASYNC_callback_status() ||
        !test_ASYNC_start_job() || !test_ASYNC_get_current_job() ||
        !test_ASYNC_WAIT_CTX_get_all_fds() || !test_ASYNC_block_pause() ||
        !test_ASYNC_start_job_ex()) {
      return 1;
    }
  }
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ASYNC_is_capable@plt>
cmp    $0x0,%eax
jne    11e0 <main+0x40>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe2a(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   1090 <test_ASYNC_init_thread@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   10a0 <test_ASYNC_callback_status@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   10b0 <test_ASYNC_start_job@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   1070 <test_ASYNC_get_current_job@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   10c0 <test_ASYNC_WAIT_CTX_get_all_fds@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   1030 <test_ASYNC_block_pause@plt>
cmp    $0x0,%eax
je     1250 <main+0xb0>
mov    $0x0,%al
call   1060 <test_ASYNC_start_job_ex@plt>
cmp    $0x0,%eax
jne    125c <main+0xbc>
movl   $0x1,-0x4(%rbp)
jmp    1274 <main+0xd4>
jmp    1261 <main+0xc1>
lea    0xdd3(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <ASYNC_is_capable@plt>
test   %eax,%eax
je     1200 <main+0x60>
xor    %eax,%eax
call   1090 <test_ASYNC_init_thread@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   10a0 <test_ASYNC_callback_status@plt>
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   10b0 <test_ASYNC_start_job@plt>
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   1070 <test_ASYNC_get_current_job@plt>
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   10c0 <test_ASYNC_WAIT_CTX_get_all_fds@plt>
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   1040 <test_ASYNC_block_pause@plt>
test   %eax,%eax
je     1223 <main+0x83>
xor    %eax,%eax
call   1060 <test_ASYNC_start_job_ex@plt>
test   %eax,%eax
jne    1215 <main+0x75>
jmp    1223 <main+0x83>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xdf0(%rip),%rsi
call   1080 <fprintf@plt>
lea    0xe1f(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"OpenSSL build is not ASYNC capable - skipping async tests\0A\00"
@.str.1 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ASYNC_is_capable()
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %34
11: ; preds = %2
%12 = call i32 (...) @test_ASYNC_init_thread()
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = call i32 (...) @test_ASYNC_callback_status()
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %14
%18 = call i32 (...) @test_ASYNC_start_job()
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = call i32 (...) @test_ASYNC_get_current_job()
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = call i32 (...) @test_ASYNC_WAIT_CTX_get_all_fds()
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = call i32 (...) @test_ASYNC_block_pause()
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = call i32 (...) @test_ASYNC_start_job_ex()
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %29, %26, %23, %20, %17, %14, %11
store i32 1, i32* %3
br label %36
33: ; preds = %29
br label %34
34: ; preds = %33, %8
%35 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %36
36: ; preds = %34, %32
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"OpenSSL build is not ASYNC capable - skipping async tests\0A\00"
@str = [5 x i8] c"PASS\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ASYNC_is_capable()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %29
8: ; preds = %2
%9 = tail call i32 (...) @test_ASYNC_init_thread()
%10 = icmp eq i32 %9, 0
br i1 %10, label %31, label %11
11: ; preds = %8
%12 = tail call i32 (...) @test_ASYNC_callback_status()
%13 = icmp eq i32 %12, 0
br i1 %13, label %31, label %14
14: ; preds = %11
%15 = tail call i32 (...) @test_ASYNC_start_job()
%16 = icmp eq i32 %15, 0
br i1 %16, label %31, label %17
17: ; preds = %14
%18 = tail call i32 (...) @test_ASYNC_get_current_job()
%19 = icmp eq i32 %18, 0
br i1 %19, label %31, label %20
20: ; preds = %17
%21 = tail call i32 (...) @test_ASYNC_WAIT_CTX_get_all_fds()
%22 = icmp eq i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %20
%24 = tail call i32 (...) @test_ASYNC_block_pause()
%25 = icmp eq i32 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = tail call i32 (...) @test_ASYNC_start_job_ex()
%28 = icmp eq i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %26, %5
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %31
31: ; preds = %8, %11, %14, %17, %20, %23, %26, %29
%32 = phi i32 [ 0, %29 ], [ 1, %26 ], [ 1, %23 ], [ 1, %20 ], [ 1, %17 ], [ 1, %14 ], [ 1, %11 ], [ 1, %8 ]
ret i32 %32
}