const char *add_usb_radio_debug_function(const char *buff) {
  pr_info("%s : switch to radio debug function\n", __func__);
  if (!strcmp(buff, "adb") || !strcmp(buff, "mtp,adb"))
    return "diag,adb,serial,rmnet,mass_storage";
  else if (!strcmp(buff, "rndis,adb"))
    return "rndis,diag,adb";
  return buff;
}


x86 assembly (clang, -O0):
<add_usb_radio_debug_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_info@plt>
mov    -0x10(%rbp),%rdi
lea    0xf36(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1173 <add_usb_radio_debug_function+0x53>
mov    -0x10(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1183 <add_usb_radio_debug_function+0x63>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b9 <add_usb_radio_debug_function+0x99>
mov    -0x10(%rbp),%rdi
lea    0xedf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ac <add_usb_radio_debug_function+0x8c>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b9 <add_usb_radio_debug_function+0x99>
jmp    11b1 <add_usb_radio_debug_function+0x91>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_usb_radio_debug_function>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
call   1030 <pr_info@plt>
lea    0xf3f(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
lea    0xef8(%rip),%rbx
test   %eax,%eax
je     1185 <add_usb_radio_debug_function+0x65>
lea    0xee5(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1185 <add_usb_radio_debug_function+0x65>
lea    0xefd(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xef6(%rip),%rbx
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"%s : switch to radio debug function\0A\00"
@__func__.add_usb_radio_debug_function = [29 x i8] c"add_usb_radio_debug_function\00"
@.str.1 = [4 x i8] c"adb\00"
@.str.2 = [8 x i8] c"mtp,adb\00"
@.str.3 = [35 x i8] c"diag,adb,serial,rmnet,mass_storage\00"
@.str.4 = [10 x i8] c"rndis,adb\00"
@.str.5 = [15 x i8] c"rndis,diag,adb\00"
define i8* @add_usb_radio_debug_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.add_usb_radio_debug_function, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8, %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %21
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %21
18: ; preds = %13
br label %19
19: ; preds = %18
%20 = load i8*, i8** %3
store i8* %20, i8** %2
br label %21
21: ; preds = %19, %17, %12
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s : switch to radio debug function\0A\00"
@__func__.add_usb_radio_debug_function = [29 x i8] c"add_usb_radio_debug_function\00"
@.str.1 = [4 x i8] c"adb\00"
@.str.2 = [8 x i8] c"mtp,adb\00"
@.str.3 = [35 x i8] c"diag,adb,serial,rmnet,mass_storage\00"
@.str.4 = [10 x i8] c"rndis,adb\00"
@.str.5 = [15 x i8] c"rndis,diag,adb\00"
define i8* @add_usb_radio_debug_function(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.add_usb_radio_debug_function, i64 0, i64 0))
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %0
br label %12
12: ; preds = %8, %1, %5
%13 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), %1 ], [ %11, %8 ]
ret i8* %13
}