#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 */
typedef int /*<<< orphan*/ end_comment;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *next_line(char *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, long *);
int /*<<< orphan*/ strncmp(char *, char const *, int);
void skip_region(char *line, FILE *in, long *plen, const char *end_comment) {
  do {
    long len;
    if (next_line(line, in, NULL, &len) == NULL)
      break;
    *plen += len;
  } while (!(((line)[0] == '%' && (line)[1] == '%') &&
             !strncmp(line, end_comment, sizeof(end_comment) - 1)));
}


x86 assembly (clang, -O0):
<skip_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x28(%rbp),%rcx
call   1040 <next_line@plt>
cmp    $0x0,%rax
jne    115c <skip_region+0x3c>
jmp    11bf <skip_region+0x9f>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x25,%ecx
mov    %al,-0x29(%rbp)
jne    11b2 <skip_region+0x92>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x25,%ecx
mov    %al,-0x29(%rbp)
jne    11b2 <skip_region+0x92>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <skip_region+0x18>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_region>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0x8(%rsp),%rcx
xor    %edx,%edx
call   1040 <next_line@plt>
test   %rax,%rax
je     119c <skip_region+0x7c>
lea    0x8(%rsp),%r13
jmp    1175 <skip_region+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r13,%rcx
call   1040 <next_line@plt>
test   %rax,%rax
je     119c <skip_region+0x7c>
mov    0x8(%rsp),%rax
add    %rax,(%r15)
cmpb   $0x25,(%rbx)
jne    1160 <skip_region+0x40>
cmpb   $0x25,0x1(%rbx)
jne    1160 <skip_region+0x40>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1160 <skip_region+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @skip_region(i8* %0, i32* %1, i64* nocapture %2, i8* %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = call i32* @next_line(i8* %0, i32* %1, i32* null, i64* %5)
%8 = icmp eq i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
br label %12
11: ; preds = %24, %4
br label %27
12: ; preds = %9, %24
%13 = load i64, i64* %5
%14 = load i64, i64* %2
%15 = add nsw i64 %14, %13
store i64 %15, i64* %2
%16 = load i8, i8* %0
%17 = icmp eq i8 %16, 37
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = load i8, i8* %10
%20 = icmp eq i8 %19, 37
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 @strncmp(i8* %0, i8* %3, i32 7)
%23 = icmp eq i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21, %18, %12
%25 = call i32* @next_line(i8* %0, i32* %1, i32* null, i64* %5)
%26 = icmp eq i32* %25, null
br i1 %26, label %11, label %12
27: ; preds = %21, %11
ret void
}