int aa_pro_tou_b02(int chan, unsigned char *buf, int len) {
  if (len < 2 || len > 256)
    hu_log(6, "hu_aap", __func__, "Touch/Input/Audio Start/Stop Request");
  else
    hu_log(3, "hu_aap", __func__, "Touch/Input/Audio Start/Stop Request");
  unsigned char rsp[] = {0x80, 0x03, 0x08, 0};
  int ret = hu_aap_enc_send(chan, rsp, sizeof(rsp));
  return (ret);
}


x86 assembly (clang, -O0):
<aa_pro_tou_b02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     1149 <aa_pro_tou_b02+0x29>
cmpl   $0x100,-0x14(%rbp)
jle    116f <aa_pro_tou_b02+0x4f>
mov    $0x6,%edi
lea    0xeab(%rip),%rsi
lea    0xeab(%rip),%rdx
lea    0xeb3(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
jmp    1190 <aa_pro_tou_b02+0x70>
mov    $0x3,%edi
lea    0xe85(%rip),%rsi
lea    0xe85(%rip),%rdx
lea    0xe8d(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    0xea5(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <hu_aap_enc_send@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_tou_b02>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
add    $0xfffffeff,%edx
xor    %eax,%eax
cmp    $0xffffff01,%edx
setb   %al
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
lea    0xebb(%rip),%rsi
lea    0xebb(%rip),%rdx
lea    0xec3(%rip),%rcx
xor    %eax,%eax
call   1030 <hu_log@plt>
movl   $0x80380,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <hu_aap_enc_send@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_tou_b02 = [15 x i8] c"aa_pro_tou_b02\00"
@.str.1 = [37 x i8] c"Touch/Input/Audio Start/Stop Request\00"
@__const.aa_pro_tou_b02.rsp = [4 x i8] c"\80\03\08\00"
define i32 @aa_pro_tou_b02(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [4 x i8]
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* %6
%13 = icmp sgt i32 %12, 256
br i1 %13, label %14, label %16
14: ; preds = %11, %3
%15 = 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_tou_b02, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(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_tou_b02, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = bitcast [4 x i8]* %7 to i8*
%20 = load i32, i32* %4
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%22 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @hu_aap_enc_send to i32 (i32, i8*, i64, ...)*)(i32 %20, i8* %21, i64 4)
store i32 %22, i32* %8
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_tou_b02 = [15 x i8] c"aa_pro_tou_b02\00"
@.str.1 = [37 x i8] c"Touch/Input/Audio Start/Stop Request\00"
define i32 @aa_pro_tou_b02(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = alloca i32
%5 = add i32 %2, -257
%6 = icmp ult i32 %5, -255
%7 = select i1 %6, i32 6, i32 3
%8 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 %7, 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_tou_b02, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%9 = bitcast i32* %4 to i8*
store i32 525184, i32* %4
%10 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @hu_aap_enc_send to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %9, i64 4)
ret i32 %10
}