#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bbm_read(void *, int, unsigned char *);
int /*<<< orphan*/ bbm_write(void *, int, unsigned char);
int /*<<< orphan*/ fc8150_data(void *, unsigned char);
void fc8150_isr(void *hDevice) {
  unsigned char bufIntStatus = 0;
  bbm_read(hDevice, 0x8000, &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
call   1050 <bbm_read@plt>
cmpb   $0x0,-0x9(%rbp)
je     117b <fc8150_isr+0x4b>
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
movzbl -0x9(%rbp),%edx
call   1030 <bbm_write@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1040 <fc8150_data@plt>
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
lea    -0x9(%rbp),%rdx
call   1050 <bbm_read@plt>
cmpb   $0x0,-0x9(%rbp)
je     11ba <fc8150_isr+0x8a>
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
movzbl -0x9(%rbp),%edx
call   1030 <bbm_write@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
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
call   1050 <bbm_read@plt>
mov    0xf(%rsp),%al
test   %al,%al
je     1171 <fc8150_isr+0x41>
movzbl %al,%edx
mov    %rbx,%rdi
mov    $0x8000,%esi
call   1030 <bbm_write@plt>
movzbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1040 <fc8150_data@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x8000,%esi
call   1050 <bbm_read@plt>
mov    0xf(%rsp),%al
test   %al,%al
je     11ad <fc8150_isr+0x7d>
movzbl %al,%edx
mov    %rbx,%rdi
mov    $0x8000,%esi
call   1030 <bbm_write@plt>
movzbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1040 <fc8150_data@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
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 @bbm_read(i8* %4, i32 32768, i8* %3)
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %3
%11 = call i32 @bbm_write(i8* %9, i32 32768, i8 zeroext %10)
%12 = load i8*, i8** %2
%13 = load i8, i8* %3
%14 = call i32 @fc8150_data(i8* %12, i8 zeroext %13)
br label %15
15: ; preds = %8, %1
store i8 0, i8* %3
%16 = load i8*, i8** %2
%17 = call i32 @bbm_read(i8* %16, i32 32768, i8* %3)
%18 = load i8, i8* %3
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = load i8, i8* %3
%23 = call i32 @bbm_write(i8* %21, i32 32768, i8 zeroext %22)
%24 = load i8*, i8** %2
%25 = load i8, i8* %3
%26 = call i32 @fc8150_data(i8* %24, i8 zeroext %25)
br label %27
27: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @fc8150_isr(i8* %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @bbm_read(i8* %0, i32 32768, i8* %2)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @bbm_write(i8* %0, i32 32768, i8 zeroext %4)
%8 = load i8, i8* %2
%9 = call i32 @fc8150_data(i8* %0, i8 zeroext %8)
br label %10
10: ; preds = %6, %1
store i8 0, i8* %2
%11 = call i32 @bbm_read(i8* %0, i32 32768, i8* %2)
%12 = load i8, i8* %2
%13 = icmp eq i8 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = call i32 @bbm_write(i8* %0, i32 32768, i8 zeroext %12)
%16 = load i8, i8* %2
%17 = call i32 @fc8150_data(i8* %0, i8 zeroext %16)
br label %18
18: ; preds = %14, %10
ret void
}