#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 */
int /*<<< orphan*/ cis_or_trans(long, long, char *, long **, char **, double **,
                                char *);
int /*<<< orphan*/ get_hbond_ij(long, long, double *, long **, char **, char *,
                                double **, long *, char **, char **, double *);
int /*<<< orphan*/ get_orientation_SS(long, long, long **, char **, double **,
                                      char *);
int /*<<< orphan*/ get_pair_type(long, char **, char **, long, long, char *,
                                 char *);
int /*<<< orphan*/ sprintf(char *, char *, char, char, char);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void LW_pair_type(long i, long j, double dist, long **seidx, char **AtomName,
                  char *HB_ATOM, double **xyz, char *bseq, char **hb_atom1,
                  char **hb_atom2, double *hb_dist, char *type) {
  long nh;
  double HB_UPPER_NEW[3];
  char tmp_str[10], cis_tran[10];
  strcpy(type, "");
  strcpy(cis_tran, "");
  HB_UPPER_NEW[0] = dist;
  get_hbond_ij(i, j, HB_UPPER_NEW, seidx, AtomName, HB_ATOM, xyz, &nh, hb_atom1,
               hb_atom2, hb_dist);
  get_pair_type(nh, hb_atom1, hb_atom2, i, j, bseq, type);
  if (type[0] == 'S' && type[2] == 'S') {
    get_orientation_SS(i, j, seidx, AtomName, xyz, type);
  }
  cis_or_trans(i, j, bseq, seidx, AtomName, xyz, cis_tran);
  strcat(type, cis_tran);
  sprintf(tmp_str, "%c%c%c", type[0], type[2], type[4]);
  if (!strcmp(tmp_str, "SWt") || !strcmp(tmp_str, "WSt")) {
    strcpy(type, "");
    HB_UPPER_NEW[0] = 5.1;
    get_hbond_ij(i, j, HB_UPPER_NEW, seidx, AtomName, HB_ATOM, xyz, &nh,
                 hb_atom1, hb_atom2, hb_dist);
    get_pair_type(nh, hb_atom1, hb_atom2, i, j, bseq, type);
    strcat(type, cis_tran);
  }
}


