#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*/ IFF_UP;
int /*<<< orphan*/ do_flags(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ do_ip_addr_set(char *);
int /*<<< orphan*/ do_ip_broad_set(char *);
int /*<<< orphan*/ do_ip_dst_set(char *);
int /*<<< orphan*/ do_ip_gw_set(char *);
int /*<<< orphan*/ do_ip_mask_set(char *);
scalar_t__ strcmp(char *, char *);
int do_keyword(char **arg) {
  if (strcmp(*arg, "ip") == 0) {
    do_ip_addr_set(arg[1]);
    return 2;
  }
  if (strcmp(*arg, "netmask") == 0) {
    do_ip_mask_set(arg[1]);
    return 2;
  }
  if (strcmp(*arg, "dst") == 0) {
    do_ip_dst_set(arg[1]);
    return 2;
  }
  if (strcmp(*arg, "gw") == 0) {
    do_ip_gw_set(arg[1]);
    return 2;
  }
  if (strcmp(*arg, "broadcast") == 0) {
    do_ip_broad_set(arg[1]);
    return 2;
  }
  if (strcmp(*arg, "up") == 0) {
    do_flags(IFF_UP, IFF_UP);
    return 1;
  }
  if (strcmp(*arg, "down") == 0) {
    do_flags(IFF_UP, 0);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_keyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe76(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11b2 <do_keyword+0x42>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <do_ip_addr_set@plt>
movl   $0x2,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe43(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11e8 <do_keyword+0x78>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <do_ip_mask_set@plt>
movl   $0x2,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe15(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    121e <do_keyword+0xae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <do_ip_dst_set@plt>
movl   $0x2,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1254 <do_keyword+0xe4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <do_ip_gw_set@plt>
movl   $0x2,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdb0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    128a <do_keyword+0x11a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <do_ip_broad_set@plt>
movl   $0x2,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd84(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12ca <do_keyword+0x15a>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
mov    0x2d31(%rip),%rax
mov    (%rax),%esi
call   1040 <do_flags@plt>
movl   $0x1,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd47(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1303 <do_keyword+0x193>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <do_flags@plt>
movl   $0x1,-0x4(%rbp)
jmp    130a <do_keyword+0x19a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_keyword>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0xe82(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     121a <do_keyword+0xaa>
mov    (%rbx),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1225 <do_keyword+0xb5>
mov    (%rbx),%rdi
lea    0xe5d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1230 <do_keyword+0xc0>
mov    (%rbx),%rdi
lea    0xe4d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     123b <do_keyword+0xcb>
mov    (%rbx),%rdi
lea    0xe3c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1246 <do_keyword+0xd6>
mov    (%rbx),%rdi
lea    0xe32(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1256 <do_keyword+0xe6>
mov    (%rbx),%rdi
lea    0xe21(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    126b <do_keyword+0xfb>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1261 <do_keyword+0xf1>
mov    0x8(%rbx),%rdi
call   1050 <do_ip_addr_set@plt>
jmp    124f <do_keyword+0xdf>
mov    0x8(%rbx),%rdi
call   1090 <do_ip_mask_set@plt>
jmp    124f <do_keyword+0xdf>
mov    0x8(%rbx),%rdi
call   1060 <do_ip_dst_set@plt>
jmp    124f <do_keyword+0xdf>
mov    0x8(%rbx),%rdi
call   1080 <do_ip_gw_set@plt>
jmp    124f <do_keyword+0xdf>
mov    0x8(%rbx),%rdi
call   1030 <do_ip_broad_set@plt>
mov    $0x2,%eax
pop    %rbx
ret
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
mov    %edi,%esi
call   1040 <do_flags@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ip\00"
@.str.1 = [8 x i8] c"netmask\00"
@.str.2 = [4 x i8] c"dst\00"
@.str.3 = [3 x i8] c"gw\00"
@.str.4 = [10 x i8] c"broadcast\00"
@.str.5 = [3 x i8] c"up\00"
@IFF_UP = global i32 0
@.str.6 = [5 x i8] c"down\00"
define i32 @do_keyword(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @do_ip_addr_set(i8* %11)
store i32 2, i32* %2
br label %71
13: ; preds = %1
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8**, i8*** %3
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @do_ip_mask_set(i8* %21)
store i32 2, i32* %2
br label %71
23: ; preds = %13
%24 = load i8**, i8*** %3
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = load i8**, i8*** %3
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @do_ip_dst_set(i8* %31)
store i32 2, i32* %2
br label %71
33: ; preds = %23
%34 = load i8**, i8*** %3
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %33
%39 = load i8**, i8*** %3
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @do_ip_gw_set(i8* %41)
store i32 2, i32* %2
br label %71
43: ; preds = %33
%44 = load i8**, i8*** %3
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %43
%49 = load i8**, i8*** %3
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 @do_ip_broad_set(i8* %51)
store i32 2, i32* %2
br label %71
53: ; preds = %43
%54 = load i8**, i8*** %3
%55 = load i8*, i8** %54
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %53
%59 = load i32, i32* @IFF_UP
%60 = load i32, i32* @IFF_UP
%61 = call i32 @do_flags(i32 %59, i32 %60)
store i32 1, i32* %2
br label %71
62: ; preds = %53
%63 = load i8**, i8*** %3
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %62
%68 = load i32, i32* @IFF_UP
%69 = call i32 @do_flags(i32 %68, i32 0)
store i32 1, i32* %2
br label %71
70: ; preds = %62
store i32 0, i32* %2
br label %71
71: ; preds = %70, %67, %58, %48, %38, %28, %18, %8
%72 = load i32, i32* %2
ret i32 %72
}

LLVM IR (-O2):
@.str = [3 x i8] c"ip\00"
@.str.1 = [8 x i8] c"netmask\00"
@.str.2 = [4 x i8] c"dst\00"
@.str.3 = [3 x i8] c"gw\00"
@.str.4 = [10 x i8] c"broadcast\00"
@.str.5 = [3 x i8] c"up\00"
@IFF_UP = global i32 0
@.str.6 = [5 x i8] c"down\00"
define i32 @do_keyword(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @do_ip_addr_set(i8* %7)
br label %55
9: ; preds = %1
%10 = load i8*, i8** %0
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = getelementptr inbounds i8*, i8** %0, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @do_ip_mask_set(i8* %15)
br label %55
17: ; preds = %9
%18 = load i8*, i8** %0
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = getelementptr inbounds i8*, i8** %0, i64 1
%23 = load i8*, i8** %22
%24 = tail call i32 @do_ip_dst_set(i8* %23)
br label %55
25: ; preds = %17
%26 = load i8*, i8** %0
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = getelementptr inbounds i8*, i8** %0, i64 1
%31 = load i8*, i8** %30
%32 = tail call i32 @do_ip_gw_set(i8* %31)
br label %55
33: ; preds = %25
%34 = load i8*, i8** %0
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = getelementptr inbounds i8*, i8** %0, i64 1
%39 = load i8*, i8** %38
%40 = tail call i32 @do_ip_broad_set(i8* %39)
br label %55
41: ; preds = %33
%42 = load i8*, i8** %0
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* @IFF_UP
%47 = tail call i32 @do_flags(i32 %46, i32 %46)
br label %55
48: ; preds = %41
%49 = load i8*, i8** %0
%50 = tail call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* @IFF_UP
%54 = tail call i32 @do_flags(i32 %53, i32 0)
br label %55
55: ; preds = %48, %52, %45, %37, %29, %21, %13, %5
%56 = phi i32 [ 2, %5 ], [ 2, %13 ], [ 2, %21 ], [ 2, %29 ], [ 2, %37 ], [ 1, %45 ], [ 1, %52 ], [ 0, %48 ]
ret i32 %56
}