void Exchange_DCAP(void) {
  unsigned char temp[2];
  MHL_MSC_Cmd_READ_DEVICE_CAP(0X0A, &temp[0]);
  if (temp[0] & 0X01) {
    pr_info("[MHL] %s "
            "LINK: RCP support = 1\n",
            __func__);
    MHL_MSC_Cmd_READ_DEVICE_CAP(0x08, &temp[1]);
    if (temp[1] & 0X80) {
      pr_info("[MHL] %s "
              "LINK: LD_GUI support = 1\n",
              __func__);
    }
  }
}


x86 assembly (clang, -O0):
<Exchange_DCAP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rsi
mov    $0xa,%edi
mov    $0x0,%al
call   1040 <MHL_MSC_Cmd_READ_DEVICE_CAP@plt>
movzbl -0x2(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     119d <Exchange_DCAP+0x7d>
lea    0xeb1(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_info@plt>
lea    -0x2(%rbp),%rsi
add    $0x1,%rsi
mov    $0x8,%edi
mov    $0x0,%al
call   1040 <MHL_MSC_Cmd_READ_DEVICE_CAP@plt>
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1198 <Exchange_DCAP+0x78>
lea    0xea4(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_info@plt>
jmp    119d <Exchange_DCAP+0x7d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exchange_DCAP>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0xa,%edi
xor    %eax,%eax
call   1040 <MHL_MSC_Cmd_READ_DEVICE_CAP@plt>
testb  $0x1,0x6(%rsp)
je     1166 <Exchange_DCAP+0x46>
lea    0xec0(%rip),%rdi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1030 <pr_info@plt>
lea    0x7(%rsp),%rsi
mov    $0x8,%edi
xor    %eax,%eax
call   1040 <MHL_MSC_Cmd_READ_DEVICE_CAP@plt>
cmpb   $0x0,0x7(%rsp)
js     1168 <Exchange_DCAP+0x48>
pop    %rax
ret
lea    0xebf(%rip),%rdi
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
call   1030 <pr_info@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"[MHL] %s LINK: RCP support = 1\0A\00"
@__func__.Exchange_DCAP = [14 x i8] c"Exchange_DCAP\00"
@.str.1 = [35 x i8] c"[MHL] %s LINK: LD_GUI support = 1\0A\00"
define void @Exchange_DCAP() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @MHL_MSC_Cmd_READ_DEVICE_CAP to i32 (i32, i8*, ...)*)(i32 10, i8* %2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %0
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.Exchange_DCAP, i64 0, i64 0))
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%12 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @MHL_MSC_Cmd_READ_DEVICE_CAP to i32 (i32, i8*, ...)*)(i32 8, i8* %11)
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, 128
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.Exchange_DCAP, i64 0, i64 0))
br label %20
20: ; preds = %18, %9
br label %21
21: ; preds = %20, %0
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"[MHL] %s LINK: RCP support = 1\0A\00"
@__func__.Exchange_DCAP = [14 x i8] c"Exchange_DCAP\00"
@.str.1 = [35 x i8] c"[MHL] %s LINK: LD_GUI support = 1\0A\00"
define void @Exchange_DCAP() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @MHL_MSC_Cmd_READ_DEVICE_CAP to i32 (i32, i8*, ...)*)(i32 10, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, 1
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.Exchange_DCAP, i64 0, i64 0))
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%10 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @MHL_MSC_Cmd_READ_DEVICE_CAP to i32 (i32, i8*, ...)*)(i32 8, i8* %9)
%11 = load i8, i8* %9
%12 = icmp sgt i8 %11, -1
br i1 %12, label %15, label %13
13: ; preds = %7
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.Exchange_DCAP, i64 0, i64 0))
br label %15
15: ; preds = %7, %13, %0
ret void
}