; LLVM IR from microsoft/LightAIMD :: src (molecule)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.molecule = type { i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.vec3d = type { double, double, double }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @read_xyz(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [1024 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noalias ptr @fopen(ptr noundef %21, ptr noundef @.str)
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %28, label %25

25:                                               ; preds = %2
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 38) #5
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %211

28:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #5
  %29 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call ptr @fgets(ptr noundef %29, i32 noundef 1024, ptr noundef %30)
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %38

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %34 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %35 = call i64 @strtoull(ptr noundef %34, ptr noundef %9, i32 noundef 10) #5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.molecule, ptr %36, i32 0, i32 0
  store i64 %35, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %38

38:                                               ; preds = %33, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 1, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !12
  %39 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call ptr @fgets(ptr noundef %39, i32 noundef 1024, ptr noundef %40)
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %61

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %44 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 7
  store ptr %45, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = call i64 @strtoll(ptr noundef %46, ptr noundef %13, i32 noundef 10) #5
  store i64 %47, ptr %11, align 8, !tbaa !12
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 14
  store ptr %49, ptr %12, align 8, !tbaa !5
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = call i64 @strtoull(ptr noundef %50, ptr noundef %13, i32 noundef 10) #5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.molecule, ptr %52, i32 0, i32 8
  store i64 %51, ptr %53, align 8, !tbaa !13
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 6
  store ptr %55, ptr %12, align 8, !tbaa !5
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = call i32 @strncmp(ptr noundef %56, ptr noundef @.str.3, i64 noundef 4) #6
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %43
  store i64 0, ptr %10, align 8, !tbaa !12
  br label %60

60:                                               ; preds = %59, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %61

61:                                               ; preds = %60, %38
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.molecule, ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = mul i64 %64, 8
  %66 = call ptr @x_malloc(i64 noundef %65)
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.molecule, ptr %67, i32 0, i32 2
  store ptr %66, ptr %68, align 8, !tbaa !14
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.molecule, ptr %69, i32 0, i32 0
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = mul i64 %71, 8
  %73 = call ptr @x_malloc(i64 noundef %72)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.molecule, ptr %74, i32 0, i32 3
  store ptr %73, ptr %75, align 8, !tbaa !15
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.molecule, ptr %76, i32 0, i32 0
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = mul i64 %78, 24
  %80 = call ptr @x_malloc(i64 noundef %79)
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.molecule, ptr %81, i32 0, i32 4
  store ptr %80, ptr %82, align 8, !tbaa !16
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.molecule, ptr %83, i32 0, i32 0
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = mul i64 %85, 24
  %87 = call ptr @x_malloc(i64 noundef %86)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.molecule, ptr %88, i32 0, i32 5
  store ptr %87, ptr %89, align 8, !tbaa !17
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.molecule, ptr %90, i32 0, i32 0
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = mul i64 %92, 24
  %94 = call ptr @x_malloc(i64 noundef %93)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.molecule, ptr %95, i32 0, i32 6
  store ptr %94, ptr %96, align 8, !tbaa !18
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.molecule, ptr %97, i32 0, i32 0
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = mul i64 %99, 24
  %101 = call ptr @x_malloc(i64 noundef %100)
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.molecule, ptr %102, i32 0, i32 7
  store ptr %101, ptr %103, align 8, !tbaa !19
  %104 = call ptr @x_malloc(i64 noundef 256)
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.molecule, ptr %105, i32 0, i32 9
  store ptr %104, ptr %106, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !12
  br label %107

107:                                              ; preds = %198, %61
  %108 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = call ptr @fgets(ptr noundef %108, i32 noundef 1024, ptr noundef %109)
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %199

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %113 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %114 = call ptr @strtok(ptr noundef %113, ptr noundef @.str.4) #5
  store ptr %114, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = call i64 @atomic_symbol_to_num(ptr noundef %115)
  store i64 %116, ptr %17, align 8, !tbaa !12
  %117 = load i64, ptr %17, align 8, !tbaa !12
  %118 = load i64, ptr %15, align 8, !tbaa !12
  %119 = add i64 %118, %117
  store i64 %119, ptr %15, align 8, !tbaa !12
  %120 = load i64, ptr %17, align 8, !tbaa !12
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.molecule, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !14
  %124 = load i64, ptr %14, align 8, !tbaa !12
  %125 = getelementptr inbounds i64, ptr %123, i64 %124
  store i64 %120, ptr %125, align 8, !tbaa !12
  %126 = load i64, ptr %17, align 8, !tbaa !12
  %127 = call double @atomic_num_to_mass(i64 noundef %126)
  %128 = fmul double %127, 0x409C7B8DCF542A68
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.molecule, ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = load i64, ptr %14, align 8, !tbaa !12
  %133 = getelementptr inbounds double, ptr %131, i64 %132
  store double %128, ptr %133, align 8, !tbaa !21
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %137, label %136

136:                                              ; preds = %112
  store i32 3, ptr %7, align 4
  br label %196

137:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %138 = call ptr @strtok(ptr noundef null, ptr noundef @.str.4) #5
  %139 = call double @strtod(ptr noundef %138, ptr noundef null) #5
  store double %139, ptr %18, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %140 = call ptr @strtok(ptr noundef null, ptr noundef @.str.4) #5
  %141 = call double @strtod(ptr noundef %140, ptr noundef null) #5
  store double %141, ptr %19, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %142 = call ptr @strtok(ptr noundef null, ptr noundef @.str.4) #5
  %143 = call double @strtod(ptr noundef %142, ptr noundef null) #5
  store double %143, ptr %20, align 8, !tbaa !21
  %144 = load i64, ptr %10, align 8, !tbaa !12
  %145 = icmp ne i64 %144, 0
  br i1 %145, label %146, label %171

146:                                              ; preds = %137
  %147 = load double, ptr %18, align 8, !tbaa !21
  %148 = fdiv double %147, 0x3FE0EF050BD3BD7A
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.molecule, ptr %149, i32 0, i32 4
  %151 = load ptr, ptr %150, align 8, !tbaa !16
  %152 = load i64, ptr %14, align 8, !tbaa !12
  %153 = getelementptr inbounds %struct.vec3d, ptr %151, i64 %152
  %154 = getelementptr inbounds %struct.vec3d, ptr %153, i32 0, i32 0
  store double %148, ptr %154, align 8, !tbaa !23
  %155 = load double, ptr %19, align 8, !tbaa !21
  %156 = fdiv double %155, 0x3FE0EF050BD3BD7A
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.molecule, ptr %157, i32 0, i32 4
  %159 = load ptr, ptr %158, align 8, !tbaa !16
  %160 = load i64, ptr %14, align 8, !tbaa !12
  %161 = getelementptr inbounds %struct.vec3d, ptr %159, i64 %160
  %162 = getelementptr inbounds %struct.vec3d, ptr %161, i32 0, i32 1
  store double %156, ptr %162, align 8, !tbaa !25
  %163 = load double, ptr %20, align 8, !tbaa !21
  %164 = fdiv double %163, 0x3FE0EF050BD3BD7A
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.molecule, ptr %165, i32 0, i32 4
  %167 = load ptr, ptr %166, align 8, !tbaa !16
  %168 = load i64, ptr %14, align 8, !tbaa !12
  %169 = getelementptr inbounds %struct.vec3d, ptr %167, i64 %168
  %170 = getelementptr inbounds %struct.vec3d, ptr %169, i32 0, i32 2
  store double %164, ptr %170, align 8, !tbaa !26
  br label %193

171:                                              ; preds = %137
  %172 = load double, ptr %18, align 8, !tbaa !21
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.molecule, ptr %173, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !16
  %176 = load i64, ptr %14, align 8, !tbaa !12
  %177 = getelementptr inbounds %struct.vec3d, ptr %175, i64 %176
  %178 = getelementptr inbounds %struct.vec3d, ptr %177, i32 0, i32 0
  store double %172, ptr %178, align 8, !tbaa !23
  %179 = load double, ptr %19, align 8, !tbaa !21
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.molecule, ptr %180, i32 0, i32 4
  %182 = load ptr, ptr %181, align 8, !tbaa !16
  %183 = load i64, ptr %14, align 8, !tbaa !12
  %184 = getelementptr inbounds %struct.vec3d, ptr %182, i64 %183
  %185 = getelementptr inbounds %struct.vec3d, ptr %184, i32 0, i32 1
  store double %179, ptr %185, align 8, !tbaa !25
  %186 = load double, ptr %20, align 8, !tbaa !21
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.molecule, ptr %187, i32 0, i32 4
  %189 = load ptr, ptr %188, align 8, !tbaa !16
  %190 = load i64, ptr %14, align 8, !tbaa !12
  %191 = getelementptr inbounds %struct.vec3d, ptr %189, i64 %190
  %192 = getelementptr inbounds %struct.vec3d, ptr %191, i32 0, i32 2
  store double %186, ptr %192, align 8, !tbaa !26
  br label %193

193:                                              ; preds = %171, %146
  %194 = load i64, ptr %14, align 8, !tbaa !12
  %195 = add i64 %194, 1
  store i64 %195, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  store i32 0, ptr %7, align 4
  br label %196

196:                                              ; preds = %193, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %197 = load i32, ptr %7, align 4
  switch i32 %197, label %213 [
    i32 0, label %198
    i32 3, label %199
  ]

198:                                              ; preds = %196
  br label %107, !llvm.loop !27

199:                                              ; preds = %196, %107
  %200 = load i64, ptr %15, align 8, !tbaa !12
  %201 = load i64, ptr %11, align 8, !tbaa !12
  %202 = sub i64 %200, %201
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.molecule, ptr %203, i32 0, i32 1
  store i64 %202, ptr %204, align 8, !tbaa !29
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.molecule, ptr %206, i32 0, i32 9
  %208 = load ptr, ptr %207, align 8, !tbaa !20
  call void @filename_stem(ptr noundef %205, ptr noundef %208)
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = call i32 @fclose(ptr noundef %209)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #5
  br label %211

211:                                              ; preds = %199, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %212 = load i64, ptr %3, align 8
  ret i64 %212

213:                                              ; preds = %196
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i64 @strtoull(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind
declare i64 @strtoll(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #4

declare ptr @x_malloc(i64 noundef) #2

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #3

declare i64 @atomic_symbol_to_num(ptr noundef) #2

declare double @atomic_num_to_mass(i64 noundef) #2

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #3

declare void @filename_stem(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"molecule", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72}
!11 = !{!"long", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 64}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 24}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 40}
!18 = !{!10, !6, i64 48}
!19 = !{!10, !6, i64 56}
!20 = !{!10, !6, i64 72}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!24, !22, i64 0}
!24 = !{!"vec3d", !22, i64 0, !22, i64 8, !22, i64 16}
!25 = !{!24, !22, i64 8}
!26 = !{!24, !22, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!10, !11, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.vec3d = type { double, double, double }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -1, 1) i64 @read_xyz(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %10

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 38) #6
  br label %105

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  %11 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %6)
  %.not68 = icmp eq ptr %11, null
  br i1 %.not68, label %14, label %12

12:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %13 = call i64 @strtoull(ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef 10) #7
  store i64 %13, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %14

14:                                               ; preds = %12, %10
  %15 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %6)
  %.not69 = icmp eq ptr %15, null
  br i1 %.not69, label %26, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %3, i64 7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %18 = call i64 @strtoll(ptr noundef nonnull %17, ptr noundef nonnull %5, i32 noundef 10) #7
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 14
  %21 = call i64 @strtoull(ptr noundef nonnull %20, ptr noundef nonnull %5, i32 noundef 10) #7
  %22 = getelementptr inbounds i8, ptr %1, i64 64
  store i64 %21, ptr %22, align 8, !tbaa !12
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 6
  %25 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %24, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef 4) #8
  %.fr = freeze i32 %25
  %.not70 = icmp eq i32 %.fr, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %26

26:                                               ; preds = %16, %14
  %.062 = phi i64 [ %18, %16 ], [ 0, %14 ]
  %.1 = phi i1 [ %.not70, %16 ], [ false, %14 ]
  %27 = load i64, ptr %1, align 8, !tbaa !9
  %28 = shl i64 %27, 3
  %29 = call ptr @x_malloc(i64 noundef %28) #7
  %30 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %29, ptr %30, align 8, !tbaa !13
  %31 = load i64, ptr %1, align 8, !tbaa !9
  %32 = shl i64 %31, 3
  %33 = call ptr @x_malloc(i64 noundef %32) #7
  %34 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr %33, ptr %34, align 8, !tbaa !14
  %35 = load i64, ptr %1, align 8, !tbaa !9
  %36 = mul i64 %35, 24
  %37 = call ptr @x_malloc(i64 noundef %36) #7
  %38 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %37, ptr %38, align 8, !tbaa !15
  %39 = load i64, ptr %1, align 8, !tbaa !9
  %40 = mul i64 %39, 24
  %41 = call ptr @x_malloc(i64 noundef %40) #7
  %42 = getelementptr inbounds i8, ptr %1, i64 40
  store ptr %41, ptr %42, align 8, !tbaa !16
  %43 = load i64, ptr %1, align 8, !tbaa !9
  %44 = mul i64 %43, 24
  %45 = call ptr @x_malloc(i64 noundef %44) #7
  %46 = getelementptr inbounds i8, ptr %1, i64 48
  store ptr %45, ptr %46, align 8, !tbaa !17
  %47 = load i64, ptr %1, align 8, !tbaa !9
  %48 = mul i64 %47, 24
  %49 = call ptr @x_malloc(i64 noundef %48) #7
  %50 = getelementptr inbounds i8, ptr %1, i64 56
  store ptr %49, ptr %50, align 8, !tbaa !18
  %51 = call ptr @x_malloc(i64 noundef 256) #7
  %52 = getelementptr inbounds i8, ptr %1, i64 72
  store ptr %51, ptr %52, align 8, !tbaa !19
  %53 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %6)
  %.not7177 = icmp eq ptr %53, null
  br i1 %.not7177, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %26
  br i1 %.1, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %63
  %.06379.us = phi i64 [ %74, %63 ], [ 0, %.lr.ph ]
  %.06578.us = phi i64 [ %56, %63 ], [ 0, %.lr.ph ]
  %54 = call ptr @strtok(ptr noundef nonnull %3, ptr noundef nonnull @.str.4) #7
  %55 = call i64 @atomic_symbol_to_num(ptr noundef %54) #7
  %56 = add i64 %55, %.06578.us
  %57 = load ptr, ptr %30, align 8, !tbaa !13
  %58 = getelementptr inbounds i64, ptr %57, i64 %.06379.us
  store i64 %55, ptr %58, align 8, !tbaa !20
  %59 = call double @atomic_num_to_mass(i64 noundef %55) #7
  %60 = fmul double %59, 0x409C7B8DCF542A68
  %61 = load ptr, ptr %34, align 8, !tbaa !14
  %62 = getelementptr inbounds double, ptr %61, i64 %.06379.us
  store double %60, ptr %62, align 8, !tbaa !21
  %.not72.us = icmp eq ptr %54, null
  br i1 %.not72.us, label %.thread, label %63

