; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/MINC/src/libminc/nifti (nifti1_io)

; 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.nifti_global_options = type { i32, i32, i32 }
%struct.nifti_image = type { i32, i32, i32, i32, i32, i32, i32, i32, [8 x i32], i64, i32, i32, float, float, float, float, float, float, float, [8 x float], float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, float, %struct.mat44, %struct.mat44, %struct.mat44, %struct.mat44, float, i32, i32, i32, i32, float, float, float, [16 x i8], [80 x i8], [24 x i8], ptr, ptr, i32, i32, i32, ptr, i32, ptr, i32 }
%struct.mat44 = type { [4 x [4 x float]] }

@stderr = external global ptr, align 8
@g_opts = external hidden global %struct.nifti_global_options, align 4
@.str.205 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.206 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @nifti_swap_Nbytes(i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @nifti_short_order() #2

declare i64 @znzread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f32(float, i32 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local i64 @nifti_read_buffer(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #2 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %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 i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %28

21:                                               ; preds = %4
  %22 = load i32, ptr @g_opts, align 4, !tbaa !11
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.205) #5
  br label %27

27:                                               ; preds = %24, %21
  store i64 -1, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %153

28:                                               ; preds = %4
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call i64 @znzread(ptr noundef %29, i64 noundef 1, i64 noundef %30, ptr noundef %31)
  store i64 %32, ptr %10, align 8, !tbaa !9
  %33 = load i64, ptr %10, align 8, !tbaa !9
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = icmp ult i64 %33, %34
  br i1 %35, label %36, label %54

36:                                               ; preds = %28
  %37 = load i32, ptr @g_opts, align 4, !tbaa !11
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %53

39:                                               ; preds = %36
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.nifti_image, ptr %41, i32 0, i32 56
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = trunc i64 %44 to i32
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = trunc i64 %46 to i32
  %48 = load i64, ptr %8, align 8, !tbaa !9
  %49 = load i64, ptr %10, align 8, !tbaa !9
  %50 = sub i64 %48, %49
  %51 = trunc i64 %50 to i32
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.206, ptr noundef %43, i32 noundef %45, i32 noundef %47, i32 noundef %51) #5
  br label %53

53:                                               ; preds = %39, %36
  store i64 -1, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %153

54:                                               ; preds = %28
  %55 = load i32, ptr @g_opts, align 4, !tbaa !11
  %56 = icmp sgt i32 %55, 2
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = trunc i64 %59 to i32
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.207, i32 noundef %60) #5
  br label %62

62:                                               ; preds = %57, %54
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.nifti_image, ptr %63, i32 0, i32 58
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = icmp sgt i32 %65, 1
  br i1 %66, label %67, label %90

67:                                               ; preds = %62
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.nifti_image, ptr %68, i32 0, i32 59
  %70 = load i32, ptr %69, align 8, !tbaa !19
  %71 = call i32 @nifti_short_order()
  %72 = icmp ne i32 %70, %71
  br i1 %72, label %73, label %90

73:                                               ; preds = %67
  %74 = load i32, ptr @g_opts, align 4, !tbaa !11
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.208) #5
  br label %79

79:                                               ; preds = %76, %73
  %80 = load i64, ptr %8, align 8, !tbaa !9
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.nifti_image, ptr %81, i32 0, i32 58
  %83 = load i32, ptr %82, align 4, !tbaa !18
  %84 = sext i32 %83 to i64
  %85 = udiv i64 %80, %84
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.nifti_image, ptr %86, i32 0, i32 58
  %88 = load i32, ptr %87, align 4, !tbaa !18
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @nifti_swap_Nbytes(i64 noundef %85, i32 noundef %88, ptr noundef %89)
  br label %90

90:                                               ; preds = %79, %67, %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !20
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.nifti_image, ptr %91, i32 0, i32 11
  %93 = load i32, ptr %92, align 4, !tbaa !21
  switch i32 %93, label %144 [
    i32 16, label %94
    i32 32, label %94
    i32 64, label %119
    i32 1792, label %119
  ]

94:                                               ; preds = %90, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %95, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %96 = load i64, ptr %8, align 8, !tbaa !9
  %97 = udiv i64 %96, 4
  store i64 %97, ptr %15, align 8, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %98

98:                                               ; preds = %115, %94
  %99 = load i64, ptr %14, align 8, !tbaa !9
  %100 = load i64, ptr %15, align 8, !tbaa !9
  %101 = icmp ult i64 %99, %100
  br i1 %101, label %102, label %118

