#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 o3_p_xyz(long ib, long ie, char *aname, char **AtomName, double **xyz,
              double *o3_or_p, long idx) {
  long i, j;
  i = find_1st_atom(aname, AtomName, ib, ie, "");
  if (i) {
    for (j = 1; j <= 3; j++)
      o3_or_p[idx - 4 + j] = xyz[i][j];
    o3_or_p[idx] = 1.0;
  } else
    o3_or_p[idx] = -1.0;
}


x86 assembly (clang, -O0):
<o3_p_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec5(%rip),%r8
call   1030 <find_1st_atom@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11c7 <o3_p_xyz+0xb7>
movq   $0x1,-0x40(%rbp)
cmpq   $0x3,-0x40(%rbp)
jg     11ad <o3_p_xyz+0x9d>
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    0x10(%rbp),%rcx
sub    $0x4,%rcx
add    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1167 <o3_p_xyz+0x57>
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    11dc <o3_p_xyz+0xcc>
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
movsd  0xe29(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<o3_p_xyz>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%rbx
mov    %r8,%r14
mov    %rsi,%r9
mov    %rdi,%rax
mov    0x20(%rsp),%r15
lea    0xee3(%rip),%r8
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %rax,%rdx
mov    %r9,%rcx
call   1030 <find_1st_atom@plt>
test   %rax,%rax
je     1175 <o3_p_xyz+0x65>
mov    (%r14,%rax,8),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbx,%r15,8)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x10(%rbx,%r15,8)
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x8(%rbx,%r15,8)
movsd  0xe95(%rip),%xmm0
jmp    117d <o3_p_xyz+0x6d>
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,(%rbx,%r15,8)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @o3_p_xyz(i64 %0, i64 %1, i8* %2, i8** %3, double** nocapture %4, double* nocapture writeonly %5, i64 %6) {
%8 = 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))
%9 = icmp eq i64 %8, 0
br i1 %9, label %25, label %10
10: ; preds = %7
%11 = getelementptr inbounds double*, double** %4, i64 %8
%12 = load double*, double** %11
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = add nsw i64 %6, -3
%16 = getelementptr inbounds double, double* %5, i64 %15
store double %14, double* %16
%17 = getelementptr inbounds double, double* %12, i64 2
%18 = load double, double* %17
%19 = add nsw i64 %6, -2
%20 = getelementptr inbounds double, double* %5, i64 %19
store double %18, double* %20
%21 = getelementptr inbounds double, double* %12, i64 3
%22 = load double, double* %21
%23 = add nsw i64 %6, -1
%24 = getelementptr inbounds double, double* %5, i64 %23
store double %22, double* %24
br label %25
25: ; preds = %7, %10
%26 = phi double [ 1.000000e+00, %10 ], [ -1.000000e+00, %7 ]
%27 = getelementptr inbounds double, double* %5, i64 %6
store double %26, double* %27
ret void
}