63:                                               ; preds = %.lr.ph.split.us
  %64 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %65 = call double @strtod(ptr nocapture noundef %64, ptr noundef null) #7
  %66 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %67 = call double @strtod(ptr nocapture noundef %66, ptr noundef null) #7
  %68 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %69 = call double @strtod(ptr nocapture noundef %68, ptr noundef null) #7
  %70 = load ptr, ptr %38, align 8, !tbaa !15
  %71 = getelementptr inbounds %struct.vec3d, ptr %70, i64 %.06379.us
  store double %65, ptr %71, align 8, !tbaa !23
  %72 = getelementptr inbounds %struct.vec3d, ptr %70, i64 %.06379.us, i32 1
  store double %67, ptr %72, align 8, !tbaa !25
  %73 = getelementptr inbounds %struct.vec3d, ptr %70, i64 %.06379.us, i32 2
  store double %69, ptr %73, align 8, !tbaa !26
  %74 = add i64 %.06379.us, 1
  %75 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %6)
  %.not71.us = icmp eq ptr %75, null
  br i1 %.not71.us, label %.thread, label %.lr.ph.split.us

.lr.ph.split:                                     ; preds = %.lr.ph, %85
  %.06379 = phi i64 [ %99, %85 ], [ 0, %.lr.ph ]
  %.06578 = phi i64 [ %78, %85 ], [ 0, %.lr.ph ]
  %76 = call ptr @strtok(ptr noundef nonnull %3, ptr noundef nonnull @.str.4) #7
  %77 = call i64 @atomic_symbol_to_num(ptr noundef %76) #7
  %78 = add i64 %77, %.06578
  %79 = load ptr, ptr %30, align 8, !tbaa !13
  %80 = getelementptr inbounds i64, ptr %79, i64 %.06379
  store i64 %77, ptr %80, align 8, !tbaa !20
  %81 = call double @atomic_num_to_mass(i64 noundef %77) #7
  %82 = fmul double %81, 0x409C7B8DCF542A68
  %83 = load ptr, ptr %34, align 8, !tbaa !14
  %84 = getelementptr inbounds double, ptr %83, i64 %.06379
  store double %82, ptr %84, align 8, !tbaa !21
  %.not72 = icmp eq ptr %76, null
  br i1 %.not72, label %.thread, label %85

