; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libSimuTilts/library.ll (Z18draw_circle_affinePfiiffffffff)

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_Z9draw_linePfiiiifii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18draw_circle_affinePfiiffffffff(ptr noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, float noundef %9, float noundef %10) #2 {
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !9
  store i32 %2, ptr %14, align 4, !tbaa !9
  store float %3, ptr %15, align 4, !tbaa !11
  store float %4, ptr %16, align 4, !tbaa !11
  store float %5, ptr %17, align 4, !tbaa !11
  store float %6, ptr %18, align 4, !tbaa !11
  store float %7, ptr %19, align 4, !tbaa !11
  store float %8, ptr %20, align 4, !tbaa !11
  store float %9, ptr %21, align 4, !tbaa !11
  store float %10, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 20, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store float 0.000000e+00, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %33 = load float, ptr %19, align 4, !tbaa !11
  store float %33, ptr %25, align 4, !tbaa !11
  %34 = load float, ptr %17, align 4, !tbaa !11
  %35 = fneg float %34
  store float %35, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %36 = load float, ptr %17, align 4, !tbaa !11
  %37 = call noundef float @_ZSt3sinf(float noundef %36)
  %38 = load float, ptr %18, align 4, !tbaa !11
  %39 = fmul float %37, %38
  store float %39, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %40 = load float, ptr %17, align 4, !tbaa !11
  %41 = call noundef float @_ZSt3cosf(float noundef %40)
  %42 = load float, ptr %18, align 4, !tbaa !11
  %43 = fmul float %41, %42
  store float %43, ptr %27, align 4, !tbaa !11
  %44 = load float, ptr %25, align 4, !tbaa !11
  %45 = load float, ptr %21, align 4, !tbaa !11
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27, float noundef %44, float noundef %45)
  %46 = load float, ptr %15, align 4, !tbaa !11
  %47 = load float, ptr %26, align 4, !tbaa !11
  %48 = fadd float %47, %46
  store float %48, ptr %26, align 4, !tbaa !11
  %49 = load float, ptr %16, align 4, !tbaa !11
  %50 = load float, ptr %27, align 4, !tbaa !11
  %51 = fadd float %50, %49
  store float %51, ptr %27, align 4, !tbaa !11
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load float, ptr %15, align 4, !tbaa !11
  %54 = fptosi float %53 to i32
  %55 = load float, ptr %16, align 4, !tbaa !11
  %56 = fptosi float %55 to i32
  %57 = load float, ptr %26, align 4, !tbaa !11
  %58 = fptosi float %57 to i32
  %59 = load float, ptr %27, align 4, !tbaa !11
  %60 = fptosi float %59 to i32
  %61 = load float, ptr %22, align 4, !tbaa !11
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = load i32, ptr %14, align 4, !tbaa !9
  call void @_Z9draw_linePfiiiifii(ptr noundef %52, i32 noundef %54, i32 noundef %56, i32 noundef %58, i32 noundef %60, float noundef %61, i32 noundef %62, i32 noundef %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store float 0.000000e+00, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  %64 = load float, ptr %18, align 4, !tbaa !11
  store float %64, ptr %29, align 4, !tbaa !11
  %65 = load float, ptr %25, align 4, !tbaa !11
  %66 = load float, ptr %21, align 4, !tbaa !11
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29, float noundef %65, float noundef %66)
  %67 = load float, ptr %15, align 4, !tbaa !11
  %68 = load float, ptr %28, align 4, !tbaa !11
  %69 = fadd float %68, %67
  store float %69, ptr %28, align 4, !tbaa !11
  %70 = load float, ptr %16, align 4, !tbaa !11
  %71 = load float, ptr %29, align 4, !tbaa !11
  %72 = fadd float %71, %70
  store float %72, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 1, ptr %32, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %117, %11
  %74 = load i32, ptr %32, align 4, !tbaa !9
  %75 = load i32, ptr %23, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  %77 = icmp sle i32 %74, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  br label %120

79:                                               ; preds = %73
  %80 = load float, ptr %24, align 4, !tbaa !11
  %81 = call noundef float @_ZSt3sinf(float noundef %80)
  %82 = load float, ptr %18, align 4, !tbaa !11
  %83 = fmul float %81, %82
  store float %83, ptr %30, align 4, !tbaa !11
  %84 = load float, ptr %24, align 4, !tbaa !11
  %85 = call noundef float @_ZSt3cosf(float noundef %84)
  %86 = load float, ptr %18, align 4, !tbaa !11
  %87 = fmul float %85, %86
  store float %87, ptr %31, align 4, !tbaa !11
  %88 = load float, ptr %25, align 4, !tbaa !11
  %89 = load float, ptr %21, align 4, !tbaa !11
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %31, float noundef %88, float noundef %89)
  %90 = load float, ptr %15, align 4, !tbaa !11
  %91 = load float, ptr %30, align 4, !tbaa !11
  %92 = fadd float %91, %90
  store float %92, ptr %30, align 4, !tbaa !11
  %93 = load float, ptr %16, align 4, !tbaa !11
  %94 = load float, ptr %31, align 4, !tbaa !11
  %95 = fadd float %94, %93
  store float %95, ptr %31, align 4, !tbaa !11
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load float, ptr %28, align 4, !tbaa !11
  %98 = fptosi float %97 to i32
  %99 = load float, ptr %29, align 4, !tbaa !11
  %100 = fptosi float %99 to i32
  %101 = load float, ptr %30, align 4, !tbaa !11
  %102 = fptosi float %101 to i32
  %103 = load float, ptr %31, align 4, !tbaa !11
  %104 = fptosi float %103 to i32
  %105 = load float, ptr %22, align 4, !tbaa !11
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = load i32, ptr %14, align 4, !tbaa !9
  call void @_Z9draw_linePfiiiifii(ptr noundef %96, i32 noundef %98, i32 noundef %100, i32 noundef %102, i32 noundef %104, float noundef %105, i32 noundef %106, i32 noundef %107)
  %108 = load float, ptr %30, align 4, !tbaa !11
  store float %108, ptr %28, align 4, !tbaa !11
  %109 = load float, ptr %31, align 4, !tbaa !11
  store float %109, ptr %29, align 4, !tbaa !11
  %110 = load i32, ptr %23, align 4, !tbaa !9
  %111 = sitofp i32 %110 to double
  %112 = fdiv double 0x401921FB54442D18, %111
  %113 = load float, ptr %24, align 4, !tbaa !11
  %114 = fpext float %113 to double
  %115 = fadd double %114, %112
  %116 = fptrunc double %115 to float
  store float %116, ptr %24, align 4, !tbaa !11
  br label %117

