#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 vdin_hw_powerdown(unsigned int offset) {
  (*(volatile unsigned long *)(0xc1100000 | ((0x1094 + offset) << 2)) =
       0x00000000);
  (*(volatile unsigned long *)(0xc1100000 | ((0x1202 + offset) << 2)) =
       Rd((0x1202 + offset)) & ~(((1L << (1)) - 1) << (4)) |
       ((unsigned int)(0) << (4)));
  (*(volatile unsigned long *)(0xc1100000 | ((0x1202 + offset) << 2)) =
       Rd((0x1202 + offset)) & ~(((1L << (4)) - 1) << (0)) |
       ((unsigned int)(0) << (0)));
  (*(volatile unsigned long *)(0xc1100000 | ((0x121b + offset) << 2)) = 0x5554);
}


x86 assembly (clang, -O0):
<vdin_hw_powerdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1094,%eax
shl    $0x2,%eax
or     $0xc1100000,%eax
mov    %eax,%eax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
add    $0x1202,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xffffffffffffffef,%rcx
or     $0x0,%rcx
mov    -0x4(%rbp),%eax
add    $0x1202,%eax
shl    $0x2,%eax
or     $0xc1100000,%eax
mov    %eax,%eax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%edi
add    $0x1202,%edi
call   1030 <Rd@plt>
mov    %rax,%rcx
and    $0xfffffffffffffff0,%rcx
or     $0x0,%rcx
mov    -0x4(%rbp),%eax
add    $0x1202,%eax
shl    $0x2,%eax
or     $0xc1100000,%eax
mov    %eax,%eax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x121b,%eax
shl    $0x2,%eax
or     $0xc1100000,%eax
mov    %eax,%eax
movq   $0x5554,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdin_hw_powerdown>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
lea    0x4250(,%r15,4),%eax
mov    $0xc1100000,%r14d
or     %r14,%rax
movq   $0x0,(%rax)
mov    %edi,%ebp
add    $0x1202,%ebp
mov    %ebp,%edi
call   1030 <Rd@plt>
and    $0xffffffffffffffef,%rax
lea    0x4808(,%r15,4),%ebx
or     %r14,%rbx
mov    %rax,(%rbx)
mov    %ebp,%edi
call   1030 <Rd@plt>
and    $0xfffffffffffffff0,%rax
mov    %rax,(%rbx)
lea    0x486c(,%r15,4),%eax
or     %r14,%rax
movq   $0x5554,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vdin_hw_powerdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 4244, %3
%5 = shl i32 %4, 2
%6 = or i32 -1055916032, %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
store volatile i64 0, i64* %8
%9 = load i32, i32* %2
%10 = add i32 4610, %9
%11 = call i64 @Rd(i32 %10)
%12 = and i64 %11, -17
%13 = or i64 %12, 0
%14 = load i32, i32* %2
%15 = add i32 4610, %14
%16 = shl i32 %15, 2
%17 = or i32 -1055916032, %16
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i64*
store volatile i64 %13, i64* %19
%20 = load i32, i32* %2
%21 = add i32 4610, %20
%22 = call i64 @Rd(i32 %21)
%23 = and i64 %22, -16
%24 = or i64 %23, 0
%25 = load i32, i32* %2
%26 = add i32 4610, %25
%27 = shl i32 %26, 2
%28 = or i32 -1055916032, %27
%29 = zext i32 %28 to i64
%30 = inttoptr i64 %29 to i64*
store volatile i64 %24, i64* %30
%31 = load i32, i32* %2
%32 = add i32 4635, %31
%33 = shl i32 %32, 2
%34 = or i32 -1055916032, %33
%35 = zext i32 %34 to i64
%36 = inttoptr i64 %35 to i64*
store volatile i64 21844, i64* %36
ret void
}

LLVM IR (-O2):
define void @vdin_hw_powerdown(i32 %0) {
%2 = shl i32 %0, 2
%3 = add i32 %2, 16976
%4 = or i32 %3, -1055916032
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i64*
store volatile i64 0, i64* %6
%7 = add i32 %0, 4610
%8 = tail call i64 @Rd(i32 %7)
%9 = and i64 %8, -17
%10 = shl i32 %7, 2
%11 = or i32 %10, -1055916032
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i64*
store volatile i64 %9, i64* %13
%14 = tail call i64 @Rd(i32 %7)
%15 = and i64 %14, -16
store volatile i64 %15, i64* %13
%16 = add i32 %2, 18540
%17 = or i32 %16, -1055916032
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i64*
store volatile i64 21844, i64* %19
ret void
}