#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 */
long Rd(int);
void tvafe_hw_powerdown(void) {
  (*(volatile unsigned long *)(0xc1100000 | (0x108f << 2)) = 0x100);
  (*(volatile unsigned long *)(0xc1100000 | (0x1090 << 2)) = 0x100);
  (*(volatile unsigned long *)(0xc1100000 | (0x1091 << 2)) = 0x100);
  (*(volatile unsigned long *)(0xc1100000 | (0x1093 << 2)) = 0x100);
  (*(volatile unsigned long *)(0xc1100000 | (0x1092 << 2)) = 0x100);
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (15)) |
       ((unsigned int)(1) << (15)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (10)) |
       ((unsigned int)(1) << (10)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (14)) |
       ((unsigned int)(1) << (14)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (11)) |
       ((unsigned int)(1) << (11)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (2)) - 1) << (8)) |
       ((unsigned int)(3) << (8)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1A00 + 0x21) << 2))) =
       Rd(((0x1A00 + 0x21) << 2)) & ~(((1L << (1)) - 1) << (0)) |
       ((unsigned int)(1) << (0)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x74) << 2))) =
       Rd(((0x1B00 + 0x74) << 2)) & ~(((1L << (1)) - 1) << (0)) |
       ((unsigned int)(1) << (0)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x74) << 2))) =
       Rd(((0x1B00 + 0x74) << 2)) & ~(((1L << (1)) - 1) << (0)) |
       ((unsigned int)(0) << (0)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1A00 + 0x21) << 2))) =
       Rd(((0x1A00 + 0x21) << 2)) & ~(((1L << (1)) - 1) << (0)) |
       ((unsigned int)(0) << (0)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (15)) |
       ((unsigned int)(0) << (15)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (10)) |
       ((unsigned int)(0) << (10)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (14)) |
       ((unsigned int)(0) << (14)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (1)) - 1) << (11)) |
       ((unsigned int)(0) << (11)));
  (*(volatile unsigned long *)(0xd0040000 + (((0x1B00 + 0x72) << 2))) =
       Rd(((0x1B00 + 0x72) << 2)) & ~(((1L << (2)) - 1) << (8)) |
       ((unsigned int)(0) << (8)));
  (*(volatile unsigned long *)(0xc1100000 | (0x108f << 2)) = 0);
  (*(volatile unsigned long *)(0xc1100000 | (0x1090 << 2)) = 0);
  (*(volatile unsigned long *)(0xc1100000 | (0x1091 << 2)) = 0);
  (*(volatile unsigned long *)(0xc1100000 | (0x1093 << 2)) = 0);
  (*(volatile unsigned long *)(0xc1100000 | (0x1092 << 2)) = 0);
}