117:                                              ; preds = %79
  %118 = load i32, ptr %32, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %32, align 4, !tbaa !9
  br label %73, !llvm.loop !13

120:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  ret void
}

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

; 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 nounwind uwtable
declare dso_local void @_Z9draw_linePfiiiifii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18draw_circle_affinePfiiffffffff(ptr noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, float noundef %9, float noundef %10) local_unnamed_addr #2 {
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = fneg float %5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %19 = tail call noundef float @_ZSt3sinf(float noundef %18)
  %20 = fmul float %19, %6
  store float %20, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  %21 = tail call noundef float @_ZSt3cosf(float noundef %18)
  %22 = fmul float %21, %6
  store float %22, ptr %13, align 4, !tbaa !5
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, float noundef %7, float noundef %9)
  %23 = load float, ptr %12, align 4, !tbaa !5
  %24 = fadd float %23, %3
  store float %24, ptr %12, align 4, !tbaa !5
  %25 = load float, ptr %13, align 4, !tbaa !5
  %26 = fadd float %25, %4
  store float %26, ptr %13, align 4, !tbaa !5
  %27 = fptosi float %3 to i32
  %28 = fptosi float %4 to i32
  %29 = fptosi float %24 to i32
  %30 = fptosi float %26 to i32
  call void @_Z9draw_linePfiiiifii(ptr noundef %0, i32 noundef %27, i32 noundef %28, i32 noundef %29, i32 noundef %30, float noundef %10, i32 noundef %1, i32 noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #4
  store float 0.000000e+00, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #4
  store float %6, ptr %15, align 4, !tbaa !5
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, float noundef %7, float noundef %9)
  %31 = load float, ptr %14, align 4, !tbaa !5
  %32 = fadd float %31, %3
  store float %32, ptr %14, align 4, !tbaa !5
  %33 = load float, ptr %15, align 4, !tbaa !5
  %34 = fadd float %33, %4
  store float %34, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #4
  br label %36

35:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  ret void

36:                                               ; preds = %11, %36
  %.039 = phi i32 [ 1, %11 ], [ %56, %36 ]
  %.03738 = phi float [ 0.000000e+00, %11 ], [ %55, %36 ]
  %37 = call noundef float @_ZSt3sinf(float noundef %.03738)
  %38 = fmul float %37, %6
  store float %38, ptr %16, align 4, !tbaa !5
  %39 = call noundef float @_ZSt3cosf(float noundef %.03738)
  %40 = fmul float %39, %6
  store float %40, ptr %17, align 4, !tbaa !5
  call void @_Z30tiltedcoor2imagecoor_continousRfS_ff(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, float noundef %7, float noundef %9)
  %41 = load float, ptr %16, align 4, !tbaa !5
  %42 = fadd float %41, %3
  store float %42, ptr %16, align 4, !tbaa !5
  %43 = load float, ptr %17, align 4, !tbaa !5
  %44 = fadd float %43, %4
  store float %44, ptr %17, align 4, !tbaa !5
  %45 = load float, ptr %14, align 4, !tbaa !5
  %46 = fptosi float %45 to i32
  %47 = load float, ptr %15, align 4, !tbaa !5
  %48 = fptosi float %47 to i32
  %49 = fptosi float %42 to i32
  %50 = fptosi float %44 to i32
  call void @_Z9draw_linePfiiiifii(ptr noundef %0, i32 noundef %46, i32 noundef %48, i32 noundef %49, i32 noundef %50, float noundef %10, i32 noundef %1, i32 noundef %2)
  %51 = load float, ptr %16, align 4, !tbaa !5
  store float %51, ptr %14, align 4, !tbaa !5
  %52 = load float, ptr %17, align 4, !tbaa !5
  store float %52, ptr %15, align 4, !tbaa !5
  %53 = fpext float %.03738 to double
  %54 = fadd double %53, 0x3FD41B2F769CF0E0
  %55 = fptrunc double %54 to float
  %56 = add nuw nsw i32 %.039, 1
  %exitcond.not = icmp eq i32 %56, 22
  br i1 %exitcond.not, label %35, label %36, !llvm.loop !9
}

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

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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