; LLVM IR from TheNachoBIT/GeoFenix-Engine :: Libraries/SOIL2/include (SOIL2)

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

@result_string_pointer = external dso_local global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

declare void @glGetIntegerv(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) #3

declare void @glPixelStorei(i32 noundef, i32 noundef) #2

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

25:                                               ; preds = %6
  %26 = load i32, ptr %13, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25, %6
  store ptr @.str.31, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %123

29:                                               ; preds = %25
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %35, label %32

32:                                               ; preds = %29
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32, %29
  store ptr @.str.32, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %123

36:                                               ; preds = %32
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store ptr @.str.33, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %123

40:                                               ; preds = %36
  call void @glGetIntegerv(i32 noundef 3333, ptr noundef %18)
  %41 = load i32, ptr %18, align 4, !tbaa !9
  %42 = icmp ne i32 1, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  call void @glPixelStorei(i32 noundef 3333, i32 noundef 1)
  br label %44

44:                                               ; preds = %43, %40
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = mul nsw i32 3, %45
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = mul nsw i32 %46, %47
  %49 = sext i32 %48 to i64
  %50 = call noalias ptr @malloc(i64 noundef %49) #5
  store ptr %50, ptr %14, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  call void @glReadPixels(i32 noundef %51, i32 noundef %52, i32 noundef %53, i32 noundef %54, i32 noundef 6407, i32 noundef 5121, ptr noundef %55)
  %56 = load i32, ptr %18, align 4, !tbaa !9
  %57 = icmp ne i32 1, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %44
  %59 = load i32, ptr %18, align 4, !tbaa !9
  call void @glPixelStorei(i32 noundef 3333, i32 noundef %59)
  br label %60

60:                                               ; preds = %58, %44
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %111, %60
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = mul nsw i32 %62, 2
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %66, label %114

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %67 = load i32, ptr %16, align 4, !tbaa !9
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = mul nsw i32 %67, %68
  %70 = mul nsw i32 %69, 3
  store i32 %70, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = sub nsw i32 %71, 1
  %73 = load i32, ptr %16, align 4, !tbaa !9
  %74 = sub nsw i32 %72, %73
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = mul nsw i32 %74, %75
  %77 = mul nsw i32 %76, 3
  store i32 %77, ptr %21, align 4, !tbaa !9
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = mul nsw i32 %78, 3
  store i32 %79, ptr %15, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %107, %66
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %110

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #4
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = load i32, ptr %20, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %84, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !11
  store i8 %88, ptr %22, align 1, !tbaa !11
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = load i32, ptr %21, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = load i32, ptr %20, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  store i8 %93, ptr %97, align 1, !tbaa !11
  %98 = load i8, ptr %22, align 1, !tbaa !11
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = load i32, ptr %21, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %99, i64 %101
  store i8 %98, ptr %102, align 1, !tbaa !11
  %103 = load i32, ptr %20, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %20, align 4, !tbaa !9
  %105 = load i32, ptr %21, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #4
  br label %107

107:                                              ; preds = %83
  %108 = load i32, ptr %15, align 4, !tbaa !9
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %15, align 4, !tbaa !9
  br label %80, !llvm.loop !12

110:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %16, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %16, align 4, !tbaa !9
  br label %61, !llvm.loop !14

114:                                              ; preds = %61
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = load ptr, ptr %14, align 8, !tbaa !5
  %120 = call i32 @SOIL_save_image(ptr noundef %115, i32 noundef %116, i32 noundef %117, i32 noundef %118, i32 noundef 3, ptr noundef %119)
  store i32 %120, ptr %17, align 4, !tbaa !9
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %121)
  %122 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %122, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %123

123:                                              ; preds = %114, %39, %35, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %124 = load i32, ptr %7, align 4
  ret i32 %124
}

