#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*/ AssertFailure(char *, int);
long FlashUserGet(unsigned long *pulUser0, unsigned long *pulUser1) {
  {
    if (!(pulUser0 != 0)) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "flashlib.c",
          644);
    }
  };
  {
    if (!(pulUser1 != 0)) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "flashlib.c",
          645);
    }
  };
  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)
jne    113c <FlashUserGet+0x2c>
lea    0xece(%rip),%rdi
mov    $0x284,%esi
call   1030 <AssertFailure@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1158 <FlashUserGet+0x48>
lea    0xeb2(%rip),%rdi
mov    $0x285,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     118a <FlashUserGet+0x7a>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
jne    1197 <FlashUserGet+0x87>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    11bd <FlashUserGet+0xad>
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
test   %rdi,%rdi
je     1180 <FlashUserGet+0x70>
test   %r14,%r14
jne    1135 <FlashUserGet+0x25>
lea    0xed5(%rip),%rdi
mov    $0x285,%esi
call   1030 <AssertFailure@plt>
mov    $0xffffffffffffffff,%rax
testq  $0x70000000,0x400fe000
je     1178 <FlashUserGet+0x68>
mov    0x400fe000,%rcx
40
and    $0x70ff0000,%ecx
cmp    $0x10000000,%ecx
je     1178 <FlashUserGet+0x68>
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
lea    0xe79(%rip),%rdi
mov    $0x284,%esi
call   1030 <AssertFailure@plt>
test   %r14,%r14
jne    1135 <FlashUserGet+0x25>
jmp    1124 <FlashUserGet+0x14>

LLVM IR (-O0):
@.str = [202 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/flashlib.c\00"
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
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @AssertFailure(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 644)
br label %10
10: ; preds = %8, %2
%11 = load i64*, i64** %5
%12 = icmp ne i64* %11, null
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @AssertFailure(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 645)
br label %15
15: ; preds = %13, %10
%16 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%17 = and i64 %16, 1879048192
%18 = icmp eq i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%21 = and i64 %20, 1895759872
%22 = icmp eq i64 %21, 268435456
br i1 %22, label %23, label %24
23: ; preds = %19, %15
store i64 -1, i64* %3
br label %29
24: ; preds = %19
%25 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
%26 = load i64*, i64** %4
store i64 %25, i64* %26
%27 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
%28 = load i64*, i64** %5
store i64 %27, i64* %28
store i64 0, i64* %3
br label %29
29: ; preds = %24, %23
%30 = load i64, i64* %3
ret i64 %30
}

LLVM IR (-O2):
@.str = [202 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/flashlib.c\00"
define i64 @FlashUserGet(i64* writeonly %0, i64* writeonly %1) {
%3 = icmp eq i64* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 644)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i64* %1, null
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 645)
br label %10
10: ; preds = %8, %6
%11 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%12 = and i64 %11, 1879048192
%13 = icmp eq i64 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %10
%15 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%16 = and i64 %15, 1895759872
%17 = icmp eq i64 %16, 268435456
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
store i64 %19, i64* %0
%20 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
store i64 %20, i64* %1
br label %21
21: ; preds = %10, %14, %18
%22 = phi i64 [ 0, %18 ], [ -1, %14 ], [ -1, %10 ]
ret i64 %22
}