#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 bus_readbyte(int);
int /*<<< orphan*/ printf(char *, int);
void dump_registers() {
  printf("LPT0_DATA: %X\n", bus_readbyte(0x78));
  printf("LPT0_STAT: %X\n", bus_readbyte(0x79));
  printf("LPT0_CTRL: %X\n", bus_readbyte(0x7A));
  printf("LPT1_DATA: %X\n", bus_readbyte(0xBC));
  printf("LPT1_STAT: %X\n", bus_readbyte(0xBD));
  printf("LPT1_CTRL: %X\n", bus_readbyte(0xBE));
}


x86 assembly (clang, -O0):
<dump_registers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x79,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7a,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbc,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbd,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbe,%edi
call   1040 <bus_readbyte@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_registers>:
push   %rax
mov    $0x78,%edi
call   1040 <bus_readbyte@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x79,%edi
call   1040 <bus_readbyte@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7a,%edi
call   1040 <bus_readbyte@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xbc,%edi
call   1040 <bus_readbyte@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xbd,%edi
call   1040 <bus_readbyte@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xbe,%edi
call   1040 <bus_readbyte@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"LPT0_DATA: %X\0A\00"
@.str.1 = [15 x i8] c"LPT0_STAT: %X\0A\00"
@.str.2 = [15 x i8] c"LPT0_CTRL: %X\0A\00"
@.str.3 = [15 x i8] c"LPT1_DATA: %X\0A\00"
@.str.4 = [15 x i8] c"LPT1_STAT: %X\0A\00"
@.str.5 = [15 x i8] c"LPT1_CTRL: %X\0A\00"
define void @dump_registers() {
%1 = call i32 @bus_readbyte(i32 120)
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @bus_readbyte(i32 121)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @bus_readbyte(i32 122)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @bus_readbyte(i32 188)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @bus_readbyte(i32 189)
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @bus_readbyte(i32 190)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"LPT0_DATA: %X\0A\00"
@.str.1 = [15 x i8] c"LPT0_STAT: %X\0A\00"
@.str.2 = [15 x i8] c"LPT0_CTRL: %X\0A\00"
@.str.3 = [15 x i8] c"LPT1_DATA: %X\0A\00"
@.str.4 = [15 x i8] c"LPT1_STAT: %X\0A\00"
@.str.5 = [15 x i8] c"LPT1_CTRL: %X\0A\00"
define void @dump_registers() {
%1 = tail call i32 @bus_readbyte(i32 120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bus_readbyte(i32 121)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bus_readbyte(i32 122)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @bus_readbyte(i32 188)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @bus_readbyte(i32 189)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @bus_readbyte(i32 190)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %11)
ret void
}