102:                                              ; preds = %98
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = load i64, ptr %14, align 8, !tbaa !9
  %105 = getelementptr inbounds float, ptr %103, i64 %104
  %106 = load float, ptr %105, align 4, !tbaa !22
  %107 = call i1 @llvm.is.fpclass.f32(float %106, i32 504)
  br i1 %107, label %114, label %108

108:                                              ; preds = %102
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = load i64, ptr %14, align 8, !tbaa !9
  %111 = getelementptr inbounds float, ptr %109, i64 %110
  store float 0.000000e+00, ptr %111, align 4, !tbaa !22
  %112 = load i32, ptr %12, align 4, !tbaa !20
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !20
  br label %114

114:                                              ; preds = %108, %102
  br label %115

115:                                              ; preds = %114
  %116 = load i64, ptr %14, align 8, !tbaa !9
  %117 = add i64 %116, 1
  store i64 %117, ptr %14, align 8, !tbaa !9
  br label %98, !llvm.loop !23

118:                                              ; preds = %98
  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 %13) #5
  br label %144

119:                                              ; preds = %90, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %120, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %121 = load i64, ptr %8, align 8, !tbaa !9
  %122 = udiv i64 %121, 8
  store i64 %122, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %140, %119
  %124 = load i64, ptr %17, align 8, !tbaa !9
  %125 = load i64, ptr %18, align 8, !tbaa !9
  %126 = icmp ult i64 %124, %125
  br i1 %126, label %127, label %143

127:                                              ; preds = %123
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = load i64, ptr %17, align 8, !tbaa !9
  %130 = getelementptr inbounds double, ptr %128, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !25
  %132 = call i1 @llvm.is.fpclass.f64(double %131, i32 504)
  br i1 %132, label %139, label %133

133:                                              ; preds = %127
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load i64, ptr %17, align 8, !tbaa !9
  %136 = getelementptr inbounds double, ptr %134, i64 %135
  store double 0.000000e+00, ptr %136, align 8, !tbaa !25
  %137 = load i32, ptr %12, align 4, !tbaa !20
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %12, align 4, !tbaa !20
  br label %139

139:                                              ; preds = %133, %127
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %17, align 8, !tbaa !9
  %142 = add i64 %141, 1
  store i64 %142, ptr %17, align 8, !tbaa !9
  br label %123, !llvm.loop !27

143:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %144

144:                                              ; preds = %143, %118, %90
  %145 = load i32, ptr @g_opts, align 4, !tbaa !11
  %146 = icmp sgt i32 %145, 1
  br i1 %146, label %147, label %151

147:                                              ; preds = %144
  %148 = load ptr, ptr @stderr, align 8, !tbaa !5
  %149 = load i32, ptr %12, align 4, !tbaa !20
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.209, i32 noundef %149) #5
  br label %151

151:                                              ; preds = %147, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %152 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %152, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %153

