#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 */
char *i8k_get_bios_version();
int i8k_get_cpu_temp();
int i8k_get_fan_speed(int);
int i8k_get_fan_status(int);
int i8k_get_fn_status();
char *i8k_get_machine_id();
int i8k_get_power_status();
int /*<<< orphan*/ printf(char *, char *, char *, char *, int, int, int, int,
                          int, int, int);
int status() {
  int fn_key, cpu_temp, ac_power;
  int left_fan, right_fan, left_speed, right_speed;
  char *bios_version, *bios_machine_id;
  bios_version = i8k_get_bios_version();
  bios_machine_id = i8k_get_machine_id();
  cpu_temp = i8k_get_cpu_temp();
  left_fan = i8k_get_fan_status(1);
  right_fan = i8k_get_fan_status(0);
  left_speed = i8k_get_fan_speed(1);
  right_speed = i8k_get_fan_speed(0);
  ac_power = i8k_get_power_status();
  fn_key = i8k_get_fn_status();
  printf("%s %s %s %d %d %d %d %d %d %d\n", "1.0", bios_version,
         bios_machine_id, cpu_temp, left_fan, right_fan, left_speed,
         right_speed, ac_power, fn_key);
  return 0;
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    $0x0,%al
call   1090 <i8k_get_bios_version@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1080 <i8k_get_machine_id@plt>
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   10a0 <i8k_get_cpu_temp@plt>
mov    %eax,-0x18(%rbp)
mov    $0x1,%edi
call   1040 <i8k_get_fan_status@plt>
mov    %eax,-0x20(%rbp)
xor    %edi,%edi
call   1040 <i8k_get_fan_status@plt>
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
call   1070 <i8k_get_fan_speed@plt>
mov    %eax,-0x28(%rbp)
xor    %edi,%edi
call   1070 <i8k_get_fan_speed@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1030 <i8k_get_power_status@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <i8k_get_fn_status@plt>
mov    %eax,-0x14(%rbp)
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%r14d
mov    -0x28(%rbp),%ebx
mov    -0x2c(%rbp),%r11d
mov    -0x1c(%rbp),%r10d
mov    -0x14(%rbp),%eax
lea    0xdea(%rip),%rdi
lea    0xe02(%rip),%rsi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1090 <i8k_get_bios_version@plt>
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1080 <i8k_get_machine_id@plt>
mov    %rax,%r12
xor    %eax,%eax
call   10a0 <i8k_get_cpu_temp@plt>
mov    %eax,%r13d
mov    $0x1,%edi
call   1040 <i8k_get_fan_status@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1040 <i8k_get_fan_status@plt>
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
call   1070 <i8k_get_fan_speed@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1070 <i8k_get_fan_speed@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <i8k_get_power_status@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1060 <i8k_get_fn_status@plt>
sub    $0x8,%rsp
lea    0xe08(%rip),%rdi
lea    0xe20(%rip),%rsi
mov    0x18(%rsp),%rdx
mov    %r12,%rcx
mov    %r13d,%r8d
mov    %ebp,%r9d
push   %rax
push   %r15
push   %r14
push   %rbx
push   0x30(%rsp)
call   1050 <printf@plt>
add    $0x30,%rsp
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%s %s %s %d %d %d %d %d %d %d\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define i32 @status() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = call i8* (...) @i8k_get_bios_version()
store i8* %10, i8** %8
%11 = call i8* (...) @i8k_get_machine_id()
store i8* %11, i8** %9
%12 = call i32 (...) @i8k_get_cpu_temp()
store i32 %12, i32* %2
%13 = call i32 @i8k_get_fan_status(i32 1)
store i32 %13, i32* %4
%14 = call i32 @i8k_get_fan_status(i32 0)
store i32 %14, i32* %5
%15 = call i32 @i8k_get_fan_speed(i32 1)
store i32 %15, i32* %6
%16 = call i32 @i8k_get_fan_speed(i32 0)
store i32 %16, i32* %7
%17 = call i32 (...) @i8k_get_power_status()
store i32 %17, i32* %3
%18 = call i32 (...) @i8k_get_fn_status()
store i32 %18, i32* %1
%19 = load i8*, i8** %8
%20 = load i8*, i8** %9
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load i32, i32* %3
%27 = load i32, i32* %1
%28 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s %s %s %d %d %d %d %d %d %d\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define i32 @status() {
%1 = tail call i8* (...) @i8k_get_bios_version()
%2 = tail call i8* (...) @i8k_get_machine_id()
%3 = tail call i32 (...) @i8k_get_cpu_temp()
%4 = tail call i32 @i8k_get_fan_status(i32 1)
%5 = tail call i32 @i8k_get_fan_status(i32 0)
%6 = tail call i32 @i8k_get_fan_speed(i32 1)
%7 = tail call i32 @i8k_get_fan_speed(i32 0)
%8 = tail call i32 (...) @i8k_get_power_status()
%9 = tail call i32 (...) @i8k_get_fn_status()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9)
ret i32 0
}