#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 uint8_t;
typedef size_t int32_t;

/* Variables and functions */
size_t wrdcmp(char *, char *);
bool pa_keyword(char *ident, uint8_t lf, uint8_t rf) {
  static char *key[] = {"break", "case",  "cont",   "default", "do",   "else",
                        "false", "float", "for",    "func",    "if",   "int",
                        "null",  "prec",  "sortie", "switch",  "true", "while"};
  int32_t ave = (lf + rf) / 2, rel = wrdcmp(key[ave], ident);
  if (!rel)
    return true;
  else if (lf == rf)
    return false;
  else if (ave == lf || ave == rf)
    return false;
  else if (rel == 1)
    return pa_keyword(ident, lf, ave);
  else
    return pa_keyword(ident, ave, rf);
}


x86 assembly (clang, -O0):
<pa_keyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
lea    0x2eef(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wrdcmp@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1179 <pa_keyword+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11f9 <pa_keyword+0xd9>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1191 <pa_keyword+0x71>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <pa_keyword+0xd9>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
je     11b3 <pa_keyword+0x93>
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmp    %rcx,%rax
jne    11bf <pa_keyword+0x9f>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <pa_keyword+0xd9>
cmpq   $0x1,-0x28(%rbp)
jne    11e4 <pa_keyword+0xc4>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
call   1040 <pa_keyword@plt>
mov    %eax,-0x4(%rbp)
jmp    11f9 <pa_keyword+0xd9>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%edx
call   1040 <pa_keyword@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_keyword>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r14
lea    (%r15,%rbx,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
lea    0x2c59(%rip),%r12
jmp    1152 <pa_keyword+0x42>
nopl   0x0(%rax)
mov    %ebp,%ebx
lea    (%r15,%rbx,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
mov    (%r12,%rax,8),%rdi
mov    %r14,%rsi
call   1030 <wrdcmp@plt>
test   %rax,%rax
je     117e <pa_keyword+0x6e>
xor    %ecx,%ecx
cmp    %r15d,%ebx
je     1183 <pa_keyword+0x73>
cmp    %ebx,%ebp
je     1183 <pa_keyword+0x73>
cmp    %r15d,%ebp
je     1183 <pa_keyword+0x73>
cmp    $0x1,%rax
jne    1140 <pa_keyword+0x30>
mov    %ebp,%r15d
jmp    1142 <pa_keyword+0x32>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@pa_keyword.key = internal global [18 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0)]
@.str = [6 x i8] c"break\00"
@.str.1 = [5 x i8] c"case\00"
@.str.2 = [5 x i8] c"cont\00"
@.str.3 = [8 x i8] c"default\00"
@.str.4 = [3 x i8] c"do\00"
@.str.5 = [5 x i8] c"else\00"
@.str.6 = [6 x i8] c"false\00"
@.str.7 = [6 x i8] c"float\00"
@.str.8 = [4 x i8] c"for\00"
@.str.9 = [5 x i8] c"func\00"
@.str.10 = [3 x i8] c"if\00"
@.str.11 = [4 x i8] c"int\00"
@.str.12 = [5 x i8] c"null\00"
@.str.13 = [5 x i8] c"prec\00"
@.str.14 = [7 x i8] c"sortie\00"
@.str.15 = [7 x i8] c"switch\00"
@.str.16 = [5 x i8] c"true\00"
@.str.17 = [6 x i8] c"while\00"
define i32 @pa_keyword(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
%13 = sdiv i32 %12, 2
%14 = sext i32 %13 to i64
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = getelementptr inbounds [18 x i8*], [18 x i8*]* @pa_keyword.key, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = load i8*, i8** %5
%19 = call i64 @wrdcmp(i8* %17, i8* %18)
store i64 %19, i64* %9
%20 = load i64, i64* %9
%21 = icmp ne i64 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %3
store i32 1, i32* %4
br label %54
23: ; preds = %3
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 0, i32* %4
br label %54
28: ; preds = %23
%29 = load i64, i64* %8
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = icmp eq i64 %29, %31
br i1 %32, label %38, label %33
33: ; preds = %28
%34 = load i64, i64* %8
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = icmp eq i64 %34, %36
br i1 %37, label %38, label %39
38: ; preds = %33, %28
store i32 0, i32* %4
br label %54
39: ; preds = %33
%40 = load i64, i64* %9
%41 = icmp eq i64 %40, 1
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load i8*, i8** %5
%44 = load i32, i32* %6
%45 = load i64, i64* %8
%46 = trunc i64 %45 to i32
%47 = call i32 @pa_keyword(i8* %43, i32 %44, i32 %46)
store i32 %47, i32* %4
br label %54
48: ; preds = %39
%49 = load i8*, i8** %5
%50 = load i64, i64* %8
%51 = trunc i64 %50 to i32
%52 = load i32, i32* %7
%53 = call i32 @pa_keyword(i8* %49, i32 %51, i32 %52)
store i32 %53, i32* %4
br label %54
54: ; preds = %48, %42, %38, %27, %22
%55 = load i32, i32* %4
ret i32 %55
}

LLVM IR (-O2):
@pa_keyword.key = internal unnamed_addr constant [18 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0)]
@.str = [6 x i8] c"break\00"
@.str.1 = [5 x i8] c"case\00"
@.str.2 = [5 x i8] c"cont\00"
@.str.3 = [8 x i8] c"default\00"
@.str.4 = [3 x i8] c"do\00"
@.str.5 = [5 x i8] c"else\00"
@.str.6 = [6 x i8] c"false\00"
@.str.7 = [6 x i8] c"float\00"
@.str.8 = [4 x i8] c"for\00"
@.str.9 = [5 x i8] c"func\00"
@.str.10 = [3 x i8] c"if\00"
@.str.11 = [4 x i8] c"int\00"
@.str.12 = [5 x i8] c"null\00"
@.str.13 = [5 x i8] c"prec\00"
@.str.14 = [7 x i8] c"sortie\00"
@.str.15 = [7 x i8] c"switch\00"
@.str.16 = [5 x i8] c"true\00"
@.str.17 = [6 x i8] c"while\00"
define i32 @pa_keyword(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = sdiv i32 %4, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [18 x i8*], [18 x i8*]* @pa_keyword.key, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i64 @wrdcmp(i8* %8, i8* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %32, label %11
11: ; preds = %3, %21
%12 = phi i64 [ %30, %21 ], [ %9, %3 ]
%13 = phi i32 [ %26, %21 ], [ %5, %3 ]
%14 = phi i32 [ %24, %21 ], [ %2, %3 ]
%15 = phi i32 [ %23, %21 ], [ %1, %3 ]
%16 = icmp eq i32 %15, %14
br i1 %16, label %32, label %17
17: ; preds = %11
%18 = icmp eq i32 %13, %15
%19 = icmp eq i32 %13, %14
%20 = or i1 %18, %19
br i1 %20, label %32, label %21
21: ; preds = %17
%22 = icmp eq i64 %12, 1
%23 = select i1 %22, i32 %15, i32 %13
%24 = select i1 %22, i32 %13, i32 %14
%25 = add nsw i32 %24, %23
%26 = sdiv i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [18 x i8*], [18 x i8*]* @pa_keyword.key, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = tail call i64 @wrdcmp(i8* %29, i8* %0)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %11
32: ; preds = %21, %11, %17, %3
%33 = phi i32 [ 1, %3 ], [ 0, %17 ], [ 0, %11 ], [ 1, %21 ]
ret i32 %33
}