; LLVM IR from casensiom/fast-image-processing :: src (hough)

; 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.SImage = type { i32, i32, i32, i32, ptr }
%struct.SHoughWorkspace = type { i32, i32, double, i32, i32, ptr, i32, i32, ptr, i32, ptr, ptr }

@spHoughWorkspace = external hidden global ptr, align 8

; 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 uwtable
define dso_local void @save_hough_workspace(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.SImage, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %12 = load ptr, ptr @spHoughWorkspace, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.SHoughWorkspace, ptr %12, i32 0, i32 5
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %15 = load ptr, ptr @spHoughWorkspace, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.SHoughWorkspace, ptr %15, i32 0, i32 4
  %17 = load i32, ptr %16, align 4, !tbaa !13
  store i32 %17, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %18 = load ptr, ptr @spHoughWorkspace, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.SHoughWorkspace, ptr %18, i32 0, i32 3
  %20 = load i32, ptr %19, align 8, !tbaa !15
  store i32 %20, ptr %8, align 4, !tbaa !14
  store i32 0, ptr %5, align 4, !tbaa !14
  store i32 0, ptr %4, align 4, !tbaa !14
  br label %21

21:                                               ; preds = %54, %1
  %22 = load i32, ptr %4, align 4, !tbaa !14
  %23 = load i32, ptr %8, align 4, !tbaa !14
  %24 = icmp ult i32 %22, %23
  br i1 %24, label %25, label %57

25:                                               ; preds = %21
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %26

26:                                               ; preds = %50, %25
  %27 = load i32, ptr %3, align 4, !tbaa !14
  %28 = load i32, ptr %7, align 4, !tbaa !14
  %29 = icmp ult i32 %27, %28
  br i1 %29, label %30, label %53

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %31 = load i32, ptr %4, align 4, !tbaa !14
  %32 = load i32, ptr %7, align 4, !tbaa !14
  %33 = mul i32 %31, %32
  %34 = load i32, ptr %3, align 4, !tbaa !14
  %35 = add i32 %33, %34
  store i32 %35, ptr %9, align 4, !tbaa !14
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i32, ptr %9, align 4, !tbaa !14
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %36, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = load i32, ptr %5, align 4, !tbaa !14
  %42 = icmp ugt i32 %40, %41
  br i1 %42, label %43, label %49

43:                                               ; preds = %30
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !14
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !14
  store i32 %48, ptr %5, align 4, !tbaa !14
  br label %49

49:                                               ; preds = %43, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !14
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !14
  br label %26, !llvm.loop !16

53:                                               ; preds = %26
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %4, align 4, !tbaa !14
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %4, align 4, !tbaa !14
  br label %21, !llvm.loop !18

57:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #3
  %58 = load i32, ptr %7, align 4, !tbaa !14
  %59 = load i32, ptr %8, align 4, !tbaa !14
  call void @create_image(ptr dead_on_unwind writable sret(%struct.SImage) align 8 %10, i32 noundef %58, i32 noundef %59, i32 noundef 1)
  store i32 0, ptr %4, align 4, !tbaa !14
  br label %60

60:                                               ; preds = %95, %57
  %61 = load i32, ptr %4, align 4, !tbaa !14
  %62 = load i32, ptr %8, align 4, !tbaa !14
  %63 = icmp ult i32 %61, %62
  br i1 %63, label %64, label %98

64:                                               ; preds = %60
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %65

65:                                               ; preds = %91, %64
  %66 = load i32, ptr %3, align 4, !tbaa !14
  %67 = load i32, ptr %7, align 4, !tbaa !14
  %68 = icmp ult i32 %66, %67
  br i1 %68, label %69, label %94

69:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %70 = load i32, ptr %4, align 4, !tbaa !14
  %71 = load i32, ptr %7, align 4, !tbaa !14
  %72 = mul i32 %70, %71
  %73 = load i32, ptr %3, align 4, !tbaa !14
  %74 = add i32 %72, %73
  store i32 %74, ptr %11, align 4, !tbaa !14
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %11, align 4, !tbaa !14
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !14
  %80 = uitofp i32 %79 to float
  %81 = load i32, ptr %5, align 4, !tbaa !14
  %82 = sitofp i32 %81 to float
  %83 = fdiv float %80, %82
  %84 = fmul float %83, 2.550000e+02
  %85 = fptoui float %84 to i8
  %86 = getelementptr inbounds %struct.SImage, ptr %10, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = load i32, ptr %11, align 4, !tbaa !14
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %87, i64 %89
  store i8 %85, ptr %90, align 1, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %91

91:                                               ; preds = %69
  %92 = load i32, ptr %3, align 4, !tbaa !14
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %3, align 4, !tbaa !14
  br label %65, !llvm.loop !22

94:                                               ; preds = %65
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %4, align 4, !tbaa !14
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !14
  br label %60, !llvm.loop !23

98:                                               ; preds = %60
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = call i32 @save_image(ptr noundef %99, ptr noundef %10)
  call void @release_image(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

declare void @create_image(ptr dead_on_unwind writable sret(%struct.SImage) align 8, i32 noundef, i32 noundef, i32 noundef) #2

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

declare void @release_image(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !6, i64 24}
!10 = !{!"SHoughWorkspace", !11, i64 0, !11, i64 4, !12, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !11, i64 32, !11, i64 36, !6, i64 40, !11, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 20}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !6, i64 16}
!20 = !{!"SImage", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


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

@spHoughWorkspace = external hidden local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
define dso_local void @save_hough_workspace(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.SImage, align 8
  %3 = load ptr, ptr @spHoughWorkspace, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %3, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !14
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge42, label %.preheader37.lr.ph

.preheader37.lr.ph:                               ; preds = %1
  %.not48 = icmp eq i32 %7, 0
  br i1 %.not48, label %.preheader.lr.ph.thread, label %.preheader37.us.preheader

.preheader.lr.ph.thread:                          ; preds = %.preheader37.lr.ph
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  br label %._crit_edge46.sink.split

.preheader37.us.preheader:                        ; preds = %.preheader37.lr.ph
  %wide.trip.count = zext i32 %7 to i64
  %10 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %7, 8
  %11 = trunc i64 %10 to i32
  %12 = icmp ugt i64 %10, 4294967295
  %n.vec = and i64 %wide.trip.count, 4294967288
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader37.us

.preheader37.us:                                  ; preds = %.preheader37.us.preheader, %._crit_edge.us
  %.02941.us = phi i32 [ %57, %._crit_edge.us ], [ 0, %.preheader37.us.preheader ]
  %.03140.us = phi i32 [ %spec.select.us.lcssa, %._crit_edge.us ], [ 0, %.preheader37.us.preheader ]
  %13 = mul i32 %.02941.us, %7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.preheader37.us
  %14 = mul i32 %7, %.02941.us
  %15 = xor i32 %14, -1
  %16 = icmp ult i32 %15, %11
  %17 = or i1 %16, %12
  br i1 %17, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.scevcheck
  %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.03140.us, i64 0
  %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %23, %vector.body ]
  %vec.phi65 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %24, %vector.body ]
  %18 = trunc i64 %index to i32
  %19 = add i32 %13, %18
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %5, i64 %20
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load = load <4 x i32>, ptr %21, align 4, !tbaa !15
  %wide.load66 = load <4 x i32>, ptr %22, align 4, !tbaa !15
  %23 = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %24 = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> %wide.load66, <4 x i32> %vec.phi65)
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> %23, <4 x i32> %24)
  %26 = tail call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %rdx.minmax)
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.scevcheck, %.preheader37.us
  %indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %.preheader37.us ], [ %n.vec, %middle.block ]
  %.13238.us.ph = phi i32 [ %.03140.us, %vector.scevcheck ], [ %.03140.us, %.preheader37.us ], [ %26, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.13238.us.prol = phi i32 [ %spec.select.us.prol, %scalar.ph.prol ], [ %.13238.us.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %27 = trunc nuw nsw i64 %indvars.iv.prol to i32
  %28 = add i32 %13, %27
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %5, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !15
  %spec.select.us.prol = tail call i32 @llvm.umax.i32(i32 %31, i32 %.13238.us.prol)
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !20

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %spec.select.us.lcssa68.unr = phi i32 [ poison, %scalar.ph.preheader ], [ %spec.select.us.prol, %scalar.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %.13238.us.unr = phi i32 [ %.13238.us.ph, %scalar.ph.preheader ], [ %spec.select.us.prol, %scalar.ph.prol ]
  %32 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %33 = icmp ugt i64 %32, -4
  br i1 %33, label %._crit_edge.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %.13238.us = phi i32 [ %spec.select.us.3, %scalar.ph ], [ %.13238.us.unr, %scalar.ph.prol.loopexit ]
  %34 = trunc nuw nsw i64 %indvars.iv to i32
  %35 = add i32 %13, %34
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %5, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !15
  %spec.select.us = tail call i32 @llvm.umax.i32(i32 %38, i32 %.13238.us)
  %39 = trunc i64 %indvars.iv to i32
  %40 = add i32 %39, 1
  %41 = add i32 %13, %40
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %5, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !15
  %spec.select.us.1 = tail call i32 @llvm.umax.i32(i32 %44, i32 %spec.select.us)
  %45 = trunc i64 %indvars.iv to i32
  %46 = add i32 %45, 2
  %47 = add i32 %13, %46
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr %5, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %spec.select.us.2 = tail call i32 @llvm.umax.i32(i32 %50, i32 %spec.select.us.1)
  %51 = trunc i64 %indvars.iv to i32
  %52 = add i32 %51, 3
  %53 = add i32 %13, %52
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %5, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !15
  %spec.select.us.3 = tail call i32 @llvm.umax.i32(i32 %56, i32 %spec.select.us.2)
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge.us, label %scalar.ph, !llvm.loop !22

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %spec.select.us.lcssa = phi i32 [ %26, %middle.block ], [ %spec.select.us.lcssa68.unr, %scalar.ph.prol.loopexit ], [ %spec.select.us.3, %scalar.ph ]
  %57 = add nuw nsw i32 %.02941.us, 1
  %exitcond54.not = icmp eq i32 %57, %9
  br i1 %exitcond54.not, label %.preheader.lr.ph, label %.preheader37.us, !llvm.loop !23

._crit_edge42:                                    ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  br label %._crit_edge46.sink.split

.preheader.lr.ph:                                 ; preds = %._crit_edge.us
  %58 = sitofp i32 %spec.select.us.lcssa to float
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @create_image(ptr dead_on_unwind nonnull writable sret(%struct.SImage) align 8 %2, i32 noundef %7, i32 noundef %9, i32 noundef 1) #4
  %59 = getelementptr inbounds i8, ptr %2, i64 16
  %xtraiter69 = and i64 %wide.trip.count, 1
  %60 = icmp eq i64 %10, 0
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  %lcmp.mod70.not = icmp eq i64 %xtraiter69, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us47
  %.13045.us = phi i32 [ %96, %._crit_edge.us47 ], [ 0, %.preheader.lr.ph ]
  %61 = mul i32 %.13045.us, %7
  br i1 %60, label %._crit_edge.us47.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv55 = phi i64 [ %indvars.iv.next56.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %62 = trunc nuw nsw i64 %indvars.iv55 to i32
  %63 = add i32 %61, %62
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %5, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !15
  %67 = uitofp i32 %66 to float
  %68 = fdiv float %67, %58
  %69 = fmul float %68, 2.550000e+02
  %70 = fptoui float %69 to i8
  %71 = load ptr, ptr %59, align 8, !tbaa !24
  %72 = getelementptr inbounds i8, ptr %71, i64 %64
  store i8 %70, ptr %72, align 1, !tbaa !26
  %73 = trunc i64 %indvars.iv55 to i32
  %74 = or disjoint i32 %73, 1
  %75 = add i32 %61, %74
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %5, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !15
  %79 = uitofp i32 %78 to float
  %80 = fdiv float %79, %58
  %81 = fmul float %80, 2.550000e+02
  %82 = fptoui float %81 to i8
  %83 = load ptr, ptr %59, align 8, !tbaa !24
  %84 = getelementptr inbounds i8, ptr %83, i64 %76
  store i8 %82, ptr %84, align 1, !tbaa !26
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us47.unr-lcssa, label %.preheader.us.new, !llvm.loop !27

._crit_edge.us47.unr-lcssa:                       ; preds = %.preheader.us.new, %.preheader.us
  %indvars.iv55.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next56.1, %.preheader.us.new ]
  br i1 %lcmp.mod70.not, label %._crit_edge.us47, label %._crit_edge.us47.epilog-lcssa

._crit_edge.us47.epilog-lcssa:                    ; preds = %._crit_edge.us47.unr-lcssa
  %85 = trunc nuw nsw i64 %indvars.iv55.unr to i32
  %86 = add i32 %61, %85
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %5, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !15
  %90 = uitofp i32 %89 to float
  %91 = fdiv float %90, %58
  %92 = fmul float %91, 2.550000e+02
  %93 = fptoui float %92 to i8
  %94 = load ptr, ptr %59, align 8, !tbaa !24
  %95 = getelementptr inbounds i8, ptr %94, i64 %87
  store i8 %93, ptr %95, align 1, !tbaa !26
  br label %._crit_edge.us47

._crit_edge.us47:                                 ; preds = %._crit_edge.us47.unr-lcssa, %._crit_edge.us47.epilog-lcssa
  %96 = add nuw nsw i32 %.13045.us, 1
  %exitcond60.not = icmp eq i32 %96, %9
  br i1 %exitcond60.not, label %._crit_edge46, label %.preheader.us, !llvm.loop !28

._crit_edge46.sink.split:                         ; preds = %._crit_edge42, %.preheader.lr.ph.thread
  call void @create_image(ptr dead_on_unwind nonnull writable sret(%struct.SImage) align 8 %2, i32 noundef %7, i32 noundef %9, i32 noundef 1) #4
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge.us47, %._crit_edge46.sink.split
  %97 = call i32 @save_image(ptr noundef %0, ptr noundef nonnull %2) #4
  call void @release_image(ptr noundef nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret void
}

declare void @create_image(ptr dead_on_unwind writable sret(%struct.SImage) align 8, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @save_image(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @release_image(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !6, i64 24}
!10 = !{!"SHoughWorkspace", !11, i64 0, !11, i64 4, !12, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !11, i64 32, !11, i64 36, !6, i64 40, !11, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 20}
!14 = !{!10, !11, i64 16}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !17, !18}
!23 = distinct !{!23, !17}
!24 = !{!25, !6, i64 16}
!25 = !{!"SImage", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !17}
!28 = distinct !{!28, !17}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass