#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__ strcmp(char *, char const *);
int is_hetatm(char *type) {
  const char *hetatm_type[] = {"D-SACCHARIDE",
                               "D-SACCHARIDE 1,4 AND 1,4 LINKING",
                               "D-SACCHARIDE 1,4 AND 1,6 LINKING",
                               "L-SACCHARIDE",
                               "L-SACCHARIDE 1,4 AND 1,4 LINKING",
                               "L-SACCHARIDE 1,4 AND 1,6 LINKING",
                               "SACCHARIDE",
                               "OTHER",
                               "NON-POLYMER",
                               0};
  for (int i = 0; hetatm_type[i]; ++i) {
    if (strcmp(type, hetatm_type[i]) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_hetatm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2c99(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmpq   $0x0,-0x60(%rbp,%rax,8)
je     1193 <is_hetatm+0x73>
mov    -0x10(%rbp),%rdi
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1180 <is_hetatm+0x60>
movl   $0x1,-0x4(%rbp)
jmp    119a <is_hetatm+0x7a>
jmp    1185 <is_hetatm+0x65>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1148 <is_hetatm+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hetatm>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xeec(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xe63(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d8 <is_hetatm+0xc8>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"D-SACCHARIDE\00"
@.str.1 = [33 x i8] c"D-SACCHARIDE 1,4 AND 1,4 LINKING\00"
@.str.2 = [33 x i8] c"D-SACCHARIDE 1,4 AND 1,6 LINKING\00"
@.str.3 = [13 x i8] c"L-SACCHARIDE\00"
@.str.4 = [33 x i8] c"L-SACCHARIDE 1,4 AND 1,4 LINKING\00"
@.str.5 = [33 x i8] c"L-SACCHARIDE 1,4 AND 1,6 LINKING\00"
@.str.6 = [11 x i8] c"SACCHARIDE\00"
@.str.7 = [6 x i8] c"OTHER\00"
@.str.8 = [12 x i8] c"NON-POLYMER\00"
@__const.is_hetatm.hetatm_type = [10 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 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 ([12 x i8], [12 x i8]* @.str.8, i32 0, i32 0), i8* null]
define i32 @is_hetatm(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [10 x i8*]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [10 x i8*]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %23, %1
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %4, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %26
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* %4, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %14, i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %2
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
store i32 0, i32* %2
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@.str = [13 x i8] c"D-SACCHARIDE\00"
@.str.1 = [33 x i8] c"D-SACCHARIDE 1,4 AND 1,4 LINKING\00"
@.str.2 = [33 x i8] c"D-SACCHARIDE 1,4 AND 1,6 LINKING\00"
@.str.3 = [13 x i8] c"L-SACCHARIDE\00"
@.str.4 = [33 x i8] c"L-SACCHARIDE 1,4 AND 1,4 LINKING\00"
@.str.5 = [33 x i8] c"L-SACCHARIDE 1,4 AND 1,6 LINKING\00"
@.str.6 = [11 x i8] c"SACCHARIDE\00"
@.str.7 = [6 x i8] c"OTHER\00"
@.str.8 = [12 x i8] c"NON-POLYMER\00"
define i32 @is_hetatm(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %29, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %29, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %29, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %29, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %29, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
br label %29
29: ; preds = %25, %22, %19, %16, %13, %10, %7, %4, %1
%30 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ %28, %25 ]
ret i32 %30
}