#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*/ mib_get(scalar_t__, void *);
int /*<<< orphan*/ system(char *);
void UpdateIpFastpathStatus(void) {
  unsigned char mode = 0;
  mode = 0;
  mib_get(0 + 73, (void *)&mode);
  if (mode) {
    system("/bin/echo 1 > /proc/FastPath");
    return;
  }
  mode = 0;
  mib_get(0 + 83, (void *)&mode);
  if (mode) {
    system("/bin/echo 1 > /proc/FastPath");
    return;
  }
  system("/bin/echo 2 > /proc/FastPath");
}


x86 assembly (clang, -O0):
<UpdateIpFastpathStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0x1(%rbp)
mov    $0x49,%edi
lea    -0x1(%rbp),%rsi
call   1040 <mib_get@plt>
cmpb   $0x0,-0x1(%rbp)
je     1159 <UpdateIpFastpathStatus+0x39>
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
jmp    1192 <UpdateIpFastpathStatus+0x72>
movb   $0x0,-0x1(%rbp)
mov    $0x53,%edi
lea    -0x1(%rbp),%rsi
call   1040 <mib_get@plt>
cmpb   $0x0,-0x1(%rbp)
je     1186 <UpdateIpFastpathStatus+0x66>
lea    0xe84(%rip),%rdi
call   1030 <system@plt>
jmp    1192 <UpdateIpFastpathStatus+0x72>
lea    0xe90(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateIpFastpathStatus>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x49,%edi
call   1040 <mib_get@plt>
cmpb   $0x0,0x7(%rsp)
je     1145 <UpdateIpFastpathStatus+0x25>
lea    0xebd(%rip),%rdi
jmp    1170 <UpdateIpFastpathStatus+0x50>
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x53,%edi
call   1040 <mib_get@plt>
cmpb   $0x0,0x7(%rsp)
lea    0xeb8(%rip),%rax
lea    0xe94(%rip),%rdi
cmove  %rax,%rdi
call   1030 <system@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"/bin/echo 1 > /proc/FastPath\00"
@.str.1 = [29 x i8] c"/bin/echo 2 > /proc/FastPath\00"
define void @UpdateIpFastpathStatus() {
%1 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %1
%2 = call i32 @mib_get(i64 73, i8* %1)
%3 = load i8, i8* %1
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %0
store i8 0, i8* %1
%8 = call i32 @mib_get(i64 83, i8* %1)
%9 = load i8, i8* %1
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11, %5
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"/bin/echo 1 > /proc/FastPath\00"
@.str.1 = [29 x i8] c"/bin/echo 2 > /proc/FastPath\00"
define void @UpdateIpFastpathStatus() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @mib_get(i64 73, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
store i8 0, i8* %1
%6 = call i32 @mib_get(i64 83, i8* %1)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
br label %10
10: ; preds = %5, %0
%11 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), %0 ], [ %9, %5 ]
%12 = call i32 @system(i8* %11)
ret void
}