#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 *);
void get_atom_xyz(long ib, long ie, char *aname, char **AtomName, double **xyz,
                  double *atom_xyz) {
  long i, j;
  i = find_1st_atom(aname, AtomName, ib, ie, "");
  if (i)
    for (j = 1; j <= 3; j++)
      atom_xyz[j] = xyz[i][j];
  return;
}


x86 assembly (clang, -O0):
<get_atom_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb9(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11a6 <get_atom_xyz+0x96>
movq   $0x1,-0x40(%rbp)
cmpq   $0x3,-0x40(%rbp)
jg     11a1 <get_atom_xyz+0x91>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1163 <get_atom_xyz+0x53>
jmp    11a6 <get_atom_xyz+0x96>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_atom_xyz>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%r15
mov    %r8,%r14
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xed8(%rip),%r8
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <find_1st_atom@plt>
test   %rax,%rax
je     1163 <get_atom_xyz+0x53>
mov    (%r14,%rax,8),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%r15)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%r15)
movsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @get_atom_xyz(i64 %0, i64 %1, i8* %2, i8** %3, double** %4, double* %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca double**
%12 = alloca double*
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i8** %3, i8*** %10
store double** %4, double*** %11
store double* %5, double** %12
%15 = load i8*, i8** %9
%16 = load i8**, i8*** %10
%17 = load i64, i64* %7
%18 = load i64, i64* %8
%19 = call i64 @find_1st_atom(i8* %15, i8** %16, i64 %17, i64 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i64 %19, i64* %13
%20 = load i64, i64* %13
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %41
22: ; preds = %6
store i64 1, i64* %14
br label %23
23: ; preds = %37, %22
%24 = load i64, i64* %14
%25 = icmp sle i64 %24, 3
br i1 %25, label %26, label %40
26: ; preds = %23
%27 = load double**, double*** %11
%28 = load i64, i64* %13
%29 = getelementptr inbounds double*, double** %27, i64 %28
%30 = load double*, double** %29
%31 = load i64, i64* %14
%32 = getelementptr inbounds double, double* %30, i64 %31
%33 = load double, double* %32
%34 = load double*, double** %12
%35 = load i64, i64* %14
%36 = getelementptr inbounds double, double* %34, i64 %35
store double %33, double* %36
br label %37
37: ; preds = %26
%38 = load i64, i64* %14
%39 = add nsw i64 %38, 1
store i64 %39, i64* %14
br label %23
40: ; preds = %23
br label %41
41: ; preds = %40, %6
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @get_atom_xyz(i64 %0, i64 %1, i8* %2, i8** %3, double** nocapture %4, double* nocapture writeonly %5) {
%7 = tail call i64 @find_1st_atom(i8* %2, i8** %3, i64 %0, i64 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %6
%10 = getelementptr inbounds double*, double** %4, i64 %7
%11 = load double*, double** %10
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %5, i64 1
store double %13, double* %14
%15 = getelementptr inbounds double, double* %11, i64 2
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %5, i64 2
store double %16, double* %17
%18 = getelementptr inbounds double, double* %11, i64 3
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %5, i64 3
store double %19, double* %20
br label %21
21: ; preds = %9, %6
ret void
}