#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 */
long find_1st_atom(char *, char **, long, long, char *);
double veclen(double *);
long residue_ident(char **AtomName, double **xyz, long ib, long ie) {
  double d1, d2, d3, dcrt = 2.0, dcrt2 = 3.0, temp[4];
  long i, id = -2;
  long CA, C, N1, C2, C6, N9;
  N9 = find_1st_atom(" N9 ", AtomName, ib, ie, "");
  N1 = find_1st_atom(" N1 ", AtomName, ib, ie, "");
  C2 = find_1st_atom(" C2 ", AtomName, ib, ie, "");
  C6 = find_1st_atom(" C6 ", AtomName, ib, ie, "");
  if (N1 && C2 && C6) {
    for (i = 1; i <= 3; i++)
      temp[i] = xyz[N1][i] - xyz[C2][i];
    d1 = veclen(temp);
    for (i = 1; i <= 3; i++)
      temp[i] = xyz[N1][i] - xyz[C6][i];
    d2 = veclen(temp);
    for (i = 1; i <= 3; i++)
      temp[i] = xyz[C2][i] - xyz[C6][i];
    d3 = veclen(temp);
    if (d1 <= dcrt && d2 <= dcrt && d3 <= dcrt2) {
      id = 0;
      if (N9) {
        for (i = 1; i <= 3; i++)
          temp[i] = xyz[N1][i] - xyz[N9][i];
        d3 = veclen(temp);
        if (d3 >= 3.5 && d3 <= 4.5)
          id = 1;
      }
    }
    return id;
  }
  CA = find_1st_atom(" CA ", AtomName, ib, ie, "");
  C = find_1st_atom(" C  ", AtomName, ib, ie, "");
  if (!C)
    C = find_1st_atom(" N  ", AtomName, ib, ie, "");
  if (CA && C) {
    for (i = 1; i <= 3; i++)
      temp[i] = xyz[CA][i] - xyz[C][i];
    if (veclen(temp) <= dcrt)
      id = -1;
    return id;
  }
  return id;
}


