#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 */
scalar_t__ strncmp(char *, char *, int);
char a3to1(char *a3) {
  int i;
  char new;
  new = 'X';
  for (i = 0; i < 24; i++) {
    if (strncmp(&"ALA ARG ASN ASP CYS GLN GLU GLY HIS ILE LEU LYS MET PHE PRO "
                 "SER THR TRP TYR VAL ASX GLX UNK CYH MSE"[i * 4],
                a3, 3) == 0)
      new = (char)"ARNDCQEGHILKMFPSTWYVBZXcK"[i];
  }
  return (new);
}


x86 assembly (clang, -O0):
<a3to1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x58,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jge    117f <a3to1+0x6f>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
cltq
lea    0xec0(%rip),%rdi
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116c <a3to1+0x5c>
movslq -0xc(%rbp),%rcx
lea    0xefe(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
jmp    1171 <a3to1+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <a3to1+0x17>
movsbl -0xd(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a3to1>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
mov    $0x58,%r14b
lea    0xedb(%rip),%rbp
xor    %ebx,%ebx
lea    0xf36(%rip),%r12
jmp    113e <a3to1+0x2e>
add    $0x1,%rbx
add    $0x4,%rbp
cmp    $0x18,%rbx
je     115a <a3to1+0x4a>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1130 <a3to1+0x20>
movzbl (%rbx,%r12,1),%r14d
jmp    1130 <a3to1+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [100 x i8] c"ALA ARG ASN ASP CYS GLN GLU GLY HIS ILE LEU LYS MET PHE PRO SER THR TRP TYR VAL ASX GLX UNK CYH MSE\00"
@.str.1 = [26 x i8] c"ARNDCQEGHILKMFPSTWYVBZXcK\00"
define signext i8 @a3to1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i8 88, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %22, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 24
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i8], [100 x i8]* @.str, i64 0, i64 %11
%13 = load i8*, i8** %2
%14 = call i64 @strncmp(i8* %12, i8* %13, i32 3)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %8
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [26 x i8], [26 x i8]* @.str.1, i64 0, i64 %18
%20 = load i8, i8* %19
store i8 %20, i8* %4
br label %21
21: ; preds = %16, %8
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %5
25: ; preds = %5
%26 = load i8, i8* %4
ret i8 %26
}

LLVM IR (-O2):
@.str = [100 x i8] c"ALA ARG ASN ASP CYS GLN GLU GLY HIS ILE LEU LYS MET PHE PRO SER THR TRP TYR VAL ASX GLX UNK CYH MSE\00"
@.str.1 = [26 x i8] c"ARNDCQEGHILKMFPSTWYVBZXcK\00"
define signext i8 @a3to1(i8* %0) {
br label %2
2: ; preds = %1, %12
%3 = phi i64 [ 0, %1 ], [ %14, %12 ]
%4 = phi i8 [ 88, %1 ], [ %13, %12 ]
%5 = shl nuw nsw i64 %3, 2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* @.str, i64 0, i64 %5
%7 = tail call i64 @strncmp(i8* %6, i8* %0, i32 3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = getelementptr inbounds [26 x i8], [26 x i8]* @.str.1, i64 0, i64 %3
%11 = load i8, i8* %10
br label %12
12: ; preds = %2, %9
%13 = phi i8 [ %11, %9 ], [ %4, %2 ]
%14 = add nuw nsw i64 %3, 1
%15 = icmp eq i64 %14, 24
br i1 %15, label %16, label %2
16: ; preds = %12
ret i8 %13
}