; LLVM IR from ggml-org/ggml :: src (ggml)

; 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.ggml_tensor = type { i32, ptr, [4 x i64], [4 x i64], i32, [16 x i32], i32, [10 x ptr], ptr, i64, ptr, [64 x i8], ptr, [8 x i8] }

@.str.12 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_format_name(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_view_tensor(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @ggml_set_op_params(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @ggml_permute(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #2 {
  %7 = alloca ptr, align 8
  %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 ptr, align 8
  %14 = alloca [4 x i32], align 16
  %15 = alloca [4 x i32], align 16
  %16 = alloca [4 x i32], align 16
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = icmp sge i32 %17, 0
  br i1 %18, label %19, label %22

19:                                               ; preds = %6
  %20 = load i32, ptr %9, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 4
  br i1 %21, label %23, label %22

22:                                               ; preds = %19, %6
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3213, ptr noundef @.str.13, ptr noundef @.str.56) #3
  unreachable

23:                                               ; preds = %19
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = icmp sge i32 %24, 0
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = icmp slt i32 %27, 4
  br i1 %28, label %30, label %29

29:                                               ; preds = %26, %23
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3214, ptr noundef @.str.13, ptr noundef @.str.57) #3
  unreachable

30:                                               ; preds = %26
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = icmp sge i32 %31, 0
  br i1 %32, label %33, label %36

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

36:                                               ; preds = %33, %30
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3215, ptr noundef @.str.13, ptr noundef @.str.58) #3
  unreachable

37:                                               ; preds = %33
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = icmp sge i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %37
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = icmp slt i32 %41, 4
  br i1 %42, label %44, label %43

43:                                               ; preds = %40, %37
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3216, ptr noundef @.str.13, ptr noundef @.str.59) #3
  unreachable

44:                                               ; preds = %40
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = icmp ne i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3218, ptr noundef @.str.13, ptr noundef @.str.60) #3
  unreachable

49:                                               ; preds = %44
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = icmp ne i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3219, ptr noundef @.str.13, ptr noundef @.str.61) #3
  unreachable

54:                                               ; preds = %49
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = icmp ne i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3220, ptr noundef @.str.13, ptr noundef @.str.62) #3
  unreachable

59:                                               ; preds = %54
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp ne i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3221, ptr noundef @.str.13, ptr noundef @.str.63) #3
  unreachable

64:                                               ; preds = %59
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = icmp ne i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3222, ptr noundef @.str.13, ptr noundef @.str.64) #3
  unreachable