x86 assembly (clang, -O0):
<tvafe_hw_powerdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc110423c,%eax
movq   $0x100,(%rax)
mov    $0xc1104240,%eax
movq   $0x100,(%rax)
mov    $0xc1104244,%eax
movq   $0x100,(%rax)
mov    $0xc110424c,%eax
movq   $0x100,(%rax)
mov    $0xc1104248,%eax
movq   $0x100,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xffffffffffff7fff,%rcx
or     $0x8000,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffbff,%rcx
or     $0x400,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xffffffffffffbfff,%rcx
or     $0x4000,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffff7ff,%rcx
or     $0x800,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffcff,%rcx
or     $0x300,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6884,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffffe,%rcx
or     $0x1,%rcx
mov    $0xd0046884,%eax
mov    %rcx,(%rax)
mov    $0x6dd0,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffffe,%rcx
or     $0x1,%rcx
mov    $0xd0046dd0,%eax
mov    %rcx,(%rax)
mov    $0x6dd0,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffffe,%rcx
or     $0x0,%rcx
mov    $0xd0046dd0,%eax
mov    %rcx,(%rax)
mov    $0x6884,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffffe,%rcx
or     $0x0,%rcx
mov    $0xd0046884,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xffffffffffff7fff,%rcx
or     $0x0,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffbff,%rcx
or     $0x0,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xffffffffffffbfff,%rcx
or     $0x0,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffff7ff,%rcx
or     $0x0,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffcff,%rcx
or     $0x0,%rcx
mov    $0xd0046dc8,%eax
mov    %rcx,(%rax)
mov    $0xc110423c,%eax
movq   $0x0,(%rax)
mov    $0xc1104240,%eax
movq   $0x0,(%rax)
mov    $0xc1104244,%eax
movq   $0x0,(%rax)
mov    $0xc110424c,%eax
movq   $0x0,(%rax)
mov    $0xc1104248,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvafe_hw_powerdown>:
push   %rbx
mov    $0xd0046dc8,%ebx
movq   $0x100,-0xef42b8c(%rbx)
movq   $0x100,-0xef42b88(%rbx)
movq   $0x100,-0xef42b84(%rbx)
movq   $0x100,-0xef42b7c(%rbx)
movq   $0x100,-0xef42b80(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
or     $0x8000,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
or     $0x400,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
or     $0x4000,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
or     $0x800,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
or     $0x300,%rax
mov    %rax,(%rbx)
mov    $0x6884,%edi
call   1030 <Rd@plt>
or     $0x1,%rax
mov    %rax,-0x544(%rbx)
mov    $0x6dd0,%edi
call   1030 <Rd@plt>
or     $0x1,%rax
mov    %rax,0x8(%rbx)
mov    $0x6dd0,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffffffe,%rax
mov    %rax,0x8(%rbx)
mov    $0x6884,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffffffe,%rax
mov    %rax,-0x544(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
and    $0xffffffffffff7fff,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffffbff,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
and    $0xffffffffffffbfff,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffff7ff,%rax
mov    %rax,(%rbx)
mov    $0x6dc8,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffffcff,%rax
mov    %rax,(%rbx)
movq   $0x0,-0xef42b8c(%rbx)
movq   $0x0,-0xef42b88(%rbx)
movq   $0x0,-0xef42b84(%rbx)
movq   $0x0,-0xef42b7c(%rbx)
movq   $0x0,-0xef42b80(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @tvafe_hw_powerdown() {
store volatile i64 256, i64* inttoptr (i64 3239068220 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068224 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068228 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068236 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068232 to i64*)
%1 = call i64 @Rd(i32 28104)
%2 = and i64 %1, -32769
%3 = or i64 %2, 32768
store volatile i64 %3, i64* inttoptr (i64 3489951176 to i64*)
%4 = call i64 @Rd(i32 28104)
%5 = and i64 %4, -1025
%6 = or i64 %5, 1024
store volatile i64 %6, i64* inttoptr (i64 3489951176 to i64*)
%7 = call i64 @Rd(i32 28104)
%8 = and i64 %7, -16385
%9 = or i64 %8, 16384
store volatile i64 %9, i64* inttoptr (i64 3489951176 to i64*)
%10 = call i64 @Rd(i32 28104)
%11 = and i64 %10, -2049
%12 = or i64 %11, 2048
store volatile i64 %12, i64* inttoptr (i64 3489951176 to i64*)
%13 = call i64 @Rd(i32 28104)
%14 = and i64 %13, -769
%15 = or i64 %14, 768
store volatile i64 %15, i64* inttoptr (i64 3489951176 to i64*)
%16 = call i64 @Rd(i32 26756)
%17 = and i64 %16, -2
%18 = or i64 %17, 1
store volatile i64 %18, i64* inttoptr (i64 3489949828 to i64*)
%19 = call i64 @Rd(i32 28112)
%20 = and i64 %19, -2
%21 = or i64 %20, 1
store volatile i64 %21, i64* inttoptr (i64 3489951184 to i64*)
%22 = call i64 @Rd(i32 28112)
%23 = and i64 %22, -2
%24 = or i64 %23, 0
store volatile i64 %24, i64* inttoptr (i64 3489951184 to i64*)
%25 = call i64 @Rd(i32 26756)
%26 = and i64 %25, -2
%27 = or i64 %26, 0
store volatile i64 %27, i64* inttoptr (i64 3489949828 to i64*)
%28 = call i64 @Rd(i32 28104)
%29 = and i64 %28, -32769
%30 = or i64 %29, 0
store volatile i64 %30, i64* inttoptr (i64 3489951176 to i64*)
%31 = call i64 @Rd(i32 28104)
%32 = and i64 %31, -1025
%33 = or i64 %32, 0
store volatile i64 %33, i64* inttoptr (i64 3489951176 to i64*)
%34 = call i64 @Rd(i32 28104)
%35 = and i64 %34, -16385
%36 = or i64 %35, 0
store volatile i64 %36, i64* inttoptr (i64 3489951176 to i64*)
%37 = call i64 @Rd(i32 28104)
%38 = and i64 %37, -2049
%39 = or i64 %38, 0
store volatile i64 %39, i64* inttoptr (i64 3489951176 to i64*)
%40 = call i64 @Rd(i32 28104)
%41 = and i64 %40, -769
%42 = or i64 %41, 0
store volatile i64 %42, i64* inttoptr (i64 3489951176 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068220 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068224 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068228 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068236 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068232 to i64*)
ret void
}

LLVM IR (-O2):
define void @tvafe_hw_powerdown() {
store volatile i64 256, i64* inttoptr (i64 3239068220 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068224 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068228 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068236 to i64*)
store volatile i64 256, i64* inttoptr (i64 3239068232 to i64*)
%1 = tail call i64 @Rd(i32 28104)
%2 = or i64 %1, 32768
store volatile i64 %2, i64* inttoptr (i64 3489951176 to i64*)
%3 = tail call i64 @Rd(i32 28104)
%4 = or i64 %3, 1024
store volatile i64 %4, i64* inttoptr (i64 3489951176 to i64*)
%5 = tail call i64 @Rd(i32 28104)
%6 = or i64 %5, 16384
store volatile i64 %6, i64* inttoptr (i64 3489951176 to i64*)
%7 = tail call i64 @Rd(i32 28104)
%8 = or i64 %7, 2048
store volatile i64 %8, i64* inttoptr (i64 3489951176 to i64*)
%9 = tail call i64 @Rd(i32 28104)
%10 = or i64 %9, 768
store volatile i64 %10, i64* inttoptr (i64 3489951176 to i64*)
%11 = tail call i64 @Rd(i32 26756)
%12 = or i64 %11, 1
store volatile i64 %12, i64* inttoptr (i64 3489949828 to i64*)
%13 = tail call i64 @Rd(i32 28112)
%14 = or i64 %13, 1
store volatile i64 %14, i64* inttoptr (i64 3489951184 to i64*)
%15 = tail call i64 @Rd(i32 28112)
%16 = and i64 %15, -2
store volatile i64 %16, i64* inttoptr (i64 3489951184 to i64*)
%17 = tail call i64 @Rd(i32 26756)
%18 = and i64 %17, -2
store volatile i64 %18, i64* inttoptr (i64 3489949828 to i64*)
%19 = tail call i64 @Rd(i32 28104)
%20 = and i64 %19, -32769
store volatile i64 %20, i64* inttoptr (i64 3489951176 to i64*)
%21 = tail call i64 @Rd(i32 28104)
%22 = and i64 %21, -1025
store volatile i64 %22, i64* inttoptr (i64 3489951176 to i64*)
%23 = tail call i64 @Rd(i32 28104)
%24 = and i64 %23, -16385
store volatile i64 %24, i64* inttoptr (i64 3489951176 to i64*)
%25 = tail call i64 @Rd(i32 28104)
%26 = and i64 %25, -2049
store volatile i64 %26, i64* inttoptr (i64 3489951176 to i64*)
%27 = tail call i64 @Rd(i32 28104)
%28 = and i64 %27, -769
store volatile i64 %28, i64* inttoptr (i64 3489951176 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068220 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068224 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068228 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068236 to i64*)
store volatile i64 0, i64* inttoptr (i64 3239068232 to i64*)
ret void
}