#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 y;
typedef int x;

/* Variables and functions */
int GetMismatchShift(char, char);
long double InteriorMM(char a, char b, char x, char y) {
  extern long double MMEnergiesIL[];
  int cp_shift;
  long double energy = 0.0;
  cp_shift = GetMismatchShift(a, b);
  energy = MMEnergiesIL[(4 * ((x)-1) + ((y)-1)) * 6 + cp_shift];
  return energy;
}


x86 assembly (clang, -O0):
<InteriorMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
fldz
fstpt  -0x20(%rbp)
movsbl -0x1(%rbp),%edi
movsbl -0x2(%rbp),%esi
call   1030 <GetMismatchShift@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x3(%rbp),%eax
mov    %eax,%ecx
movsbl -0x4(%rbp),%edx
mov    %edx,%eax
lea    (%rax,%rcx,4),%ecx
mov    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
mov    %edx,%eax
lea    -0x1e(%rax,%rcx,2),%eax
movslq %eax,%rcx
shl    $0x4,%rcx
mov    0x2e77(%rip),%rax
fldt   (%rax,%rcx,1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InteriorMM>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
call   1030 <GetMismatchShift@plt>
lea    (%r14,%rbx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
lea    (%rax,%rcx,2),%eax
add    $0xffffffe2,%eax
cltq
shl    $0x4,%rax
mov    0x2eb0(%rip),%rcx
fldt   (%rcx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@MMEnergiesIL = external global [0 x x86_fp80]
define x86_fp80 @InteriorMM(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca x86_fp80
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
store x86_fp80 0xK00000000000000000000, x86_fp80* %10
%11 = load i8, i8* %5
%12 = load i8, i8* %6
%13 = call i32 @GetMismatchShift(i8 signext %11, i8 signext %12)
store i32 %13, i32* %9
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 1
%17 = mul nsw i32 4, %16
%18 = load i8, i8* %8
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 1
%21 = add nsw i32 %17, %20
%22 = mul nsw i32 %21, 6
%23 = load i32, i32* %9
%24 = add nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [0 x x86_fp80], [0 x x86_fp80]* @MMEnergiesIL, i64 0, i64 %25
%27 = load x86_fp80, x86_fp80* %26
store x86_fp80 %27, x86_fp80* %10
%28 = load x86_fp80, x86_fp80* %10
ret x86_fp80 %28
}

LLVM IR (-O2):
@MMEnergiesIL = external global [0 x x86_fp80]
define x86_fp80 @InteriorMM(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @GetMismatchShift(i8 signext %0, i8 signext %1)
%6 = sext i8 %2 to i32
%7 = shl nsw i32 %6, 2
%8 = sext i8 %3 to i32
%9 = add nsw i32 %7, %8
%10 = mul nsw i32 %9, 6
%11 = add nsw i32 %10, -30
%12 = add nsw i32 %11, %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [0 x x86_fp80], [0 x x86_fp80]* @MMEnergiesIL, i64 0, i64 %13
%15 = load x86_fp80, x86_fp80* %14
ret x86_fp80 %15
}