#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, char *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
char *skip_block_comment(char *p) {
  char *ps = p - 2;
  if (!*p) {
    fprintf(stderr,
            "NXJSON PARSE ERROR (%d): "
            "endless comment"
            " at %s\n",
            192, ps);
    return 0;
  }
REPEAT:
  p = strchr(p + 1, '/');
  if (!p) {
    fprintf(stderr,
            "NXJSON PARSE ERROR (%d): "
            "endless comment"
            " at %s\n",
            198, ps);
    return 0;
  }
  if (p[-1] != '*')
    goto REPEAT;
  return p + 1;
}


x86 assembly (clang, -O0):
<skip_block_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1170 <skip_block_comment+0x50>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rcx
lea    0xea7(%rip),%rsi
mov    $0xc0,%edx
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    11e3 <skip_block_comment+0xc3>
jmp    1175 <skip_block_comment+0x55>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c1 <skip_block_comment+0xa1>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rcx
lea    0xe56(%rip),%rsi
mov    $0xc6,%edx
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    11e3 <skip_block_comment+0xc3>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x2a,%eax
je     11d7 <skip_block_comment+0xb7>
jmp    1175 <skip_block_comment+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_block_comment>:
push   %rbx
lea    -0x2(%rdi),%rbx
cmpb   $0x0,(%rdi)
je     1152 <skip_block_comment+0x32>
mov    %rdi,%rax
nopl   (%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1169 <skip_block_comment+0x49>
cmpb   $0x2a,-0x1(%rax)
jne    1130 <skip_block_comment+0x10>
add    $0x1,%rax
pop    %rbx
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0xc0,%edx
jmp    117e <skip_block_comment+0x5e>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
mov    $0xc6,%edx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"NXJSON PARSE ERROR (%d): endless comment at %s\0A\00"
define i8* @skip_block_comment(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 -2
store i8* %6, i8** %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 192, i8* %12)
store i8* null, i8** %2
br label %35
14: ; preds = %1
br label %15
15: ; preds = %31, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = call i8* @strchr(i8* %17, i8 signext 47)
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = icmp ne i8* %19, null
br i1 %20, label %25, label %21
21: ; preds = %15
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %4
%24 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 198, i8* %23)
store i8* null, i8** %2
br label %35
25: ; preds = %15
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 -1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 42
br i1 %30, label %31, label %32
31: ; preds = %25
br label %15
32: ; preds = %25
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %34, i8** %2
br label %35
35: ; preds = %32, %21, %10
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"NXJSON PARSE ERROR (%d): endless comment at %s\0A\00"
define i8* @skip_block_comment(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -2
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 192, i8* %2)
br label %22
8: ; preds = %1, %16
%9 = phi i8* [ %11, %16 ], [ %0, %1 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = tail call i8* @strchr(i8* %10, i8 signext 47)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 198, i8* %2)
br label %22
16: ; preds = %8
%17 = getelementptr inbounds i8, i8* %11, i64 -1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 42
br i1 %19, label %20, label %8
20: ; preds = %16
%21 = getelementptr inbounds i8, i8* %11, i64 1
br label %22
22: ; preds = %20, %13, %5
%23 = phi i8* [ %21, %20 ], [ null, %13 ], [ null, %5 ]
ret i8* %23
}