69:                                               ; preds = %64
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = icmp ne i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3223, ptr noundef @.str.13, ptr noundef @.str.65) #3
  unreachable

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call ptr @ggml_view_tensor(ptr noundef %75, ptr noundef %76)
  store ptr %77, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ggml_tensor, ptr %79, i32 0, i32 11
  %81 = getelementptr inbounds [64 x i8], ptr %80, i64 0, i64 0
  %82 = call ptr (ptr, ptr, ...) @ggml_format_name(ptr noundef %78, ptr noundef @.str.66, ptr noundef %81)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ggml_tensor, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds [4 x i64], ptr %84, i64 0, i64 0
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = trunc i64 %86 to i32
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %89
  store i32 %87, ptr %90, align 4, !tbaa !9
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ggml_tensor, ptr %91, i32 0, i32 2
  %93 = getelementptr inbounds [4 x i64], ptr %92, i64 0, i64 1
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = trunc i64 %94 to i32
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %97
  store i32 %95, ptr %98, align 4, !tbaa !9
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ggml_tensor, ptr %99, i32 0, i32 2
  %101 = getelementptr inbounds [4 x i64], ptr %100, i64 0, i64 2
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = trunc i64 %102 to i32
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !9
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ggml_tensor, ptr %107, i32 0, i32 2
  %109 = getelementptr inbounds [4 x i64], ptr %108, i64 0, i64 3
  %110 = load i64, ptr %109, align 8, !tbaa !11
  %111 = trunc i64 %110 to i32
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %113
  store i32 %111, ptr %114, align 4, !tbaa !9
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ggml_tensor, ptr %115, i32 0, i32 3
  %117 = getelementptr inbounds [4 x i64], ptr %116, i64 0, i64 0
  %118 = load i64, ptr %117, align 8, !tbaa !11
  %119 = trunc i64 %118 to i32
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %121
  store i32 %119, ptr %122, align 4, !tbaa !9
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ggml_tensor, ptr %123, i32 0, i32 3
  %125 = getelementptr inbounds [4 x i64], ptr %124, i64 0, i64 1
  %126 = load i64, ptr %125, align 8, !tbaa !11
  %127 = trunc i64 %126 to i32
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %129
  store i32 %127, ptr %130, align 4, !tbaa !9
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ggml_tensor, ptr %131, i32 0, i32 3
  %133 = getelementptr inbounds [4 x i64], ptr %132, i64 0, i64 2
  %134 = load i64, ptr %133, align 8, !tbaa !11
  %135 = trunc i64 %134 to i32
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !9
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ggml_tensor, ptr %139, i32 0, i32 3
  %141 = getelementptr inbounds [4 x i64], ptr %140, i64 0, i64 3
  %142 = load i64, ptr %141, align 8, !tbaa !11
  %143 = trunc i64 %142 to i32
  %144 = load i32, ptr %12, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %145
  store i32 %143, ptr %146, align 4, !tbaa !9
  %147 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %148 = load i32, ptr %147, align 16, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ggml_tensor, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds [4 x i64], ptr %151, i64 0, i64 0
  store i64 %149, ptr %152, align 8, !tbaa !11
  %153 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 1
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ggml_tensor, ptr %156, i32 0, i32 2
  %158 = getelementptr inbounds [4 x i64], ptr %157, i64 0, i64 1
  store i64 %155, ptr %158, align 8, !tbaa !11
  %159 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 2
  %160 = load i32, ptr %159, align 8, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.ggml_tensor, ptr %162, i32 0, i32 2
  %164 = getelementptr inbounds [4 x i64], ptr %163, i64 0, i64 2
  store i64 %161, ptr %164, align 8, !tbaa !11
  %165 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 3
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ggml_tensor, ptr %168, i32 0, i32 2
  %170 = getelementptr inbounds [4 x i64], ptr %169, i64 0, i64 3
  store i64 %167, ptr %170, align 8, !tbaa !11
  %171 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 0
  %172 = load i32, ptr %171, align 16, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.ggml_tensor, ptr %174, i32 0, i32 3
  %176 = getelementptr inbounds [4 x i64], ptr %175, i64 0, i64 0
  store i64 %173, ptr %176, align 8, !tbaa !11
  %177 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 1
  %178 = load i32, ptr %177, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.ggml_tensor, ptr %180, i32 0, i32 3
  %182 = getelementptr inbounds [4 x i64], ptr %181, i64 0, i64 1
  store i64 %179, ptr %182, align 8, !tbaa !11
  %183 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 2
  %184 = load i32, ptr %183, align 8, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.ggml_tensor, ptr %186, i32 0, i32 3
  %188 = getelementptr inbounds [4 x i64], ptr %187, i64 0, i64 2
  store i64 %185, ptr %188, align 8, !tbaa !11
  %189 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 3
  %190 = load i32, ptr %189, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.ggml_tensor, ptr %192, i32 0, i32 3
  %194 = getelementptr inbounds [4 x i64], ptr %193, i64 0, i64 3
  store i64 %191, ptr %194, align 8, !tbaa !11
  %195 = load ptr, ptr %13, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.ggml_tensor, ptr %195, i32 0, i32 4
  store i32 36, ptr %196, align 8, !tbaa !13
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.ggml_tensor, ptr %198, i32 0, i32 7
  %200 = getelementptr inbounds [10 x ptr], ptr %199, i64 0, i64 0
  store ptr %197, ptr %200, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #4
  %201 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %201, ptr %16, align 4, !tbaa !9
  %202 = getelementptr inbounds i32, ptr %16, i64 1
  %203 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %203, ptr %202, align 4, !tbaa !9
  %204 = getelementptr inbounds i32, ptr %16, i64 2
  %205 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %205, ptr %204, align 4, !tbaa !9
  %206 = getelementptr inbounds i32, ptr %16, i64 3
  %207 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %207, ptr %206, align 4, !tbaa !9
  %208 = load ptr, ptr %13, align 8, !tbaa !5
  %209 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 0
  call void @ggml_set_op_params(ptr noundef %208, ptr noundef %209, i64 noundef 16)
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret ptr %210
}

attributes #0 = { noreturn 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 80}
!14 = !{!"ggml_tensor", !10, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !10, i64 80, !7, i64 84, !10, i64 148, !7, i64 152, !6, i64 232, !12, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}


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

@.str.12 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_format_name(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_view_tensor(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @ggml_set_op_params(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @ggml_permute(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = alloca [4 x i32], align 16
  %8 = alloca [4 x i32], align 16
  %9 = alloca [4 x i32], align 16
  %or.cond = icmp ult i32 %2, 4
  br i1 %or.cond, label %11, label %10

10:                                               ; preds = %6
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3213, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.56) #3
  unreachable

11:                                               ; preds = %6
  %or.cond3 = icmp ult i32 %3, 4
  br i1 %or.cond3, label %13, label %12

12:                                               ; preds = %11
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3214, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.57) #3
  unreachable

13:                                               ; preds = %11
  %or.cond5 = icmp ult i32 %4, 4
  br i1 %or.cond5, label %15, label %14

14:                                               ; preds = %13
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3215, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.58) #3
  unreachable

15:                                               ; preds = %13
  %or.cond7 = icmp ult i32 %5, 4
  br i1 %or.cond7, label %17, label %16

16:                                               ; preds = %15
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3216, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.59) #3
  unreachable