85:                                               ; preds = %.lr.ph.split
  %86 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %87 = call double @strtod(ptr nocapture noundef %86, ptr noundef null) #7
  %88 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %89 = call double @strtod(ptr nocapture noundef %88, ptr noundef null) #7
  %90 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.4) #7
  %91 = call double @strtod(ptr nocapture noundef %90, ptr noundef null) #7
  %92 = load ptr, ptr %38, align 8, !tbaa !15
  %93 = getelementptr inbounds %struct.vec3d, ptr %92, i64 %.06379
  %94 = insertelement <2 x double> poison, double %87, i64 0
  %95 = insertelement <2 x double> %94, double %89, i64 1
  %96 = fdiv <2 x double> %95, <double 0x3FE0EF050BD3BD7A, double 0x3FE0EF050BD3BD7A>
  store <2 x double> %96, ptr %93, align 8, !tbaa !21
  %97 = fdiv double %91, 0x3FE0EF050BD3BD7A
  %98 = getelementptr inbounds %struct.vec3d, ptr %92, i64 %.06379, i32 2
  store double %97, ptr %98, align 8, !tbaa !26
  %99 = add i64 %.06379, 1
  %100 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %6)
  %.not71 = icmp eq ptr %100, null
  br i1 %.not71, label %.thread, label %.lr.ph.split

