#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__ mp_get_mp3_header(unsigned char *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int mp_check_mp3_header(unsigned int head) {
  if ((head & 0x0000e0ff) != 0x0000e0ff || (head & 0x00fc0000) == 0x00fc0000)
    return 0;
  if (mp_get_mp3_header((unsigned char *)(&head), NULL, NULL, NULL, NULL,
                        NULL) <= 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<mp_check_mp3_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xe0ff,%eax
cmp    $0xe0ff,%eax
jne    1141 <mp_check_mp3_header+0x31>
mov    -0x8(%rbp),%eax
and    $0xfc0000,%eax
cmp    $0xfc0000,%eax
jne    114d <mp_check_mp3_header+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <mp_check_mp3_header+0x74>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <mp_get_mp3_header@plt>
cmp    $0x0,%rax
jg     117d <mp_check_mp3_header+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <mp_check_mp3_header+0x74>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_check_mp3_header>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edi,%ecx
not    %ecx
xor    %eax,%eax
test   $0xe0ff,%ecx
jne    1152 <mp_check_mp3_header+0x42>
and    $0xfc0000,%edi
cmp    $0xfc0000,%edi
je     1152 <mp_check_mp3_header+0x42>
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <mp_get_mp3_header@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mp_check_mp3_header(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 57599
%6 = icmp ne i32 %5, 57599
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 16515072
%10 = icmp eq i32 %9, 16515072
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 0, i32* %2
br label %18
12: ; preds = %7
%13 = bitcast i32* %3 to i8*
%14 = call i64 @mp_get_mp3_header(i8* %13, i32* null, i32* null, i32* null, i32* null, i32* null)
%15 = icmp sle i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %2
br label %18
17: ; preds = %12
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @mp_check_mp3_header(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = and i32 %0, 57599
%4 = icmp ne i32 %3, 57599
%5 = and i32 %0, 16515072
%6 = icmp eq i32 %5, 16515072
%7 = or i1 %4, %6
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = bitcast i32* %2 to i8*
%10 = call i64 @mp_get_mp3_header(i8* %9, i32* null, i32* null, i32* null, i32* null, i32* null)
%11 = icmp sgt i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1
%14 = phi i32 [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}