; 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.68 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [8 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 zeroext i1 @ggml_is_matrix(ptr noundef) #2

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

18:                                               ; preds = %6
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3926, ptr noundef @.str.13, ptr noundef @.str.84) #3
  unreachable

19:                                               ; preds = %6
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ggml_tensor, ptr %20, i32 0, i32 2
  %22 = getelementptr inbounds [4 x i64], ptr %21, i64 0, i64 2
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ggml_tensor, ptr %24, i32 0, i32 2
  %26 = getelementptr inbounds [4 x i64], ptr %25, i64 0, i64 1
  %27 = load i64, ptr %26, align 8, !tbaa !11
  %28 = icmp eq i64 %23, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %19
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ggml_tensor, ptr %31, i32 0, i32 2
  %33 = getelementptr inbounds [4 x i64], ptr %32, i64 0, i64 3
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = icmp eq i64 %34, 1
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %30
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %41, label %40

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

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

44:                                               ; preds = %41
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 3931, ptr noundef @.str.13, ptr noundef @.str.87) #3
  unreachable

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ggml_tensor, ptr %46, i32 0, i32 2
  %48 = getelementptr inbounds [4 x i64], ptr %47, i64 0, i64 0
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ggml_tensor, ptr %50, i32 0, i32 2
  %52 = getelementptr inbounds [4 x i64], ptr %51, i64 0, i64 0
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = call i64 @ggml_calc_conv_transpose_1d_output_size(i64 noundef %49, i64 noundef %53, i32 noundef %54, i32 noundef 0, i32 noundef 1)
  store i64 %55, ptr %13, align 8, !tbaa !11
  %56 = getelementptr inbounds i64, ptr %13, i64 1
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ggml_tensor, ptr %57, i32 0, i32 2
  %59 = getelementptr inbounds [4 x i64], ptr %58, i64 0, i64 1
  %60 = load i64, ptr %59, align 8, !tbaa !11
  store i64 %60, ptr %56, align 8, !tbaa !11
  %61 = getelementptr inbounds i64, ptr %13, i64 2
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ggml_tensor, ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds [4 x i64], ptr %63, i64 0, i64 2
  %65 = load i64, ptr %64, align 8, !tbaa !11
  store i64 %65, ptr %61, align 8, !tbaa !11
  %66 = getelementptr inbounds i64, ptr %13, i64 3
  store i64 1, ptr %66, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds [4 x i64], ptr %13, i64 0, i64 0
  %69 = call ptr @ggml_new_tensor(ptr noundef %67, i32 noundef 0, i32 noundef 4, ptr noundef %68)
  store ptr %69, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #4
  %70 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %70, ptr %15, align 4, !tbaa !9
  %71 = getelementptr inbounds i32, ptr %15, i64 1
  %72 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %72, ptr %71, align 4, !tbaa !9
  %73 = getelementptr inbounds i32, ptr %15, i64 2
  %74 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %74, ptr %73, align 4, !tbaa !9
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  %76 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 0
  call void @ggml_set_op_params(ptr noundef %75, ptr noundef %76, i64 noundef 12)
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ggml_tensor, ptr %77, i32 0, i32 4
  store i32 48, ptr %78, align 8, !tbaa !13
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ggml_tensor, ptr %80, i32 0, i32 7
  %82 = getelementptr inbounds [10 x ptr], ptr %81, i64 0, i64 0
  store ptr %79, ptr %82, align 8, !tbaa !5
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ggml_tensor, ptr %84, i32 0, i32 7
  %86 = getelementptr inbounds [10 x ptr], ptr %85, i64 0, i64 1
  store ptr %83, ptr %86, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  ret ptr %87
}

; Function Attrs: nounwind uwtable
declare hidden i64 @ggml_calc_conv_transpose_1d_output_size(i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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.68 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [8 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 zeroext i1 @ggml_is_matrix(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_new_tensor(ptr noundef, i32 noundef, i32 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_conv_transpose_1d(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = alloca [4 x i64], align 16
  %8 = alloca [3 x i32], align 4
  %9 = tail call zeroext i1 @ggml_is_matrix(ptr noundef %2)
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %1, i64 32
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %2, i64 24
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = icmp eq i64 %13, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %11
  %19 = getelementptr inbounds i8, ptr %1, i64 40
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = icmp eq i64 %20, 1
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %18
  %24 = icmp eq i32 %4, 0
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %23
  %27 = icmp eq i32 %5, 1
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %1, i64 16
  %31 = getelementptr inbounds i8, ptr %2, i64 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = load i64, ptr %30, align 8, !tbaa !5
  %34 = tail call i64 @ggml_calc_conv_transpose_1d_output_size(i64 noundef %32, i64 noundef %33, i32 noundef %3, i32 noundef 0, i32 noundef 1)
  store i64 %34, ptr %7, align 16, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %7, i64 8
  %36 = getelementptr inbounds i8, ptr %1, i64 24
  %37 = load i64, ptr %36, align 8, !tbaa !5
  store i64 %37, ptr %35, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %7, i64 16
  %39 = getelementptr inbounds i8, ptr %2, i64 32
  %40 = load i64, ptr %39, align 8, !tbaa !5
  store i64 %40, ptr %38, align 16, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %7, i64 24
  store i64 1, ptr %41, align 8, !tbaa !5
  %42 = call ptr @ggml_new_tensor(ptr noundef %0, i32 noundef 0, i32 noundef 4, ptr noundef nonnull %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #4
  store i32 %3, ptr %8, align 4, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 0, ptr %43, align 4, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 1, ptr %44, align 4, !tbaa !9
  call void @ggml_set_op_params(ptr noundef %42, ptr noundef nonnull %8, i64 noundef 12)
  %45 = getelementptr inbounds i8, ptr %42, i64 80
  store i32 48, ptr %45, align 8, !tbaa !11
  %46 = getelementptr inbounds i8, ptr %42, i64 152
  store ptr %1, ptr %46, align 8, !tbaa !14
  %47 = getelementptr inbounds i8, ptr %42, i64 160
  store ptr %2, ptr %47, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  ret ptr %42
}

; Function Attrs: nounwind uwtable
declare hidden i64 @ggml_calc_conv_transpose_1d_output_size(i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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,SROAPass,TailCallElimPass