#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 */
char **cmatrix(int /*<<< orphan*/, long, int /*<<< orphan*/, int);
int /*<<< orphan*/ edge_type(long, char **, long, char *, char *);
int /*<<< orphan*/ get_unequility(long, char **, long *, char **);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void get_pair_type(long num_hbonds, char **hb_atom1, char **hb_atom2, long i,
                   long j, char *bseq, char *type) {
  char type_wd1[5], type_wd2[5], **atom;
  long nh1, nh2;
  atom = cmatrix(0, num_hbonds + 40, 0, 4);
  if (num_hbonds >= 1) {
    get_unequility(num_hbonds, hb_atom1, &nh1, atom);
    edge_type(nh1, atom, i, bseq, type_wd1);
    get_unequility(num_hbonds, hb_atom2, &nh2, atom);
    edge_type(nh2, atom, j, bseq, type_wd2);
    sprintf(type, "%s/%s", type_wd1, type_wd2);
  } else
    sprintf(type, "?/?");
}


x86 assembly (clang, -O0):
<get_pair_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
add    $0x28,%rsi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%edi
call   1030 <cmatrix@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     1204 <get_pair_type+0xc4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x48(%rbp),%rcx
lea    -0x50(%rbp),%rdx
call   1060 <get_unequility@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x35(%rbp),%r8
call   1040 <edge_type@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x48(%rbp),%rcx
lea    -0x58(%rbp),%rdx
call   1060 <get_unequility@plt>
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x3a(%rbp),%r8
call   1040 <edge_type@plt>
mov    0x10(%rbp),%rdi
lea    -0x35(%rbp),%rdx
lea    -0x3a(%rbp),%rcx
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    1216 <get_pair_type+0xd6>
mov    0x10(%rbp),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pair_type>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r13
mov    %r8,(%rsp)
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x28(%rdi),%rsi
xor    %edi,%edi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <cmatrix@plt>
test   %rbx,%rbx
jle    11f3 <get_pair_type+0xb3>
mov    %rax,%rbp
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rax,%rcx
call   1060 <get_unequility@plt>
mov    0x10(%rsp),%rdi
lea    0x23(%rsp),%r15
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1040 <edge_type@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rcx
call   1060 <get_unequility@plt>
mov    0x8(%rsp),%rdi
lea    0x1e(%rsp),%rbx
mov    %rbp,%rsi
mov    (%rsp),%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1040 <edge_type@plt>
lea    0xe21(%rip),%rsi
mov    0x60(%rsp),%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    11fe <get_pair_type+0xbe>
mov    0x60(%rsp),%rax
movl   $0x3f2f3f,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [4 x i8] c"?/?\00"
define void @get_pair_type(i64 %0, i8** %1, i8** %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [5 x i8]
%16 = alloca [5 x i8]
%17 = alloca i8**
%18 = alloca i64
%19 = alloca i64
store i64 %0, i64* %8
store i8** %1, i8*** %9
store i8** %2, i8*** %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%20 = load i64, i64* %8
%21 = add nsw i64 %20, 40
%22 = call i8** @cmatrix(i32 0, i64 %21, i32 0, i32 4)
store i8** %22, i8*** %17
%23 = load i64, i64* %8
%24 = icmp sge i64 %23, 1
br i1 %24, label %25, label %50
25: ; preds = %7
%26 = load i64, i64* %8
%27 = load i8**, i8*** %9
%28 = load i8**, i8*** %17
%29 = call i32 @get_unequility(i64 %26, i8** %27, i64* %18, i8** %28)
%30 = load i64, i64* %18
%31 = load i8**, i8*** %17
%32 = load i64, i64* %11
%33 = load i8*, i8** %13
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%35 = call i32 @edge_type(i64 %30, i8** %31, i64 %32, i8* %33, i8* %34)
%36 = load i64, i64* %8
%37 = load i8**, i8*** %10
%38 = load i8**, i8*** %17
%39 = call i32 @get_unequility(i64 %36, i8** %37, i64* %19, i8** %38)
%40 = load i64, i64* %19
%41 = load i8**, i8*** %17
%42 = load i64, i64* %12
%43 = load i8*, i8** %13
%44 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%45 = call i32 @edge_type(i64 %40, i8** %41, i64 %42, i8* %43, i8* %44)
%46 = load i8*, i8** %14
%47 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%48 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%49 = call i32 (i8*, i8*, ...) @sprintf(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %47, i8* %48)
br label %53
50: ; preds = %7
%51 = load i8*, i8** %14
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %53
53: ; preds = %50, %25
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define void @get_pair_type(i64 %0, i8** %1, i8** %2, i64 %3, i64 %4, i8* %5, i8* nocapture writeonly %6) {
%8 = alloca [5 x i8]
%9 = alloca [5 x i8]
%10 = alloca i64
%11 = alloca i64
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%14 = bitcast i64* %10 to i8*
%15 = bitcast i64* %11 to i8*
%16 = add nsw i64 %0, 40
%17 = tail call i8** @cmatrix(i32 0, i64 %16, i32 0, i32 4)
%18 = icmp sgt i64 %0, 0
br i1 %18, label %19, label %27
19: ; preds = %7
%20 = call i32 @get_unequility(i64 %0, i8** %1, i64* %10, i8** %17)
%21 = load i64, i64* %10
%22 = call i32 @edge_type(i64 %21, i8** %17, i64 %3, i8* %5, i8* %12)
%23 = call i32 @get_unequility(i64 %0, i8** %2, i64* %11, i8** %17)
%24 = load i64, i64* %11
%25 = call i32 @edge_type(i64 %24, i8** %17, i64 %4, i8* %5, i8* %13)
%26 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
br label %29
27: ; preds = %7
%28 = bitcast i8* %6 to i32*
store i32 4140863, i32* %28
br label %29
29: ; preds = %27, %19
ret void
}