#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int read_char(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void check_next_char(FILE *rfile, int c) {
  int n;
  while ((n = read_char(rfile)) == ' ')
    ;
  if (n == '{' && c == '[')
    return;
  if (n == '}' && c == ']')
    return;
  if (n != c) {
    fprintf(stderr, "#Input error: \'%c\' expected (not %c).\n", c, n);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read_char@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x20,%eax
jne    1159 <check_next_char+0x29>
jmp    113f <check_next_char+0xf>
cmpl   $0x7b,-0x10(%rbp)
jne    1172 <check_next_char+0x42>
cmpl   $0x5b,-0xc(%rbp)
jne    1172 <check_next_char+0x42>
jmp    11bc <check_next_char+0x8c>
cmpl   $0x7d,-0x10(%rbp)
jne    118b <check_next_char+0x5b>
cmpl   $0x5d,-0xc(%rbp)
jne    118b <check_next_char+0x5b>
jmp    11bc <check_next_char+0x8c>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11bc <check_next_char+0x8c>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe53(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_next_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <read_char@plt>
cmp    $0x20,%eax
je     1140 <check_next_char+0x10>
cmp    $0x5b,%ebp
jne    1157 <check_next_char+0x27>
cmp    $0x7b,%eax
je     116e <check_next_char+0x3e>
mov    %eax,%ecx
xor    $0x7d,%ecx
mov    %ebp,%edx
xor    $0x5d,%edx
or     %ecx,%edx
sete   %cl
cmp    %ebp,%eax
je     116e <check_next_char+0x3e>
test   %cl,%cl
je     1175 <check_next_char+0x45>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e64(%rip),%rcx
mov    (%rcx),%edi
lea    0xe7b(%rip),%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"#Input error: '%c' expected (not %c).\0A\00"
define void @check_next_char(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %10, %2
%7 = load i32*, i32** %3
%8 = call i32 @read_char(i32* %7)
store i32 %8, i32* %5
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 123
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 91
br i1 %16, label %17, label %18
17: ; preds = %14
br label %35
18: ; preds = %14, %11
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 125
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 93
br i1 %23, label %24, label %25
24: ; preds = %21
br label %35
25: ; preds = %21, %18
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load i32, i32* @stderr
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %32)
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %17, %24, %25
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"#Input error: '%c' expected (not %c).\0A\00"
define void @check_next_char(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @read_char(i32* %0)
%5 = icmp eq i32 %4, 32
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = icmp eq i32 %4, 123
%8 = icmp eq i32 %1, 91
%9 = and i1 %8, %7
br i1 %9, label %20, label %10
10: ; preds = %6
%11 = icmp eq i32 %4, 125
%12 = icmp eq i32 %1, 93
%13 = and i1 %12, %11
%14 = icmp eq i32 %4, %1
%15 = or i1 %14, %13
br i1 %15, label %20, label %16
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %10, %6
ret void
}