#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ process_udhcpc_callback(int, char **);
int /*<<< orphan*/ run_udhcpc(int, char **);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    errx(EXIT_FAILURE, "Pass at least one parameter. For example, \"udhcpc\" "
                       "to start up udhcpc.");
  if (strcmp(argv[1], "udhcpc") == 0)
    run_udhcpc(argc - 1, &argv[1]);
  else
    process_udhcpc_callback(argc, argv);
  exit(EXIT_SUCCESS);
}


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   $0x2,-0x8(%rbp)
jge    1185 <main+0x35>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bb <main+0x6b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <run_udhcpc@plt>
jmp    11c7 <main+0x77>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <process_udhcpc_callback@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x1,%edi
jg     1172 <main+0x22>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1040 <errx@plt>
mov    0x8(%rbx),%rdi
lea    0xeca(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    119a <main+0x4a>
add    $0x8,%rbx
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <run_udhcpc@plt>
jmp    11a4 <main+0x54>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <process_udhcpc_callback@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [71 x i8] c"Pass at least one parameter. For example, \22udhcpc\22 to start up udhcpc.\00"
@.str.1 = [7 x i8] c"udhcpc\00"
@EXIT_SUCCESS = global i32 0
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 slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = call i32 @run_udhcpc(i32 %19, i8** %21)
br label %27
23: ; preds = %11
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @process_udhcpc_callback(i32 %24, i8** %25)
br label %27
27: ; preds = %23, %17
%28 = load i32, i32* @EXIT_SUCCESS
%29 = call i32 @exit(i32 %28)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [71 x i8] c"Pass at least one parameter. For example, \22udhcpc\22 to start up udhcpc.\00"
@.str.1 = [7 x i8] c"udhcpc\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = add nsw i32 %0, -1
%14 = tail call i32 @run_udhcpc(i32 %13, i8** %8)
br label %17
15: ; preds = %7
%16 = tail call i32 @process_udhcpc_callback(i32 %0, i8** %1)
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* @EXIT_SUCCESS
%19 = tail call i32 @exit(i32 %18)
unreachable
}