user: Converte this assembly snippet into its equivalent C code:

```asm
<edge_type>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,%rbx
  mov    %r8,0x8(%rsp)
  movzbl (%rcx,%rdx,1),%eax
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  jne    L451
  test   %rdi,%rdi
  jle    L966
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r15d
  jmp    L955
L1281:
  add    $0x1,%r14
L32:
  lea    D900(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L415
L192:
  add    $0x1,%r12
L380:
  lea    D349(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L204
L360:
  add    $0x1,%rbp
L1288:
  add    $0x1,%r15
  add    $0x8,%rbx
  cmp    %r15,(%rsp)
  jl     L1455
L955:
  mov    %rbx,%r13
  lea    D337(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1281
  lea    D349(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1281
  lea    D900(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L32
  jmp    L1281
L415:
  lea    D284(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L192
  lea    D849(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L192
  lea    D715(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L380
  jmp    L192
L204:
  lea    D731(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D272(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D375(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D362(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D485(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D558(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D662(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L360
  lea    D172(%rip),%rsi
  mov    0x0(%r13),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1288
  jmp    L360
L451:
  sub    $0x43,%eax
  cmp    $0x32,%al
  ja     L631
  movzbl %al,%eax
  lea    D798(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cmpq   $0x0,(%rsp)
  jle    L766
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r13d
  jmp    L541
L766:
  mov    $0x0,%ebx
  jmp    L918
  cmpq   $0x0,(%rsp)
  jle    L332
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r13d
  jmp    L1504
L332:
  mov    $0x0,%ebx
  jmp    L918
  cmpq   $0x0,(%rsp)
  jle    L923
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r13d
  jmp    L150
L923:
  mov    $0x0,%ebx
  jmp    L918
  cmpq   $0x0,(%rsp)
  jle    L16
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r13d
  jmp    L984
L16:
  mov    $0x0,%ebx
  jmp    L918
  cmpq   $0x0,(%rsp)
  jle    L409
  add    $0x8,%rbx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x1,%r13d
  jmp    L194
L1503:
  mov    %rbx,%r15
  lea    D337(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L691
L934:
  add    $0x1,%r14
L942:
  lea    D27(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L936
L75:
  add    $0x1,%r12
L322:
  lea    D349(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L607
L1507:
  add    $0x1,%rbp
L604:
  add    $0x1,%r13
  add    $0x8,%rbx
  cmp    %r13,(%rsp)
  jl     L1455
L194:
  cmp    $0x1,%r13
  jle    L1503
  mov    -0x8(%rbx),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1503
  jmp    L604
L691:
  lea    D349(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L934
  lea    D27(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L942
  jmp    L934
L936:
  lea    D284(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L75
  lea    D849(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L75
  lea    D715(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L322
  jmp    L75
L607:
  lea    D731(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D272(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D375(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D362(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D485(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D558(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D662(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1507
  lea    D172(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L604
  jmp    L1507
L613:
  mov    %rbx,%r15
  lea    D48(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L263
L709:
  add    $0x1,%r14
L1052:
  lea    D27(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L855
L1012:
  add    $0x1,%r12
L90:
  lea    D48(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L922
L1047:
  add    $0x1,%rbp
L323:
  add    $0x1,%r13
  add    $0x8,%rbx
  cmp    %r13,(%rsp)
  jl     L1455
L984:
  cmp    $0x1,%r13
  jle    L613
  mov    -0x8(%rbx),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L613
  jmp    L323
L263:
  lea    D337(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L709
  lea    D27(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1052
  jmp    L709
L855:
  lea    D284(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1012
  lea    D849(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1012
  lea    D715(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L90
  jmp    L1012
L922:
  lea    D731(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1047
  lea    D272(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1047
  lea    D375(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1047
  lea    D362(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1047
  lea    D485(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1047
  lea    D172(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L323
  jmp    L1047
L1276:
  mov    %rbx,%r15
  lea    D580(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1324
L458:
  add    $0x1,%r14
L1448:
  lea    D754(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L484
L1472:
  add    $0x1,%r12
L1175:
  lea    D580(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1158
L566:
  add    $0x1,%rbp
L80:
  add    $0x1,%r13
  add    $0x8,%rbx
  cmp    %r13,(%rsp)
  jl     L1455
L150:
  cmp    $0x1,%r13
  jle    L1276
  mov    -0x8(%rbx),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1276
  jmp    L80
L1324:
  lea    D731(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L458
  lea    D754(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1448
  jmp    L458
L484:
  lea    D284(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1472
  lea    D797(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1175
  jmp    L1472
L1158:
  lea    D337(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L566
  lea    D362(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L566
  lea    D485(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L566
  lea    D558(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L566
  lea    D662(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L566
  lea    D172(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L80
  jmp    L566
L1258:
  mov    %rbx,%r15
  lea    D580(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L52
L260:
  add    $0x1,%r14
L798:
  lea    D625(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L642
L1056:
  add    $0x1,%r12
L781:
  lea    D580(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1463
L1314:
  add    $0x1,%rbp
L718:
  add    $0x1,%r13
  add    $0x8,%rbx
  cmp    %r13,(%rsp)
  jl     L1455
L1504:
  cmp    $0x1,%r13
  jle    L1258
  mov    -0x8(%rbx),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1258
  jmp    L718
L52:
  lea    D731(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L260
  lea    D625(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L798
  jmp    L260
L642:
  lea    D284(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1056
  lea    D797(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L781
  jmp    L1056
L1463:
  lea    D337(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1314
  lea    D362(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1314
  lea    D485(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1314
  lea    D558(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1314
  lea    D662(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1314
  lea    D172(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L718
  jmp    L1314
L1427:
  mov    %rbx,%r15
  lea    D580(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1514
L995:
  add    $0x1,%r14
L921:
  lea    D625(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L453
L1075:
  add    $0x1,%r12
L886:
  lea    D580(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1418
L1028:
  add    $0x1,%rbp
L304:
  add    $0x1,%r13
  add    $0x8,%rbx
  cmp    %r13,(%rsp)
  jl     L1455
L541:
  cmp    $0x1,%r13
  jle    L1427
  mov    -0x8(%rbx),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L1427
  jmp    L304
L1514:
  lea    D731(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L995
  lea    D625(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L921
  jmp    L995
L453:
  lea    D337(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1075
  lea    D797(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L886
  jmp    L1075
L1418:
  lea    D284(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1028
  lea    D362(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1028
  lea    D485(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1028
  lea    D558(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1028
  lea    D662(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1028
  lea    D172(%rip),%rsi
  mov    (%r15),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L304
  jmp    L1028
L631:
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r14d
L1455:
  cmp    %r12,%r14
  mov    %r12,%rax
  cmovge %r14,%rax
  cmp    %rbp,%rax
  mov    %rbp,%rbx
  cmovge %rax,%rbx
  cmp    %rbx,%r14
  je     L918
  cmp    %rbx,%r12
  je     L711
  cmp    %rbp,%rax
  jle    L987
L577:
  test   %rbx,%rbx
  je     L1120
  cmp    $0x1,%rbx
  je     L373
L1393:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L966:
  mov    $0x0,%ebx
L918:
  lea    D680(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L577
L409:
  mov    $0x0,%ebx
  jmp    L918
L711:
  lea    D275(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L577
L987:
  lea    D871(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L577
L1120:
  lea    D699(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L1393
L373:
  lea    D38(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  jmp    L1393
```

