void fc8150_isr(void *hDevice) {
  unsigned char bufIntStatus = 0;
  bbm_read(hDevice, 0x8000, &bufIntStatus);
  PRINTF(0, "(SJINU %s) bufIntStatus\%d\n", __func__, bufIntStatus);
  if (bufIntStatus) {
    bbm_write(hDevice, 0x8000, bufIntStatus);
    fc8150_data(hDevice, bufIntStatus);
  }
  bufIntStatus = 0;
  bbm_read(hDevice, 0x8000, &bufIntStatus);
  if (bufIntStatus) {
    bbm_write(hDevice, 0x8000, bufIntStatus);
    fc8150_data(hDevice, bufIntStatus);
  }
}


x86 assembly (clang, -O0):
<fc8150_isr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
lea    -0x9(%rbp),%rdx
mov    $0x0,%al
call   1050 <bbm_read@plt>
movzbl -0x9(%rbp),%ecx
xor    %edi,%edi
lea    0xe8f(%rip),%rsi
lea    0xea3(%rip),%rdx
mov    $0x0,%al
call   1060 <PRINTF@plt>
cmpb   $0x0,-0x9(%rbp)
je     11ac <fc8150_isr+0x6c>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%edx
mov    $0x8000,%esi
mov    $0x0,%al
call   1030 <bbm_write@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
mov    $0x0,%al
call   1040 <fc8150_data@plt>
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
lea    -0x9(%rbp),%rdx
mov    $0x0,%al
call   1050 <bbm_read@plt>
cmpb   $0x0,-0x9(%rbp)
je     11f1 <fc8150_isr+0xb1>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%edx
mov    $0x8000,%esi
mov    $0x0,%al
call   1030 <bbm_write@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
mov    $0x0,%al
call   1040 <fc8150_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_isr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    $0x8000,%esi
xor    %eax,%eax
call   1050 <bbm_read@plt>
movzbl 0xf(%rsp),%ecx
lea    0xe96(%rip),%rsi
lea    0xeaa(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1060 <PRINTF@plt>
movzbl 0xf(%rsp),%edx
test   %edx,%edx
je     11a1 <fc8150_isr+0x61>
mov    %rbx,%rdi
mov    $0x8000,%esi
xor    %eax,%eax
call   1030 <bbm_write@plt>
movzbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fc8150_data@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x8000,%esi
xor    %eax,%eax
call   1050 <bbm_read@plt>
movzbl 0xf(%rsp),%edx
test   %edx,%edx
je     11e1 <fc8150_isr+0xa1>
mov    %rbx,%rdi
mov    $0x8000,%esi
xor    %eax,%eax
call   1030 <bbm_write@plt>
movzbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fc8150_data@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"(SJINU %s) bufIntStatus%d\0A\00"
@__func__.fc8150_isr = [11 x i8] c"fc8150_isr\00"
define void @fc8150_isr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @bbm_read to i32 (i8*, i32, i8*, ...)*)(i8* %4, i32 32768, i8* %3)
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @PRINTF to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.fc8150_isr, i64 0, i64 0), i32 %7)
%9 = load i8, i8* %3
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @bbm_write to i32 (i8*, i32, i32, ...)*)(i8* %12, i32 32768, i32 %14)
%16 = load i8*, i8** %2
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fc8150_data to i32 (i8*, i32, ...)*)(i8* %16, i32 %18)
br label %20
20: ; preds = %11, %1
store i8 0, i8* %3
%21 = load i8*, i8** %2
%22 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @bbm_read to i32 (i8*, i32, i8*, ...)*)(i8* %21, i32 32768, i8* %3)
%23 = load i8, i8* %3
%24 = icmp ne i8 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %20
%26 = load i8*, i8** %2
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @bbm_write to i32 (i8*, i32, i32, ...)*)(i8* %26, i32 32768, i32 %28)
%30 = load i8*, i8** %2
%31 = load i8, i8* %3
%32 = zext i8 %31 to i32
%33 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fc8150_data to i32 (i8*, i32, ...)*)(i8* %30, i32 %32)
br label %34
34: ; preds = %25, %20
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"(SJINU %s) bufIntStatus%d\0A\00"
@__func__.fc8150_isr = [11 x i8] c"fc8150_isr\00"
define void @fc8150_isr(i8* %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @bbm_read to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 32768, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @PRINTF to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.fc8150_isr, i64 0, i64 0), i32 %5)
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = zext i8 %7 to i32
%11 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @bbm_write to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 32768, i32 %10)
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fc8150_data to i32 (i8*, i32, ...)*)(i8* %0, i32 %13)
br label %15
15: ; preds = %9, %1
store i8 0, i8* %2
%16 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @bbm_read to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 32768, i8* %2)
%17 = load i8, i8* %2
%18 = icmp eq i8 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %15
%20 = zext i8 %17 to i32
%21 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @bbm_write to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 32768, i32 %20)
%22 = load i8, i8* %2
%23 = zext i8 %22 to i32
%24 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fc8150_data to i32 (i8*, i32, ...)*)(i8* %0, i32 %23)
br label %25
25: ; preds = %19, %15
ret void
}