#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*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void skip_past_char(FILE *is, char c) {
  int curr, count;
  for (curr = fgetc(is), count = 0;
       (curr != c || count % 2 != 0) && curr != EOF; curr = fgetc(is)) {
    if (curr == '\\') {
      count++;
    } else {
      count = 0;
    }
  }
}


x86 assembly (clang, -O0):
<skip_past_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    115d <skip_past_char+0x4d>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x15(%rbp)
je     116f <skip_past_char+0x5f>
mov    -0x10(%rbp),%eax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    117f <skip_past_char+0x6f>
jmp    11b4 <skip_past_char+0xa4>
cmpl   $0x5c,-0x10(%rbp)
jne    1197 <skip_past_char+0x87>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119e <skip_past_char+0x8e>
movl   $0x0,-0x14(%rbp)
jmp    11a3 <skip_past_char+0x93>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
jmp    1135 <skip_past_char+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_past_char>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %rdi,%rbx
call   1030 <fgetc@plt>
cmp    %r12d,%eax
je     1165 <skip_past_char+0x55>
mov    0x2eb9(%rip),%r14
cmp    (%r14),%eax
je     1165 <skip_past_char+0x55>
xor    %r15d,%r15d
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x5c,%eax
cmovne %r15d,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
xor    %r12d,%ecx
mov    %ebp,%edx
and    $0x1,%edx
or     %ecx,%edx
je     1165 <skip_past_char+0x55>
cmp    (%r14),%eax
jne    1140 <skip_past_char+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_past_char(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i8 %1, i8* %4
%7 = load i32*, i32** %3
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %32, %2
%10 = load i32, i32* %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = load i32, i32* %6
%16 = srem i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14, %9
%19 = load i32, i32* %5
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br i1 %23, label %24, label %35
24: ; preds = %22
%25 = load i32, i32* %5
%26 = icmp eq i32 %25, 92
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %31
30: ; preds = %24
store i32 0, i32* %6
br label %31
31: ; preds = %30, %27
br label %32
32: ; preds = %31
%33 = load i32*, i32** %3
%34 = call i32 @fgetc(i32* %33)
store i32 %34, i32* %5
br label %9
35: ; preds = %22
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_past_char(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = sext i8 %1 to i32
%5 = icmp eq i32 %3, %4
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %3, %6
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %23, label %9
9: ; preds = %2, %9
%10 = phi i32 [ %14, %9 ], [ 0, %2 ]
%11 = phi i32 [ %15, %9 ], [ %3, %2 ]
%12 = icmp eq i32 %11, 92
%13 = add nsw i32 %10, 1
%14 = select i1 %12, i32 %13, i32 0
%15 = tail call i32 @fgetc(i32* %0)
%16 = icmp eq i32 %15, %4
%17 = and i32 %14, 1
%18 = icmp eq i32 %17, 0
%19 = select i1 %16, i1 %18, i1 false
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %15, %20
%22 = select i1 %19, i1 true, i1 %21
br i1 %22, label %23, label %9
23: ; preds = %9, %2
ret void
}