tool_calls: name: retrieve_data
arguments: data_tag: D900
data_type: string
name: retrieve_data
arguments: data_tag: D349
data_type: string
name: retrieve_data
arguments: data_tag: D337
data_type: string
name: retrieve_data
arguments: data_tag: D284
data_type: string
name: retrieve_data
arguments: data_tag: D849
data_type: string
name: retrieve_data
arguments: data_tag: D715
data_type: string
name: retrieve_data
arguments: data_tag: D731
data_type: string
name: retrieve_data
arguments: data_tag: D272
data_type: string
name: retrieve_data
arguments: data_tag: D375
data_type: string
name: retrieve_data
arguments: data_tag: D362
data_type: string
name: retrieve_data
arguments: data_tag: D485
data_type: string
name: retrieve_data
arguments: data_tag: D558
data_type: string
name: retrieve_data
arguments: data_tag: D662
data_type: string
name: retrieve_data
arguments: data_tag: D172
data_type: string
name: retrieve_data
arguments: data_tag: D27
data_type: string
name: retrieve_data
arguments: data_tag: D48
data_type: string
name: retrieve_data
arguments: data_tag: D580
data_type: string
name: retrieve_data
arguments: data_tag: D754
data_type: string
name: retrieve_data
arguments: data_tag: D797
data_type: string
name: retrieve_data
arguments: data_tag: D625
data_type: string
name: retrieve_data
arguments: data_tag: D680
data_type: string
name: retrieve_data
arguments: data_tag: D275
data_type: string
name: retrieve_data
arguments: data_tag: D871
data_type: string
name: retrieve_data
arguments: data_tag: D699
data_type: string
name: retrieve_data
arguments: data_tag: D38
data_type: string

tool: D900:  N6 

tool: D349:  C2 

tool: D337:  N1 

