#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_rng_init();
int /*<<< orphan*/ console_init();
int /*<<< orphan*/ framebuffer_init(int, int, int);
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ pmu_init();
int /*<<< orphan*/ printk(char *, int, int);
int /*<<< orphan*/ ps2_keyboard_init();
int /*<<< orphan*/ serial_enable_interrupts();
int thermal_read();
int /*<<< orphan*/ timer_init();
void drivers_init_all(void) {
  uint32_t framebuffer_width = 640, framebuffer_height = 480;
  uint32_t temperature;
  console_init();
  led_init();
  timer_init();
  ps2_keyboard_init();
  framebuffer_init(framebuffer_width, framebuffer_height, 24);
  serial_enable_interrupts();
  bcm2835_rng_init();
  temperature = thermal_read();
  printk("CPU Temperature: %dC, %dF\n", temperature / 1000,
         ((temperature * 9) / 5000) + 32);
  pmu_init();
}


x86 assembly (clang, -O0):
<drivers_init_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x280,-0x4(%rbp)
movl   $0x1e0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <console_init@plt>
mov    $0x0,%al
call   1070 <led_init@plt>
mov    $0x0,%al
call   10a0 <timer_init@plt>
mov    $0x0,%al
call   10c0 <ps2_keyboard_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x18,%edx
call   1050 <framebuffer_init@plt>
mov    $0x0,%al
call   1080 <serial_enable_interrupts@plt>
mov    $0x0,%al
call   1090 <bcm2835_rng_init@plt>
mov    $0x0,%al
call   10b0 <thermal_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x9,-0xc(%rbp),%eax
mov    $0x1388,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
add    $0x20,%edx
lea    0xde1(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1060 <pmu_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drivers_init_all>:
push   %rax
xor    %eax,%eax
call   1040 <console_init@plt>
xor    %eax,%eax
call   1070 <led_init@plt>
xor    %eax,%eax
call   10a0 <timer_init@plt>
xor    %eax,%eax
call   10c0 <ps2_keyboard_init@plt>
mov    $0x280,%edi
mov    $0x1e0,%esi
mov    $0x18,%edx
call   1050 <framebuffer_init@plt>
xor    %eax,%eax
call   1080 <serial_enable_interrupts@plt>
xor    %eax,%eax
call   1090 <bcm2835_rng_init@plt>
xor    %eax,%eax
call   10b0 <thermal_read@plt>
cltq
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rsi
add    %ecx,%esi
lea    (%rax,%rax,8),%eax
cltq
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
sar    $0x2b,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edx
add    $0x20,%edx
lea    0xde0(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <pmu_init@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"CPU Temperature: %dC, %dF\0A\00"
define void @drivers_init_all() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 640, i32* %1
store i32 480, i32* %2
%4 = call i32 (...) @console_init()
%5 = call i32 (...) @led_init()
%6 = call i32 (...) @timer_init()
%7 = call i32 (...) @ps2_keyboard_init()
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @framebuffer_init(i32 %8, i32 %9, i32 24)
%11 = call i32 (...) @serial_enable_interrupts()
%12 = call i32 (...) @bcm2835_rng_init()
%13 = call i32 (...) @thermal_read()
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 1000
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, 9
%18 = sdiv i32 %17, 5000
%19 = add nsw i32 %18, 32
%20 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %19)
%21 = call i32 (...) @pmu_init()
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"CPU Temperature: %dC, %dF\0A\00"
define void @drivers_init_all() {
%1 = tail call i32 (...) @console_init()
%2 = tail call i32 (...) @led_init()
%3 = tail call i32 (...) @timer_init()
%4 = tail call i32 (...) @ps2_keyboard_init()
%5 = tail call i32 @framebuffer_init(i32 640, i32 480, i32 24)
%6 = tail call i32 (...) @serial_enable_interrupts()
%7 = tail call i32 (...) @bcm2835_rng_init()
%8 = tail call i32 (...) @thermal_read()
%9 = sdiv i32 %8, 1000
%10 = mul nsw i32 %8, 9
%11 = sdiv i32 %10, 5000
%12 = add nsw i32 %11, 32
%13 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
%14 = tail call i32 (...) @pmu_init()
ret void
}