; LLVM IR from libxsmm/libxsmm :: src (generator_rv64_reference)

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

%union.libxsmm_ref_code_pointer = type { ptr }

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_rv64_reference_kernel(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %union.libxsmm_ref_code_pointer, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 0
  %21 = zext i1 %20 to i64
  %22 = select i1 %20, i64 96, i64 32
  store i64 %22, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 11, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 29, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr null, ptr %14, align 8, !tbaa !13
  %23 = load i64, ptr %7, align 8, !tbaa !11
  %24 = call noalias ptr @malloc(i64 noundef %23) #8
  store ptr %24, ptr %10, align 8, !tbaa !5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = load i64, ptr %7, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr align 1 %25, i8 0, i64 %26, i1 false)
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %34

29:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %30, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %31, ptr %16, align 8, !tbaa !5
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 %33, i64 95, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %39

34:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %35, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %36, ptr %18, align 8, !tbaa !5
  %37 = load ptr, ptr %18, align 8, !tbaa !5
  %38 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %37, ptr align 1 %38, i64 32, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %39

39:                                               ; preds = %34, %29
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %40, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_rv64_instruction_open_stream(ptr noundef %41, i16 noundef zeroext 16383)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %42, i32 noundef 19, i32 noundef 2, i32 noundef 18, i32 noundef 0)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = load i32, ptr %13, align 4, !tbaa !9
  call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %43, i32 noundef 19, i32 noundef 2, i32 noundef %44, i32 noundef 0)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = load i32, ptr %12, align 4, !tbaa !9
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = load i64, ptr %7, align 8, !tbaa !11
  call void @libxsmm_rv64_instruction_alu_compute_imm64(ptr noundef %45, i32 noundef 1073741875, i32 noundef %46, i32 noundef %47, i32 noundef %48, i64 noundef %49)
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !9
  call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %50, i32 noundef 19, i32 noundef %51, i32 noundef 2, i32 noundef 0)
  store i32 0, ptr %9, align 4, !tbaa !9
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %52

52:                                               ; preds = %97, %39
  %53 = load i64, ptr %8, align 8, !tbaa !11
  %54 = load i64, ptr %7, align 8, !tbaa !11
  %55 = udiv i64 %54, 32
  %56 = icmp ult i64 %53, %55
  br i1 %56, label %57, label %100

57:                                               ; preds = %52
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds i64, ptr %60, i64 0
  %62 = load i64, ptr %61, align 8, !tbaa !11
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %58, i32 noundef %59, i64 noundef %62)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds i64, ptr %65, i64 1
  %67 = load i64, ptr %66, align 8, !tbaa !11
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %63, i32 noundef %64, i64 noundef %67)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = load i32, ptr %9, align 4, !tbaa !9
  call void @libxsmm_rv64_instruction_alu_move(ptr noundef %68, i32 noundef 12323, i32 noundef 2, i32 noundef %69, i32 noundef %70)
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = add i32 %73, 8
  call void @libxsmm_rv64_instruction_alu_move(ptr noundef %71, i32 noundef 12323, i32 noundef 2, i32 noundef %72, i32 noundef %74)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds i64, ptr %77, i64 2
  %79 = load i64, ptr %78, align 8, !tbaa !11
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %75, i32 noundef %76, i64 noundef %79)
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds i64, ptr %82, i64 3
  %84 = load i64, ptr %83, align 8, !tbaa !11
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %80, i32 noundef %81, i64 noundef %84)
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = add i32 %87, 16
  call void @libxsmm_rv64_instruction_alu_move(ptr noundef %85, i32 noundef 12323, i32 noundef 2, i32 noundef %86, i32 noundef %88)
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = add i32 %91, 24
  call void @libxsmm_rv64_instruction_alu_move(ptr noundef %89, i32 noundef 12323, i32 noundef 2, i32 noundef %90, i32 noundef %92)
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds i64, ptr %93, i64 4
  store ptr %94, ptr %11, align 8, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = add i32 %95, 32
  store i32 %96, ptr %9, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %57
  %98 = load i64, ptr %8, align 8, !tbaa !11
  %99 = add i64 %98, 1
  store i64 %99, ptr %8, align 8, !tbaa !11
  br label %52, !llvm.loop !18

100:                                              ; preds = %52
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load i32, ptr %12, align 4, !tbaa !9
  call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %101, i32 noundef 19, i32 noundef 2, i32 noundef %102, i32 noundef 0)
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %100
  store ptr @libxsmm_reference_gemm, ptr %14, align 8, !tbaa !13
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = load i64, ptr %14, align 8, !tbaa !13
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %106, i32 noundef %107, i64 noundef %108)
  br label %113