.thread:                                          ; preds = %85, %.lr.ph.split, %63, %.lr.ph.split.us, %26
  %.166 = phi i64 [ 0, %26 ], [ %56, %.lr.ph.split.us ], [ %56, %63 ], [ %78, %.lr.ph.split ], [ %78, %85 ]
  %101 = sub i64 %.166, %.062
  %102 = getelementptr inbounds i8, ptr %1, i64 8
  store i64 %101, ptr %102, align 8, !tbaa !27
  %103 = load ptr, ptr %52, align 8, !tbaa !19
  call void @filename_stem(ptr noundef %0, ptr noundef %103) #7
  %104 = call i32 @fclose(ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  br label %105

105:                                              ; preds = %.thread, %7
  %.0 = phi i64 [ 0, %.thread ], [ -1, %7 ]
  ret i64 %.0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtoull(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtoll(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #4

declare ptr @x_malloc(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3

declare i64 @atomic_symbol_to_num(ptr noundef) local_unnamed_addr #5

declare double @atomic_num_to_mass(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #3

declare void @filename_stem(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"molecule", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 64}
!13 = !{!10, !6, i64 16}
!14 = !{!10, !6, i64 24}
!15 = !{!10, !6, i64 32}
!16 = !{!10, !6, i64 40}
!17 = !{!10, !6, i64 48}
!18 = !{!10, !6, i64 56}
!19 = !{!10, !6, i64 72}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!24, !22, i64 0}
!24 = !{!"vec3d", !22, i64 0, !22, i64 8, !22, i64 16}
!25 = !{!24, !22, i64 8}
!26 = !{!24, !22, i64 16}
!27 = !{!10, !11, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass