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


x86 assembly (clang, -O0):
<aa_pro_mic_b01>:
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_mic_b01+0x2d>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x8,%eax
je     1163 <aa_pro_mic_b01+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_mic_b01+0x7d>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%r8d
mov    $0x6,%edi
lea    0xe88(%rip),%rsi
lea    0xe88(%rip),%rdx
lea    0xead(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_mic_b01>:
push   %rax
cmp    $0x4,%edx
jne    1144 <aa_pro_mic_b01+0x34>
cmpb   $0x8,0x2(%rsi)
jne    1144 <aa_pro_mic_b01+0x34>
movzbl 0x3(%rsi),%r8d
lea    0xed8(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xefd(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
jmp    1165 <aa_pro_mic_b01+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_mic_b01 = [15 x i8] c"aa_pro_mic_b01\00"
@.str.1 = [29 x i8] c"Media Mic Start Request ????\00"
@.str.2 = [33 x i8] c"Media Mic Start Request ????: %d\00"
define i32 @aa_pro_mic_b01(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 4
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %9, %3
%16 = 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_mic_b01, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %23
17: ; preds = %9
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i32, ...)*)(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_mic_b01, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %17, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_mic_b01 = [15 x i8] c"aa_pro_mic_b01\00"
@.str.1 = [29 x i8] c"Media Mic Start Request ????\00"
@.str.2 = [33 x i8] c"Media Mic Start Request ????: %d\00"
define i32 @aa_pro_mic_b01(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, 8
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_mic_b01, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 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 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_mic_b01, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %11, %9
ret i32 0
}