char *cleanup_base_class_name(name)
char *name;
{
  char temp_name[80];
  unsigned long i = 0;
  for (; '[' == name[i]; i++) {
  }
  if (0 != i) {
    if ('L' == name[i]) {
      strcpy(temp_name, name + i + 1);
      temp_name[strlen(temp_name) - 1] = '\0';
      strcpy(name, temp_name);
    }
  }
  return (name);
}


x86 assembly (clang, -O0):
<cleanup_base_class_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x5b,%eax
cmp    %ecx,%eax
jne    1163 <cleanup_base_class_name+0x43>
jmp    1152 <cleanup_base_class_name+0x32>
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    1134 <cleanup_base_class_name+0x14>
xor    %eax,%eax
cmp    -0x68(%rbp),%rax
je     11c1 <cleanup_base_class_name+0xa1>
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x4c,%eax
cmp    %ecx,%eax
jne    11bc <cleanup_base_class_name+0x9c>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x68(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%rax
movb   $0x0,-0x60(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11c1 <cleanup_base_class_name+0xa1>
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_base_class_name>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
xor    %esi,%esi
nopl   0x0(%rax)
movzbl (%rbx,%rsi,1),%eax
add    $0x1,%rsi
cmp    $0x5b,%al
je     1130 <cleanup_base_class_name+0x10>
cmp    $0x1,%rsi
je     116d <cleanup_base_class_name+0x4d>
cmp    $0x4c,%al
jne    116d <cleanup_base_class_name+0x4d>
add    %rbx,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movb   $0x0,-0x1(%rax,%r14,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cleanup_base_class_name(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 91, %10
br i1 %11, label %12, label %16
12: ; preds = %5
br label %13
13: ; preds = %12
%14 = load i64, i64* %4
%15 = add i64 %14, 1
store i64 %15, i64* %4
br label %5
16: ; preds = %5
%17 = load i64, i64* %4
%18 = icmp ne i64 0, %17
br i1 %18, label %19, label %41
19: ; preds = %16
%20 = load i8*, i8** %2
%21 = load i64, i64* %4
%22 = getelementptr inbounds i8, i8* %20, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 76, %24
br i1 %25, label %26, label %40
26: ; preds = %19
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%28 = load i8*, i8** %2
%29 = load i64, i64* %4
%30 = getelementptr inbounds i8, i8* %28, i64 %29
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = call i8* @strcpy(i8* %27, i8* %31)
%33 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%34 = call i64 @strlen(i8* %33)
%35 = sub i64 %34, 1
%36 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %35
store i8 0, i8* %36
%37 = load i8*, i8** %2
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%39 = call i8* @strcpy(i8* %37, i8* %38)
br label %40
40: ; preds = %26, %19
br label %41
41: ; preds = %40, %16
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
define i8* @cleanup_base_class_name(i8* returned %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 91
%9 = add i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = icmp ne i64 %5, 0
%12 = icmp eq i8 %7, 76
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %0, i64 %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i8* @strcpy(i8* %3, i8* %16)
%18 = call i64 @strlen(i8* %3)
%19 = add i64 %18, -1
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %19
store i8 0, i8* %20
%21 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %3)
br label %22
22: ; preds = %14, %10
ret i8* %0
}