int aa_pro_ctr_a0d(int chan, unsigned char *buf, int len) {
  if (len != 4 || buf[2] != 0x08)
    hu_log(6, "hu_aap", __func__, "Navigation Focus Request");
  else
    hu_log(3, "hu_aap", __func__, "Navigation Focus Request: %d", buf[3]);
  buf[0] = 0;
  buf[1] = 14;
  buf[2] = 0x08;
  buf[3] = 2;
  int ret = hu_aap_enc_send(chan, buf, 4);
  return (0);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a0d>:
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    114d <aa_pro_ctr_a0d+0x2d>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x8,%eax
je     1173 <aa_pro_ctr_a0d+0x53>
mov    $0x6,%edi
lea    0xea7(%rip),%rsi
lea    0xea7(%rip),%rdx
lea    0xeaf(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
jmp    119d <aa_pro_ctr_a0d+0x7d>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%r8d
mov    $0x3,%edi
lea    0xe78(%rip),%rsi
lea    0xe78(%rip),%rdx
lea    0xe99(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xe,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x8,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,0x3(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <hu_aap_enc_send@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a0d>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x4,%edx
jne    115b <aa_pro_ctr_a0d+0x3b>
cmpb   $0x8,0x2(%rbx)
jne    115b <aa_pro_ctr_a0d+0x3b>
movzbl 0x3(%rbx),%r8d
lea    0xec1(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xee2(%rip),%rcx
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
jmp    117c <aa_pro_ctr_a0d+0x5c>
lea    0xe9e(%rip),%rsi
lea    0xe9e(%rip),%rdx
lea    0xea6(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
movl   $0x2080e00,(%rbx)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <hu_aap_enc_send@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a0d = [15 x i8] c"aa_pro_ctr_a0d\00"
@.str.1 = [25 x i8] c"Navigation Focus Request\00"
@.str.2 = [29 x i8] c"Navigation Focus Request: %d\00"
define i32 @aa_pro_ctr_a0d(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, 8
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_ctr_a0d, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 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_ctr_a0d, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18, %16
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 0
store i8 0, i8* %26
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 1
store i8 14, i8* %28
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 2
store i8 8, i8* %30
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 3
store i8 2, i8* %32
%33 = load i32, i32* %4
%34 = load i8*, i8** %5
%35 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @hu_aap_enc_send to i32 (i32, i8*, i32, ...)*)(i32 %33, i8* %34, i32 4)
store i32 %35, i32* %7
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a0d = [15 x i8] c"aa_pro_ctr_a0d\00"
@.str.1 = [25 x i8] c"Navigation Focus Request\00"
@.str.2 = [29 x i8] c"Navigation Focus Request: %d\00"
define i32 @aa_pro_ctr_a0d(i32 %0, i8* %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_ctr_a0d, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 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_ctr_a0d, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %11, %9
store i8 0, i8* %1
%17 = getelementptr inbounds i8, i8* %1, i64 1
store i8 14, i8* %17
%18 = getelementptr inbounds i8, i8* %1, i64 2
store i8 8, i8* %18
%19 = getelementptr inbounds i8, i8* %1, i64 3
store i8 2, i8* %19
%20 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @hu_aap_enc_send to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 4)
ret i32 0
}