#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*/ WOLFSSL_MSG(char *);
int caamParseCCBError(unsigned int);
int caamParseDECOError(unsigned int);
int caamParseError(unsigned int error) {
  int ret = 0;
  if ((error & 0x40000000) > 0) {
    WOLFSSL_MSG("[DECO Error]");
    ret = caamParseDECOError(error);
  }
  if ((error & 0x20000000) > 0) {
    WOLFSSL_MSG("[CCB Error]");
    ret = caamParseCCBError(error);
  }
  return ret;
}


x86 assembly (clang, -O0):
<caamParseError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
jbe    116a <caamParseError+0x3a>
lea    0xea6(%rip),%rdi
call   1050 <WOLFSSL_MSG@plt>
mov    -0x4(%rbp),%edi
call   1040 <caamParseDECOError@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x20000000,%eax
cmp    $0x0,%eax
jbe    1192 <caamParseError+0x62>
lea    0xe8b(%rip),%rdi
call   1050 <WOLFSSL_MSG@plt>
mov    -0x4(%rbp),%edi
call   1030 <caamParseCCBError@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caamParseError>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
test   $0x40000000,%edi
je     1150 <caamParseError+0x20>
lea    0xebc(%rip),%rdi
call   1050 <WOLFSSL_MSG@plt>
mov    %ebx,%edi
call   1040 <caamParseDECOError@plt>
test   $0x20000000,%ebx
jne    115a <caamParseError+0x2a>
pop    %rbx
ret
lea    0xeac(%rip),%rdi
call   1050 <WOLFSSL_MSG@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <caamParseCCBError@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[DECO Error]\00"
@.str.1 = [12 x i8] c"[CCB Error]\00"
define i32 @caamParseError(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 1073741824
%6 = icmp ugt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @WOLFSSL_MSG(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @caamParseDECOError(i32 %9)
store i32 %10, i32* %3
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %2
%13 = and i32 %12, 536870912
%14 = icmp ugt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = call i32 @WOLFSSL_MSG(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = call i32 @caamParseCCBError(i32 %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"[DECO Error]\00"
@.str.1 = [12 x i8] c"[CCB Error]\00"
define i32 @caamParseError(i32 %0) {
%2 = and i32 %0, 1073741824
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @WOLFSSL_MSG(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @caamParseDECOError(i32 %0)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
%9 = and i32 %0, 536870912
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = tail call i32 @WOLFSSL_MSG(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @caamParseCCBError(i32 %0)
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %13, %11 ], [ %8, %7 ]
ret i32 %15
}