#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*/ SysCtlDelay(int);
void SysCtlSubSystemReset(unsigned long ulResetConf) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FB8C0))) &=
      ~((ulResetConf & 0x00000003) << 16);
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FB8C0))) |=
      ((ulResetConf & 0x00000003) << 16);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlSubSystemReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
shl    $0x10,%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fb8c0,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fb8c0,%eax
mov    %rcx,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    -0x8(%rbp),%rax
and    $0x3,%rax
shl    $0x10,%rax
mov    $0x400fb8c0,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb8c0,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlSubSystemReset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x400fb980,%r14
40
mov    $0xa5a5a5a5,%eax
mov    %rax,0x400fb980
40
and    $0x3,%ebx
shl    $0x10,%rbx
mov    %rbx,%rax
not    %rax
and    %rax,0x400fb8c0
40
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
or     %rbx,0x400fb8c0
40
mov    %r14,0x400fb980
40
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SysCtlSubSystemReset(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %4, i64* %3
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %5, 3
%7 = shl i64 %6, 16
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* inttoptr (i64 1074772160 to i64*)
%10 = and i64 %9, %8
store volatile i64 %10, i64* inttoptr (i64 1074772160 to i64*)
%11 = call i32 @SysCtlDelay(i32 10)
%12 = load i64, i64* %2
%13 = and i64 %12, 3
%14 = shl i64 %13, 16
%15 = load volatile i64, i64* inttoptr (i64 1074772160 to i64*)
%16 = or i64 %15, %14
store volatile i64 %16, i64* inttoptr (i64 1074772160 to i64*)
%17 = load i64, i64* %3
store volatile i64 %17, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlSubSystemReset(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = shl i64 %0, 16
%4 = and i64 %3, 196608
%5 = xor i64 %4, -1
%6 = load volatile i64, i64* inttoptr (i64 1074772160 to i64*)
%7 = and i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1074772160 to i64*)
%8 = tail call i32 @SysCtlDelay(i32 10)
%9 = load volatile i64, i64* inttoptr (i64 1074772160 to i64*)
%10 = or i64 %9, %4
store volatile i64 %10, i64* inttoptr (i64 1074772160 to i64*)
store volatile i64 %2, i64* inttoptr (i64 1074772352 to i64*)
ret void
}