#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 maplow(int);
int dilook(int a, int b, char t[26][13]) {
  int i, j;
  i = t[maplow(a) - 'a'][(j = maplow(b) - 'a') / 2];
  if (!(j & 01))
    i >>= 4;
  return (i & 017);
}


x86 assembly (clang, -O0):
<dilook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <maplow@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
movsbl %cl,%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
imul   $0xd,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <maplow@plt>
movsbl %al,%eax
sub    $0x61,%eax
mov    %eax,-0x18(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    118d <dilook+0x7d>
mov    -0x14(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xf,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dilook>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
call   1030 <maplow@plt>
movsbq %al,%rax
lea    (%rax,%rax,2),%rcx
lea    (%rax,%rcx,4),%rbx
mov    %ebp,%edi
call   1030 <maplow@plt>
movsbl %al,%eax
lea    -0x61(%rax),%ecx
movzwl %cx,%edx
shr    $0xf,%edx
add    %edx,%eax
add    $0xffffff9f,%eax
cwtl
sar    %eax
cltq
add    %r14,%rbx
movzbl -0x4ed(%rax,%rbx,1),%edx
ff
mov    %edx,%eax
shr    $0x4,%eax
test   $0x1,%cl
cmovne %edx,%eax
and    $0xf,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dilook(i32 %0, i32 %1, [13 x i8]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [13 x i8]*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store [13 x i8]* %2, [13 x i8]** %6
%9 = load [13 x i8]*, [13 x i8]** %6
%10 = load i32, i32* %4
%11 = call signext i8 @maplow(i32 %10)
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %9, i64 %14
%16 = load i32, i32* %5
%17 = call signext i8 @maplow(i32 %16)
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 97
store i32 %19, i32* %8
%20 = sdiv i32 %19, 2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %15, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
store i32 %24, i32* %7
%25 = load i32, i32* %8
%26 = and i32 %25, 1
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %3
%29 = load i32, i32* %7
%30 = ashr i32 %29, 4
store i32 %30, i32* %7
br label %31
31: ; preds = %28, %3
%32 = load i32, i32* %7
%33 = and i32 %32, 15
ret i32 %33
}

LLVM IR (-O2):
define i32 @dilook(i32 %0, i32 %1, [13 x i8]* nocapture %2) {
%4 = tail call signext i8 @maplow(i32 %0)
%5 = sext i8 %4 to i64
%6 = add nsw i64 %5, -97
%7 = tail call signext i8 @maplow(i32 %1)
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, -97
%10 = trunc i32 %9 to i16
%11 = sdiv i16 %10, 2
%12 = sext i16 %11 to i64
%13 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 %6, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %9, 1
%17 = icmp eq i32 %16, 0
%18 = lshr i32 %15, 4
%19 = select i1 %17, i32 %18, i32 %15
%20 = and i32 %19, 15
ret i32 %20
}