#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 uint_fast8_t;
struct syntree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_error(char *, uintptr_t, char *);
int /*<<< orphan*/ parse_impl(char *, uintptr_t, int /*<<< orphan*/,
                              struct syntree **);
struct syntree *parse(char *re, uintptr_t len) {
  uintptr_t i;
  for (i = 0; i < len; ++i) {
    if ((uint_fast8_t)re[i] > 127) {
      parse_error(re, i, "Non-ASCII character");
    }
  }
  struct syntree *res;
  parse_impl(re, len, 0, &res);
  return res;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1185 <parse+0x65>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7f,%eax
jle    116f <parse+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe96(%rip),%rdx
call   1040 <parse_error@plt>
jmp    1174 <parse+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <parse+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
lea    -0x20(%rbp),%rcx
call   1030 <parse_impl@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rax
mov    %rsp,%rcx
xor    %edx,%edx
call   1030 <parse_impl@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.syntree = type { i32 }
@.str = [20 x i8] c"Non-ASCII character\00"
define %struct.syntree* @parse(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.syntree*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %7
7: ; preds = %23, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sgt i32 %16, 127
br i1 %17, label %18, label %22
18: ; preds = %11
%19 = load i8*, i8** %3
%20 = load i64, i64* %5
%21 = call i32 @parse_error(i8* %19, i64 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %18, %11
br label %23
23: ; preds = %22
%24 = load i64, i64* %5
%25 = add i64 %24, 1
store i64 %25, i64* %5
br label %7
26: ; preds = %7
%27 = load i8*, i8** %3
%28 = load i64, i64* %4
%29 = call i32 @parse_impl(i8* %27, i64 %28, i32 0, %struct.syntree** %6)
%30 = load %struct.syntree*, %struct.syntree** %6
ret %struct.syntree* %30
}

LLVM IR (-O2):
%struct.syntree = type { i32 }
define %struct.syntree* @parse(i8* %0, i64 %1) {
%3 = alloca %struct.syntree*
%4 = bitcast %struct.syntree** %3 to i8*
%5 = call i32 @parse_impl(i8* %0, i64 %1, i32 0, %struct.syntree** %3)
%6 = load %struct.syntree*, %struct.syntree** %3
ret %struct.syntree* %6
}