; LLVM IR from moldyn/Clustering :: src/coords_file/xdrfile (trr2xtc)

; 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"

@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ReadWrite(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !9
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 5
  br i1 %16, label %17, label %23

17:                                               ; preds = %2
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.12, ptr noundef %21) #6
  call void @exit(i32 noundef 1) #7
  unreachable

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %96, %23
  %25 = load i32, ptr %14, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %99

28:                                               ; preds = %24
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = load i32, ptr %14, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds ptr, ptr %29, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = call i32 @strcmp(ptr noundef %33, ptr noundef @.str.13) #8
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %62

36:                                               ; preds = %28
  %37 = load i32, ptr %14, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %14, align 4, !tbaa !5
  store i32 1, ptr %6, align 4, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !9
  %40 = load i32, ptr %14, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %39, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = call ptr @strstr(ptr noundef %43, ptr noundef @.str.14) #8
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  store i32 1, ptr %8, align 4, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %46, %36
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = load i32, ptr %14, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call ptr @strstr(ptr noundef %52, ptr noundef @.str.15) #8
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %56

55:                                               ; preds = %47
  store i32 1, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %55, %47
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = load i32, ptr %14, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  store ptr %61, ptr %12, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %56, %28
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = load i32, ptr %14, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %63, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = call i32 @strcmp(ptr noundef %67, ptr noundef @.str.16) #8
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %96

70:                                               ; preds = %62
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %14, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = load i32, ptr %14, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %73, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = call ptr @strstr(ptr noundef %77, ptr noundef @.str.14) #8
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %70
  store i32 1, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %80, %70
  %82 = load ptr, ptr %5, align 8, !tbaa !9
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %82, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = call ptr @strstr(ptr noundef %86, ptr noundef @.str.15) #8
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %90

89:                                               ; preds = %81
  store i32 1, ptr %11, align 4, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %89, %81
  %91 = load ptr, ptr %5, align 8, !tbaa !9
  %92 = load i32, ptr %14, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  store ptr %95, ptr %13, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %90, %62
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %14, align 4, !tbaa !5
  br label %24, !llvm.loop !11

99:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %107, label %106

106:                                              ; preds = %103, %100
  call void @perror(ptr noundef @.str.17)
  call void @exit(i32 noundef 1) #7
  unreachable

107:                                              ; preds = %103
  %108 = load ptr, ptr %12, align 8, !tbaa !9
  %109 = load ptr, ptr %13, align 8, !tbaa !9
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !5
  call void @ReadWrite(ptr noundef %108, ptr noundef %109, i32 noundef %110, i32 noundef %111, i32 noundef %112, i32 noundef %113)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  ret i32 0
}

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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

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

declare void @perror(ptr noundef) #5

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 = { 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 = { noreturn 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 = { "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 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ReadWrite(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %.not = icmp eq i32 %0, 5
  br i1 %.not, label %.preheader, label %3

3:                                                ; preds = %2
  %4 = load ptr, ptr @stderr, align 8, !tbaa !5
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %4, ptr noundef nonnull @.str.12, ptr noundef %5) #4
  tail call void @exit(i32 noundef 1) #5
  unreachable

.preheader:                                       ; preds = %2, %30
  %.070 = phi i32 [ %31, %30 ], [ 1, %2 ]
  %.03169 = phi ptr [ %.132, %30 ], [ null, %2 ]
  %.03368 = phi ptr [ %.134, %30 ], [ null, %2 ]
  %.03567 = phi i32 [ %.3, %30 ], [ 0, %2 ]
  %.03866 = phi i32 [ %.341, %30 ], [ 0, %2 ]
  %.04265 = phi i32 [ %.345, %30 ], [ 0, %2 ]
  %.04664 = phi i32 [ %.349, %30 ], [ 0, %2 ]
  %.05063 = phi i32 [ %.151, %30 ], [ 0, %2 ]
  %.05262 = phi i32 [ %.153, %30 ], [ 0, %2 ]
  %7 = sext i32 %.070 to i64
  %8 = getelementptr inbounds ptr, ptr %1, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.13) #6
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %19

12:                                               ; preds = %.preheader
  %13 = add nsw i32 %.070, 1
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds ptr, ptr %1, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.14) #6
  %.not55 = icmp eq ptr %17, null
  %spec.select = select i1 %.not55, i32 %.04664, i32 1
  %spec.select59 = select i1 %.not55, i32 %.03866, i32 0
  %18 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.15) #6
  %.not56 = icmp eq ptr %18, null
  %.248 = select i1 %.not56, i32 %spec.select, i32 0
  %.240 = select i1 %.not56, i32 %spec.select59, i32 1
  br label %19

19:                                               ; preds = %12, %.preheader
  %20 = phi ptr [ %16, %12 ], [ %9, %.preheader ]
  %.153 = phi i32 [ 1, %12 ], [ %.05262, %.preheader ]
  %.349 = phi i32 [ %.248, %12 ], [ %.04664, %.preheader ]
  %.341 = phi i32 [ %.240, %12 ], [ %.03866, %.preheader ]
  %.134 = phi ptr [ %16, %12 ], [ %.03368, %.preheader ]
  %.1 = phi i32 [ %13, %12 ], [ %.070, %.preheader ]
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.16) #6
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %30

23:                                               ; preds = %19
  %24 = add nsw i32 %.1, 1
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds ptr, ptr %1, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %27, ptr noundef nonnull dereferenceable(1) @.str.14) #6
  %.not57 = icmp eq ptr %28, null
  %spec.select60 = select i1 %.not57, i32 %.04265, i32 1
  %spec.select61 = select i1 %.not57, i32 %.03567, i32 0
  %29 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %27, ptr noundef nonnull dereferenceable(1) @.str.15) #6
  %.not58 = icmp eq ptr %29, null
  %.244 = select i1 %.not58, i32 %spec.select60, i32 0
  %.237 = select i1 %.not58, i32 %spec.select61, i32 1
  br label %30

30:                                               ; preds = %23, %19
  %.151 = phi i32 [ 1, %23 ], [ %.05063, %19 ]
  %.345 = phi i32 [ %.244, %23 ], [ %.04265, %19 ]
  %.3 = phi i32 [ %.237, %23 ], [ %.03567, %19 ]
  %.132 = phi ptr [ %27, %23 ], [ %.03169, %19 ]
  %.2 = phi i32 [ %24, %23 ], [ %.1, %19 ]
  %31 = add nsw i32 %.2, 1
  %32 = icmp slt i32 %.2, 4
  br i1 %32, label %.preheader, label %33, !llvm.loop !9

33:                                               ; preds = %30
  %34 = icmp ne i32 %.153, 0
  %35 = icmp ne i32 %.151, 0
  %or.cond = select i1 %34, i1 %35, i1 false
  br i1 %or.cond, label %37, label %36

36:                                               ; preds = %33
  tail call void @perror(ptr noundef nonnull @.str.17) #7
  tail call void @exit(i32 noundef 1) #5
  unreachable

37:                                               ; preds = %33
  tail call void @ReadWrite(ptr noundef %.134, ptr noundef %.132, i32 noundef %.349, i32 noundef %.345, i32 noundef %.341, i32 noundef %.3)
  ret i32 0
}

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

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 = { 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 #2 = { noreturn 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 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 #4 = { cold nounwind }
attributes #5 = { noreturn nounwind }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { cold }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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