#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*/ pci_conf_read(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int, int, unsigned long *);
int /*<<< orphan*/ pci_conf_write(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int, int, unsigned long);
int /*<<< orphan*/ print_ram_line(float, int, int, int, int);
void poll_timings_ct(void) {
  unsigned long mcr, mdr;
  float cas;
  int rcd, rp, ras;
  mcr = (0x10 << 24);
  mcr += (0x01 << 16);
  mcr += (0x01 << 8);
  mcr &= 0xFFFFFFF0;
  pci_conf_write(0, 0, 0, 0xD0, 4, mcr);
  pci_conf_read(0, 0, 0, 0xD4, 4, &mdr);
  cas = ((mdr >> 12) & 0x7) + 5.0f;
  rcd = ((mdr >> 8) & 0x7) + 5;
  rp = ((mdr >> 4) & 0x7) + 5;
  mcr = 0x10010200;
  pci_conf_write(0, 0, 0, 0xD0, 4, mcr);
  pci_conf_read(0, 0, 0, 0xD4, 4, &mdr);
  ras = (mdr >> 20) & 0xF;
  print_ram_line(cas, rcd, rp, ras, 1);
}


x86 assembly (clang, -O0):
<poll_timings_ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x10000000,-0x8(%rbp)
10
mov    -0x8(%rbp),%rax
add    $0x10000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffff0,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%r9
xor    %edx,%edx
mov    %edx,-0x28(%rbp)
mov    $0xd0,%ecx
mov    $0x4,%r8d
mov    %r8d,-0x24(%rbp)
mov    %edx,%edi
mov    %edx,%esi
call   1040 <pci_conf_write@plt>
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%r8d
mov    $0xd4,%ecx
lea    -0x10(%rbp),%r9
mov    %edx,%edi
mov    %edx,%esi
call   1030 <pci_conf_read@plt>
mov    -0x10(%rbp),%eax
shr    $0xc,%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm0
movss  0xe4a(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0x7,%rax
add    $0x5,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x4,%rax
and    $0x7,%rax
add    $0x5,%rax
mov    %eax,-0x1c(%rbp)
movq   $0x10010200,-0x8(%rbp)
10
mov    -0x8(%rbp),%r9
xor    %edx,%edx
mov    $0xd0,%ecx
mov    $0x4,%r8d
mov    %edx,%edi
mov    %edx,%esi
call   1040 <pci_conf_write@plt>
xor    %edx,%edx
mov    $0xd4,%ecx
mov    $0x4,%r8d
lea    -0x10(%rbp),%r9
mov    %edx,%edi
mov    %edx,%esi
call   1030 <pci_conf_read@plt>
mov    -0x10(%rbp),%rax
shr    $0x14,%rax
and    $0xf,%rax
mov    %eax,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    $0x1,%ecx
call   1050 <print_ram_line@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_timings_ct>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x10010100,%r9d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xd0,%ecx
mov    $0x4,%r8d
call   1040 <pci_conf_write@plt>
lea    0x8(%rsp),%r14
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xd4,%ecx
mov    $0x4,%r8d
mov    %r14,%r9
call   1030 <pci_conf_read@plt>
mov    0x8(%rsp),%ebx
mov    %ebx,%eax
shr    $0xc,%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm0
addss  0xe76(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %ebx,%ebp
shr    $0x8,%ebp
and    $0x7,%ebp
add    $0x5,%ebp
shr    $0x4,%ebx
and    $0x7,%ebx
add    $0x5,%ebx
mov    $0x10010200,%r9d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xd0,%ecx
mov    $0x4,%r8d
call   1040 <pci_conf_write@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xd4,%ecx
mov    $0x4,%r8d
mov    %r14,%r9
call   1030 <pci_conf_read@plt>
mov    0x8(%rsp),%edx
shr    $0x14,%edx
and    $0xf,%edx
movss  0x4(%rsp),%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%ecx
call   1050 <print_ram_line@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @poll_timings_ct() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64 268435456, i64* %1
%7 = load i64, i64* %1
%8 = add i64 %7, 65536
store i64 %8, i64* %1
%9 = load i64, i64* %1
%10 = add i64 %9, 256
store i64 %10, i64* %1
%11 = load i64, i64* %1
%12 = and i64 %11, 4294967280
store i64 %12, i64* %1
%13 = load i64, i64* %1
%14 = call i32 @pci_conf_write(i32 0, i32 0, i32 0, i32 208, i32 4, i64 %13)
%15 = call i32 @pci_conf_read(i32 0, i32 0, i32 0, i32 212, i32 4, i64* %2)
%16 = load i64, i64* %2
%17 = lshr i64 %16, 12
%18 = and i64 %17, 7
%19 = uitofp i64 %18 to float
%20 = fadd float %19, 5.000000e+00
store float %20, float* %3
%21 = load i64, i64* %2
%22 = lshr i64 %21, 8
%23 = and i64 %22, 7
%24 = add i64 %23, 5
%25 = trunc i64 %24 to i32
store i32 %25, i32* %4
%26 = load i64, i64* %2
%27 = lshr i64 %26, 4
%28 = and i64 %27, 7
%29 = add i64 %28, 5
%30 = trunc i64 %29 to i32
store i32 %30, i32* %5
store i64 268501504, i64* %1
%31 = load i64, i64* %1
%32 = call i32 @pci_conf_write(i32 0, i32 0, i32 0, i32 208, i32 4, i64 %31)
%33 = call i32 @pci_conf_read(i32 0, i32 0, i32 0, i32 212, i32 4, i64* %2)
%34 = load i64, i64* %2
%35 = lshr i64 %34, 20
%36 = and i64 %35, 15
%37 = trunc i64 %36 to i32
store i32 %37, i32* %6
%38 = load float, float* %3
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = call i32 @print_ram_line(float %38, i32 %39, i32 %40, i32 %41, i32 1)
ret void
}

LLVM IR (-O2):
define void @poll_timings_ct() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @pci_conf_write(i32 0, i32 0, i32 0, i32 208, i32 4, i64 268501248)
%4 = call i32 @pci_conf_read(i32 0, i32 0, i32 0, i32 212, i32 4, i64* %1)
%5 = load i64, i64* %1
%6 = lshr i64 %5, 12
%7 = and i64 %6, 7
%8 = uitofp i64 %7 to float
%9 = fadd float %8, 5.000000e+00
%10 = trunc i64 %5 to i32
%11 = lshr i32 %10, 8
%12 = and i32 %11, 7
%13 = add nuw nsw i32 %12, 5
%14 = lshr i32 %10, 4
%15 = and i32 %14, 7
%16 = add nuw nsw i32 %15, 5
%17 = call i32 @pci_conf_write(i32 0, i32 0, i32 0, i32 208, i32 4, i64 268501504)
%18 = call i32 @pci_conf_read(i32 0, i32 0, i32 0, i32 212, i32 4, i64* %1)
%19 = load i64, i64* %1
%20 = trunc i64 %19 to i32
%21 = lshr i32 %20, 20
%22 = and i32 %21, 15
%23 = call i32 @print_ram_line(float %9, i32 %13, i32 %16, i32 %22, i32 1)
ret void
}