int aa_pro_vid_b07(int chan, unsigned char *buf, int len) {
  if (len != 4 || buf[2] != 0x10)
    hu_log(6, "hu_aap", __func__, "Media Video ? Request");
  else
    hu_log(3, "hu_aap", __func__, "Media Video ? Request: %d", buf[3]);
  int ret = 0;
  return (ret);
}


x86 assembly (clang, -O0):
<aa_pro_vid_b07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jne    113d <aa_pro_vid_b07+0x2d>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x10,%eax
je     1163 <aa_pro_vid_b07+0x53>
mov    $0x6,%edi
lea    0xeb7(%rip),%rsi
lea    0xeb7(%rip),%rdx
lea    0xebf(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
jmp    118d <aa_pro_vid_b07+0x7d>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%r8d
mov    $0x3,%edi
lea    0xe88(%rip),%rsi
lea    0xe88(%rip),%rdx
lea    0xea6(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_vid_b07>:
push   %rax
cmp    $0x4,%edx
jne    1144 <aa_pro_vid_b07+0x34>
cmpb   $0x10,0x2(%rsi)
jne    1144 <aa_pro_vid_b07+0x34>
movzbl 0x3(%rsi),%r8d
lea    0xed8(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xef6(%rip),%rcx
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
jmp    1165 <aa_pro_vid_b07+0x55>
lea    0xeb5(%rip),%rsi
lea    0xeb5(%rip),%rdx
lea    0xebd(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_vid_b07 = [15 x i8] c"aa_pro_vid_b07\00"
@.str.1 = [22 x i8] c"Media Video ? Request\00"
@.str.2 = [26 x i8] c"Media Video ? Request: %d\00"
define i32 @aa_pro_vid_b07(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 4
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 16
br i1 %15, label %16, label %18
16: ; preds = %10, %3
%17 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_vid_b07, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %24
18: ; preds = %10
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_vid_b07, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18, %16
store i32 0, i32* %7
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_vid_b07 = [15 x i8] c"aa_pro_vid_b07\00"
@.str.1 = [22 x i8] c"Media Video ? Request\00"
@.str.2 = [26 x i8] c"Media Video ? Request: %d\00"
define i32 @aa_pro_vid_b07(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 4
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 16
br i1 %8, label %11, label %9
9: ; preds = %5, %3
%10 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_vid_b07, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %1, i64 3
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = tail call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_vid_b07, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %11, %9
ret i32 0
}