#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*/ add_action(char *, char *, int);
int /*<<< orphan*/ enable_commands();
int /*<<< orphan*/ enable_wizard();
int /*<<< orphan*/ getuid(int /*<<< orphan*/);
int /*<<< orphan*/ query_name();
int /*<<< orphan*/ set_heart_beat(int);
int /*<<< orphan*/ set_living_name(int /*<<< orphan*/);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
int /*<<< orphan*/ this_object();
void setup() {
  set_heart_beat(1);
  seteuid(getuid(this_object()));
  set_living_name(query_name());
  enable_commands();
  enable_wizard();
  add_action("commandHook", "", 1);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1080 <set_heart_beat@plt>
mov    $0x0,%al
call   1050 <this_object@plt>
mov    %eax,%edi
call   1030 <getuid@plt>
mov    %eax,%edi
call   10b0 <seteuid@plt>
mov    $0x0,%al
call   1090 <query_name@plt>
mov    %eax,%edi
call   1060 <set_living_name@plt>
mov    $0x0,%al
call   1070 <enable_commands@plt>
mov    $0x0,%al
call   1040 <enable_wizard@plt>
lea    0xe2a(%rip),%rdi
lea    0xe2e(%rip),%rsi
mov    $0x1,%edx
call   10a0 <add_action@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
mov    $0x1,%edi
call   1080 <set_heart_beat@plt>
xor    %eax,%eax
call   1050 <this_object@plt>
mov    %eax,%edi
call   1030 <getuid@plt>
mov    %eax,%edi
call   10b0 <seteuid@plt>
xor    %eax,%eax
call   1090 <query_name@plt>
mov    %eax,%edi
call   1060 <set_living_name@plt>
xor    %eax,%eax
call   1070 <enable_commands@plt>
xor    %eax,%eax
call   1040 <enable_wizard@plt>
lea    0xe2d(%rip),%rdi
lea    0xe31(%rip),%rsi
mov    $0x1,%edx
pop    %rax
jmp    10a0 <add_action@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"commandHook\00"
@.str.1 = [1 x i8] zeroinitializer
define void @setup() {
%1 = call i32 @set_heart_beat(i32 1)
%2 = call i32 (...) @this_object()
%3 = call i32 @getuid(i32 %2)
%4 = call i32 @seteuid(i32 %3)
%5 = call i32 (...) @query_name()
%6 = call i32 @set_living_name(i32 %5)
%7 = call i32 (...) @enable_commands()
%8 = call i32 (...) @enable_wizard()
%9 = call i32 @add_action(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"commandHook\00"
@.str.1 = [1 x i8] zeroinitializer
define void @setup() {
%1 = tail call i32 @set_heart_beat(i32 1)
%2 = tail call i32 (...) @this_object()
%3 = tail call i32 @getuid(i32 %2)
%4 = tail call i32 @seteuid(i32 %3)
%5 = tail call i32 (...) @query_name()
%6 = tail call i32 @set_living_name(i32 %5)
%7 = tail call i32 (...) @enable_commands()
%8 = tail call i32 (...) @enable_wizard()
%9 = tail call i32 @add_action(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}