#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 */
struct himci_host {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IO_ADDRESS(int);
unsigned int himci_readl(int /*<<< orphan*/);
int /*<<< orphan*/ himci_writel(unsigned int, int /*<<< orphan*/);
void hi_mci_sys_ctrl_suspend(struct himci_host *host) {
  unsigned int tmp_reg;
  tmp_reg = himci_readl(IO_ADDRESS(0x101f5000 + 0xf8));
  tmp_reg |= (0x01 << 0);
  himci_writel(tmp_reg, IO_ADDRESS(0x101f5000 + 0xf8));
  tmp_reg &= ~((0x01 << 8) | (0x01 << 9));
  himci_writel(tmp_reg, IO_ADDRESS(0x101f5000 + 0xf8));
}


x86 assembly (clang, -O0):
<hi_mci_sys_ctrl_suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    %eax,%edi
call   1030 <himci_readl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <himci_writel@plt>
mov    -0xc(%rbp),%eax
and    $0xfffffcff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <himci_writel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_mci_sys_ctrl_suspend>:
push   %rbx
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    %eax,%edi
call   1030 <himci_readl@plt>
mov    %eax,%ebx
or     $0x1,%ebx
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <himci_writel@plt>
and    $0xfffffcff,%ebx
mov    $0x101f50f8,%edi
call   1050 <IO_ADDRESS@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <himci_writel@plt>

LLVM IR (-O0):
%struct.himci_host = type { i32 }
define void @hi_mci_sys_ctrl_suspend(%struct.himci_host* %0) {
%2 = alloca %struct.himci_host*
%3 = alloca i32
store %struct.himci_host* %0, %struct.himci_host** %2
%4 = call i32 @IO_ADDRESS(i32 270487800)
%5 = call i32 @himci_readl(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = or i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @IO_ADDRESS(i32 270487800)
%10 = call i32 @himci_writel(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = and i32 %11, -769
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @IO_ADDRESS(i32 270487800)
%15 = call i32 @himci_writel(i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.himci_host = type { i32 }
define void @hi_mci_sys_ctrl_suspend(%struct.himci_host* nocapture readnone %0) {
%2 = tail call i32 @IO_ADDRESS(i32 270487800)
%3 = tail call i32 @himci_readl(i32 %2)
%4 = or i32 %3, 1
%5 = tail call i32 @IO_ADDRESS(i32 270487800)
%6 = tail call i32 @himci_writel(i32 %4, i32 %5)
%7 = and i32 %4, -769
%8 = tail call i32 @IO_ADDRESS(i32 270487800)
%9 = tail call i32 @himci_writel(i32 %7, i32 %8)
ret void
}