#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__ mls(int, int);
scalar_t__ parser_skip_whitespace(int, int *);
int parser_skip(int buf, int *p, int skip_char) {
  int c;
  if (parser_skip_whitespace(buf, p))
    return -1;
  c = (*(char *)mls((buf), (*p)));
  if (c == skip_char) {
    (*p)++;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<parser_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parser_skip_whitespace@plt>
cmp    $0x0,%rax
je     1154 <parser_skip+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <parser_skip+0x72>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <mls@plt>
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    118b <parser_skip+0x6b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1192 <parser_skip+0x72>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_skip>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <parser_skip_whitespace@plt>
mov    $0xffffffff,%r15d
test   %rax,%rax
jne    1156 <parser_skip+0x36>
mov    (%rbx),%esi
mov    %ebp,%edi
call   1040 <mls@plt>
movsbl (%rax),%eax
cmp    %r14d,%eax
jne    1156 <parser_skip+0x36>
addl   $0x1,(%rbx)
xor    %r15d,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parser_skip(i32 %0, i32* %1, i32 %2) {
%4 = tail call i64 @parser_skip_whitespace(i32 %0, i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = tail call i64 @mls(i32 %0, i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %16
16: ; preds = %6, %3, %13
%17 = phi i32 [ 0, %13 ], [ -1, %3 ], [ -1, %6 ]
ret i32 %17
}