#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 */
scalar_t__ isspace(char);
char *skipComment(char *ptr, char *end) {
  char *p = ptr;
  while (p < end && (isspace(*p) || *p == '/' || *p == '*'))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1184 <skipComment+0x74>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
jne    117e <skipComment+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x1a(%rbp)
je     117e <skipComment+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1194 <skipComment+0x84>
jmp    11a5 <skipComment+0x95>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <skipComment+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipComment>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
jae    1157 <skipComment+0x47>
mov    %rsi,%r14
mov    %rsi,%r15
sub    %rbx,%r15
jmp    113a <skipComment+0x2a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
je     1154 <skipComment+0x44>
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <skipComment+0x20>
movzbl (%rbx),%eax
cmp    $0x2f,%al
je     1130 <skipComment+0x20>
cmp    $0x2a,%al
je     1130 <skipComment+0x20>
jmp    1157 <skipComment+0x47>
mov    %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @skipComment(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %28
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = call i64 @isspace(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 47
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 42
br label %26
26: ; preds = %21, %16, %11
%27 = phi i1 [ true, %16 ], [ true, %11 ], [ %25, %21 ]
br label %28
28: ; preds = %26, %7
%29 = phi i1 [ false, %7 ], [ %27, %26 ]
br i1 %29, label %30, label %33
30: ; preds = %28
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %5
br label %7
33: ; preds = %28
%34 = load i8*, i8** %5
ret i8* %34
}

LLVM IR (-O2):
define i8* @skipComment(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %16
%10 = phi i8* [ %17, %16 ], [ %0, %4 ]
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8, i8* %10
switch i8 %15, label %19 [
i8 47, label %16
i8 42, label %16
]
16: ; preds = %14, %14, %9
%17 = getelementptr inbounds i8, i8* %10, i64 1
%18 = icmp eq i8* %17, %8
br i1 %18, label %19, label %9
19: ; preds = %16, %14, %2
%20 = phi i8* [ %0, %2 ], [ %10, %14 ], [ %8, %16 ]
ret i8* %20
}