#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*/ USB_INFO(char *, char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
const char *add_usb_radio_debug_function(const char *buff) {
  if (!strcmp(buff, "mtp,adb,mass_storage"))
    return "mtp,adb,mass_storage,diag,modem,rmnet";
  else if (!strcmp(buff, "mtp,adb,mass_storage,acm"))
    return "mtp,adb,mass_storage,diag,modem,rmnet";
  else if (!strcmp(buff, "mtp,mass_storage"))
    return "mtp,mass_storage,diag,modem,rmnet";
  else if (!strcmp(buff, "mtp,mass_storage,acm"))
    return "mtp,mass_storage,diag,modem,rmnet";
  else if (!strcmp(buff, "ffs,acm"))
    return "adb,diag,modem,acm";
  USB_INFO("switch to radio debug function:%s\n", buff);
  return buff;
}


x86 assembly (clang, -O0):
<add_usb_radio_debug_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1155 <add_usb_radio_debug_function+0x35>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1225 <add_usb_radio_debug_function+0x105>
mov    -0x10(%rbp),%rdi
lea    0xedb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    117e <add_usb_radio_debug_function+0x5e>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1225 <add_usb_radio_debug_function+0x105>
mov    -0x10(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11a7 <add_usb_radio_debug_function+0x87>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1225 <add_usb_radio_debug_function+0x105>
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11d0 <add_usb_radio_debug_function+0xb0>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1225 <add_usb_radio_debug_function+0x105>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11f9 <add_usb_radio_debug_function+0xd9>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1225 <add_usb_radio_debug_function+0x105>
jmp    11fe <add_usb_radio_debug_function+0xde>
jmp    1203 <add_usb_radio_debug_function+0xe3>
jmp    1208 <add_usb_radio_debug_function+0xe8>
jmp    120d <add_usb_radio_debug_function+0xed>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <USB_INFO@plt>
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,%rbx
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
lea    0xedb(%rip),%r14
test   %eax,%eax
je     11ac <add_usb_radio_debug_function+0x8c>
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11ac <add_usb_radio_debug_function+0x8c>
lea    0xefc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
lea    0xefe(%rip),%r14
test   %eax,%eax
je     11ac <add_usb_radio_debug_function+0x8c>
lea    0xf15(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11ac <add_usb_radio_debug_function+0x8c>
lea    0xf17(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a5 <add_usb_radio_debug_function+0x85>
lea    0xf1f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <USB_INFO@plt>
mov    %rbx,%r14
jmp    11ac <add_usb_radio_debug_function+0x8c>
lea    0xef8(%rip),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"mtp,adb,mass_storage\00"
@.str.1 = [38 x i8] c"mtp,adb,mass_storage,diag,modem,rmnet\00"
@.str.2 = [25 x i8] c"mtp,adb,mass_storage,acm\00"
@.str.3 = [17 x i8] c"mtp,mass_storage\00"
@.str.4 = [34 x i8] c"mtp,mass_storage,diag,modem,rmnet\00"
@.str.5 = [21 x i8] c"mtp,mass_storage,acm\00"
@.str.6 = [8 x i8] c"ffs,acm\00"
@.str.7 = [19 x i8] c"adb,diag,modem,acm\00"
@.str.8 = [35 x i8] c"switch to radio debug function:%s\0A\00"
define i8* @add_usb_radio_debug_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %36
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %36
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %36
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %36
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %36
28: ; preds = %23
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
%33 = load i8*, i8** %3
%34 = call i32 @USB_INFO(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* %33)
%35 = load i8*, i8** %3
store i8* %35, i8** %2
br label %36
36: ; preds = %32, %27, %22, %17, %12, %7
%37 = load i8*, i8** %2
ret i8* %37
}

LLVM IR (-O2):
@.str = [21 x i8] c"mtp,adb,mass_storage\00"
@.str.1 = [38 x i8] c"mtp,adb,mass_storage,diag,modem,rmnet\00"
@.str.2 = [25 x i8] c"mtp,adb,mass_storage,acm\00"
@.str.3 = [17 x i8] c"mtp,mass_storage\00"
@.str.4 = [34 x i8] c"mtp,mass_storage,diag,modem,rmnet\00"
@.str.5 = [21 x i8] c"mtp,mass_storage,acm\00"
@.str.6 = [8 x i8] c"ffs,acm\00"
@.str.7 = [19 x i8] c"adb,diag,modem,acm\00"
@.str.8 = [35 x i8] c"switch to radio debug function:%s\0A\00"
define i8* @add_usb_radio_debug_function(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(25) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @USB_INFO(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* %0)
br label %18
18: ; preds = %13, %10, %7, %4, %1, %16
%19 = phi i8* [ %0, %16 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), %10 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), %13 ]
ret i8* %19
}