#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 */
char *look(char *, char *);
char *functs(char *p) {
  char *ptr;
  if ((ptr = look(p, "character")) != 0 || (ptr = look(p, "logical")) != 0 ||
      (ptr = look(p, "real")) != 0 || (ptr = look(p, "integer")) != 0 ||
      (ptr = look(p, "doubleprecision")) != 0 ||
      (ptr = look(p, "complex")) != 0 ||
      (ptr = look(p, "doublecomplex")) != 0) {
    while (*ptr == ' ' || *ptr == '\t' || *ptr == '*' ||
           (*ptr >= '0' && *ptr <= '9') || *ptr == '(' || *ptr == ')')
      ptr++;
    ptr = look(ptr, "function");
    return (ptr);
  } else
    return (0);
}


x86 assembly (clang, -O0):
<functs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ee <functs+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     12be <functs+0x1ae>
jmp    11f3 <functs+0xe3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
je     127c <functs+0x16c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x19(%rbp)
je     127c <functs+0x16c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x19(%rbp)
je     127c <functs+0x16c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1257 <functs+0x147>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x19(%rbp)
jle    127c <functs+0x16c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x28,%ecx
mov    %al,-0x19(%rbp)
je     127c <functs+0x16c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    128c <functs+0x17c>
jmp    129d <functs+0x18d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11f3 <functs+0xe3>
mov    -0x18(%rbp),%rdi
lea    0xd95(%rip),%rsi
call   1030 <look@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12c6 <functs+0x1b6>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functs>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
jne    119d <functs+0x8d>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <look@plt>
test   %rax,%rax
je     11e4 <functs+0xd4>
movabs $0x40100000200,%rcx
jmp    11b4 <functs+0xa4>
nopl   0x0(%rax)
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x2a,%rdx
ja     11c3 <functs+0xb3>
bt     %rdx,%rcx
jb     11b0 <functs+0xa0>
lea    -0x30(%rdx),%esi
and    $0xfe,%dl
cmp    $0xa,%sil
jb     11b0 <functs+0xa0>
cmp    $0x28,%dl
je     11b0 <functs+0xa0>
lea    0xe62(%rip),%rsi
mov    %rax,%rdi
pop    %rbx
jmp    1030 <look@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"character\00"
@.str.1 = [8 x i8] c"logical\00"
@.str.2 = [5 x i8] c"real\00"
@.str.3 = [8 x i8] c"integer\00"
@.str.4 = [16 x i8] c"doubleprecision\00"
@.str.5 = [8 x i8] c"complex\00"
@.str.6 = [14 x i8] c"doublecomplex\00"
@.str.7 = [9 x i8] c"function\00"
define i8* @functs(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @look(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %32, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @look(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %32, label %12
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = call i8* @look(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %14, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %32, label %16
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = call i8* @look(i8* %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i8* %18, i8** %4
%19 = icmp ne i8* %18, null
br i1 %19, label %32, label %20
20: ; preds = %16
%21 = load i8*, i8** %3
%22 = call i8* @look(i8* %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
store i8* %22, i8** %4
%23 = icmp ne i8* %22, null
br i1 %23, label %32, label %24
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = call i8* @look(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i8* %26, i8** %4
%27 = icmp ne i8* %26, null
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8*, i8** %3
%30 = call i8* @look(i8* %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
store i8* %30, i8** %4
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %77
32: ; preds = %28, %24, %20, %16, %12, %8, %1
br label %33
33: ; preds = %70, %32
%34 = load i8*, i8** %4
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 32
br i1 %37, label %68, label %38
38: ; preds = %33
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 9
br i1 %42, label %68, label %43
43: ; preds = %38
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 42
br i1 %47, label %68, label %48
48: ; preds = %43
%49 = load i8*, i8** %4
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp sge i32 %51, 48
br i1 %52, label %53, label %58
53: ; preds = %48
%54 = load i8*, i8** %4
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp sle i32 %56, 57
br i1 %57, label %68, label %58
58: ; preds = %53, %48
%59 = load i8*, i8** %4
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 40
br i1 %62, label %68, label %63
63: ; preds = %58
%64 = load i8*, i8** %4
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 41
br label %68
68: ; preds = %63, %58, %53, %43, %38, %33
%69 = phi i1 [ true, %58 ], [ true, %53 ], [ true, %43 ], [ true, %38 ], [ true, %33 ], [ %67, %63 ]
br i1 %69, label %70, label %73
70: ; preds = %68
%71 = load i8*, i8** %4
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %4
br label %33
73: ; preds = %68
%74 = load i8*, i8** %4
%75 = call i8* @look(i8* %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i8* %75, i8** %4
%76 = load i8*, i8** %4
store i8* %76, i8** %2
br label %78
77: ; preds = %28
store i8* null, i8** %2
br label %78
78: ; preds = %77, %73
%79 = load i8*, i8** %2
ret i8* %79
}

LLVM IR (-O2):
@.str = [10 x i8] c"character\00"
@.str.1 = [8 x i8] c"logical\00"
@.str.2 = [5 x i8] c"real\00"
@.str.3 = [8 x i8] c"integer\00"
@.str.4 = [16 x i8] c"doubleprecision\00"
@.str.5 = [8 x i8] c"complex\00"
@.str.6 = [14 x i8] c"doublecomplex\00"
@.str.7 = [9 x i8] c"function\00"
define i8* @functs(i8* %0) {
%2 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %22
4: ; preds = %1
%5 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = tail call i8* @look(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %37, label %22
22: ; preds = %19, %16, %13, %10, %7, %4, %1
%23 = phi i8* [ %20, %19 ], [ %17, %16 ], [ %14, %13 ], [ %11, %10 ], [ %8, %7 ], [ %5, %4 ], [ %2, %1 ]
br label %24
24: ; preds = %22, %33
%25 = phi i8* [ %34, %33 ], [ %23, %22 ]
%26 = load i8, i8* %25
switch i8 %26, label %27 [
i8 32, label %33
i8 9, label %33
i8 42, label %33
]
27: ; preds = %24
%28 = add i8 %26, -48
%29 = icmp ult i8 %28, 10
%30 = and i8 %26, -2
%31 = icmp eq i8 %30, 40
%32 = or i1 %29, %31
br i1 %32, label %33, label %35
33: ; preds = %27, %24, %24, %24
%34 = getelementptr inbounds i8, i8* %25, i64 1
br label %24
35: ; preds = %27
%36 = tail call i8* @look(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %37
37: ; preds = %19, %35
%38 = phi i8* [ %36, %35 ], [ null, %19 ]
ret i8* %38
}