#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*/ ac_average_init(int);
int ac_cpuinfo();
int /*<<< orphan*/ ac_imgconvert_init(int);
int /*<<< orphan*/ ac_memcpy_init(int);
int /*<<< orphan*/ ac_rescale_init(int);
int ac_init(int accel) {
  accel &= ac_cpuinfo();
  if (!ac_average_init(accel) || !ac_imgconvert_init(accel) ||
      !ac_memcpy_init(accel) || !ac_rescale_init(accel)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ac_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ac_cpuinfo@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ac_average_init@plt>
cmp    $0x0,%eax
je     11ac <ac_init+0x5c>
mov    -0x8(%rbp),%edi
call   1060 <ac_imgconvert_init@plt>
cmp    $0x0,%eax
je     11ac <ac_init+0x5c>
mov    -0x8(%rbp),%edi
call   1040 <ac_memcpy_init@plt>
cmp    $0x0,%eax
je     11ac <ac_init+0x5c>
mov    -0x8(%rbp),%edi
call   1070 <ac_rescale_init@plt>
cmp    $0x0,%eax
jne    11b8 <ac_init+0x68>
movl   $0x0,-0x4(%rbp)
jmp    11bf <ac_init+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ac_init>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <ac_cpuinfo@plt>
and    %eax,%ebp
mov    %ebp,%edi
call   1030 <ac_average_init@plt>
test   %eax,%eax
je     118f <ac_init+0x3f>
mov    %ebp,%edi
call   1060 <ac_imgconvert_init@plt>
test   %eax,%eax
je     118f <ac_init+0x3f>
mov    %ebp,%edi
call   1040 <ac_memcpy_init@plt>
test   %eax,%eax
je     118f <ac_init+0x3f>
mov    %ebp,%edi
call   1070 <ac_rescale_init@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ac_init(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @ac_cpuinfo()
%5 = load i32, i32* %3
%6 = and i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @ac_average_init(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @ac_imgconvert_init(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i32 @ac_memcpy_init(i32 %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i32 @ac_rescale_init(i32 %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18, %14, %10, %1
store i32 0, i32* %2
br label %24
23: ; preds = %18
store i32 1, i32* %2
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @ac_init(i32 %0) {
%2 = tail call i32 (...) @ac_cpuinfo()
%3 = and i32 %2, %0
%4 = tail call i32 @ac_average_init(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = tail call i32 @ac_imgconvert_init(i32 %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = tail call i32 @ac_memcpy_init(i32 %3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = tail call i32 @ac_rescale_init(i32 %3)
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %1, %6, %9
%17 = phi i32 [ 0, %9 ], [ 0, %6 ], [ 0, %1 ], [ %15, %12 ]
ret i32 %17
}