17:                                               ; preds = %15
  %.not = icmp eq i32 %2, %3
  br i1 %.not, label %18, label %19

18:                                               ; preds = %17
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3218, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.60) #3
  unreachable

19:                                               ; preds = %17
  %.not66 = icmp eq i32 %2, %4
  br i1 %.not66, label %20, label %21

20:                                               ; preds = %19
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3219, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.61) #3
  unreachable

21:                                               ; preds = %19
  %.not67 = icmp eq i32 %2, %5
  br i1 %.not67, label %22, label %23

22:                                               ; preds = %21
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3220, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.62) #3
  unreachable

23:                                               ; preds = %21
  %.not68 = icmp eq i32 %3, %4
  br i1 %.not68, label %24, label %25

24:                                               ; preds = %23
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3221, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.63) #3
  unreachable

25:                                               ; preds = %23
  %.not69 = icmp eq i32 %3, %5
  br i1 %.not69, label %26, label %27

26:                                               ; preds = %25
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3222, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.64) #3
  unreachable

27:                                               ; preds = %25
  %.not70 = icmp eq i32 %4, %5
  br i1 %.not70, label %28, label %29

28:                                               ; preds = %27
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 3223, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.65) #3
  unreachable

29:                                               ; preds = %27
  %30 = tail call ptr @ggml_view_tensor(ptr noundef %0, ptr noundef %1)
  %31 = getelementptr inbounds i8, ptr %1, i64 256
  %32 = tail call ptr (ptr, ptr, ...) @ggml_format_name(ptr noundef %30, ptr noundef nonnull @.str.66, ptr noundef nonnull %31)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  %33 = getelementptr inbounds i8, ptr %1, i64 16
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = trunc i64 %34 to i32
  %36 = zext nneg i32 %2 to i64
  %37 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 %36
  store i32 %35, ptr %37, align 4, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %1, i64 24
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = trunc i64 %39 to i32
  %41 = zext nneg i32 %3 to i64
  %42 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 %41
  store i32 %40, ptr %42, align 4, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %1, i64 32
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = trunc i64 %44 to i32
  %46 = zext nneg i32 %4 to i64
  %47 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 %46
  store i32 %45, ptr %47, align 4, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %1, i64 40
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = trunc i64 %49 to i32
  %51 = zext nneg i32 %5 to i64
  %52 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 %51
  store i32 %50, ptr %52, align 4, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %1, i64 48
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = trunc i64 %54 to i32
  %56 = getelementptr inbounds [4 x i32], ptr %8, i64 0, i64 %36
  store i32 %55, ptr %56, align 4, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %1, i64 56
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = trunc i64 %58 to i32
  %60 = getelementptr inbounds [4 x i32], ptr %8, i64 0, i64 %41
  store i32 %59, ptr %60, align 4, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %1, i64 64
  %62 = load i64, ptr %61, align 8, !tbaa !5
  %63 = trunc i64 %62 to i32
  %64 = getelementptr inbounds [4 x i32], ptr %8, i64 0, i64 %46
  store i32 %63, ptr %64, align 4, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %1, i64 72
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = trunc i64 %66 to i32
  %68 = getelementptr inbounds [4 x i32], ptr %8, i64 0, i64 %51
  store i32 %67, ptr %68, align 4, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %30, i64 16
  %70 = load <4 x i32>, ptr %7, align 16, !tbaa !9
  %71 = sext <4 x i32> %70 to <4 x i64>
  store <4 x i64> %71, ptr %69, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %30, i64 48
  %73 = load <4 x i32>, ptr %8, align 16, !tbaa !9
  %74 = sext <4 x i32> %73 to <4 x i64>
  store <4 x i64> %74, ptr %72, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %30, i64 80
  store i32 36, ptr %75, align 8, !tbaa !11
  %76 = getelementptr inbounds i8, ptr %30, i64 152
  store ptr %1, ptr %76, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  store i32 %2, ptr %9, align 16, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 %3, ptr %77, align 4, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %4, ptr %78, align 8, !tbaa !9
  %79 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 %5, ptr %79, align 4, !tbaa !9
  call void @ggml_set_op_params(ptr noundef %30, ptr noundef nonnull %9, i64 noundef 16)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  ret ptr %30
}

attributes #0 = { noreturn 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn }
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 = !{!"long", !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 = !{!12, !10, i64 80}
!12 = !{!"ggml_tensor", !10, i64 0, !13, i64 8, !7, i64 16, !7, i64 48, !10, i64 80, !7, i64 84, !10, i64 148, !7, i64 152, !13, i64 232, !6, i64 240, !13, i64 248, !7, i64 256, !13, i64 320, !7, i64 328}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!13, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass