#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__ chmatch(char, char *);
int skipchars(char **p, char *chars) {
  while (chmatch(**p, chars))
    (*p)++;
  if (**p == '\r' || **p == '\n')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<skipchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <chmatch@plt>
cmp    $0x0,%rax
je     1152 <skipchars+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1120 <skipchars+0x10>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1178 <skipchars+0x68>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1184 <skipchars+0x74>
movl   $0x0,-0x4(%rbp)
jmp    118b <skipchars+0x7b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipchars>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <chmatch@plt>
test   %rax,%rax
je     113d <skipchars+0x2d>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
mov    %r14,%rsi
jmp    1120 <skipchars+0x10>
mov    (%rbx),%rax
mov    (%rax),%al
cmp    $0xd,%al
setne  %cl
cmp    $0xa,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @skipchars(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = tail call i64 @chmatch(i8 signext %4, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = tail call i64 @chmatch(i8 signext %10, i8* %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = load i8*, i8** %0
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 13
%17 = icmp ne i8 %15, 10
%18 = and i1 %16, %17
%19 = zext i1 %18 to i32
ret i32 %19
}