#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 unsigned long volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperEventsConfig(uint32_t ui32Config) {
  uint32_t ui32Temp;
  ui32Temp = ((*((volatile unsigned long *)(0x400FC400))) & ~0x00000300);
  (*((volatile unsigned long *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC400))) = (ui32Temp | ui32Config);
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperEventsConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fc400,%eax
mov    (%rax),%rax
and    $0xfffffffffffffcff,%rax
mov    %rax,-0x10(%rbp)
mov    $0x400fc360,%eax
mov    $0xa3359554,%ecx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
or     %rax,%rcx
mov    $0x400fc400,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperEventsConfig>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    $0xfffffffffffffcff,%rax
and    0x400fc400,%rax
40
mov    %rax,0x8(%rsp)
mov    $0xa3359554,%eax
mov    %rax,0x400fc360
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
mov    0x8(%rsp),%rax
or     0x10(%rsp),%rax
mov    %rax,0x400fc400
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movq   $0x0,0x400fc360
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperEventsConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store volatile i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%5 = and i64 %4, -769
store volatile i64 %5, i64* %3
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%6 = call i32 (...) @_HibernateWriteComplete()
%7 = load volatile i64, i64* %3
%8 = load volatile i64, i64* %2
%9 = or i64 %7, %8
store volatile i64 %9, i64* inttoptr (i64 1074775040 to i64*)
%10 = call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%11 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperEventsConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store volatile i64 %0, i64* %2
%4 = bitcast i64* %3 to i8*
%5 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%6 = and i64 %5, -769
store volatile i64 %6, i64* %3
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%7 = tail call i32 (...) @_HibernateWriteComplete()
%8 = load volatile i64, i64* %3
%9 = load volatile i64, i64* %2
%10 = or i64 %9, %8
store volatile i64 %10, i64* inttoptr (i64 1074775040 to i64*)
%11 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%12 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}