declare void @glReadPixels(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SOIL_save_image(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

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

!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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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

@result_string_pointer = external dso_local local_unnamed_addr global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [28 x i8], align 1

; 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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

declare void @glGetIntegerv(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) local_unnamed_addr #3

declare void @glPixelStorei(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_save_screenshot(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %8 = icmp slt i32 %4, 1
  %9 = icmp slt i32 %5, 1
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %10, label %11

10:                                               ; preds = %6
  store ptr @.str.31, ptr @result_string_pointer, align 8, !tbaa !5
  br label %53

11:                                               ; preds = %6
  %12 = or i32 %3, %2
  %or.cond3.not = icmp sgt i32 %12, -1
  br i1 %or.cond3.not, label %14, label %13

13:                                               ; preds = %11
  store ptr @.str.32, ptr @result_string_pointer, align 8, !tbaa !5
  br label %53

14:                                               ; preds = %11
  %15 = icmp eq ptr %0, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %14
  store ptr @.str.33, ptr @result_string_pointer, align 8, !tbaa !5
  br label %53

17:                                               ; preds = %14
  call void @glGetIntegerv(i32 noundef 3333, ptr noundef nonnull %7) #5
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %.not = icmp eq i32 %18, 1
  br i1 %.not, label %20, label %19

19:                                               ; preds = %17
  call void @glPixelStorei(i32 noundef 3333, i32 noundef 1) #5
  br label %20

20:                                               ; preds = %19, %17
  %21 = mul nuw nsw i32 %4, 3
  %22 = mul nuw nsw i32 %21, %5
  %23 = zext nneg i32 %22 to i64
  %24 = call noalias ptr @malloc(i64 noundef %23) #6
  call void @glReadPixels(i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef 6407, i32 noundef 5121, ptr noundef %24) #5
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %.not54 = icmp eq i32 %25, 1
  br i1 %.not54, label %.lr.ph.us.preheader, label %26

26:                                               ; preds = %20
  call void @glPixelStorei(i32 noundef 3333, i32 noundef %25) #5
  br label %.lr.ph.us.preheader

.lr.ph.us.preheader:                              ; preds = %26, %20
  %27 = add nsw i32 %5, -1
  %28 = mul i32 %27, %4
  %29 = mul i32 %28, 3
  %30 = lshr i32 %27, 1
  %smin = call i32 @llvm.smin.i32(i32 %21, i32 1)
  %31 = sub nsw i32 %21, %smin
  %32 = zext i32 %31 to i64
  %33 = add nuw nsw i64 %32, 1
  %scevgep72 = getelementptr i8, ptr %24, i64 %33
  %scevgep75 = getelementptr i8, ptr %24, i64 %33
  %smin77 = call i32 @llvm.smin.i32(i32 %21, i32 1)
  %34 = sub nsw i32 %21, %smin77
  %35 = zext i32 %34 to i64
  %36 = add nuw nsw i64 %35, 1
  %min.iters.check = icmp ult i32 %34, 7
  %min.iters.check78 = icmp ult i32 %34, 31
  %n.vec = and i64 %36, 8589934560
  %cmp.n = icmp eq i64 %36, %n.vec
  %.cast90 = trunc i64 %n.vec to i32
  %ind.end91 = sub i32 %21, %.cast90
  %n.vec.remaining = and i64 %36, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  %n.vec84 = and i64 %36, 8589934584
  %.cast = trunc i64 %n.vec84 to i32
  %ind.end89 = sub i32 %21, %.cast
  %cmp.n99 = icmp eq i64 %36, %n.vec84
  br label %iter.check

iter.check:                                       ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv65 = phi i32 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next66, %._crit_edge.us ]
  %indvars.iv = phi i32 [ %29, %.lr.ph.us.preheader ], [ %indvars.iv.next, %._crit_edge.us ]
  %.04758.us = phi i32 [ 0, %.lr.ph.us.preheader ], [ %51, %._crit_edge.us ]
  %37 = sext i32 %indvars.iv to i64
  %38 = zext i32 %indvars.iv65 to i64
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %39 = sext i32 %indvars.iv to i64
  %scevgep76 = getelementptr i8, ptr %scevgep75, i64 %39
  %scevgep74 = getelementptr i8, ptr %24, i64 %39
  %40 = zext i32 %indvars.iv65 to i64
  %scevgep73 = getelementptr i8, ptr %scevgep72, i64 %40
  %scevgep = getelementptr i8, ptr %24, i64 %40
  %bound0 = icmp ult ptr %scevgep, %scevgep76
  %bound1 = icmp ult ptr %scevgep74, %scevgep73
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  br i1 %min.iters.check78, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %invariant.gep = getelementptr i8, ptr %24, i64 %38
  %invariant.gep100 = getelementptr i8, ptr %24, i64 %37
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %gep = getelementptr i8, ptr %invariant.gep, i64 %index
  %41 = getelementptr inbounds i8, ptr %gep, i64 16
  %wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !11, !alias.scope !12, !noalias !15
  %wide.load80 = load <16 x i8>, ptr %41, align 1, !tbaa !11, !alias.scope !12, !noalias !15
  %gep101 = getelementptr i8, ptr %invariant.gep100, i64 %index
  %42 = getelementptr inbounds i8, ptr %gep101, i64 16
  %wide.load81 = load <16 x i8>, ptr %gep101, align 1, !tbaa !11, !alias.scope !15
  %wide.load82 = load <16 x i8>, ptr %42, align 1, !tbaa !11, !alias.scope !15
  store <16 x i8> %wide.load81, ptr %gep, align 1, !tbaa !11, !alias.scope !12, !noalias !15
  store <16 x i8> %wide.load82, ptr %41, align 1, !tbaa !11, !alias.scope !12, !noalias !15
  store <16 x i8> %wide.load, ptr %gep101, align 1, !tbaa !11, !alias.scope !15
  store <16 x i8> %wide.load80, ptr %42, align 1, !tbaa !11, !alias.scope !15
  %index.next = add nuw i64 %index, 32
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end87 = add nsw i64 %n.vec, %37
  %ind.end85 = add nuw nsw i64 %n.vec, %38
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %ind.end = add nuw nsw i64 %n.vec84, %38
  %ind.end86 = add nsw i64 %n.vec84, %37
  %invariant.gep102 = getelementptr i8, ptr %24, i64 %38
  %invariant.gep104 = getelementptr i8, ptr %24, i64 %37
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index93 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next98, %vec.epilog.vector.body ]
  %gep103 = getelementptr i8, ptr %invariant.gep102, i64 %index93
  %wide.load96 = load <8 x i8>, ptr %gep103, align 1, !tbaa !11, !alias.scope !21, !noalias !24
  %gep105 = getelementptr i8, ptr %invariant.gep104, i64 %index93
  %wide.load97 = load <8 x i8>, ptr %gep105, align 1, !tbaa !11, !alias.scope !24
  store <8 x i8> %wide.load97, ptr %gep103, align 1, !tbaa !11, !alias.scope !21, !noalias !24
  store <8 x i8> %wide.load96, ptr %gep105, align 1, !tbaa !11, !alias.scope !24
  %index.next98 = add nuw i64 %index93, 8
  %44 = icmp eq i64 %index.next98, %n.vec84
  br i1 %44, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !26

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  br i1 %cmp.n99, label %._crit_edge.us, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %indvars.iv67.ph = phi i64 [ %38, %iter.check ], [ %38, %vector.memcheck ], [ %ind.end85, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %indvars.iv63.ph = phi i64 [ %37, %iter.check ], [ %37, %vector.memcheck ], [ %ind.end87, %vec.epilog.iter.check ], [ %ind.end86, %vec.epilog.middle.block ]
  %.04655.us.ph = phi i32 [ %21, %iter.check ], [ %21, %vector.memcheck ], [ %ind.end91, %vec.epilog.iter.check ], [ %ind.end89, %vec.epilog.middle.block ]
  br label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %vec.epilog.scalar.ph ], [ %indvars.iv67.ph, %vec.epilog.scalar.ph.preheader ]
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %vec.epilog.scalar.ph ], [ %indvars.iv63.ph, %vec.epilog.scalar.ph.preheader ]
  %.04655.us = phi i32 [ %49, %vec.epilog.scalar.ph ], [ %.04655.us.ph, %vec.epilog.scalar.ph.preheader ]
  %45 = getelementptr inbounds i8, ptr %24, i64 %indvars.iv67
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %24, i64 %indvars.iv63
  %48 = load i8, ptr %47, align 1, !tbaa !11
  store i8 %48, ptr %45, align 1, !tbaa !11
  store i8 %46, ptr %47, align 1, !tbaa !11
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, 1
  %49 = add nsw i32 %.04655.us, -1
  %50 = icmp sgt i32 %.04655.us, 1
  br i1 %50, label %vec.epilog.scalar.ph, label %._crit_edge.us, !llvm.loop !27

._crit_edge.us:                                   ; preds = %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %51 = add nuw nsw i32 %.04758.us, 1
  %indvars.iv.next = sub i32 %indvars.iv, %21
  %indvars.iv.next66 = add i32 %indvars.iv65, %21
  %exitcond.not = icmp eq i32 %.04758.us, %30
  br i1 %exitcond.not, label %._crit_edge61, label %iter.check, !llvm.loop !28

._crit_edge61:                                    ; preds = %._crit_edge.us
  %52 = call i32 @SOIL_save_image(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %4, i32 noundef %5, i32 noundef 3, ptr noundef nonnull %24)
  call void @SOIL_free_image_data(ptr noundef nonnull %24)
  br label %53

53:                                               ; preds = %._crit_edge61, %16, %13, %10
  %.0 = phi i32 [ 0, %10 ], [ 0, %13 ], [ 0, %16 ], [ %52, %._crit_edge61 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  ret i32 %.0
}

declare void @glReadPixels(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SOIL_save_image(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13}
!13 = distinct !{!13, !14}
!14 = distinct !{!14, !"LVerDomain"}
!15 = !{!16}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = !{!22}
!22 = distinct !{!22, !23}
!23 = distinct !{!23, !"LVerDomain"}
!24 = !{!25}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !18, !19, !20}
!27 = distinct !{!27, !18, !19}
!28 = distinct !{!28, !18}


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