153:                                              ; preds = %151, %53, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %154 = load i64, ptr %5, align 8
  ret i64 %154
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f64(double, i32 immarg) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 640}
!15 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !7, i64 32, !10, i64 64, !13, i64 72, !13, i64 76, !16, i64 80, !16, i64 84, !16, i64 88, !16, i64 92, !16, i64 96, !16, i64 100, !16, i64 104, !7, i64 108, !16, i64 140, !16, i64 144, !16, i64 148, !16, i64 152, !13, i64 156, !13, i64 160, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !17, i64 220, !17, i64 284, !17, i64 348, !17, i64 412, !16, i64 476, !13, i64 480, !13, i64 484, !13, i64 488, !13, i64 492, !16, i64 496, !16, i64 500, !16, i64 504, !7, i64 508, !7, i64 524, !7, i64 604, !6, i64 632, !6, i64 640, !13, i64 648, !13, i64 652, !13, i64 656, !6, i64 664, !13, i64 672, !6, i64 680, !13, i64 688}
!16 = !{!"float", !7, i64 0}
!17 = !{!"", !7, i64 0}
!18 = !{!15, !13, i64 652}
!19 = !{!15, !13, i64 656}
!20 = !{!13, !13, i64 0}
!21 = !{!15, !13, i64 76}
!22 = !{!16, !16, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !26, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = distinct !{!27, !24}


; 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.nifti_global_options = type { i32, i32, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@g_opts = external hidden local_unnamed_addr global %struct.nifti_global_options, align 4
@.str.205 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.206 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [42 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local void @nifti_swap_Nbytes(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @nifti_short_order() local_unnamed_addr #1

declare i64 @znzread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @nifti_read_buffer(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #1 {
  %5 = icmp eq ptr %1, null
  br i1 %5, label %6, label %12

6:                                                ; preds = %4
  %7 = load i32, ptr @g_opts, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %9, label %133

9:                                                ; preds = %6
  %10 = load ptr, ptr @stderr, align 8, !tbaa !10
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.205) #4
  br label %133

12:                                               ; preds = %4
  %13 = tail call i64 @znzread(ptr noundef nonnull %1, i64 noundef 1, i64 noundef %2, ptr noundef %0) #5
  %14 = icmp ult i64 %13, %2
  %15 = load i32, ptr @g_opts, align 4, !tbaa !5
  br i1 %14, label %16, label %27

16:                                               ; preds = %12
  %17 = icmp sgt i32 %15, 0
  br i1 %17, label %18, label %133

18:                                               ; preds = %16
  %19 = load ptr, ptr @stderr, align 8, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %3, i64 640
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = trunc i64 %2 to i32
  %23 = trunc i64 %13 to i32
  %24 = sub i64 %2, %13
  %25 = trunc i64 %24 to i32
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.206, ptr noundef %21, i32 noundef %22, i32 noundef %23, i32 noundef %25) #4
  br label %133

27:                                               ; preds = %12
  %28 = icmp sgt i32 %15, 2
  br i1 %28, label %29, label %33

29:                                               ; preds = %27
  %30 = load ptr, ptr @stderr, align 8, !tbaa !10
  %31 = trunc i64 %13 to i32
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.207, i32 noundef %31) #4
  br label %33

33:                                               ; preds = %29, %27
  %34 = getelementptr inbounds i8, ptr %3, i64 652
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = icmp sgt i32 %35, 1
  br i1 %36, label %37, label %51

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %3, i64 656
  %39 = load i32, ptr %38, align 8, !tbaa !18
  %40 = tail call i32 @nifti_short_order()
  %.not = icmp eq i32 %39, %40
  br i1 %.not, label %51, label %41

41:                                               ; preds = %37
  %42 = load i32, ptr @g_opts, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 1
  br i1 %43, label %44, label %47

44:                                               ; preds = %41
  %45 = load ptr, ptr @stderr, align 8, !tbaa !10
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.208) #4
  br label %47

47:                                               ; preds = %44, %41
  %48 = load i32, ptr %34, align 4, !tbaa !17
  %49 = sext i32 %48 to i64
  %50 = udiv i64 %2, %49
  tail call void @nifti_swap_Nbytes(i64 noundef %50, i32 noundef %48, ptr noundef nonnull %1)
  br label %51

51:                                               ; preds = %47, %37, %33
  %52 = getelementptr inbounds i8, ptr %3, i64 76
  %53 = load i32, ptr %52, align 4, !tbaa !19
  switch i32 %53, label %.loopexit [
    i32 16, label %54
    i32 32, label %54
    i32 64, label %97
    i32 1792, label %97
  ]

54:                                               ; preds = %51, %51
  %55 = lshr i64 %2, 2
  %.not57 = icmp ult i64 %2, 4
  br i1 %.not57, label %.loopexit, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %54
  %min.iters.check73 = icmp ult i64 %2, 32
  br i1 %min.iters.check73, label %.lr.ph54.preheader106, label %vector.ph74

vector.ph74:                                      ; preds = %.lr.ph54.preheader
  %n.vec76 = and i64 %55, 4611686018427387896
  br label %vector.body78

vector.body78:                                    ; preds = %pred.store.continue99, %vector.ph74
  %index79 = phi i64 [ 0, %vector.ph74 ], [ %index.next102, %pred.store.continue99 ]
  %vec.phi80 = phi <4 x i32> [ zeroinitializer, %vector.ph74 ], [ %predphi100, %pred.store.continue99 ]
  %vec.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph74 ], [ %predphi101, %pred.store.continue99 ]
  %56 = or disjoint i64 %index79, 4
  %57 = getelementptr inbounds float, ptr %1, i64 %index79
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %wide.load82 = load <4 x float>, ptr %57, align 4, !tbaa !20
  %wide.load83 = load <4 x float>, ptr %58, align 4, !tbaa !20
  %59 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %wide.load82)
  %60 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %wide.load83)
  %61 = fcmp ueq <4 x float> %59, <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000>
  %62 = fcmp ueq <4 x float> %60, <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000>
  %63 = extractelement <4 x i1> %61, i64 0
  br i1 %63, label %pred.store.if84, label %pred.store.continue85

