#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*/ battery_refresh();
int /*<<< orphan*/ devtype_refresh();
int /*<<< orphan*/ extension_refresh();
scalar_t__ geteuid();
int /*<<< orphan*/ led_refresh(int);
int /*<<< orphan*/ mp_refresh();
int /*<<< orphan*/ mvprintw(int, int, char *);
void refresh_all(void) {
  battery_refresh();
  led_refresh(0);
  led_refresh(1);
  led_refresh(2);
  led_refresh(3);
  devtype_refresh();
  extension_refresh();
  mp_refresh();
  if (geteuid() != 0)
    mvprintw(20, 22,
             "Warning: Please run as root! (sysfs+evdev access needed)");
}


x86 assembly (clang, -O0):
<refresh_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <battery_refresh@plt>
xor    %edi,%edi
call   1080 <led_refresh@plt>
mov    $0x1,%edi
call   1080 <led_refresh@plt>
mov    $0x2,%edi
call   1080 <led_refresh@plt>
mov    $0x3,%edi
call   1080 <led_refresh@plt>
mov    $0x0,%al
call   1030 <devtype_refresh@plt>
mov    $0x0,%al
call   1070 <extension_refresh@plt>
mov    $0x0,%al
call   1060 <mp_refresh@plt>
mov    $0x0,%al
call   1050 <geteuid@plt>
cmp    $0x0,%rax
je     11dc <refresh_all+0x6c>
mov    $0x14,%edi
mov    $0x16,%esi
lea    0xe29(%rip),%rdx
call   1090 <mvprintw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<refresh_all>:
push   %rax
xor    %eax,%eax
call   1040 <battery_refresh@plt>
xor    %edi,%edi
call   1080 <led_refresh@plt>
mov    $0x1,%edi
call   1080 <led_refresh@plt>
mov    $0x2,%edi
call   1080 <led_refresh@plt>
mov    $0x3,%edi
call   1080 <led_refresh@plt>
xor    %eax,%eax
call   1030 <devtype_refresh@plt>
xor    %eax,%eax
call   1070 <extension_refresh@plt>
xor    %eax,%eax
call   1060 <mp_refresh@plt>
xor    %eax,%eax
call   1050 <geteuid@plt>
test   %rax,%rax
je     11d5 <refresh_all+0x65>
lea    0xe3b(%rip),%rdx
mov    $0x14,%edi
mov    $0x16,%esi
pop    %rax
jmp    1090 <mvprintw@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Warning: Please run as root! (sysfs+evdev access needed)\00"
define void @refresh_all() {
%1 = call i32 (...) @battery_refresh()
%2 = call i32 @led_refresh(i32 0)
%3 = call i32 @led_refresh(i32 1)
%4 = call i32 @led_refresh(i32 2)
%5 = call i32 @led_refresh(i32 3)
%6 = call i32 (...) @devtype_refresh()
%7 = call i32 (...) @extension_refresh()
%8 = call i32 (...) @mp_refresh()
%9 = call i64 (...) @geteuid()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @mvprintw(i32 20, i32 22, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Warning: Please run as root! (sysfs+evdev access needed)\00"
define void @refresh_all() {
%1 = tail call i32 (...) @battery_refresh()
%2 = tail call i32 @led_refresh(i32 0)
%3 = tail call i32 @led_refresh(i32 1)
%4 = tail call i32 @led_refresh(i32 2)
%5 = tail call i32 @led_refresh(i32 3)
%6 = tail call i32 (...) @devtype_refresh()
%7 = tail call i32 (...) @extension_refresh()
%8 = tail call i32 (...) @mp_refresh()
%9 = tail call i64 (...) @geteuid()
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = tail call i32 @mvprintw(i32 20, i32 22, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
ret void
}