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


x86 assembly (clang, -O0):
<aa_pro_vid_b01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jne    114e <aa_pro_vid_b01+0x3e>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x8,%eax
jne    114e <aa_pro_vid_b01+0x3e>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x10,%eax
je     1174 <aa_pro_vid_b01+0x64>
mov    $0x6,%edi
lea    0xea6(%rip),%rsi
lea    0xea6(%rip),%rdx
lea    0xeae(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
jmp    11a7 <aa_pro_vid_b01+0x97>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%r8d
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%r9d
mov    $0x3,%edi
lea    0xe6e(%rip),%rsi
lea    0xe6e(%rip),%rdx
lea    0xe90(%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_b01>:
push   %rax
cmp    $0x6,%edx
jne    114f <aa_pro_vid_b01+0x3f>
cmpb   $0x8,0x2(%rsi)
jne    114f <aa_pro_vid_b01+0x3f>
cmpb   $0x10,0x4(%rsi)
jne    114f <aa_pro_vid_b01+0x3f>
movzbl 0x3(%rsi),%r8d
movzbl 0x5(%rsi),%r9d
lea    0xecd(%rip),%rsi
lea    0xecd(%rip),%rdx
lea    0xeef(%rip),%rcx
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
jmp    1170 <aa_pro_vid_b01+0x60>
lea    0xeaa(%rip),%rsi
lea    0xeaa(%rip),%rdx
lea    0xeb2(%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_b01 = [15 x i8] c"aa_pro_vid_b01\00"
@.str.1 = [26 x i8] c"Media Video Start Request\00"
@.str.2 = [33 x i8] c"Media Video Start Request: %d %d\00"
define i32 @aa_pro_vid_b01(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, 6
br i1 %9, label %22, 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, 8
br i1 %15, label %22, label %16
16: ; preds = %10
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = icmp ne i32 %20, 16
br i1 %21, label %22, label %24
22: ; preds = %16, %10, %3
%23 = 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_b01, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %34
24: ; preds = %16
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 5
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = call i32 (i32, i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i32, 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_b01, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %32)
br label %34
34: ; preds = %24, %22
store i32 0, i32* %7
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_vid_b01 = [15 x i8] c"aa_pro_vid_b01\00"
@.str.1 = [26 x i8] c"Media Video Start Request\00"
@.str.2 = [33 x i8] c"Media Video Start Request: %d %d\00"
define i32 @aa_pro_vid_b01(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 6
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 8
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %1, i64 4
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 16
br i1 %12, label %15, label %13
13: ; preds = %9, %5, %3
%14 = 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_b01, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %23
15: ; preds = %9
%16 = getelementptr inbounds i8, i8* %1, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = getelementptr inbounds i8, i8* %1, i64 5
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = tail call i32 (i32, i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i32, 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_b01, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %21)
br label %23
23: ; preds = %15, %13
ret i32 0
}