pred.store.if84:                                  ; preds = %vector.body78
  %64 = getelementptr inbounds float, ptr %1, i64 %index79
  store float 0.000000e+00, ptr %64, align 4, !tbaa !20
  br label %pred.store.continue85

pred.store.continue85:                            ; preds = %pred.store.if84, %vector.body78
  %65 = extractelement <4 x i1> %61, i64 1
  br i1 %65, label %pred.store.if86, label %pred.store.continue87

pred.store.if86:                                  ; preds = %pred.store.continue85
  %66 = or disjoint i64 %index79, 1
  %67 = getelementptr inbounds float, ptr %1, i64 %66
  store float 0.000000e+00, ptr %67, align 4, !tbaa !20
  br label %pred.store.continue87

pred.store.continue87:                            ; preds = %pred.store.if86, %pred.store.continue85
  %68 = extractelement <4 x i1> %61, i64 2
  br i1 %68, label %pred.store.if88, label %pred.store.continue89

pred.store.if88:                                  ; preds = %pred.store.continue87
  %69 = or disjoint i64 %index79, 2
  %70 = getelementptr inbounds float, ptr %1, i64 %69
  store float 0.000000e+00, ptr %70, align 4, !tbaa !20
  br label %pred.store.continue89

pred.store.continue89:                            ; preds = %pred.store.if88, %pred.store.continue87
  %71 = extractelement <4 x i1> %61, i64 3
  br i1 %71, label %pred.store.if90, label %pred.store.continue91

pred.store.if90:                                  ; preds = %pred.store.continue89
  %72 = or disjoint i64 %index79, 3
  %73 = getelementptr inbounds float, ptr %1, i64 %72
  store float 0.000000e+00, ptr %73, align 4, !tbaa !20
  br label %pred.store.continue91

pred.store.continue91:                            ; preds = %pred.store.if90, %pred.store.continue89
  %74 = extractelement <4 x i1> %62, i64 0
  br i1 %74, label %pred.store.if92, label %pred.store.continue93

pred.store.if92:                                  ; preds = %pred.store.continue91
  %75 = getelementptr inbounds float, ptr %1, i64 %56
  store float 0.000000e+00, ptr %75, align 4, !tbaa !20
  br label %pred.store.continue93

pred.store.continue93:                            ; preds = %pred.store.if92, %pred.store.continue91
  %76 = extractelement <4 x i1> %62, i64 1
  br i1 %76, label %pred.store.if94, label %pred.store.continue95

pred.store.if94:                                  ; preds = %pred.store.continue93
  %77 = or disjoint i64 %index79, 5
  %78 = getelementptr inbounds float, ptr %1, i64 %77
  store float 0.000000e+00, ptr %78, align 4, !tbaa !20
  br label %pred.store.continue95

pred.store.continue95:                            ; preds = %pred.store.if94, %pred.store.continue93
  %79 = extractelement <4 x i1> %62, i64 2
  br i1 %79, label %pred.store.if96, label %pred.store.continue97

pred.store.if96:                                  ; preds = %pred.store.continue95
  %80 = or disjoint i64 %index79, 6
  %81 = getelementptr inbounds float, ptr %1, i64 %80
  store float 0.000000e+00, ptr %81, align 4, !tbaa !20
  br label %pred.store.continue97

pred.store.continue97:                            ; preds = %pred.store.if96, %pred.store.continue95
  %82 = extractelement <4 x i1> %62, i64 3
  br i1 %82, label %pred.store.if98, label %pred.store.continue99

pred.store.if98:                                  ; preds = %pred.store.continue97
  %83 = or disjoint i64 %index79, 7
  %84 = getelementptr inbounds float, ptr %1, i64 %83
  store float 0.000000e+00, ptr %84, align 4, !tbaa !20
  br label %pred.store.continue99

pred.store.continue99:                            ; preds = %pred.store.if98, %pred.store.continue97
  %85 = zext <4 x i1> %61 to <4 x i32>
  %predphi100 = add <4 x i32> %vec.phi80, %85
  %86 = zext <4 x i1> %62 to <4 x i32>
  %predphi101 = add <4 x i32> %vec.phi81, %86
  %index.next102 = add nuw i64 %index79, 8
  %87 = icmp eq i64 %index.next102, %n.vec76
  br i1 %87, label %middle.block71, label %vector.body78, !llvm.loop !21

