#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__ getuid();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_IFACE_IPv4(char *, char *);
int main(int argc, char *argv[]) {
  if (getuid()) {
    printf("\nRoot yourself\n");
    return -1;
  }
  char MAC_addr[6];
  char IP[4];
  char *IP_2 = "192.168.1.98";
  short FLAGS;
  set_IFACE_IPv4(IP_2, "eth0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
cmp    $0x0,%rax
je     116f <main+0x3f>
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <main+0x61>
lea    0xe9a(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <set_IFACE_IPv4@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getuid@plt>
test   %rax,%rax
je     1152 <main+0x22>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
jmp    1165 <main+0x35>
lea    0xea7(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <set_IFACE_IPv4@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0ARoot yourself\0A\00"
@.str.1 = [13 x i8] c"192.168.1.98\00"
@.str.2 = [5 x i8] c"eth0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
%7 = alloca [4 x i8]
%8 = alloca i8*
%9 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i64 (...) @getuid()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %17
14: ; preds = %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %8
%15 = load i8*, i8** %8
%16 = call i32 @set_IFACE_IPv4(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"192.168.1.98\00"
@.str.2 = [5 x i8] c"eth0\00"
@str = [15 x i8] c"\0ARoot yourself\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @set_IFACE_IPv4(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %10
}