#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*/ s5js100_pmip_trim_value();
int s5js100_pmip_control_powersave(int enable) {
  if (enable) {
    (*(volatile unsigned int *)((
         ((volatile unsigned int *)((0x81000000) + 0x0500)))) =
         (((((*(volatile unsigned int *)((
                (volatile unsigned int *)((0x81000000) + 0x0500))))) &
            ~(0x7 << 10)) |
           ((0) & (0x7 << 10)))));
    (*(volatile unsigned int *)((
         ((volatile unsigned int *)((0x81000000) + 0x0508)))) =
         (((((*(volatile unsigned int *)((
                (volatile unsigned int *)((0x81000000) + 0x0508))))) &
            ~(0x7 << 2)) |
           ((0) & (0x7 << 2)))));
    (*(volatile unsigned int *)((
         ((volatile unsigned int *)((0x82020000) + 0x0600)))) =
         (((((*(volatile unsigned int *)((
                (volatile unsigned int *)((0x82020000) + 0x0600))))) &
            ~(0x7 << 10)) |
           ((0) & (0x7 << 10)))));
    (*(volatile unsigned int *)((
         ((volatile unsigned int *)((0x82020000) + 0x0618)))) =
         (((((*(volatile unsigned int *)((
                (volatile unsigned int *)((0x82020000) + 0x0618))))) &
            ~(0x7 << 1)) |
           ((0) & (0x7 << 1)))));
  } else {
    s5js100_pmip_trim_value();
  }
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1180 <s5js100_pmip_control_powersave+0x70>
mov    $0x81000500,%eax
mov    (%rax),%ecx
and    $0xffffe3ff,%ecx
or     $0x0,%ecx
mov    $0x81000500,%eax
mov    %ecx,(%rax)
mov    $0x81000508,%eax
mov    (%rax),%ecx
and    $0xffffffe3,%ecx
or     $0x0,%ecx
mov    $0x81000508,%eax
mov    %ecx,(%rax)
mov    $0x82020600,%eax
mov    (%rax),%ecx
and    $0xffffe3ff,%ecx
or     $0x0,%ecx
mov    $0x82020600,%eax
mov    %ecx,(%rax)
mov    $0x82020618,%eax
mov    (%rax),%ecx
and    $0xfffffff1,%ecx
or     $0x0,%ecx
mov    $0x82020618,%eax
mov    %ecx,(%rax)
jmp    1187 <s5js100_pmip_control_powersave+0x77>
mov    $0x0,%al
call   1030 <s5js100_pmip_trim_value@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
test   %edi,%edi
je     1137 <s5js100_pmip_control_powersave+0x27>
mov    $0x81000500,%eax
andl   $0xffffe3ff,(%rax)
andl   $0xffffffe3,0x8(%rax)
andl   $0xffffe3ff,0x1020100(%rax)
e3 ff ff
andl   $0xfffffff1,0x1020118(%rax)
jmp    113e <s5js100_pmip_control_powersave+0x2e>
xor    %eax,%eax
call   1030 <s5js100_pmip_trim_value@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @s5js100_pmip_control_powersave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2164262144 to i32*)
%7 = and i32 %6, -7169
%8 = or i32 %7, 0
store volatile i32 %8, i32* inttoptr (i64 2164262144 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 2164262152 to i32*)
%10 = and i32 %9, -29
%11 = or i32 %10, 0
store volatile i32 %11, i32* inttoptr (i64 2164262152 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 2181170688 to i32*)
%13 = and i32 %12, -7169
%14 = or i32 %13, 0
store volatile i32 %14, i32* inttoptr (i64 2181170688 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 2181170712 to i32*)
%16 = and i32 %15, -15
%17 = or i32 %16, 0
store volatile i32 %17, i32* inttoptr (i64 2181170712 to i32*)
br label %20
18: ; preds = %1
%19 = call i32 (...) @s5js100_pmip_trim_value()
br label %20
20: ; preds = %18, %5
ret i32 1
}

LLVM IR (-O2):
define i32 @s5js100_pmip_control_powersave(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load volatile i32, i32* inttoptr (i64 2164262144 to i32*)
%5 = and i32 %4, -7169
store volatile i32 %5, i32* inttoptr (i64 2164262144 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 2164262152 to i32*)
%7 = and i32 %6, -29
store volatile i32 %7, i32* inttoptr (i64 2164262152 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 2181170688 to i32*)
%9 = and i32 %8, -7169
store volatile i32 %9, i32* inttoptr (i64 2181170688 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 2181170712 to i32*)
%11 = and i32 %10, -15
store volatile i32 %11, i32* inttoptr (i64 2181170712 to i32*)
br label %14
12: ; preds = %1
%13 = tail call i32 (...) @s5js100_pmip_trim_value()
br label %14
14: ; preds = %12, %3
ret i32 1
}