middle.block71:                                   ; preds = %pred.store.continue99
  %bin.rdx103 = add <4 x i32> %predphi101, %predphi100
  %88 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx103)
  %cmp.n104 = icmp eq i64 %55, %n.vec76
  br i1 %cmp.n104, label %.loopexit, label %.lr.ph54.preheader106

.lr.ph54.preheader106:                            ; preds = %middle.block71, %.lr.ph54.preheader
  %.04253.ph = phi i32 [ 0, %.lr.ph54.preheader ], [ %88, %middle.block71 ]
  %.04352.ph = phi i64 [ 0, %.lr.ph54.preheader ], [ %n.vec76, %middle.block71 ]
  br label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.preheader106, %95
  %.04253 = phi i32 [ %.1, %95 ], [ %.04253.ph, %.lr.ph54.preheader106 ]
  %.04352 = phi i64 [ %96, %95 ], [ %.04352.ph, %.lr.ph54.preheader106 ]
  %89 = getelementptr inbounds float, ptr %1, i64 %.04352
  %90 = load float, ptr %89, align 4, !tbaa !20
  %91 = tail call float @llvm.fabs.f32(float %90)
  %92 = fcmp ueq float %91, 0x7FF0000000000000
  br i1 %92, label %93, label %95

93:                                               ; preds = %.lr.ph54
  store float 0.000000e+00, ptr %89, align 4, !tbaa !20
  %94 = add nsw i32 %.04253, 1
  br label %95

95:                                               ; preds = %.lr.ph54, %93
  %.1 = phi i32 [ %.04253, %.lr.ph54 ], [ %94, %93 ]
  %96 = add nuw nsw i64 %.04352, 1
  %exitcond59.not = icmp eq i64 %96, %55
  br i1 %exitcond59.not, label %.loopexit, label %.lr.ph54, !llvm.loop !25

97:                                               ; preds = %51, %51
  %98 = lshr i64 %2, 3
  %.not56 = icmp ult i64 %2, 8
  br i1 %.not56, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %97
  %min.iters.check = icmp ult i64 %2, 32
  br i1 %min.iters.check, label %.lr.ph.preheader107, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %98, 2305843009213693948
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue69, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue69 ]
  %vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %pred.store.continue69 ]
  %vec.phi62 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %predphi70, %pred.store.continue69 ]
  %99 = or disjoint i64 %index, 2
  %100 = getelementptr inbounds double, ptr %1, i64 %index
  %101 = getelementptr inbounds i8, ptr %100, i64 16
  %wide.load = load <2 x double>, ptr %100, align 8, !tbaa !26
  %wide.load63 = load <2 x double>, ptr %101, align 8, !tbaa !26
  %102 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %wide.load)
  %103 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %wide.load63)
  %104 = fcmp ueq <2 x double> %102, <double 0x7FF0000000000000, double 0x7FF0000000000000>
  %105 = fcmp ueq <2 x double> %103, <double 0x7FF0000000000000, double 0x7FF0000000000000>
  %106 = extractelement <2 x i1> %104, i64 0
  br i1 %106, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %107 = getelementptr inbounds double, ptr %1, i64 %index
  store double 0.000000e+00, ptr %107, align 8, !tbaa !26
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %108 = extractelement <2 x i1> %104, i64 1
  br i1 %108, label %pred.store.if64, label %pred.store.continue65

pred.store.if64:                                  ; preds = %pred.store.continue
  %109 = or disjoint i64 %index, 1
  %110 = getelementptr inbounds double, ptr %1, i64 %109
  store double 0.000000e+00, ptr %110, align 8, !tbaa !26
  br label %pred.store.continue65

pred.store.continue65:                            ; preds = %pred.store.if64, %pred.store.continue
  %111 = extractelement <2 x i1> %105, i64 0
  br i1 %111, label %pred.store.if66, label %pred.store.continue67

pred.store.if66:                                  ; preds = %pred.store.continue65
  %112 = getelementptr inbounds double, ptr %1, i64 %99
  store double 0.000000e+00, ptr %112, align 8, !tbaa !26
  br label %pred.store.continue67

pred.store.continue67:                            ; preds = %pred.store.if66, %pred.store.continue65
  %113 = extractelement <2 x i1> %105, i64 1
  br i1 %113, label %pred.store.if68, label %pred.store.continue69

