#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*/ printf(char *, ...);
int timer_read_div();
int timer_read_tac();
int timer_read_tima();
int timer_read_tma();
void timer_dump(void) {
  printf("Timer dump:\n");
  printf("[$ff04] div=0x%.2x\n", timer_read_div());
  printf("[$ff05] tima=0x%.2x\n", timer_read_tima());
  printf("[$ff06] tma=0x%.2x\n", timer_read_tma());
  printf("[$ff07] tac=0x%.2x\n", timer_read_tac());
}


x86 assembly (clang, -O0):
<timer_dump>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <timer_read_div@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <timer_read_tima@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <timer_read_tma@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <timer_read_tac@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_dump>:
push   %rax
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <timer_read_div@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <timer_read_tima@plt>
lea    0xe82(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <timer_read_tma@plt>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <timer_read_tac@plt>
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Timer dump:\0A\00"
@.str.1 = [20 x i8] c"[$ff04] div=0x%.2x\0A\00"
@.str.2 = [21 x i8] c"[$ff05] tima=0x%.2x\0A\00"
@.str.3 = [20 x i8] c"[$ff06] tma=0x%.2x\0A\00"
@.str.4 = [20 x i8] c"[$ff07] tac=0x%.2x\0A\00"
define void @timer_dump() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @timer_read_div()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @timer_read_tima()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @timer_read_tma()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @timer_read_tac()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"[$ff04] div=0x%.2x\0A\00"
@.str.2 = [21 x i8] c"[$ff05] tima=0x%.2x\0A\00"
@.str.3 = [20 x i8] c"[$ff06] tma=0x%.2x\0A\00"
@.str.4 = [20 x i8] c"[$ff07] tac=0x%.2x\0A\00"
@str = [12 x i8] c"Timer dump:\00"
define void @timer_dump() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @timer_read_div()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @timer_read_tima()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @timer_read_tma()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @timer_read_tac()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %8)
ret void
}