#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 */
scalar_t__ aes_cbc_test();
scalar_t__ aes_ccm_test();
scalar_t__ aes_ctr_test();
scalar_t__ aes_ecb_test();
int aes_test() {
  int pass = 1;
  pass = pass && aes_ecb_test();
  pass = pass && aes_cbc_test();
  pass = pass && aes_ctr_test();
  pass = pass && aes_ccm_test();
  return (pass);
}


x86 assembly (clang, -O0):
<aes_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116f <aes_test+0x2f>
mov    $0x0,%al
call   1040 <aes_ecb_test@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
je     119a <aes_test+0x5a>
mov    $0x0,%al
call   1060 <aes_cbc_test@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x7(%rbp)
je     11c5 <aes_test+0x85>
mov    $0x0,%al
call   1050 <aes_ctr_test@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x8(%rbp)
je     11f0 <aes_test+0xb0>
mov    $0x0,%al
call   1030 <aes_ccm_test@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_test>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <aes_ecb_test@plt>
test   %rax,%rax
je     117a <aes_test+0x3a>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <aes_cbc_test@plt>
test   %rax,%rax
je     117a <aes_test+0x3a>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <aes_ctr_test@plt>
test   %rax,%rax
je     117a <aes_test+0x3a>
xor    %eax,%eax
call   1030 <aes_ccm_test@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @aes_test() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @aes_ecb_test()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = call i64 (...) @aes_cbc_test()
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %12, %7
%16 = phi i1 [ false, %7 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = call i64 (...) @aes_ctr_test()
%22 = icmp ne i64 %21, 0
br label %23
23: ; preds = %20, %15
%24 = phi i1 [ false, %15 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %1
%26 = load i32, i32* %1
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = call i64 (...) @aes_ccm_test()
%30 = icmp ne i64 %29, 0
br label %31
31: ; preds = %28, %23
%32 = phi i1 [ false, %23 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
store i32 %33, i32* %1
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @aes_test() {
%1 = tail call i64 (...) @aes_ecb_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i64 (...) @aes_cbc_test()
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i64 (...) @aes_ctr_test()
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 (...) @aes_ccm_test()
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %0, %3, %9, %6
%14 = phi i32 [ 0, %6 ], [ %12, %9 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %14
}