#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _EEPROMSectorMaskSet(int);
uint32_t EEPROMProgramNonBlocking(uint32_t ui32Data, uint32_t ui32Address) {
  ;
  ;
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x00050000)) &&
      (((*((volatile uint32_t *)(0x400FE000))) & (0x0000FF00 | 0x000000FF)) ==
       (0x00000000 | 0x00000000))) {
    _EEPROMSectorMaskSet(ui32Address);
  }
  (*((volatile uint32_t *)(0x400AF004))) = ((ui32Address) >> 6);
  (*((volatile uint32_t *)(0x400AF008))) = (((ui32Address) >> 2) & 0x0F);
  (*((volatile uint32_t *)(0x400AF014))) = ui32Data;
  return ((*((volatile uint32_t *)(0x400AF018))));
}


x86 assembly (clang, -O0):
<EEPROMProgramNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x10050000,%eax
jne    1152 <EEPROMProgramNonBlocking+0x42>
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0xffff,%eax
cmp    $0x0,%eax
jne    1152 <EEPROMProgramNonBlocking+0x42>
mov    -0x8(%rbp),%edi
call   1030 <_EEPROMSectorMaskSet@plt>
mov    -0x8(%rbp),%ecx
sar    $0x6,%ecx
mov    $0x400af004,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
and    $0xf,%ecx
mov    $0x400af008,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    $0x400af014,%eax
mov    %ecx,(%rax)
mov    $0x400af018,%eax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMProgramNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
cmp    $0x10050000,%eax
jne    113d <EEPROMProgramNonBlocking+0x2d>
mov    0x400fe000,%eax
test   %ax,%ax
jne    113d <EEPROMProgramNonBlocking+0x2d>
mov    %ebp,%edi
call   1030 <_EEPROMSectorMaskSet@plt>
mov    %ebp,%eax
sar    $0x6,%eax
mov    %eax,0x400af004
shr    $0x2,%ebp
and    $0xf,%ebp
mov    %ebp,0x400af008
mov    %ebx,0x400af014
mov    0x400af018,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @EEPROMProgramNonBlocking(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%6 = and i32 %5, 1895759872
%7 = icmp eq i32 %6, 268763136
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%10 = and i32 %9, 65535
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %4
%14 = call i32 @_EEPROMSectorMaskSet(i32 %13)
br label %15
15: ; preds = %12, %8, %2
%16 = load i32, i32* %4
%17 = ashr i32 %16, 6
store volatile i32 %17, i32* inttoptr (i64 1074458628 to i32*)
%18 = load i32, i32* %4
%19 = ashr i32 %18, 2
%20 = and i32 %19, 15
store volatile i32 %20, i32* inttoptr (i64 1074458632 to i32*)
%21 = load i32, i32* %3
store volatile i32 %21, i32* inttoptr (i64 1074458644 to i32*)
%22 = load volatile i32, i32* inttoptr (i64 1074458648 to i32*)
ret i32 %22
}

LLVM IR (-O2):
define i32 @EEPROMProgramNonBlocking(i32 %0, i32 %1) {
%3 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%4 = and i32 %3, 1895759872
%5 = icmp eq i32 %4, 268763136
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%8 = and i32 %7, 65535
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @_EEPROMSectorMaskSet(i32 %1)
br label %12
12: ; preds = %10, %6, %2
%13 = ashr i32 %1, 6
store volatile i32 %13, i32* inttoptr (i64 1074458628 to i32*)
%14 = lshr i32 %1, 2
%15 = and i32 %14, 15
store volatile i32 %15, i32* inttoptr (i64 1074458632 to i32*)
store volatile i32 %0, i32* inttoptr (i64 1074458644 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1074458648 to i32*)
ret i32 %16
}