#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 /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ uxmi_color_fg(int);
int /*<<< orphan*/ uxmi_color_reset();
int uxmi_do_cfg();
int /*<<< orphan*/ uxmi_sysinit_disp(char *);
int /*<<< orphan*/ uxmi_sysinit_testrc(int);
int uxmi_system(char *);
void uxmi_sysinit() {
  char xcmd[254];
  int rc = 0;
  uxmi_color_fg(9);
  printf("\nStarting System Initialization....\n\n");
  uxmi_sysinit_disp("\t Mounting /proc filesystem");
  sprintf(xcmd, "%s -n -t proc none /proc ", "/bin/mount");
  rc = uxmi_system(xcmd);
  uxmi_sysinit_testrc(rc);
  uxmi_sysinit_disp("\t Mounting /sys filesystem");
  sprintf(xcmd, "%s -n -t sysfs none /sys ", "/bin/mount");
  rc = uxmi_system(xcmd);
  uxmi_sysinit_testrc(rc);
  uxmi_color_fg(9);
  printf("\nProcessing System Configuration....\n\n");
  sprintf(xcmd, "\t Configuration file is %s ", "/etc/AppOS/uxmi.cfg");
  uxmi_sysinit_disp(xcmd);
  rc = uxmi_do_cfg();
  uxmi_color_reset();
}


x86 assembly (clang, -O0):
<uxmi_sysinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x104(%rbp)
mov    $0x9,%edi
call   10a0 <uxmi_color_fg@plt>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
call   1060 <uxmi_sysinit_disp@plt>
lea    -0x100(%rbp),%rdi
lea    0xe7d(%rip),%rsi
lea    0xe90(%rip),%rdx
call   1090 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <uxmi_system@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
call   1050 <uxmi_sysinit_testrc@plt>
lea    0xe72(%rip),%rdi
call   1060 <uxmi_sysinit_disp@plt>
lea    -0x100(%rbp),%rdi
lea    0xe7a(%rip),%rsi
lea    0xe4d(%rip),%rdx
call   1090 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <uxmi_system@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
call   1050 <uxmi_sysinit_testrc@plt>
mov    $0x9,%edi
call   10a0 <uxmi_color_fg@plt>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xe6e(%rip),%rsi
lea    0xe83(%rip),%rdx
call   1090 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1060 <uxmi_sysinit_disp@plt>
mov    $0x0,%al
call   1070 <uxmi_do_cfg@plt>
mov    %eax,-0x104(%rbp)
mov    $0x0,%al
call   1080 <uxmi_color_reset@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uxmi_sysinit>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    $0x9,%edi
call   10a0 <uxmi_color_fg@plt>
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe59(%rip),%rdi
call   1060 <uxmi_sysinit_disp@plt>
lea    0xe69(%rip),%rsi
lea    0xe7c(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <uxmi_system@plt>
mov    %eax,%edi
call   1050 <uxmi_sysinit_testrc@plt>
lea    0xe63(%rip),%rdi
call   1060 <uxmi_sysinit_disp@plt>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <uxmi_system@plt>
mov    %eax,%edi
call   1050 <uxmi_sysinit_testrc@plt>
mov    $0x9,%edi
call   10a0 <uxmi_color_fg@plt>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xe55(%rip),%rsi
lea    0xe6a(%rip),%rdx
mov    %rbx,%rdi
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <uxmi_sysinit_disp@plt>
xor    %eax,%eax
call   1070 <uxmi_do_cfg@plt>
xor    %eax,%eax
call   1080 <uxmi_color_reset@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0AStarting System Initialization....\0A\0A\00"
@.str.1 = [28 x i8] c"\09 Mounting /proc filesystem\00"
@.str.2 = [26 x i8] c"%s -n -t proc none /proc \00"
@.str.3 = [11 x i8] c"/bin/mount\00"
@.str.4 = [27 x i8] c"\09 Mounting /sys filesystem\00"
@.str.5 = [26 x i8] c"%s -n -t sysfs none /sys \00"
@.str.6 = [39 x i8] c"\0AProcessing System Configuration....\0A\0A\00"
@.str.7 = [28 x i8] c"\09 Configuration file is %s \00"
@.str.8 = [20 x i8] c"/etc/AppOS/uxmi.cfg\00"
define void @uxmi_sysinit() {
%1 = alloca [254 x i8]
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @uxmi_color_fg(i32 9)
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @uxmi_sysinit_disp(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%9 = call i32 @uxmi_system(i8* %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @uxmi_sysinit_testrc(i32 %10)
%12 = call i32 @uxmi_sysinit_disp(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%13 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%16 = call i32 @uxmi_system(i8* %15)
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @uxmi_sysinit_testrc(i32 %17)
%19 = call i32 @uxmi_color_fg(i32 9)
%20 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%21 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%22 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%23 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%24 = call i32 @uxmi_sysinit_disp(i8* %23)
%25 = call i32 (...) @uxmi_do_cfg()
store i32 %25, i32* %2
%26 = call i32 (...) @uxmi_color_reset()
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"\09 Mounting /proc filesystem\00"
@.str.2 = [26 x i8] c"%s -n -t proc none /proc \00"
@.str.3 = [11 x i8] c"/bin/mount\00"
@.str.4 = [27 x i8] c"\09 Mounting /sys filesystem\00"
@.str.5 = [26 x i8] c"%s -n -t sysfs none /sys \00"
@.str.7 = [28 x i8] c"\09 Configuration file is %s \00"
@.str.8 = [20 x i8] c"/etc/AppOS/uxmi.cfg\00"
@str = [37 x i8] c"\0AStarting System Initialization....\0A\00"
@str.9 = [38 x i8] c"\0AProcessing System Configuration....\0A\00"
define void @uxmi_sysinit() {
%1 = alloca [254 x i8]
%2 = getelementptr inbounds [254 x i8], [254 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @uxmi_color_fg(i32 9)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @uxmi_sysinit_disp(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @uxmi_system(i8* %2)
%8 = call i32 @uxmi_sysinit_testrc(i32 %7)
%9 = call i32 @uxmi_sysinit_disp(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @uxmi_system(i8* %2)
%12 = call i32 @uxmi_sysinit_testrc(i32 %11)
%13 = call i32 @uxmi_color_fg(i32 9)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.9, i64 0, i64 0))
%15 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 @uxmi_sysinit_disp(i8* %2)
%17 = call i32 (...) @uxmi_do_cfg()
%18 = call i32 (...) @uxmi_color_reset()
ret void
}