#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_status(char *);
int /*<<< orphan*/ close_statusbar();
int /*<<< orphan*/ datetime(char *);
int /*<<< orphan*/ host(char *);
int /*<<< orphan*/ launch_statusbar();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ status(char *, char *, char *, char *);
int /*<<< orphan*/ statusbar(char *);
main() {
  char current_time[50];
  char hostname[10];
  char battery_remain[4];
  char status_string[100];
  launch_statusbar();
  for (;; sleep(1)) {
    host(hostname);
    datetime(current_time);
    battery_status(battery_remain);
    status(status_string, hostname, battery_remain, current_time);
    statusbar(status_string);
  }
  close_statusbar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <launch_statusbar@plt>
lea    -0x4a(%rbp),%rdi
call   1060 <host@plt>
lea    -0x40(%rbp),%rdi
call   1070 <datetime@plt>
lea    -0x4e(%rbp),%rdi
call   1090 <battery_status@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x4a(%rbp),%rsi
lea    -0x4e(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1040 <status@plt>
lea    -0xc0(%rbp),%rdi
call   1050 <statusbar@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
jmp    1189 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb8,%rsp
xor    %eax,%eax
call   1030 <launch_statusbar@plt>
lea    0x6(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x2(%rsp),%r12
lea    0x50(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1060 <host@plt>
mov    %r15,%rdi
call   1070 <datetime@plt>
mov    %r12,%rdi
call   1090 <battery_status@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1040 <status@plt>
mov    %rbx,%rdi
call   1050 <statusbar@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
jmp    11a0 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [10 x i8]
%4 = alloca [4 x i8]
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = call i32 (...) @launch_statusbar()
br label %7
7: ; preds = %21, %0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @host(i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%11 = call i32 @datetime(i8* %10)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%13 = call i32 @battery_status(i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%18 = call i32 @status(i8* %14, i8* %15, i8* %16, i8* %17)
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%20 = call i32 @statusbar(i8* %19)
br label %21
21: ; preds = %7
%22 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [10 x i8]
%3 = alloca [4 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = tail call i32 (...) @launch_statusbar()
br label %10
10: ; preds = %10, %0
%11 = call i32 @host(i8* %6)
%12 = call i32 @datetime(i8* %5)
%13 = call i32 @battery_status(i8* %7)
%14 = call i32 @status(i8* %8, i8* %6, i8* %7, i8* %5)
%15 = call i32 @statusbar(i8* %8)
%16 = call i32 @sleep(i32 1)
br label %10
}