#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
const char *c2bf_skip_comment(const char *code, int *numLine) {
  const char *c = code;
  while (*c) {
    if (*c == '\n') {
      if (numLine)
        (*numLine)++;
    } else if (*c == '*' && c[1] == '/') {
      return c + 2;
    }
    c++;
  }
  fprintf(stderr, "No ending C comment\n");
  return c;
}


x86 assembly (clang, -O0):
<c2bf_skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a8 <c2bf_skip_comment+0x98>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1160 <c2bf_skip_comment+0x50>
cmpq   $0x0,-0x18(%rbp)
je     115b <c2bf_skip_comment+0x4b>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1197 <c2bf_skip_comment+0x87>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1192 <c2bf_skip_comment+0x82>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    1192 <c2bf_skip_comment+0x82>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    11c5 <c2bf_skip_comment+0xb5>
jmp    1197 <c2bf_skip_comment+0x87>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <c2bf_skip_comment+0x18>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe48(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2bf_skip_comment>:
push   %rbx
mov    %rdi,%rbx
jmp    112a <c2bf_skip_comment+0x1a>
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x2f,0x1(%rbx)
je     114e <c2bf_skip_comment+0x3e>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1140 <c2bf_skip_comment+0x30>
cmp    $0x2a,%al
je     1120 <c2bf_skip_comment+0x10>
test   %al,%al
jne    1126 <c2bf_skip_comment+0x16>
jmp    1154 <c2bf_skip_comment+0x44>
nopl   0x0(%rax,%rax,1)
test   %rsi,%rsi
je     1126 <c2bf_skip_comment+0x16>
addl   $0x1,(%rsi)
add    $0x1,%rbx
jmp    112a <c2bf_skip_comment+0x1a>
add    $0x2,%rbx
jmp    1169 <c2bf_skip_comment+0x59>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"No ending C comment\0A\00"
define i8* @c2bf_skip_comment(i8* %0, i32* %1) {
%3 = icmp eq i32* %1, null
br label %4
4: ; preds = %17, %2
%5 = phi i8* [ %0, %2 ], [ %18, %17 ]
%6 = load i8, i8* %5
switch i8 %6, label %17 [
i8 0, label %19
i8 10, label %7
i8 42, label %11
]
7: ; preds = %4
br i1 %3, label %17, label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %17
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %5, i64 2
br label %22
17: ; preds = %4, %11, %7, %8
%18 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
19: ; preds = %4
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %19, %15
%23 = phi i8* [ %16, %15 ], [ %5, %19 ]
ret i8* %23
}