#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*/ DEBUG_ASSERT(int);
long FlashUserGet(unsigned long *pulUser0, unsigned long *pulUser1) {
  DEBUG_ASSERT(pulUser0 != 0);
  DEBUG_ASSERT(pulUser1 != 0);
  if (((((*((volatile unsigned long *)(0x400FE000))) & 0x70000000) ==
        0x00000000) ||
       (((*((volatile unsigned long *)(0x400FE000))) &
         (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00000000)))) {
    return (-1);
  }
  *pulUser0 = (*((volatile unsigned long *)(0x400FE1E0)));
  *pulUser1 = (*((volatile unsigned long *)(0x400FE1E4)));
  return (0);
}


x86 assembly (clang, -O0):
<FlashUserGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     1176 <FlashUserGet+0x66>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
jne    1183 <FlashUserGet+0x73>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    11a9 <FlashUserGet+0x99>
mov    $0x400fe1e0,%eax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x400fe1e4,%eax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUserGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xffffffffffffffff,%rax
testq  $0x70000000,0x400fe000
je     1179 <FlashUserGet+0x69>
mov    0x400fe000,%rcx
40
and    $0x70ff0000,%ecx
cmp    $0x10000000,%ecx
je     1179 <FlashUserGet+0x69>
mov    0x400fe1e0,%rax
40
mov    %rax,(%rbx)
mov    0x400fe1e4,%rax
40
mov    %rax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @FlashUserGet(i64* %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
%6 = load i64*, i64** %4
%7 = icmp ne i64* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i64*, i64** %5
%11 = icmp ne i64* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%15 = and i64 %14, 1879048192
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %2
%18 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%19 = and i64 %18, 1895759872
%20 = icmp eq i64 %19, 268435456
br i1 %20, label %21, label %22
21: ; preds = %17, %2
store i64 -1, i64* %3
br label %27
22: ; preds = %17
%23 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
%24 = load i64*, i64** %4
store i64 %23, i64* %24
%25 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
%26 = load i64*, i64** %5
store i64 %25, i64* %26
store i64 0, i64* %3
br label %27
27: ; preds = %22, %21
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @FlashUserGet(i64* writeonly %0, i64* writeonly %1) {
%3 = icmp ne i64* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ne i64* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%10 = and i64 %9, 1879048192
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %2
%13 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%14 = and i64 %13, 1895759872
%15 = icmp eq i64 %14, 268435456
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
store i64 %17, i64* %0
%18 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
store i64 %18, i64* %1
br label %19
19: ; preds = %2, %12, %16
%20 = phi i64 [ 0, %16 ], [ -1, %12 ], [ -1, %2 ]
ret i64 %20
}