109:                                              ; preds = %100
  store ptr @libxsmm_reference_elementwise, ptr %14, align 8, !tbaa !13
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = load i64, ptr %14, align 8, !tbaa !13
  call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %110, i32 noundef %111, i64 noundef %112)
  br label %113

113:                                              ; preds = %109, %105
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !9
  call void @libxsmm_rv64_instruction_jump_and_link_reg(ptr noundef %114, i32 noundef 103, i32 noundef 1, i32 noundef %115, i32 noundef 0)
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %116, i32 noundef 19, i32 noundef 18, i32 noundef 2, i32 noundef 0)
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %117) #7
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_rv64_instruction_close_stream(ptr noundef %118, i16 noundef zeroext 16383)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret void
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

declare void @libxsmm_rv64_instruction_open_stream(ptr noundef, i16 noundef zeroext) #5

declare void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

declare void @libxsmm_rv64_instruction_alu_compute_imm64(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #5

declare void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef, i32 noundef, i64 noundef) #5

declare void @libxsmm_rv64_instruction_alu_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

declare void @libxsmm_reference_gemm(ptr noundef, ptr noundef) #5

declare void @libxsmm_reference_elementwise(ptr noundef, ptr noundef) #5

declare void @libxsmm_rv64_instruction_jump_and_link_reg(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

declare void @libxsmm_rv64_instruction_close_stream(ptr noundef, i16 noundef zeroext) #5

attributes #0 = { 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 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 "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 #7 = { nounwind }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 4, !9, i64 28, i64 1, !13, i64 29, i64 3, !13, i64 32, i64 1, !13, i64 33, i64 8, !11, i64 41, i64 8, !11, i64 49, i64 1, !13, i64 50, i64 4, !9, i64 54, i64 4, !9, i64 58, i64 4, !9, i64 62, i64 2, !15, i64 64, i64 2, !15, i64 66, i64 1, !13, i64 67, i64 1, !13, i64 68, i64 1, !13, i64 69, i64 1, !13, i64 70, i64 2, !15, i64 72, i64 2, !15, i64 74, i64 2, !15, i64 76, i64 2, !15, i64 78, i64 2, !15, i64 80, i64 2, !15, i64 82, i64 4, !9, i64 86, i64 4, !9, i64 90, i64 4, !9, i64 94, i64 1, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 1, !13, i64 25, i64 1, !13, i64 26, i64 1, !13, i64 27, i64 2, !15, i64 29, i64 2, !15, i64 31, i64 1, !13}
!18 = distinct !{!18, !19}
!19 = !{!"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: nounwind uwtable
define dso_local void @libxsmm_generator_rv64_reference_kernel(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq i32 %2, 0
  %5 = select i1 %4, i64 96, i64 32
  %calloc = tail call ptr @calloc(i64 1, i64 %5)
  br i1 %4, label %6, label %7

6:                                                ; preds = %3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(95) %calloc, ptr noundef nonnull align 1 dereferenceable(95) %1, i64 95, i1 false), !tbaa.struct !5
  br label %8

7:                                                ; preds = %3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %calloc, ptr noundef nonnull align 1 dereferenceable(32) %1, i64 32, i1 false), !tbaa.struct !15
  br label %8

8:                                                ; preds = %7, %6
  tail call void @libxsmm_rv64_instruction_open_stream(ptr noundef %0, i16 noundef zeroext 16383) #5
  tail call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %0, i32 noundef 19, i32 noundef 2, i32 noundef 18, i32 noundef 0) #5
  tail call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %0, i32 noundef 19, i32 noundef 2, i32 noundef 29, i32 noundef 0) #5
  tail call void @libxsmm_rv64_instruction_alu_compute_imm64(ptr noundef %0, i32 noundef 1073741875, i32 noundef 29, i32 noundef 11, i32 noundef 29, i64 noundef %5) #5
  tail call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %0, i32 noundef 19, i32 noundef 29, i32 noundef 2, i32 noundef 0) #5
  %9 = lshr exact i64 %5, 5
  br label %10

