void noCommentPlease(char *str) {
  int strLength = strlen(str);
  if ((str[0] == '/') && (str[1] == '*') && (str[strLength - 1] == '/') &&
      (str[strLength - 2] == '*')) {
    *str = "";
  }
}


x86 assembly (clang, -O0):
<noCommentPlease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    118a <noCommentPlease+0x7a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2a,%eax
jne    118a <noCommentPlease+0x7a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    118a <noCommentPlease+0x7a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    118a <noCommentPlease+0x7a>
mov    -0x8(%rbp),%rax
lea    0xe78(%rip),%rcx
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noCommentPlease>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0x2f,(%rbx)
jne    115f <noCommentPlease+0x4f>
cmpb   $0x2a,0x1(%rbx)
jne    115f <noCommentPlease+0x4f>
shl    $0x20,%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
add    %rax,%rcx
sar    $0x20,%rcx
cmpb   $0x2f,(%rbx,%rcx,1)
jne    115f <noCommentPlease+0x4f>
movabs $0xfffffffe00000000,%rcx
ff ff ff
add    %rcx,%rax
sar    $0x20,%rax
cmpb   $0x2a,(%rbx,%rax,1)
jne    115f <noCommentPlease+0x4f>
lea    0xea3(%rip),%rax
mov    %al,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @noCommentPlease(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 47
br i1 %4, label %5, label %23
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 42
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = shl i64 %2, 32
%11 = add i64 %10, -4294967296
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 47
br i1 %15, label %16, label %23
16: ; preds = %9
%17 = add i64 %10, -8589934592
%18 = ashr exact i64 %17, 32
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 42
br i1 %21, label %22, label %23
22: ; preds = %16
store i8 ptrtoint ([1 x i8]* @.str to i8), i8* %0
br label %23
23: ; preds = %22, %16, %9, %5, %1
ret void
}