tool: D284:  C5 

tool: D849:  N7 

tool: D715:  C8 

tool: D731:  N3 

tool: D272:  C4 

tool: D375:  N9 

tool: D362:  C1'

tool: D485:  C2'

tool: D558:  C3'

tool: D662:  O3'

tool: D172:  O2'

tool: D27:  O6 

tool: D48:  N2 

tool: D580:  O2 

tool: D754:  N4 

tool: D797:  C6 

tool: D625:  O4 

tool: D680: W

tool: D275: H

tool: D871: S

tool: D699: ?

tool: D38: .

assistant: ```c
void edge_type(long nh, char **hb_atm, long i, char *bseq, char *type_wd) {
  long k, max1, max2, max, Watson = 0, Hoogsteen = 0, Suger = 0;
  long s = 0, h = 0, w = 0;
  if (bseq[i] == 'A' || bseq[i] == 'a') {
    for (k = 1; k <= nh; k++) {
      if (strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " C2 ") == 0 || strcmp(hb_atm[k], " N6 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " N6 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " N7 ") == 0 || strcmp(hb_atm[k], " C8 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " C2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " C4 ") == 0 || strcmp(hb_atm[k], " N9 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " C3'") == 0 || strcmp(hb_atm[k], " O3'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  } else if (bseq[i] == 'I' || bseq[i] == 'i') {
    for (k = 1; k <= nh; k++) {
      if (k > 1 && !strcmp(hb_atm[k], hb_atm[k - 1]))
        continue;
      if (strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " C2 ") == 0 || strcmp(hb_atm[k], " O6 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " O6 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " N7 ") == 0 || strcmp(hb_atm[k], " C8 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " C2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " C4 ") == 0 || strcmp(hb_atm[k], " N9 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " C3'") == 0 || strcmp(hb_atm[k], " O3'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  } else if (bseq[i] == 'G' || bseq[i] == 'g') {
    for (k = 1; k <= nh; k++) {
      if (k > 1 && !strcmp(hb_atm[k], hb_atm[k - 1]))
        continue;
      if (strcmp(hb_atm[k], " N2 ") == 0 || strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " O6 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " O6 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " N7 ") == 0 || strcmp(hb_atm[k], " C8 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " N2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " C4 ") == 0 || strcmp(hb_atm[k], " N9 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  } else if (bseq[i] == 'C' || bseq[i] == 'c') {
    for (k = 1; k <= nh; k++) {
      if (k > 1 && !strcmp(hb_atm[k], hb_atm[k - 1]))
        continue;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " N4 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " N4 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " C6 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " C3'") == 0 || strcmp(hb_atm[k], " O3'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  } else if (bseq[i] == 'U' || bseq[i] == 'T' || bseq[i] == 'u' || bseq[i] == 't') {
    for (k = 1; k <= nh; k++) {
      if (k > 1 && !strcmp(hb_atm[k], hb_atm[k - 1]))
        continue;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " O4 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " O4 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " C6 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " C3'") == 0 || strcmp(hb_atm[k], " O3'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  } else if (bseq[i] == 'P' || bseq[i] == 'p') {
    for (k = 1; k <= nh; k++) {
      if (k > 1 && !strcmp(hb_atm[k], hb_atm[k - 1]))
        continue;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " N3 ") == 0 || strcmp(hb_atm[k], " O4 ") == 0)
        Watson++;
      if (strcmp(hb_atm[k], " O4 ") == 0 || strcmp(hb_atm[k], " N1 ") == 0 || strcmp(hb_atm[k], " C6 ") == 0)
        Hoogsteen++;
      if (strcmp(hb_atm[k], " O2 ") == 0 || strcmp(hb_atm[k], " C5 ") == 0 || strcmp(hb_atm[k], " C1'") == 0 || strcmp(hb_atm[k], " C2'") == 0 || strcmp(hb_atm[k], " C3'") == 0 || strcmp(hb_atm[k], " O3'") == 0 || strcmp(hb_atm[k], " O2'") == 0)
        Suger++;
    };
  }
  w = Watson;
  h = Hoogsteen;
  s = Suger;
  max1 = (Watson >= Hoogsteen) ? Watson : Hoogsteen;
  max2 = (Hoogsteen >= Suger) ? Hoogsteen : Suger;
  max = (max1 >= max2) ? max1 : max2;
  if (Watson == max)
    strcpy(type_wd, "W");
  else if (Hoogsteen == max)
    strcpy(type_wd, "H");
  else if (Suger == max)
    strcpy(type_wd, "S");
  if (max == 0)
    strcpy(type_wd, "?");
  if (max == 1)
    strcpy(type_wd, ".");
}
```