x86 assembly (clang, -O0):
<residue_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movq   $0xfffffffffffffffe,-0x80(%rbp)
ff
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xeb0(%rip),%rdi
lea    0xec6(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe8f(%rip),%rdi
lea    0xea0(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe6e(%rip),%rdi
lea    0xe7a(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe4d(%rip),%rdi
lea    0xe54(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0x98(%rbp)
je     146a <residue_ident+0x34a>
cmpq   $0x0,-0xa0(%rbp)
je     146a <residue_ident+0x34a>
cmpq   $0x0,-0xa8(%rbp)
je     146a <residue_ident+0x34a>
movq   $0x1,-0x78(%rbp)
cmpq   $0x3,-0x78(%rbp)
jg     127d <residue_ident+0x15d>
mov    -0x18(%rbp),%rax
mov    -0x98(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    1227 <residue_ident+0x107>
lea    -0x70(%rbp),%rdi
call   1040 <veclen@plt>
movsd  %xmm0,-0x30(%rbp)
movq   $0x1,-0x78(%rbp)
cmpq   $0x3,-0x78(%rbp)
jg     12e9 <residue_ident+0x1c9>
mov    -0x18(%rbp),%rax
mov    -0x98(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xa8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    1293 <residue_ident+0x173>
lea    -0x70(%rbp),%rdi
call   1040 <veclen@plt>
movsd  %xmm0,-0x38(%rbp)
movq   $0x1,-0x78(%rbp)
cmpq   $0x3,-0x78(%rbp)
jg     1355 <residue_ident+0x235>
mov    -0x18(%rbp),%rax
mov    -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xa8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    12ff <residue_ident+0x1df>
lea    -0x70(%rbp),%rdi
call   1040 <veclen@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     145d <residue_ident+0x33d>
movsd  -0x38(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     145d <residue_ident+0x33d>
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     145d <residue_ident+0x33d>
movq   $0x0,-0x80(%rbp)
cmpq   $0x0,-0xb0(%rbp)
je     1458 <residue_ident+0x338>
movq   $0x1,-0x78(%rbp)
cmpq   $0x3,-0x78(%rbp)
jg     1413 <residue_ident+0x2f3>
mov    -0x18(%rbp),%rax
mov    -0x98(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xb0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    13bd <residue_ident+0x29d>
lea    -0x70(%rbp),%rdi
call   1040 <veclen@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xbe2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1453 <residue_ident+0x333>
movsd  0xbd8(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jb     1453 <residue_ident+0x333>
movq   $0x1,-0x80(%rbp)
jmp    1458 <residue_ident+0x338>
jmp    145d <residue_ident+0x33d>
mov    -0x80(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    159c <residue_ident+0x47c>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xbb7(%rip),%rdi
lea    0xbb9(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xb96(%rip),%rdi
lea    0xb93(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
jne    14ea <residue_ident+0x3ca>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xb67(%rip),%rdi
lea    0xb5f(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     1594 <residue_ident+0x474>
cmpq   $0x0,-0x90(%rbp)
je     1594 <residue_ident+0x474>
movq   $0x1,-0x78(%rbp)
cmpq   $0x3,-0x78(%rbp)
jg     1564 <residue_ident+0x444>
mov    -0x18(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x90(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    150e <residue_ident+0x3ee>
lea    -0x70(%rbp),%rdi
call   1040 <veclen@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1587 <residue_ident+0x467>
movq   $0xffffffffffffffff,-0x80(%rbp)
ff
mov    -0x80(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    159c <residue_ident+0x47c>
mov    -0x80(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<residue_ident>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%r13
mov    %rdx,%rbx
mov    %rsi,0x28(%rsp)
mov    %rdi,%rbp
lea    0xedd(%rip),%rdi
lea    0xef3(%rip),%r15
mov    %rbp,%rsi
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
mov    %rax,0x40(%rsp)
lea    0xec4(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
mov    %rax,%r12
lea    0xeae(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
mov    %rax,%r14
lea    0xe98(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
test   %r12,%r12
je     131d <residue_ident+0x1fd>
test   %r14,%r14
je     131d <residue_ident+0x1fd>
mov    %rax,%r15
test   %rax,%rax
je     131d <residue_ident+0x1fd>
mov    0x28(%rsp),%rbp
mov    0x0(%rbp,%r12,8),%rax
mov    0x0(%rbp,%r14,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <veclen@plt>
movsd  %xmm0,0x38(%rsp)
mov    0x0(%rbp,%r12,8),%rax
mov    0x0(%rbp,%r15,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
call   1040 <veclen@plt>
movsd  %xmm0,0x30(%rsp)
mov    0x0(%rbp,%r14,8),%rax
mov    0x0(%rbp,%r15,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
call   1040 <veclen@plt>
movsd  0xd7c(%rip),%xmm1
ucomisd 0x38(%rsp),%xmm1
mov    $0xfffffffffffffffe,%rax
jb     13e0 <residue_ident+0x2c0>
ucomisd 0x30(%rsp),%xmm1
jb     13e0 <residue_ident+0x2c0>
movsd  0xd5d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     13e0 <residue_ident+0x2c0>
mov    0x40(%rsp),%rcx
test   %rcx,%rcx
je     13de <residue_ident+0x2be>
mov    0x0(%rbp,%r12,8),%rax
mov    0x0(%rbp,%rcx,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rsp,%rdi
call   1040 <veclen@plt>
ucomisd 0xd0f(%rip),%xmm0
setae  %al
movsd  0xd0c(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%eax
jmp    13e0 <residue_ident+0x2c0>
lea    0xd10(%rip),%rdi
lea    0xd12(%rip),%r15
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
mov    %rax,%r14
lea    0xcf3(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <find_1st_atom@plt>
mov    %rax,%rcx
test   %rax,%rax
jne    137e <residue_ident+0x25e>
lea    0xcd8(%rip),%rdi
lea    0xcd0(%rip),%r8
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1030 <find_1st_atom@plt>
mov    %rax,%rcx
mov    $0xfffffffffffffffe,%rax
test   %r14,%r14
je     13e0 <residue_ident+0x2c0>
test   %rcx,%rcx
mov    0x28(%rsp),%rdx
je     13e0 <residue_ident+0x2c0>
mov    (%rdx,%r14,8),%rax
mov    (%rdx,%rcx,8),%rcx
movupd 0x8(%rax),%xmm0
movupd 0x8(%rcx),%xmm1
subpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rsp)
movsd  0x18(%rax),%xmm0
subsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rsp,%rdi
call   1040 <veclen@plt>
movsd  0xc30(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
not    %rax
jmp    13e0 <residue_ident+0x2c0>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" N9 \00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c" N1 \00"
@.str.3 = [5 x i8] c" C2 \00"
@.str.4 = [5 x i8] c" C6 \00"
@.str.5 = [5 x i8] c" CA \00"
@.str.6 = [5 x i8] c" C \00"
@.str.7 = [5 x i8] c" N \00"
define i64 @residue_ident(i8** %0, double** %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i8**
%7 = alloca double**
%8 = alloca i64
%9 = alloca i64
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca [4 x double]
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
store i8** %0, i8*** %6
store double** %1, double*** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store double 2.000000e+00, double* %13
store double 3.000000e+00, double* %14
store i64 -2, i64* %17
%24 = load i8**, i8*** %6
%25 = load i64, i64* %8
%26 = load i64, i64* %9
%27 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %24, i64 %25, i64 %26, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %27, i64* %23
%28 = load i8**, i8*** %6
%29 = load i64, i64* %8
%30 = load i64, i64* %9
%31 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %28, i64 %29, i64 %30, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %31, i64* %20
%32 = load i8**, i8*** %6
%33 = load i64, i64* %8
%34 = load i64, i64* %9
%35 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %32, i64 %33, i64 %34, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %35, i64* %21
%36 = load i8**, i8*** %6
%37 = load i64, i64* %8
%38 = load i64, i64* %9
%39 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %36, i64 %37, i64 %38, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %39, i64* %22
%40 = load i64, i64* %20
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %182
42: ; preds = %4
%43 = load i64, i64* %21
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %182
45: ; preds = %42
%46 = load i64, i64* %22
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %182
48: ; preds = %45
store i64 1, i64* %16
br label %49
49: ; preds = %70, %48
%50 = load i64, i64* %16
%51 = icmp sle i64 %50, 3
br i1 %51, label %52, label %73
52: ; preds = %49
%53 = load double**, double*** %7
%54 = load i64, i64* %20
%55 = getelementptr inbounds double*, double** %53, i64 %54
%56 = load double*, double** %55
%57 = load i64, i64* %16
%58 = getelementptr inbounds double, double* %56, i64 %57
%59 = load double, double* %58
%60 = load double**, double*** %7
%61 = load i64, i64* %21
%62 = getelementptr inbounds double*, double** %60, i64 %61
%63 = load double*, double** %62
%64 = load i64, i64* %16
%65 = getelementptr inbounds double, double* %63, i64 %64
%66 = load double, double* %65
%67 = fsub double %59, %66
%68 = load i64, i64* %16
%69 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %68
store double %67, double* %69
br label %70
70: ; preds = %52
%71 = load i64, i64* %16
%72 = add nsw i64 %71, 1
store i64 %72, i64* %16
br label %49
73: ; preds = %49
%74 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%75 = call double @veclen(double* %74)
store double %75, double* %10
store i64 1, i64* %16
br label %76
76: ; preds = %97, %73
%77 = load i64, i64* %16
%78 = icmp sle i64 %77, 3
br i1 %78, label %79, label %100
79: ; preds = %76
%80 = load double**, double*** %7
%81 = load i64, i64* %20
%82 = getelementptr inbounds double*, double** %80, i64 %81
%83 = load double*, double** %82
%84 = load i64, i64* %16
%85 = getelementptr inbounds double, double* %83, i64 %84
%86 = load double, double* %85
%87 = load double**, double*** %7
%88 = load i64, i64* %22
%89 = getelementptr inbounds double*, double** %87, i64 %88
%90 = load double*, double** %89
%91 = load i64, i64* %16
%92 = getelementptr inbounds double, double* %90, i64 %91
%93 = load double, double* %92
%94 = fsub double %86, %93
%95 = load i64, i64* %16
%96 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %95
store double %94, double* %96
br label %97
97: ; preds = %79
%98 = load i64, i64* %16
%99 = add nsw i64 %98, 1
store i64 %99, i64* %16
br label %76
100: ; preds = %76
%101 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%102 = call double @veclen(double* %101)
store double %102, double* %11
store i64 1, i64* %16
br label %103
103: ; preds = %124, %100
%104 = load i64, i64* %16
%105 = icmp sle i64 %104, 3
br i1 %105, label %106, label %127
106: ; preds = %103
%107 = load double**, double*** %7
%108 = load i64, i64* %21
%109 = getelementptr inbounds double*, double** %107, i64 %108
%110 = load double*, double** %109
%111 = load i64, i64* %16
%112 = getelementptr inbounds double, double* %110, i64 %111
%113 = load double, double* %112
%114 = load double**, double*** %7
%115 = load i64, i64* %22
%116 = getelementptr inbounds double*, double** %114, i64 %115
%117 = load double*, double** %116
%118 = load i64, i64* %16
%119 = getelementptr inbounds double, double* %117, i64 %118
%120 = load double, double* %119
%121 = fsub double %113, %120
%122 = load i64, i64* %16
%123 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %122
store double %121, double* %123
br label %124
124: ; preds = %106
%125 = load i64, i64* %16
%126 = add nsw i64 %125, 1
store i64 %126, i64* %16
br label %103
127: ; preds = %103
%128 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%129 = call double @veclen(double* %128)
store double %129, double* %12
%130 = load double, double* %10
%131 = load double, double* %13
%132 = fcmp ole double %130, %131
br i1 %132, label %133, label %180
133: ; preds = %127
%134 = load double, double* %11
%135 = load double, double* %13
%136 = fcmp ole double %134, %135
br i1 %136, label %137, label %180
137: ; preds = %133
%138 = load double, double* %12
%139 = load double, double* %14
%140 = fcmp ole double %138, %139
br i1 %140, label %141, label %180
141: ; preds = %137
store i64 0, i64* %17
%142 = load i64, i64* %23
%143 = icmp ne i64 %142, 0
br i1 %143, label %144, label %179
144: ; preds = %141
store i64 1, i64* %16
br label %145
145: ; preds = %166, %144
%146 = load i64, i64* %16
%147 = icmp sle i64 %146, 3
br i1 %147, label %148, label %169
148: ; preds = %145
%149 = load double**, double*** %7
%150 = load i64, i64* %20
%151 = getelementptr inbounds double*, double** %149, i64 %150
%152 = load double*, double** %151
%153 = load i64, i64* %16
%154 = getelementptr inbounds double, double* %152, i64 %153
%155 = load double, double* %154
%156 = load double**, double*** %7
%157 = load i64, i64* %23
%158 = getelementptr inbounds double*, double** %156, i64 %157
%159 = load double*, double** %158
%160 = load i64, i64* %16
%161 = getelementptr inbounds double, double* %159, i64 %160
%162 = load double, double* %161
%163 = fsub double %155, %162
%164 = load i64, i64* %16
%165 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %164
store double %163, double* %165
br label %166
166: ; preds = %148
%167 = load i64, i64* %16
%168 = add nsw i64 %167, 1
store i64 %168, i64* %16
br label %145
169: ; preds = %145
%170 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%171 = call double @veclen(double* %170)
store double %171, double* %12
%172 = load double, double* %12
%173 = fcmp oge double %172, 3.500000e+00
br i1 %173, label %174, label %178
174: ; preds = %169
%175 = load double, double* %12
%176 = fcmp ole double %175, 4.500000e+00
br i1 %176, label %177, label %178
177: ; preds = %174
store i64 1, i64* %17
br label %178
178: ; preds = %177, %174, %169
br label %179
179: ; preds = %178, %141
br label %180
180: ; preds = %179, %137, %133, %127
%181 = load i64, i64* %17
store i64 %181, i64* %5
br label %239
182: ; preds = %45, %42, %4
%183 = load i8**, i8*** %6
%184 = load i64, i64* %8
%185 = load i64, i64* %9
%186 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %183, i64 %184, i64 %185, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %186, i64* %18
%187 = load i8**, i8*** %6
%188 = load i64, i64* %8
%189 = load i64, i64* %9
%190 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %187, i64 %188, i64 %189, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %190, i64* %19
%191 = load i64, i64* %19
%192 = icmp ne i64 %191, 0
br i1 %192, label %198, label %193
193: ; preds = %182
%194 = load i8**, i8*** %6
%195 = load i64, i64* %8
%196 = load i64, i64* %9
%197 = call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %194, i64 %195, i64 %196, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i64 %197, i64* %19
br label %198
198: ; preds = %193, %182
%199 = load i64, i64* %18
%200 = icmp ne i64 %199, 0
br i1 %200, label %201, label %237
201: ; preds = %198
%202 = load i64, i64* %19
%203 = icmp ne i64 %202, 0
br i1 %203, label %204, label %237
204: ; preds = %201
store i64 1, i64* %16
br label %205
205: ; preds = %226, %204
%206 = load i64, i64* %16
%207 = icmp sle i64 %206, 3
br i1 %207, label %208, label %229
208: ; preds = %205
%209 = load double**, double*** %7
%210 = load i64, i64* %18
%211 = getelementptr inbounds double*, double** %209, i64 %210
%212 = load double*, double** %211
%213 = load i64, i64* %16
%214 = getelementptr inbounds double, double* %212, i64 %213
%215 = load double, double* %214
%216 = load double**, double*** %7
%217 = load i64, i64* %19
%218 = getelementptr inbounds double*, double** %216, i64 %217
%219 = load double*, double** %218
%220 = load i64, i64* %16
%221 = getelementptr inbounds double, double* %219, i64 %220
%222 = load double, double* %221
%223 = fsub double %215, %222
%224 = load i64, i64* %16
%225 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %224
store double %223, double* %225
br label %226
226: ; preds = %208
%227 = load i64, i64* %16
%228 = add nsw i64 %227, 1
store i64 %228, i64* %16
br label %205
229: ; preds = %205
%230 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%231 = call double @veclen(double* %230)
%232 = load double, double* %13
%233 = fcmp ole double %231, %232
br i1 %233, label %234, label %235
234: ; preds = %229
store i64 -1, i64* %17
br label %235
235: ; preds = %234, %229
%236 = load i64, i64* %17
store i64 %236, i64* %5
br label %239
237: ; preds = %201, %198
%238 = load i64, i64* %17
store i64 %238, i64* %5
br label %239
239: ; preds = %237, %235, %180
%240 = load i64, i64* %5
ret i64 %240
}

LLVM IR (-O2):
@.str = [5 x i8] c" N9 \00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c" N1 \00"
@.str.3 = [5 x i8] c" C2 \00"
@.str.4 = [5 x i8] c" C6 \00"
@.str.5 = [5 x i8] c" CA \00"
@.str.6 = [5 x i8] c" C \00"
@.str.7 = [5 x i8] c" N \00"
define i64 @residue_ident(i8** %0, double** nocapture %1, i64 %2, i64 %3) {
%5 = alloca [4 x double]
%6 = bitcast [4 x double]* %5 to i8*
%7 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i64 %8, 0
%12 = icmp ne i64 %9, 0
%13 = select i1 %11, i1 %12, i1 false
%14 = icmp ne i64 %10, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %16, label %100
16: ; preds = %4
%17 = getelementptr inbounds double*, double** %1, i64 %8
%18 = load double*, double** %17
%19 = getelementptr inbounds double*, double** %1, i64 %9
%20 = load double*, double** %19
%21 = getelementptr inbounds double, double* %18, i64 1
%22 = getelementptr inbounds double, double* %20, i64 1
%23 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%24 = bitcast double* %21 to <2 x double>*
%25 = load <2 x double>, <2 x double>* %24
%26 = bitcast double* %22 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = fsub <2 x double> %25, %27
%29 = bitcast double* %23 to <2 x double>*
store <2 x double> %28, <2 x double>* %29
%30 = getelementptr inbounds double, double* %18, i64 3
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %20, i64 3
%33 = load double, double* %32
%34 = fsub double %31, %33
%35 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
store double %34, double* %35
%36 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%37 = call double @veclen(double* %36)
%38 = load double*, double** %17
%39 = getelementptr inbounds double*, double** %1, i64 %10
%40 = load double*, double** %39
%41 = getelementptr inbounds double, double* %38, i64 1
%42 = getelementptr inbounds double, double* %40, i64 1
%43 = bitcast double* %41 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = bitcast double* %42 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = fsub <2 x double> %44, %46
%48 = bitcast double* %23 to <2 x double>*
store <2 x double> %47, <2 x double>* %48
%49 = getelementptr inbounds double, double* %38, i64 3
%50 = load double, double* %49
%51 = getelementptr inbounds double, double* %40, i64 3
%52 = load double, double* %51
%53 = fsub double %50, %52
store double %53, double* %35
%54 = call double @veclen(double* %36)
%55 = load double*, double** %19
%56 = load double*, double** %39
%57 = getelementptr inbounds double, double* %55, i64 1
%58 = getelementptr inbounds double, double* %56, i64 1
%59 = bitcast double* %57 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = bitcast double* %58 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = fsub <2 x double> %60, %62
%64 = bitcast double* %23 to <2 x double>*
store <2 x double> %63, <2 x double>* %64
%65 = getelementptr inbounds double, double* %55, i64 3
%66 = load double, double* %65
%67 = getelementptr inbounds double, double* %56, i64 3
%68 = load double, double* %67
%69 = fsub double %66, %68
store double %69, double* %35
%70 = call double @veclen(double* %36)
%71 = fcmp ugt double %37, 2.000000e+00
%72 = fcmp ugt double %54, 2.000000e+00
%73 = select i1 %71, i1 true, i1 %72
%74 = fcmp ugt double %70, 3.000000e+00
%75 = select i1 %73, i1 true, i1 %74
br i1 %75, label %135, label %76
76: ; preds = %16
%77 = icmp eq i64 %7, 0
br i1 %77, label %135, label %78
78: ; preds = %76
%79 = load double*, double** %17
%80 = getelementptr inbounds double*, double** %1, i64 %7
%81 = load double*, double** %80
%82 = getelementptr inbounds double, double* %79, i64 1
%83 = getelementptr inbounds double, double* %81, i64 1
%84 = bitcast double* %82 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = bitcast double* %83 to <2 x double>*
%87 = load <2 x double>, <2 x double>* %86
%88 = fsub <2 x double> %85, %87
%89 = bitcast double* %23 to <2 x double>*
store <2 x double> %88, <2 x double>* %89
%90 = getelementptr inbounds double, double* %79, i64 3
%91 = load double, double* %90
%92 = getelementptr inbounds double, double* %81, i64 3
%93 = load double, double* %92
%94 = fsub double %91, %93
store double %94, double* %35
%95 = call double @veclen(double* %36)
%96 = fcmp oge double %95, 3.500000e+00
%97 = fcmp ole double %95, 4.500000e+00
%98 = and i1 %96, %97
%99 = zext i1 %98 to i64
br label %135
100: ; preds = %4
%101 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%102 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = tail call i64 @find_1st_atom(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %0, i64 %2, i64 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %106
106: ; preds = %104, %100
%107 = phi i64 [ %102, %100 ], [ %105, %104 ]
%108 = icmp ne i64 %101, 0
%109 = icmp ne i64 %107, 0
%110 = select i1 %108, i1 %109, i1 false
br i1 %110, label %111, label %135
111: ; preds = %106
%112 = getelementptr inbounds double*, double** %1, i64 %101
%113 = load double*, double** %112
%114 = getelementptr inbounds double*, double** %1, i64 %107
%115 = load double*, double** %114
%116 = getelementptr inbounds double, double* %113, i64 1
%117 = getelementptr inbounds double, double* %115, i64 1
%118 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%119 = bitcast double* %116 to <2 x double>*
%120 = load <2 x double>, <2 x double>* %119
%121 = bitcast double* %117 to <2 x double>*
%122 = load <2 x double>, <2 x double>* %121
%123 = fsub <2 x double> %120, %122
%124 = bitcast double* %118 to <2 x double>*
store <2 x double> %123, <2 x double>* %124
%125 = getelementptr inbounds double, double* %113, i64 3
%126 = load double, double* %125
%127 = getelementptr inbounds double, double* %115, i64 3
%128 = load double, double* %127
%129 = fsub double %126, %128
%130 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
store double %129, double* %130
%131 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%132 = call double @veclen(double* %131)
%133 = fcmp ugt double %132, 2.000000e+00
%134 = select i1 %133, i64 -2, i64 -1
br label %135
135: ; preds = %78, %106, %16, %76, %111
%136 = phi i64 [ %134, %111 ], [ 0, %76 ], [ -2, %16 ], [ %99, %78 ], [ -2, %106 ]
ret i64 %136
}