10:                                               ; preds = %8, %10
  %.070 = phi i64 [ 0, %8 ], [ %23, %10 ]
  %.06669 = phi i32 [ 0, %8 ], [ %22, %10 ]
  %.06768 = phi ptr [ %calloc, %8 ], [ %21, %10 ]
  %11 = load i64, ptr %.06768, align 8, !tbaa !11
  tail call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %0, i32 noundef 11, i64 noundef %11) #5
  %12 = getelementptr inbounds i8, ptr %.06768, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !11
  tail call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %0, i32 noundef 29, i64 noundef %13) #5
  tail call void @libxsmm_rv64_instruction_alu_move(ptr noundef %0, i32 noundef 12323, i32 noundef 2, i32 noundef 11, i32 noundef %.06669) #5
  %14 = or disjoint i32 %.06669, 8
  tail call void @libxsmm_rv64_instruction_alu_move(ptr noundef %0, i32 noundef 12323, i32 noundef 2, i32 noundef 29, i32 noundef %14) #5
  %15 = getelementptr inbounds i8, ptr %.06768, i64 16
  %16 = load i64, ptr %15, align 8, !tbaa !11
  tail call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %0, i32 noundef 11, i64 noundef %16) #5
  %17 = getelementptr inbounds i8, ptr %.06768, i64 24
  %18 = load i64, ptr %17, align 8, !tbaa !11
  tail call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %0, i32 noundef 29, i64 noundef %18) #5
  %19 = or disjoint i32 %.06669, 16
  tail call void @libxsmm_rv64_instruction_alu_move(ptr noundef %0, i32 noundef 12323, i32 noundef 2, i32 noundef 11, i32 noundef %19) #5
  %20 = or disjoint i32 %.06669, 24
  tail call void @libxsmm_rv64_instruction_alu_move(ptr noundef %0, i32 noundef 12323, i32 noundef 2, i32 noundef 29, i32 noundef %20) #5
  %21 = getelementptr inbounds i8, ptr %.06768, i64 32
  %22 = add nuw nsw i32 %.06669, 32
  %23 = add nuw nsw i64 %.070, 1
  %exitcond.not = icmp eq i64 %23, %9
  br i1 %exitcond.not, label %24, label %10, !llvm.loop !16

24:                                               ; preds = %10
  tail call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %0, i32 noundef 19, i32 noundef 2, i32 noundef 11, i32 noundef 0) #5
  %. = select i1 %4, i64 ptrtoint (ptr @libxsmm_reference_gemm to i64), i64 ptrtoint (ptr @libxsmm_reference_elementwise to i64)
  tail call void @libxsmm_rv64_instruction_alu_set_imm64(ptr noundef %0, i32 noundef 29, i64 noundef %.) #5
  tail call void @libxsmm_rv64_instruction_jump_and_link_reg(ptr noundef %0, i32 noundef 103, i32 noundef 1, i32 noundef 29, i32 noundef 0) #5
  tail call void @libxsmm_rv64_instruction_alu_compute_imm12(ptr noundef %0, i32 noundef 19, i32 noundef 18, i32 noundef 2, i32 noundef 0) #5
  tail call void @free(ptr noundef %calloc) #5
  tail call void @libxsmm_rv64_instruction_close_stream(ptr noundef %0, i16 noundef zeroext 16383) #5
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare void @libxsmm_rv64_instruction_open_stream(ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

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

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

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

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

declare void @libxsmm_reference_gemm(ptr noundef, ptr noundef) #2

declare void @libxsmm_reference_elementwise(ptr noundef, ptr noundef) #2

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare void @libxsmm_rv64_instruction_close_stream(ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { 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 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 willreturn allockind("free") memory(argmem: readwrite, 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 #4 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6, i64 24, i64 4, !6, i64 28, i64 1, !10, i64 29, i64 3, !10, i64 32, i64 1, !10, i64 33, i64 8, !11, i64 41, i64 8, !11, i64 49, i64 1, !10, i64 50, i64 4, !6, i64 54, i64 4, !6, i64 58, i64 4, !6, i64 62, i64 2, !13, i64 64, i64 2, !13, i64 66, i64 1, !10, i64 67, i64 1, !10, i64 68, i64 1, !10, i64 69, i64 1, !10, i64 70, i64 2, !13, i64 72, i64 2, !13, i64 74, i64 2, !13, i64 76, i64 2, !13, i64 78, i64 2, !13, i64 80, i64 2, !13, i64 82, i64 4, !6, i64 86, i64 4, !6, i64 90, i64 4, !6, i64 94, i64 1, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6, i64 24, i64 1, !10, i64 25, i64 1, !10, i64 26, i64 1, !10, i64 27, i64 2, !13, i64 29, i64 2, !13, i64 31, i64 1, !10}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass