#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*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void wlanToHuman(char *wlan) {
  if (!strcmp(wlan, "wlan0-1")) {
    strcpy(wlan, "[FREE]");
  } else if (!strcmp(wlan, "wlan0")) {
    strcpy(wlan, "[ 2G ]");
  } else if (!strcmp(wlan, "wlan1")) {
    strcpy(wlan, "[ 5G ]");
  } else {
    char tmp[10];
    strcpy(tmp, wlan);
    sprintf(wlan, "[%-3s]", tmp);
  }
}


x86 assembly (clang, -O0):
<wlanToHuman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    116a <wlanToHuman+0x3a>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11f1 <wlanToHuman+0xc1>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1198 <wlanToHuman+0x68>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ec <wlanToHuman+0xbc>
mov    -0x8(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11c6 <wlanToHuman+0x96>
mov    -0x8(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11e7 <wlanToHuman+0xb7>
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    0xe47(%rip),%rsi
call   1050 <sprintf@plt>
jmp    11ec <wlanToHuman+0xbc>
jmp    11f1 <wlanToHuman+0xc1>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wlanToHuman>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     119a <wlanToHuman+0x6a>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11a3 <wlanToHuman+0x73>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11ac <wlanToHuman+0x7c>
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe67(%rip),%rsi
jmp    11b3 <wlanToHuman+0x83>
lea    0xe6b(%rip),%rsi
jmp    11b3 <wlanToHuman+0x83>
lea    0xe6f(%rip),%rsi
mov    %rbx,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"wlan0-1\00"
@.str.1 = [7 x i8] c"[FREE]\00"
@.str.2 = [6 x i8] c"wlan0\00"
@.str.3 = [7 x i8] c"[ 2G ]\00"
@.str.4 = [6 x i8] c"wlan1\00"
@.str.5 = [7 x i8] c"[ 5G ]\00"
@.str.6 = [7 x i8] c"[%-3s]\00"
define void @wlanToHuman(i8* %0) {
%2 = alloca [10 x i8]
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %21
7: ; preds = %1
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %21
12: ; preds = %7
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %21
17: ; preds = %12
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%19 = call i32 @strcpy(i8* %18, i8* %0)
%20 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %18)
br label %21
21: ; preds = %10, %17, %15, %5
ret void
}