#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 */
int /*<<< orphan*/ disp_error_message(char *, unsigned char *);
int /*<<< orphan*/ exit(int);
unsigned char *parse_subexpr(unsigned char *, int);
unsigned char *parse_expr(unsigned char *p) {
  switch (*p) {
  case ')':
  case ';':
  case ':':
  case '[':
  case ']':
  case '}':
    disp_error_message("unexpected char", p);
    exit(1);
  }
  p = parse_subexpr(p, -1);
  return p;
}


x86 assembly (clang, -O0):
<parse_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x29,%eax
je     119b <parse_expr+0x6b>
jmp    1154 <parse_expr+0x24>
mov    -0xc(%rbp),%eax
add    $0xffffffc6,%eax
sub    $0x2,%eax
jb     119b <parse_expr+0x6b>
jmp    1168 <parse_expr+0x38>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     119b <parse_expr+0x6b>
jmp    1179 <parse_expr+0x49>
mov    -0xc(%rbp),%eax
sub    $0x5d,%eax
je     119b <parse_expr+0x6b>
jmp    118a <parse_expr+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x7d,%eax
jne    11b5 <parse_expr+0x85>
jmp    119b <parse_expr+0x6b>
mov    -0x8(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1030 <disp_error_message@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1040 <parse_subexpr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_expr>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%al
lea    -0x29(%rax),%ecx
cmp    $0x34,%cl
ja     1151 <parse_expr+0x21>
movzbl %cl,%ecx
movabs $0x14000000060001,%rdx
bt     %rcx,%rdx
jb     1163 <parse_expr+0x33>
cmp    $0x7d,%al
je     1163 <parse_expr+0x33>
mov    %rsi,%rdi
mov    $0xffffffff,%esi
pop    %rax
jmp    1040 <parse_subexpr@plt>
lea    0xe96(%rip),%rdi
call   1030 <disp_error_message@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"unexpected char\00"
define i8* @parse_expr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 41, label %6
i32 59, label %6
i32 58, label %6
i32 91, label %6
i32 93, label %6
i32 125, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
%7 = load i8*, i8** %2
%8 = call i32 @disp_error_message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i8* @parse_subexpr(i8* %11, i32 -1)
store i8* %12, i8** %2
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"unexpected char\00"
define i8* @parse_expr(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 41, label %3
i8 59, label %3
i8 58, label %3
i8 91, label %3
i8 93, label %3
i8 125, label %3
]
3: ; preds = %1, %1, %1, %1, %1, %1
%4 = tail call i32 @disp_error_message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i8* @parse_subexpr(i8* %0, i32 -1)
ret i8* %7
}