pred.store.if68:                                  ; preds = %pred.store.continue67
  %114 = or disjoint i64 %index, 3
  %115 = getelementptr inbounds double, ptr %1, i64 %114
  store double 0.000000e+00, ptr %115, align 8, !tbaa !26
  br label %pred.store.continue69

pred.store.continue69:                            ; preds = %pred.store.if68, %pred.store.continue67
  %116 = zext <2 x i1> %104 to <2 x i32>
  %predphi = add <2 x i32> %vec.phi, %116
  %117 = zext <2 x i1> %105 to <2 x i32>
  %predphi70 = add <2 x i32> %vec.phi62, %117
  %index.next = add nuw i64 %index, 4
  %118 = icmp eq i64 %index.next, %n.vec
  br i1 %118, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %pred.store.continue69
  %bin.rdx = add <2 x i32> %predphi70, %predphi
  %119 = tail call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %98, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader107

.lr.ph.preheader107:                              ; preds = %middle.block, %.lr.ph.preheader
  %.04151.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.250.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %119, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader107, %126
  %.04151 = phi i64 [ %127, %126 ], [ %.04151.ph, %.lr.ph.preheader107 ]
  %.250 = phi i32 [ %.3, %126 ], [ %.250.ph, %.lr.ph.preheader107 ]
  %120 = getelementptr inbounds double, ptr %1, i64 %.04151
  %121 = load double, ptr %120, align 8, !tbaa !26
  %122 = tail call double @llvm.fabs.f64(double %121)
  %123 = fcmp ueq double %122, 0x7FF0000000000000
  br i1 %123, label %124, label %126

124:                                              ; preds = %.lr.ph
  store double 0.000000e+00, ptr %120, align 8, !tbaa !26
  %125 = add nsw i32 %.250, 1
  br label %126

126:                                              ; preds = %.lr.ph, %124
  %.3 = phi i32 [ %.250, %.lr.ph ], [ %125, %124 ]
  %127 = add nuw nsw i64 %.04151, 1
  %exitcond.not = icmp eq i64 %127, %98
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !29

.loopexit:                                        ; preds = %126, %95, %middle.block, %middle.block71, %97, %54, %51
  %.4 = phi i32 [ 0, %51 ], [ 0, %54 ], [ 0, %97 ], [ %88, %middle.block71 ], [ %119, %middle.block ], [ %.1, %95 ], [ %.3, %126 ]
  %128 = load i32, ptr @g_opts, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 1
  br i1 %129, label %130, label %133

130:                                              ; preds = %.loopexit
  %131 = load ptr, ptr @stderr, align 8, !tbaa !10
  %132 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.209, i32 noundef %.4) #4
  br label %133

133:                                              ; preds = %.loopexit, %130, %16, %18, %6, %9
  %.0 = phi i64 [ -1, %9 ], [ -1, %6 ], [ -1, %18 ], [ -1, %16 ], [ %13, %130 ], [ %13, %.loopexit ]
  ret i64 %.0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fabs.v4f32(<4 x float>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { cold nounwind }
attributes #5 = { nounwind }

!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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !11, i64 640}
!13 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !8, i64 32, !14, i64 64, !7, i64 72, !7, i64 76, !15, i64 80, !15, i64 84, !15, i64 88, !15, i64 92, !15, i64 96, !15, i64 100, !15, i64 104, !8, i64 108, !15, i64 140, !15, i64 144, !15, i64 148, !15, i64 152, !7, i64 156, !7, i64 160, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !16, i64 220, !16, i64 284, !16, i64 348, !16, i64 412, !15, i64 476, !7, i64 480, !7, i64 484, !7, i64 488, !7, i64 492, !15, i64 496, !15, i64 500, !15, i64 504, !8, i64 508, !8, i64 524, !8, i64 604, !11, i64 632, !11, i64 640, !7, i64 648, !7, i64 652, !7, i64 656, !11, i64 664, !7, i64 672, !11, i64 680, !7, i64 688}
!14 = !{!"long", !8, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{!"", !8, i64 0}
!17 = !{!13, !7, i64 652}
!18 = !{!13, !7, i64 656}
!19 = !{!13, !7, i64 76}
!20 = !{!15, !15, i64 0}
!21 = distinct !{!21, !22, !23, !24}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !22, !24, !23}
!26 = !{!27, !27, i64 0}
!27 = !{!"double", !8, i64 0}
!28 = distinct !{!28, !22, !23, !24}
!29 = distinct !{!29, !22, !24, !23}


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