#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 */
scalar_t__ config_load();
int dm_run();
int /*<<< orphan*/ printf(char *);
scalar_t__ util_daemonize();
int main(int argc, char **argv) {
  if (argc > 1) {
    printf(
        "error: expected to run without parameters.\n"
        "\n"
        "  orthos the versatile X11 display manager version "
        "0.3"
        "\n"
        "  is distributed and shall be used under the terms of GNU GPLv3.\n"
        "\n"
        "  To correctly startup orthos, please provide default configuration "
        "file at\n"
        "   "
        "/etc/orthos.conf"
        "\n"
        "  or select yours by setting environment variable like this:\n"
        "   export ORTHOS_CONF=/my/o.conf\n"
        "\n"
        "  More documentation should be available at manual page orthos(1).\n"
        "\n");
    return 1;
  }
  if (config_load()) {
    printf(
        "error: loading configuration file failed.\n"
        "\n"
        "  orthos the versatile X11 display manager version "
        "0.3"
        "\n"
        "  is distributed and shall be used under the terms of GNU GPLv3.\n"
        "\n"
        "  To correctly startup orthos, please provide default configuration "
        "file at\n"
        "   "
        "/etc/orthos.conf"
        "\n"
        "  or select yours by setting environment variable like this:\n"
        "   export ORTHOS_CONF=/my/o.conf\n"
        "\n"
        "  More documentation should be available at manual page orthos(1).\n"
        "\n");
    return 2;
  }
  if (util_daemonize()) {
    printf("error: couldn't daemonize");
    return 3;
  }
  return dm_run();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d4 <main+0x94>
mov    $0x0,%al
call   1030 <config_load@plt>
cmp    $0x0,%rax
je     11a1 <main+0x61>
lea    0x1019(%rip),%rdi
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    11d4 <main+0x94>
mov    $0x0,%al
call   1060 <util_daemonize@plt>
cmp    $0x0,%rax
je     11ca <main+0x8a>
lea    0x1198(%rip),%rdi
call   1040 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    11d4 <main+0x94>
mov    $0x0,%al
call   1050 <dm_run@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1169 <main+0x19>
lea    0x1064(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <config_load@plt>
test   %rax,%rax
je     1188 <main+0x38>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1070 <util_daemonize@plt>
test   %rax,%rax
je     11a7 <main+0x57>
lea    0xe65(%rip),%rdi
call   1050 <printf@plt>
mov    $0x3,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1060 <dm_run@plt>

LLVM IR (-O0):
@.str = [425 x i8] c"error: expected to run without parameters.\0A\0A orthos the versatile X11 display manager version 0.3\0A is distributed and shall be used under the terms of GNU GPLv3.\0A\0A To correctly startup orthos, please provide default configuration file at\0A /etc/orthos.conf\0A or select yours by setting environment variable like this:\0A export ORTHOS_CONF=/my/o.conf\0A\0A More documentation should be available at manual page orthos(1).\0A\0A\00"
@.str.1 = [424 x i8] c"error: loading configuration file failed.\0A\0A orthos the versatile X11 display manager version 0.3\0A is distributed and shall be used under the terms of GNU GPLv3.\0A\0A To correctly startup orthos, please provide default configuration file at\0A /etc/orthos.conf\0A or select yours by setting environment variable like this:\0A export ORTHOS_CONF=/my/o.conf\0A\0A More documentation should be available at manual page orthos(1).\0A\0A\00"
@.str.2 = [26 x i8] c"error: couldn't daemonize\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %22
10: ; preds = %2
%11 = call i64 (...) @config_load()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([424 x i8], [424 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %3
br label %22
15: ; preds = %10
%16 = call i64 (...) @util_daemonize()
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 3, i32* %3
br label %22
20: ; preds = %15
%21 = call i32 (...) @dm_run()
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %18, %13, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str.2 = [26 x i8] c"error: couldn't daemonize\00"
@str = [423 x i8] c"error: loading configuration file failed.\0A\0A orthos the versatile X11 display manager version 0.3\0A is distributed and shall be used under the terms of GNU GPLv3.\0A\0A To correctly startup orthos, please provide default configuration file at\0A /etc/orthos.conf\0A or select yours by setting environment variable like this:\0A export ORTHOS_CONF=/my/o.conf\0A\0A More documentation should be available at manual page orthos(1).\0A\00"
@str.3 = [424 x i8] c"error: expected to run without parameters.\0A\0A orthos the versatile X11 display manager version 0.3\0A is distributed and shall be used under the terms of GNU GPLv3.\0A\0A To correctly startup orthos, please provide default configuration file at\0A /etc/orthos.conf\0A or select yours by setting environment variable like this:\0A export ORTHOS_CONF=/my/o.conf\0A\0A More documentation should be available at manual page orthos(1).\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([424 x i8], [424 x i8]* @str.3, i64 0, i64 0))
br label %18
6: ; preds = %2
%7 = tail call i64 (...) @config_load()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([423 x i8], [423 x i8]* @str, i64 0, i64 0))
br label %18
11: ; preds = %6
%12 = tail call i64 (...) @util_daemonize()
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = tail call i32 (...) @dm_run()
br label %18
18: ; preds = %16, %14, %9, %4
%19 = phi i32 [ 1, %4 ], [ 2, %9 ], [ 3, %14 ], [ %17, %16 ]
ret i32 %19
}