#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*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int mib_name_resolve(char *from, char *to) {
  if ((!strcmp(from, "HW_NIC0_ADDR")) ||
      (!strcmp(from, "HW_WLAN0_WLAN_ADDR"))) {
    strcpy(to, "ELAN_MAC_ADDR");
  } else if ((!strcmp(from, "HW_NIC1_ADDR")) ||
             (!strcmp(from, "HW_WLAN1_WLAN_ADDR"))) {
    strcpy(to, "ELAN_MAC_ADDR");
  } else
    strcpy(to, from);
  return 0;
}


x86 assembly (clang, -O0):
<mib_name_resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1162 <mib_name_resolve+0x42>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1177 <mib_name_resolve+0x57>
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11d0 <mib_name_resolve+0xb0>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11a9 <mib_name_resolve+0x89>
mov    -0x8(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11be <mib_name_resolve+0x9e>
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11cb <mib_name_resolve+0xab>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11d0 <mib_name_resolve+0xb0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mib_name_resolve>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%rsi
call   1040 <strcmp@plt>
lea    0xee2(%rip),%r15
test   %eax,%eax
je     1184 <mib_name_resolve+0x64>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1184 <mib_name_resolve+0x64>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1184 <mib_name_resolve+0x64>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xea0(%rip),%r15
cmovne %rbx,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"HW_NIC0_ADDR\00"
@.str.1 = [19 x i8] c"HW_WLAN0_WLAN_ADDR\00"
@.str.2 = [14 x i8] c"ELAN_MAC_ADDR\00"
@.str.3 = [13 x i8] c"HW_NIC1_ADDR\00"
@.str.4 = [19 x i8] c"HW_WLAN1_WLAN_ADDR\00"
define i32 @mib_name_resolve(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %31
15: ; preds = %8
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %19, %15
%24 = load i8*, i8** %4
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %30
26: ; preds = %19
%27 = load i8*, i8** %4
%28 = load i8*, i8** %3
%29 = call i32 @strcpy(i8* %27, i8* %28)
br label %30
30: ; preds = %26, %23
br label %31
31: ; preds = %30, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"HW_NIC0_ADDR\00"
@.str.1 = [19 x i8] c"HW_WLAN0_WLAN_ADDR\00"
@.str.2 = [14 x i8] c"ELAN_MAC_ADDR\00"
@.str.3 = [13 x i8] c"HW_NIC1_ADDR\00"
@.str.4 = [19 x i8] c"HW_WLAN1_WLAN_ADDR\00"
define i32 @mib_name_resolve(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(19) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(19) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %0
br label %15
15: ; preds = %11, %8, %2, %5
%16 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %8 ], [ %14, %11 ]
%17 = tail call i32 @strcpy(i8* %1, i8* %16)
ret i32 0
}