// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/simulation.c
// Function: Test_buildup
float Test_buildup(struct bond *bonds, atom *atoms, int natoms, int naxes)
{
  printf("Testing build up\n");
  // Compute new conformation
  float coord_old[3*natoms], coord_new[3*natoms];
  Set_bonds_measure(bonds, natoms, atoms);
  Put_coord(coord_old, bonds, natoms);
  Build_up(bonds, natoms, NULL, naxes);
  Put_coord(coord_new, bonds, natoms);
  float mass[natoms]; for(int i=0; i<natoms; i++)mass[i]=1;
  float RMSD=rmsd_mclachlan_f(coord_old, coord_new, mass, natoms);
  printf("RMSD with no torsion change: %.2g\n", RMSD);
  if(RMSD > 0.5){
    printf("ERROR in Test_buildup, RMSD= %.2f\n", RMSD);
    exit(8);
  }
  return(RMSD);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl %edx, %ebx
movq %rsi, %r13
movq %rdi, %r12
leaq 0x232b6(%rip), %rdi     # 0x5bd7a
callq 0x2090
leal (%rbx,%rbx,2), %eax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rcx, %rsp
movq %r12, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x14cf3
testl %ebx, %ebx
jle 0x38cc6
movl %ebx, %r13d
leaq 0x8(%r12), %rax
xorl %ecx, %ecx
movq %r14, %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%r12,%rsi)
js 0x38b4a
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x38b22
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq %r13, %rcx
jne 0x38b10
movq %r14, -0x30(%rbp)
xorl %r14d, %r14d
movq %r12, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x15083
leaq 0x8(%r12), %rax
movq -0x38(%rbp), %rsi
movq %rsi, %rcx
leaq (%r14,%r14,2), %rdx
shlq $0x6, %rdx
cmpl $0x0, 0x20(%r12,%rdx)
js 0x38ba6
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rdx,2), %xmm0
movss %xmm0, (%rcx,%rdx)
addq $0x4, %rdx
cmpq $0xc, %rdx
jne 0x38b7e
incq %r14
addq $0xc0, %rax
addq %rdx, %rcx
cmpq %r13, %r14
jne 0x38b6c
movq %rsp, %rdx
leaq 0xf(,%r13,4), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, %rsp
testl %ebx, %ebx
jle 0x38cf2
leal 0x3(%r13), %eax
decq %r13
movq %r13, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %eax
shlq $0x4, %rax
movdqa 0x1842d(%rip), %xmm1    # 0x51010
movdqa 0x18435(%rip), %xmm2    # 0x51020
xorl %ecx, %ecx
movdqa 0x1843b(%rip), %xmm3    # 0x51030
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x1d57b(%rip), %xmm5    # 0x56180
movq -0x30(%rbp), %r14
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x38c45
movl $0x3f800000, (%rdx,%rcx) # imm = 0x3F800000
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x38c5c
movl $0x3f800000, 0x4(%rdx,%rcx) # imm = 0x3F800000
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edi
testb $0x1, %dil
je 0x38c9c
movl $0x3f800000, 0x8(%rdx,%rcx) # imm = 0x3F800000
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x38caf
movl $0x3f800000, 0xc(%rdx,%rcx) # imm = 0x3F800000
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x38c09
jmp 0x38cf6
movq %r12, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x15083
movl %ebx, %eax
movq %rsp, %rdx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, %rsp
movq -0x38(%rbp), %rsi
jmp 0x38cf6
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl %ebx, %ecx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
cvtss2sd %xmm0, %xmm0
leaq 0x22a25(%rip), %rdi     # 0x5b739
movsd %xmm0, -0x30(%rbp)
movb $0x1, %al
callq 0x20f0
movss -0x38(%rbp), %xmm0
ucomiss 0x1ce98(%rip), %xmm0    # 0x55bc4
ja 0x38d3d
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22a18(%rip), %rdi     # 0x5b75c
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x20f0
movl $0x8, %edi
callq 0x2280