x86 assembly (clang, -O0):
<LW_pair_type>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    0x30(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x84(%rbp),%rdi
lea    0xe31(%rip),%rsi
call   1030 <strcpy@plt>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%r14
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
lea    -0x50(%rbp),%rbx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1080 <get_hbond_ij@plt>
mov    -0x50(%rbp),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <get_pair_type@plt>
mov    0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    1298 <LW_pair_type+0x118>
mov    0x30(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x53,%eax
jne    1298 <LW_pair_type+0x118>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    0x30(%rbp),%r9
call   1060 <get_orientation_SS@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    -0x84(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <cis_or_trans@plt>
mov    0x30(%rbp),%rdi
lea    -0x84(%rbp),%rsi
call   1090 <strcat@plt>
lea    -0x7a(%rbp),%rdi
mov    0x30(%rbp),%rax
mov    (%rax),%dl
mov    0x30(%rbp),%rax
mov    0x2(%rax),%cl
mov    0x30(%rbp),%rax
lea    0xd1c(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl 0x4(%rax),%r8d
call   10a0 <sprintf@plt>
lea    -0x7a(%rbp),%rdi
lea    0xd08(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     132e <LW_pair_type+0x1ae>
lea    -0x7a(%rbp),%rdi
lea    0xcf3(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13c9 <LW_pair_type+0x249>
mov    0x30(%rbp),%rdi
lea    0xcd5(%rip),%rsi
call   1030 <strcpy@plt>
movsd  0xcba(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%r14
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
lea    -0x50(%rbp),%rbx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1080 <get_hbond_ij@plt>
mov    -0x50(%rbp),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <get_pair_type@plt>
mov    0x30(%rbp),%rdi
lea    -0x84(%rbp),%rsi
call   1090 <strcat@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<LW_pair_type>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,%r15
mov    %r8,%r14
mov    %rcx,0x10(%rsp)
mov    %rdx,%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbp
mov    %rdi,%r13
mov    0xb0(%rsp),%rdi
lea    0xe5f(%rip),%r12
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0x24(%rsp),%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
sub    $0x8,%rsp
lea    0x20(%rsp),%rax
lea    0x48(%rsp),%rdx
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rcx
mov    0x18(%rsp),%r8
mov    %r14,0x40(%rsp)
mov    %r14,%r9
mov    0xb8(%rsp),%r12
push   0xb0(%rsp)
push   0xb0(%rsp)
mov    0xb0(%rsp),%r14
push   %r14
push   %rax
mov    %r15,0x30(%rsp)
push   %r15
call   1070 <get_hbond_ij@plt>
add    $0x30,%rsp
mov    0x18(%rsp),%rdi
sub    $0x8,%rsp
mov    %r14,%rsi
mov    0xa8(%rsp),%rdx
mov    %r13,%rcx
mov    %rbp,%r8
mov    0x98(%rsp),%r9
push   %r12
call   1040 <get_pair_type@plt>
add    $0x10,%rsp
cmpb   $0x53,(%r12)
jne    127f <LW_pair_type+0x10f>
mov    0xb0(%rsp),%rax
cmpb   $0x53,0x2(%rax)
jne    127f <LW_pair_type+0x10f>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%r8
mov    0xb0(%rsp),%r9
call   1050 <get_orientation_SS@plt>
sub    $0x8,%rsp
mov    %r13,%r15
mov    %r13,%rdi
mov    %rbp,%r13
mov    %rbp,%rsi
mov    0x98(%rsp),%rdx
mov    %rbx,%r14
mov    %rbx,%rcx
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%r9
lea    0x2c(%rsp),%rbx
push   %rbx
call   1060 <cis_or_trans@plt>
add    $0x10,%rsp
mov    0xb0(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <strcat@plt>
movsbl 0x0(%rbp),%edx
movsbl 0x2(%rbp),%ecx
movsbl 0x4(%rbp),%r8d
lea    0xd23(%rip),%rsi
lea    0x2e(%rsp),%rdi
call   1090 <sprintf@plt>
cmpl   $0x745753,0x2e(%rsp)
je     12ff <LW_pair_type+0x18f>
cmpl   $0x745357,0x2e(%rsp)
jne    13a6 <LW_pair_type+0x236>
lea    0xd00(%rip),%rsi
mov    0xb0(%rsp),%r12
mov    %r12,%rdi
call   1030 <strcpy@plt>
movabs $0x4014666666666666,%rax
66 14 40
mov    %rax,0x40(%rsp)
sub    $0x8,%rsp
lea    0x48(%rsp),%rdx
mov    %r15,%rdi
mov    %r13,%rbx
mov    %r13,%rsi
mov    %r14,%rcx
mov    0x18(%rsp),%r8
mov    0x40(%rsp),%r9
push   0xb0(%rsp)
mov    0xb0(%rsp),%r13
push   %r13
mov    0xb0(%rsp),%rbp
push   %rbp
lea    0x38(%rsp),%rax
push   %rax
push   0x30(%rsp)
call   1070 <get_hbond_ij@plt>
add    $0x30,%rsp
mov    0x18(%rsp),%rdi
sub    $0x8,%rsp
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %rbx,%r8
mov    0x98(%rsp),%r9
push   %r12
call   1040 <get_pair_type@plt>
add    $0x10,%rsp
lea    0x24(%rsp),%rsi
mov    %r12,%rdi
call   1080 <strcat@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"%c%c%c\00"
@.str.2 = [4 x i8] c"SWt\00"
@.str.3 = [4 x i8] c"WSt\00"
define void @LW_pair_type(i64 %0, i64 %1, double %2, i64** %3, i8** %4, i8* %5, double** %6, i8* %7, i8** %8, i8** %9, double* %10, i8* %11) {
%13 = alloca i64
%14 = alloca i64
%15 = alloca double
%16 = alloca i64**
%17 = alloca i8**
%18 = alloca i8*
%19 = alloca double**
%20 = alloca i8*
%21 = alloca i8**
%22 = alloca i8**
%23 = alloca double*
%24 = alloca i8*
%25 = alloca i64
%26 = alloca [3 x double]
%27 = alloca [10 x i8]
%28 = alloca [10 x i8]
store i64 %0, i64* %13
store i64 %1, i64* %14
store double %2, double* %15
store i64** %3, i64*** %16
store i8** %4, i8*** %17
store i8* %5, i8** %18
store double** %6, double*** %19
store i8* %7, i8** %20
store i8** %8, i8*** %21
store i8** %9, i8*** %22
store double* %10, double** %23
store i8* %11, i8** %24
%29 = load i8*, i8** %24
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%33 = load double, double* %15
%34 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
store double %33, double* %34
%35 = load i64, i64* %13
%36 = load i64, i64* %14
%37 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
%38 = load i64**, i64*** %16
%39 = load i8**, i8*** %17
%40 = load i8*, i8** %18
%41 = load double**, double*** %19
%42 = load i8**, i8*** %21
%43 = load i8**, i8*** %22
%44 = load double*, double** %23
%45 = call i32 @get_hbond_ij(i64 %35, i64 %36, double* %37, i64** %38, i8** %39, i8* %40, double** %41, i64* %25, i8** %42, i8** %43, double* %44)
%46 = load i64, i64* %25
%47 = load i8**, i8*** %21
%48 = load i8**, i8*** %22
%49 = load i64, i64* %13
%50 = load i64, i64* %14
%51 = load i8*, i8** %20
%52 = load i8*, i8** %24
%53 = call i32 @get_pair_type(i64 %46, i8** %47, i8** %48, i64 %49, i64 %50, i8* %51, i8* %52)
%54 = load i8*, i8** %24
%55 = getelementptr inbounds i8, i8* %54, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 83
br i1 %58, label %59, label %73
59: ; preds = %12
%60 = load i8*, i8** %24
%61 = getelementptr inbounds i8, i8* %60, i64 2
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 83
br i1 %64, label %65, label %73
65: ; preds = %59
%66 = load i64, i64* %13
%67 = load i64, i64* %14
%68 = load i64**, i64*** %16
%69 = load i8**, i8*** %17
%70 = load double**, double*** %19
%71 = load i8*, i8** %24
%72 = call i32 @get_orientation_SS(i64 %66, i64 %67, i64** %68, i8** %69, double** %70, i8* %71)
br label %73
73: ; preds = %65, %59, %12
%74 = load i64, i64* %13
%75 = load i64, i64* %14
%76 = load i8*, i8** %20
%77 = load i64**, i64*** %16
%78 = load i8**, i8*** %17
%79 = load double**, double*** %19
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 0
%81 = call i32 @cis_or_trans(i64 %74, i64 %75, i8* %76, i64** %77, i8** %78, double** %79, i8* %80)
%82 = load i8*, i8** %24
%83 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 0
%84 = call i32 @strcat(i8* %82, i8* %83)
%85 = getelementptr inbounds [10 x i8], [10 x i8]* %27, i64 0, i64 0
%86 = load i8*, i8** %24
%87 = getelementptr inbounds i8, i8* %86, i64 0
%88 = load i8, i8* %87
%89 = load i8*, i8** %24
%90 = getelementptr inbounds i8, i8* %89, i64 2
%91 = load i8, i8* %90
%92 = load i8*, i8** %24
%93 = getelementptr inbounds i8, i8* %92, i64 4
%94 = load i8, i8* %93
%95 = call i32 @sprintf(i8* %85, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %88, i8 signext %91, i8 signext %94)
%96 = getelementptr inbounds [10 x i8], [10 x i8]* %27, i64 0, i64 0
%97 = call i32 @strcmp(i8* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %73
%100 = getelementptr inbounds [10 x i8], [10 x i8]* %27, i64 0, i64 0
%101 = call i32 @strcmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%102 = icmp ne i32 %101, 0
br i1 %102, label %129, label %103
103: ; preds = %99, %73
%104 = load i8*, i8** %24
%105 = call i32 @strcpy(i8* %104, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%106 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
store double 5.100000e+00, double* %106
%107 = load i64, i64* %13
%108 = load i64, i64* %14
%109 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
%110 = load i64**, i64*** %16
%111 = load i8**, i8*** %17
%112 = load i8*, i8** %18
%113 = load double**, double*** %19
%114 = load i8**, i8*** %21
%115 = load i8**, i8*** %22
%116 = load double*, double** %23
%117 = call i32 @get_hbond_ij(i64 %107, i64 %108, double* %109, i64** %110, i8** %111, i8* %112, double** %113, i64* %25, i8** %114, i8** %115, double* %116)
%118 = load i64, i64* %25
%119 = load i8**, i8*** %21
%120 = load i8**, i8*** %22
%121 = load i64, i64* %13
%122 = load i64, i64* %14
%123 = load i8*, i8** %20
%124 = load i8*, i8** %24
%125 = call i32 @get_pair_type(i64 %118, i8** %119, i8** %120, i64 %121, i64 %122, i8* %123, i8* %124)
%126 = load i8*, i8** %24
%127 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 0
%128 = call i32 @strcat(i8* %126, i8* %127)
br label %129
129: ; preds = %103, %99
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"%c%c%c\00"
@.str.2 = [4 x i8] c"SWt\00"
@.str.3 = [4 x i8] c"WSt\00"
define void @LW_pair_type(i64 %0, i64 %1, double %2, i64** %3, i8** %4, i8* %5, double** %6, i8* %7, i8** %8, i8** %9, double* %10, i8* %11) {
%13 = alloca i64
%14 = alloca [3 x double]
%15 = alloca [10 x i8]
%16 = alloca [10 x i8]
%17 = bitcast i64* %13 to i8*
%18 = bitcast [3 x double]* %14 to i8*
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %16, i64 0, i64 0
%21 = tail call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%23 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 0
store double %2, double* %23
%24 = call i32 @get_hbond_ij(i64 %0, i64 %1, double* %23, i64** %3, i8** %4, i8* %5, double** %6, i64* %13, i8** %8, i8** %9, double* %10)
%25 = load i64, i64* %13
%26 = call i32 @get_pair_type(i64 %25, i8** %8, i8** %9, i64 %0, i64 %1, i8* %7, i8* %11)
%27 = load i8, i8* %11
%28 = icmp eq i8 %27, 83
br i1 %28, label %29, label %35
29: ; preds = %12
%30 = getelementptr inbounds i8, i8* %11, i64 2
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 83
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @get_orientation_SS(i64 %0, i64 %1, i64** %3, i8** %4, double** %6, i8* %11)
br label %35
35: ; preds = %33, %29, %12
%36 = call i32 @cis_or_trans(i64 %0, i64 %1, i8* %7, i64** %3, i8** %4, double** %6, i8* %20)
%37 = call i32 @strcat(i8* %11, i8* %20)
%38 = load i8, i8* %11
%39 = getelementptr inbounds i8, i8* %11, i64 2
%40 = load i8, i8* %39
%41 = getelementptr inbounds i8, i8* %11, i64 4
%42 = load i8, i8* %41
%43 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %38, i8 signext %40, i8 signext %42)
%44 = call i32 @bcmp(i8* dereferenceable(4) %19, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 4)
%45 = icmp eq i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %35
%47 = call i32 @bcmp(i8* dereferenceable(4) %19, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 4)
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %55
49: ; preds = %46, %35
%50 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store double 5.100000e+00, double* %23
%51 = call i32 @get_hbond_ij(i64 %0, i64 %1, double* %23, i64** %3, i8** %4, i8* %5, double** %6, i64* %13, i8** %8, i8** %9, double* %10)
%52 = load i64, i64* %13
%53 = call i32 @get_pair_type(i64 %52, i8** %8, i8** %9, i64 %0, i64 %1, i8* %7, i8* %11)
%54 = call i32 @strcat(i8* %11, i8* %20)
br label %55
55: ; preds = %49, %46
ret void
}