#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*/ execute_rc_scripts();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ read_inittab();
int /*<<< orphan*/ setup_singleuser_mode();
int /*<<< orphan*/ start_ttys();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait_loop();
int main(int argc, char *argv[], char *envp[]) {
  if (!execute_rc_scripts()) {
    fprintf(stderr,
            "init: error running rc script, dropping to singleuser mode!\n");
    setup_singleuser_mode();
  } else
    read_inittab();
  start_ttys();
  wait_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <execute_rc_scripts@plt>
cmp    $0x0,%eax
jne    11ab <main+0x4b>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xe66(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1070 <setup_singleuser_mode@plt>
jmp    11b2 <main+0x52>
mov    $0x0,%al
call   1030 <read_inittab@plt>
mov    $0x0,%al
call   1080 <start_ttys@plt>
mov    $0x0,%al
call   1050 <wait_loop@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <execute_rc_scripts@plt>
test   %eax,%eax
je     1175 <main+0x15>
xor    %eax,%eax
call   1030 <read_inittab@plt>
jmp    1191 <main+0x31>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1070 <setup_singleuser_mode@plt>
xor    %eax,%eax
call   1080 <start_ttys@plt>
xor    %eax,%eax
call   1050 <wait_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"init: error running rc script, dropping to singleuser mode!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @execute_rc_scripts()
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @setup_singleuser_mode()
br label %16
14: ; preds = %3
%15 = call i32 (...) @read_inittab()
br label %16
16: ; preds = %14, %10
%17 = call i32 (...) @start_ttys()
%18 = call i32 (...) @wait_loop()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"init: error running rc script, dropping to singleuser mode!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @execute_rc_scripts()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @setup_singleuser_mode()
br label %12
10: ; preds = %3
%11 = tail call i32 (...) @read_inittab()
br label %12
12: ; preds = %10, %6
%13 = tail call i32 (...) @start_ttys()
%14 = tail call i32 (...) @wait_loop()
ret i32 0
}