void SkipComments(ptr) char **ptr;
{
  if ((**ptr == '/') && (*(*ptr + 1) == '*')) {
    while (**ptr != '\0' && strncmp(*ptr, "*/", 2) != 0)
      (*ptr)++;
    if (**ptr != '\0')
      (*ptr) += 2;
  }
}


x86 assembly (clang, -O0):
<SkipComments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    11ca <SkipComments+0xba>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2a,%eax
jne    11ca <SkipComments+0xba>
jmp    1148 <SkipComments+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1181 <SkipComments+0x71>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe92(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1191 <SkipComments+0x81>
jmp    11a4 <SkipComments+0x94>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1148 <SkipComments+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c5 <SkipComments+0xb5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
jmp    11ca <SkipComments+0xba>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipComments>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rbx
cmpb   $0x2f,(%rbx)
jne    116a <SkipComments+0x5a>
cmpb   $0x2a,0x1(%rbx)
jne    116a <SkipComments+0x5a>
mov    %rdi,%r15
add    $0x1,%rbx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%rdi
mov    $0x2,%edx
mov    %r14,%rsi
call   1030 <strncmp@plt>
test   %eax,%eax
je     1163 <SkipComments+0x53>
mov    %rbx,(%r15)
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <SkipComments+0x30>
jmp    116a <SkipComments+0x5a>
add    $0x1,%rbx
mov    %rbx,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"*/\00"
define void @SkipComments(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %8, label %44
8: ; preds = %1
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %15, label %44
15: ; preds = %8
br label %16
16: ; preds = %29, %15
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = load i8**, i8*** %2
%24 = load i8*, i8** %23
%25 = call i32 @strncmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %22, %16
%28 = phi i1 [ false, %16 ], [ %26, %22 ]
br i1 %28, label %29, label %33
29: ; preds = %27
%30 = load i8**, i8*** %2
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %30
br label %16
33: ; preds = %27
%34 = load i8**, i8*** %2
%35 = load i8*, i8** %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %33
%40 = load i8**, i8*** %2
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 2
store i8* %42, i8** %40
br label %43
43: ; preds = %39, %33
br label %44
44: ; preds = %43, %8, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"*/\00"
define void @SkipComments(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 47
br i1 %4, label %5, label %19
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 42
br i1 %8, label %9, label %19
9: ; preds = %5, %13
%10 = phi i8* [ %14, %13 ], [ %2, %5 ]
%11 = tail call i32 @strncmp(i8* %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %19, label %9
17: ; preds = %9
%18 = getelementptr inbounds i8, i8* %10, i64 2
store i8* %18, i8** %0
br label %19
19: ; preds = %13, %17, %5, %1
ret void
}