; LLVM IR from steps3d/graphics-book :: Code/Chapter-7 (test)

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

%class.TgaImage = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.TgaImage, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #5
  call void @_ZN8TgaImageC1Eii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 100, i32 noundef 100)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %9 = invoke noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 255, i32 noundef 0, i32 noundef 0)
          to label %10 unwind label %29

10:                                               ; preds = %0
  store i32 %9, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %11 = invoke noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 0, i32 noundef 255, i32 noundef 0)
          to label %12 unwind label %33

12:                                               ; preds = %10
  store i32 %11, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %13 = invoke noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 0, i32 noundef 0, i32 noundef 255)
          to label %14 unwind label %37

14:                                               ; preds = %12
  store i32 %13, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 10, i32 noundef 10, i32 noundef %15)
          to label %16 unwind label %37

16:                                               ; preds = %14
  %17 = load i32, ptr %3, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 11, i32 noundef 10, i32 noundef %17)
          to label %18 unwind label %37

18:                                               ; preds = %16
  %19 = load i32, ptr %3, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 12, i32 noundef 10, i32 noundef %19)
          to label %20 unwind label %37

20:                                               ; preds = %18
  %21 = load i32, ptr %3, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 13, i32 noundef 10, i32 noundef %21)
          to label %22 unwind label %37

22:                                               ; preds = %20
  %23 = load i32, ptr %7, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 20, i32 noundef 10, i32 noundef %23)
          to label %24 unwind label %37

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 15, ptr %8, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %46, %24
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 50
  br i1 %27, label %41, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %53

29:                                               ; preds = %0
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %4, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %5, align 4
  br label %74

33:                                               ; preds = %10
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  br label %73

37:                                               ; preds = %68, %66, %63, %61, %58, %56, %53, %22, %20, %18, %16, %14, %12
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  br label %72

41:                                               ; preds = %25
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %42, i32 noundef %43, i32 noundef %44)
          to label %45 unwind label %49

45:                                               ; preds = %41
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %8, align 4, !tbaa !5
  br label %25, !llvm.loop !9

49:                                               ; preds = %41
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %72

53:                                               ; preds = %28
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = invoke noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 10, i32 noundef 10)
          to label %56 unwind label %37

56:                                               ; preds = %53
  %57 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %54, i32 noundef %55)
          to label %58 unwind label %37

58:                                               ; preds = %56
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = invoke noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 15, i32 noundef 15)
          to label %61 unwind label %37

61:                                               ; preds = %58
  %62 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %59, i32 noundef %60)
          to label %63 unwind label %37

63:                                               ; preds = %61
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = invoke noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 20, i32 noundef 10)
          to label %66 unwind label %37

66:                                               ; preds = %63
  %67 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %64, i32 noundef %65)
          to label %68 unwind label %37

68:                                               ; preds = %66
  %69 = invoke noundef zeroext i1 @_ZN8TgaImage11writeToFileEPKc(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef @.str.1)
          to label %70 unwind label %37

70:                                               ; preds = %68
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #5
  %71 = load i32, ptr %1, align 4
  ret i32 %71

72:                                               ; preds = %49, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %73

73:                                               ; preds = %72, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %74

74:                                               ; preds = %73, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #5
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %4, align 8
  %77 = load i32, ptr %5, align 4
  %78 = insertvalue { ptr, i32 } poison, ptr %76, 0
  %79 = insertvalue { ptr, i32 } %78, i32 %77, 1
  resume { ptr, i32 } %79
}

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

declare void @_ZN8TgaImageC1Eii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) #3 align 2

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #3 align 2

declare noundef zeroext i1 @_ZN8TgaImage11writeToFileEPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

; Function Attrs: nounwind
declare void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"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"

%class.TgaImage = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.TgaImage, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  call void @_ZN8TgaImageC1Eii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 100, i32 noundef 100)
  %2 = call noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 255, i32 noundef 0, i32 noundef 0)
  %3 = call noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 0, i32 noundef 255, i32 noundef 0)
  %4 = call noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 0, i32 noundef 0, i32 noundef 255)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 10, i32 noundef 10, i32 noundef %2)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 11, i32 noundef 10, i32 noundef %2)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 12, i32 noundef 10, i32 noundef %2)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 13, i32 noundef 10, i32 noundef %2)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 20, i32 noundef 10, i32 noundef %4)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 15, i32 noundef 15, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 16, i32 noundef 16, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 17, i32 noundef 17, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 18, i32 noundef 18, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 19, i32 noundef 19, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 20, i32 noundef 20, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 21, i32 noundef 21, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 22, i32 noundef 22, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 23, i32 noundef 23, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 24, i32 noundef 24, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 25, i32 noundef 25, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 26, i32 noundef 26, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 27, i32 noundef 27, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 28, i32 noundef 28, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 29, i32 noundef 29, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 30, i32 noundef 30, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 31, i32 noundef 31, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 32, i32 noundef 32, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 33, i32 noundef 33, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 34, i32 noundef 34, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 35, i32 noundef 35, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 36, i32 noundef 36, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 37, i32 noundef 37, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 38, i32 noundef 38, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 39, i32 noundef 39, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 40, i32 noundef 40, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 41, i32 noundef 41, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 42, i32 noundef 42, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 43, i32 noundef 43, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 44, i32 noundef 44, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 45, i32 noundef 45, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 46, i32 noundef 46, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 47, i32 noundef 47, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 48, i32 noundef 48, i32 noundef %3)
  call void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 49, i32 noundef 49, i32 noundef %3)
  %5 = call noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 10, i32 noundef 10)
  %6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2, i32 noundef %5)
  %7 = call noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 15, i32 noundef 15)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3, i32 noundef %7)
  %9 = call noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 20, i32 noundef 10)
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4, i32 noundef %9)
  %11 = invoke noundef zeroext i1 @_ZN8TgaImage11writeToFileEPKc(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull @.str.1)
          to label %14 unwind label %12

12:                                               ; preds = %0
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  resume { ptr, i32 } %13

14:                                               ; preds = %0
  call void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  ret i32 0
}

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

declare void @_ZN8TgaImageC1Eii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8TgaImage8rgbToIntEjjj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8TgaImage8putPixelEiij(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8TgaImage8getPixelEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN8TgaImage11writeToFileEPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN8TgaImageD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass