#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*/ syntax(char *);
char *scan_known(char *from, char *kn) {
  while (*from && *from <= ' ')
    from++;
  while (*kn && *kn++ == *from)
    from++;
  if (*kn)
    syntax(from);
  return from;
}


x86 assembly (clang, -O0):
<scan_known>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1145 <scan_known+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <scan_known+0x45>
jmp    1166 <scan_known+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <scan_known+0x10>
jmp    116b <scan_known+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     11a1 <scan_known+0x91>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11b1 <scan_known+0xa1>
jmp    11c2 <scan_known+0xb2>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116b <scan_known+0x5b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11d8 <scan_known+0xc8>
mov    -0x8(%rbp),%rdi
call   1030 <syntax@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_known>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112f <scan_known+0x1f>
cmp    $0x21,%al
jl     1120 <scan_known+0x10>
mov    (%rsi),%cl
lea    -0x1(%rdi),%rbx
test   %cl,%cl
je     117c <scan_known+0x6c>
add    $0x1,%rsi
cmp    %al,%cl
jne    116a <scan_known+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsi),%eax
test   %al,%al
je     1179 <scan_known+0x69>
add    $0x1,%rsi
lea    0x1(%rdi),%rbx
cmp    (%rdi),%al
mov    %rbx,%rdi
je     1150 <scan_known+0x40>
add    $0xffffffffffffffff,%rbx
cmpb   $0x0,(%rsi)
je     117c <scan_known+0x6c>
mov    %rbx,%rdi
call   1030 <syntax@plt>
jmp    117c <scan_known+0x6c>
mov    %rdi,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @scan_known(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 32
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %15
br label %21
21: ; preds = %37, %20
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
%29 = load i8, i8* %27
%30 = sext i8 %29 to i32
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %30, %33
br label %35
35: ; preds = %26, %21
%36 = phi i1 [ false, %21 ], [ %34, %26 ]
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
br label %21
40: ; preds = %35
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = icmp ne i8 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i8*, i8** %3
%46 = call i32 @syntax(i8* %45)
br label %47
47: ; preds = %44, %40
%48 = load i8*, i8** %3
ret i8* %48
}

LLVM IR (-O2):
define i8* @scan_known(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = icmp slt i8 %5, 33
%8 = and i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %3, label %10
10: ; preds = %3
%11 = load i8, i8* %1
%12 = icmp eq i8 %11, 0
br i1 %12, label %33, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %1, i64 1
%15 = icmp eq i8 %11, %5
br i1 %15, label %16, label %26
16: ; preds = %13, %22
%17 = phi i8* [ %24, %22 ], [ %14, %13 ]
%18 = phi i8* [ %19, %22 ], [ %4, %13 ]
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %17
%21 = icmp eq i8 %20, 0
br i1 %21, label %33, label %22
22: ; preds = %16
%23 = load i8, i8* %19
%24 = getelementptr inbounds i8, i8* %17, i64 1
%25 = icmp eq i8 %20, %23
br i1 %25, label %16, label %26
26: ; preds = %22, %13
%27 = phi i8* [ %4, %13 ], [ %19, %22 ]
%28 = phi i8* [ %14, %13 ], [ %24, %22 ]
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %26
%32 = tail call i32 @syntax(i8* %27)
br label %33
33: ; preds = %16, %10, %31, %26
%34 = phi i8* [ %27, %31 ], [ %27, %26 ], [ %4, %10 ], [ %19, %16 ]
ret i8* %34
}