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

; 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.libxsmm_meltw_descriptor = type <{ i32, i32, i32, i32, i32, i32, i8, i8, i8, i16, i16, i8 }>
%struct.libxsmm_mateltwise_kernel_config_struct = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8 }

@.str = external hidden unnamed_addr constant [93 x i8], align 1
@libxsmm_ninit = external global i32, align 4
@libxsmm_verbosity = external global i32, align 4
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@__const.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel.l_perm_table_1st_stage = external hidden unnamed_addr constant [32 x i16], align 16
@__func__.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel = external hidden unnamed_addr constant [68 x i8], align 1

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

declare void @libxsmm_handle_error(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

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

; 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) #2

declare void @libxsmm_x86_instruction_alu_imm(ptr noundef, i32 noundef, i32 noundef, i64 noundef) #1

declare void @libxsmm_x86_instruction_mask_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef, ptr noundef) #1

declare void @libxsmm_generator_mateltwise_footer_n_loop(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

declare void @libxsmm_generator_mateltwise_footer_m_loop(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

declare void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef, ptr noundef, ptr noundef, i8 noundef signext, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8, ptr noundef %9) #3 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca [32 x i16], align 16
  %27 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store i32 %2, ptr %13, align 4, !tbaa !9
  store i32 %3, ptr %14, align 4, !tbaa !9
  store i32 %4, ptr %15, align 4, !tbaa !9
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i32 %6, ptr %17, align 4, !tbaa !9
  store i32 %7, ptr %18, align 4, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 4, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %28 = load ptr, ptr %20, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 1, !tbaa !11
  %31 = urem i32 %30, 16
  store i32 %31, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %32 = load ptr, ptr %20, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 1, !tbaa !11
  %35 = udiv i32 %34, 16
  store i32 %35, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %36 = load ptr, ptr %20, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 1, !tbaa !14
  %39 = load i32, ptr %21, align 4, !tbaa !9
  %40 = udiv i32 %38, %39
  store i32 %40, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 31, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %26) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 @__const.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel.l_perm_table_1st_stage, i64 64, i1 false)
  %41 = load ptr, ptr %20, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 1, !tbaa !14
  %44 = urem i32 %43, 4
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %55

46:                                               ; preds = %10
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = load i32, ptr @libxsmm_ninit, align 4, !tbaa !9
  %49 = icmp ult i32 1, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  br label %53

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52, %50
  %54 = phi i32 [ %51, %50 ], [ 1, %52 ]
  call void @libxsmm_handle_error(ptr noundef %47, i32 noundef 90016, ptr noundef @__func__.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel, ptr noundef @.str, i32 noundef 3894, i32 noundef %54)
  store i32 1, ptr %27, align 4
  br label %211

55:                                               ; preds = %10
  br label %56

56:                                               ; preds = %63, %55
  %57 = load ptr, ptr %20, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 1, !tbaa !14
  %60 = load i32, ptr %21, align 4, !tbaa !9
  %61 = urem i32 %59, %60
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %56
  %64 = load i32, ptr %21, align 4, !tbaa !9
  %65 = sub i32 %64, 4
  store i32 %65, ptr %21, align 4, !tbaa !9
  br label %56, !llvm.loop !15

66:                                               ; preds = %56
  %67 = load i32, ptr %22, align 4, !tbaa !9
  %68 = icmp ugt i32 %67, 0
  br i1 %68, label %69, label %81

69:                                               ; preds = %66
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i32, ptr %17, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %70, i32 noundef -1568407413, i32 noundef %71, i64 noundef 1)
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = load i32, ptr %17, align 4, !tbaa !9
  %74 = load i32, ptr %22, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %72, i32 noundef 30005, i32 noundef %73, i64 noundef %75)
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load i32, ptr %17, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %76, i32 noundef 30008, i32 noundef %77, i64 noundef 1)
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = load i32, ptr %18, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_mask_move(ptr noundef %78, i32 noundef -1610346094, i32 noundef %79, i32 noundef %80)
  br label %81

81:                                               ; preds = %69, %66
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds [32 x i16], ptr %26, i64 0, i64 0
  %84 = load ptr, ptr %19, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %84, i32 0, i32 128
  %86 = load i8, ptr %85, align 4, !tbaa !17
  %87 = load i32, ptr %25, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef %82, ptr noundef %83, ptr noundef @.str.23, i8 noundef signext %86, i32 noundef %87)
  %88 = load i32, ptr %24, align 4, !tbaa !9
  %89 = icmp ugt i32 %88, 1
  br i1 %89, label %90, label %102

90:                                               ; preds = %81
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %92, i32 0, i32 14
  %94 = load i32, ptr %93, align 4, !tbaa !19
  %95 = load i32, ptr %16, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %91, i32 noundef %94, i32 noundef %95, i64 noundef 0)
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %96, ptr noundef %97)
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = load i32, ptr %21, align 4, !tbaa !9
  %101 = zext i32 %100 to i64
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %98, i32 noundef 30000, i32 noundef %99, i64 noundef %101)
  br label %102

102:                                              ; preds = %90, %81
  %103 = load i32, ptr %23, align 4, !tbaa !9
  %104 = icmp ugt i32 %103, 0
  br i1 %104, label %105, label %136

105:                                              ; preds = %102
  %106 = load i32, ptr %23, align 4, !tbaa !9
  %107 = icmp ugt i32 %106, 1
  br i1 %107, label %108, label %118

108:                                              ; preds = %105
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %110, i32 0, i32 14
  %112 = load i32, ptr %111, align 4, !tbaa !19
  %113 = load i32, ptr %15, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %109, i32 noundef %112, i32 noundef %113, i64 noundef 0)
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %114, ptr noundef %115)
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i32, ptr %15, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %116, i32 noundef 30000, i32 noundef %117, i64 noundef 16)
  br label %118

118:                                              ; preds = %108, %105
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = load i32, ptr %13, align 4, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = load i32, ptr %25, align 4, !tbaa !9
  %123 = load i32, ptr %21, align 4, !tbaa !9
  %124 = load ptr, ptr %19, align 8, !tbaa !5
  %125 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef %119, i32 noundef %120, i32 noundef %121, i32 noundef 0, i32 noundef %122, i32 noundef 16, i32 noundef %123, ptr noundef %124, ptr noundef %125)
  %126 = load i32, ptr %23, align 4, !tbaa !9
  %127 = icmp ugt i32 %126, 1
  br i1 %127, label %128, label %135

128:                                              ; preds = %118
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = load ptr, ptr %19, align 8, !tbaa !5
  %132 = load i32, ptr %15, align 4, !tbaa !9
  %133 = load i32, ptr %23, align 4, !tbaa !9
  %134 = mul i32 %133, 16
  call void @libxsmm_generator_mateltwise_footer_m_loop(ptr noundef %129, ptr noundef %130, ptr noundef %131, i32 noundef %132, i32 noundef %134)
  br label %135

135:                                              ; preds = %128, %118
  br label %136

136:                                              ; preds = %135, %102
  %137 = load i32, ptr %22, align 4, !tbaa !9
  %138 = icmp ugt i32 %137, 0
  br i1 %138, label %139, label %149

139:                                              ; preds = %136
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load i32, ptr %13, align 4, !tbaa !9
  %142 = load i32, ptr %14, align 4, !tbaa !9
  %143 = load i32, ptr %18, align 4, !tbaa !9
  %144 = load i32, ptr %25, align 4, !tbaa !9
  %145 = load i32, ptr %22, align 4, !tbaa !9
  %146 = load i32, ptr %21, align 4, !tbaa !9
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef %140, i32 noundef %141, i32 noundef %142, i32 noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef %146, ptr noundef %147, ptr noundef %148)
  br label %149

149:                                              ; preds = %139, %136
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = load i32, ptr %21, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = load ptr, ptr %20, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %154, i32 0, i32 2
  %156 = load i32, ptr %155, align 1, !tbaa !20
  %157 = zext i32 %156 to i64
  %158 = mul nsw i64 %153, %157
  %159 = load ptr, ptr %19, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %159, i32 0, i32 2
  %161 = load i32, ptr %160, align 4, !tbaa !21
  %162 = zext i32 %161 to i64
  %163 = mul nsw i64 %158, %162
  %164 = load ptr, ptr %19, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %165, align 4, !tbaa !21
  %167 = zext i32 %166 to i64
  %168 = load ptr, ptr %20, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 1, !tbaa !11
  %171 = zext i32 %170 to i64
  %172 = mul nsw i64 %167, %171
  %173 = mul nsw i64 %172, 4
  %174 = sub nsw i64 %163, %173
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %150, i32 noundef 30000, i32 noundef %151, i64 noundef %174)
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = load i32, ptr %14, align 4, !tbaa !9
  %177 = load i32, ptr %21, align 4, !tbaa !9
  %178 = zext i32 %177 to i64
  %179 = load ptr, ptr %20, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %179, i32 0, i32 3
  %181 = load i32, ptr %180, align 1, !tbaa !22
  %182 = zext i32 %181 to i64
  %183 = mul nsw i64 %178, %182
  %184 = load ptr, ptr %19, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %184, i32 0, i32 5
  %186 = load i32, ptr %185, align 4, !tbaa !23
  %187 = zext i32 %186 to i64
  %188 = mul nsw i64 %183, %187
  %189 = load ptr, ptr %19, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %189, i32 0, i32 5
  %191 = load i32, ptr %190, align 4, !tbaa !23
  %192 = zext i32 %191 to i64
  %193 = load ptr, ptr %20, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %193, i32 0, i32 0
  %195 = load i32, ptr %194, align 1, !tbaa !11
  %196 = zext i32 %195 to i64
  %197 = mul nsw i64 %192, %196
  %198 = mul nsw i64 %197, 2
  %199 = sub nsw i64 %188, %198
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %175, i32 noundef 30000, i32 noundef %176, i64 noundef %199)
  %200 = load i32, ptr %24, align 4, !tbaa !9
  %201 = icmp ugt i32 %200, 1
  br i1 %201, label %202, label %210

202:                                              ; preds = %149
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = load ptr, ptr %19, align 8, !tbaa !5
  %206 = load i32, ptr %16, align 4, !tbaa !9
  %207 = load i32, ptr %24, align 4, !tbaa !9
  %208 = load i32, ptr %21, align 4, !tbaa !9
  %209 = mul i32 %207, %208
  call void @libxsmm_generator_mateltwise_footer_n_loop(ptr noundef %203, ptr noundef %204, ptr noundef %205, i32 noundef %206, i32 noundef %209)
  br label %210

210:                                              ; preds = %202, %149
  store i32 0, ptr %27, align 4
  br label %211

211:                                              ; preds = %210, %53
  call void @llvm.lifetime.end.p0(i64 64, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %212 = load i32, ptr %27, align 4
  switch i32 %212, label %214 [
    i32 0, label %213
    i32 1, label %213
  ]

213:                                              ; preds = %211, %211
  ret void

214:                                              ; preds = %211
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"libxsmm_meltw_descriptor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !13, i64 27, !13, i64 29, !7, i64 31}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !10, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !7, i64 512}
!18 = !{!"libxsmm_mateltwise_kernel_config_struct", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236, !10, i64 240, !10, i64 244, !10, i64 248, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !10, i64 388, !10, i64 392, !10, i64 396, !10, i64 400, !10, i64 404, !10, i64 408, !10, i64 412, !10, i64 416, !10, i64 420, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !7, i64 512}
!19 = !{!18, !10, i64 56}
!20 = !{!12, !10, i64 8}
!21 = !{!18, !10, i64 8}
!22 = !{!12, !10, i64 12}
!23 = !{!18, !10, i64 20}


; 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 = external hidden unnamed_addr constant [93 x i8], align 1
@libxsmm_ninit = external local_unnamed_addr global i32, align 4
@libxsmm_verbosity = external local_unnamed_addr global i32, align 4
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@__const.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel.l_perm_table_1st_stage = external hidden unnamed_addr constant [32 x i16], align 16
@__func__.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel = external hidden unnamed_addr constant [68 x i8], align 1

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

declare void @libxsmm_handle_error(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; 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 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) #2

declare void @libxsmm_x86_instruction_alu_imm(ptr noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

declare void @libxsmm_x86_instruction_mask_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libxsmm_generator_mateltwise_footer_n_loop(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @libxsmm_generator_mateltwise_footer_m_loop(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef, ptr noundef, ptr noundef, i8 noundef signext, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #3 {
  %11 = alloca [32 x i16], align 16
  %12 = load i32, ptr %9, align 1, !tbaa !5
  %13 = and i32 %12, 15
  %14 = and i32 %12, -16
  %15 = getelementptr inbounds i8, ptr %9, i64 4
  %16 = load i32, ptr %15, align 1, !tbaa !11
  %17 = lshr i32 %16, 2
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %11, ptr noundef nonnull align 16 dereferenceable(64) @__const.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel.l_perm_table_1st_stage, i64 64, i1 false)
  %18 = and i32 %16, 3
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %.preheader, label %19

19:                                               ; preds = %10
  %20 = load i32, ptr @libxsmm_ninit, align 4, !tbaa !12
  %21 = icmp ugt i32 %20, 1
  %22 = load i32, ptr @libxsmm_verbosity, align 4
  %23 = select i1 %21, i32 %22, i32 1
  tail call void @libxsmm_handle_error(ptr noundef %0, i32 noundef 90016, ptr noundef nonnull @__func__.libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_microkernel, ptr noundef nonnull @.str, i32 noundef 3894, i32 noundef %23) #4
  br label %75

.preheader:                                       ; preds = %10, %.preheader
  %.0 = phi i32 [ %25, %.preheader ], [ 4, %10 ]
  %24 = urem i32 %16, %.0
  %.not87 = icmp eq i32 %24, 0
  %25 = add i32 %.0, -4
  br i1 %.not87, label %26, label %.preheader, !llvm.loop !13

26:                                               ; preds = %.preheader
  %.not88 = icmp eq i32 %13, 0
  br i1 %.not88, label %29, label %27

27:                                               ; preds = %26
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef -1568407413, i32 noundef %6, i64 noundef 1) #4
  %28 = zext nneg i32 %13 to i64
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30005, i32 noundef %6, i64 noundef %28) #4
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30008, i32 noundef %6, i64 noundef 1) #4
  tail call void @libxsmm_x86_instruction_mask_move(ptr noundef %0, i32 noundef -1610346094, i32 noundef %6, i32 noundef %7) #4
  br label %29

29:                                               ; preds = %27, %26
  %30 = getelementptr inbounds i8, ptr %8, i64 512
  %31 = load i8, ptr %30, align 4, !tbaa !15
  call void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef %0, ptr noundef nonnull %11, ptr noundef nonnull @.str.23, i8 noundef signext %31, i32 noundef 31) #4
  %32 = icmp ugt i32 %16, 7
  br i1 %32, label %33, label %37

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %8, i64 56
  %35 = load i32, ptr %34, align 4, !tbaa !17
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef %35, i32 noundef %5, i64 noundef 0) #4
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %0, ptr noundef %1) #4
  %36 = zext i32 %.0 to i64
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %5, i64 noundef %36) #4
  br label %37

37:                                               ; preds = %33, %29
  %.not89 = icmp ult i32 %12, 16
  br i1 %.not89, label %43, label %38

38:                                               ; preds = %37
  %39 = icmp ugt i32 %12, 31
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %38
  %41 = getelementptr inbounds i8, ptr %8, i64 56
  %42 = load i32, ptr %41, align 4, !tbaa !17
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef %42, i32 noundef %4, i64 noundef 0) #4
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %0, ptr noundef %1) #4
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %4, i64 noundef 16) #4
  call void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 31, i32 noundef 16, i32 noundef %.0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  call void @libxsmm_generator_mateltwise_footer_m_loop(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %8, i32 noundef %4, i32 noundef %14) #4
  br label %43

.critedge:                                        ; preds = %38
  call void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 31, i32 noundef 16, i32 noundef %.0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  br label %43

43:                                               ; preds = %.critedge, %40, %37
  br i1 %.not88, label %45, label %44

44:                                               ; preds = %43
  call void @libxsmm_generator_transform_vnni4_to_vnni2_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef %7, i32 noundef 31, i32 noundef %13, i32 noundef %.0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  br label %45

45:                                               ; preds = %44, %43
  %46 = zext i32 %.0 to i64
  %47 = getelementptr inbounds i8, ptr %9, i64 8
  %48 = load i32, ptr %47, align 1, !tbaa !18
  %49 = zext i32 %48 to i64
  %50 = mul nuw nsw i64 %49, %46
  %51 = getelementptr inbounds i8, ptr %8, i64 8
  %52 = load i32, ptr %51, align 4, !tbaa !19
  %53 = zext i32 %52 to i64
  %54 = mul nuw nsw i64 %50, %53
  %55 = load i32, ptr %9, align 1, !tbaa !5
  %56 = zext i32 %55 to i64
  %57 = shl nuw nsw i64 %53, 2
  %58 = mul i64 %57, %56
  %59 = sub nsw i64 %54, %58
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %2, i64 noundef %59) #4
  %60 = getelementptr inbounds i8, ptr %9, i64 12
  %61 = load i32, ptr %60, align 1, !tbaa !20
  %62 = zext i32 %61 to i64
  %63 = mul nuw nsw i64 %62, %46
  %64 = getelementptr inbounds i8, ptr %8, i64 20
  %65 = load i32, ptr %64, align 4, !tbaa !21
  %66 = zext i32 %65 to i64
  %67 = mul nuw nsw i64 %63, %66
  %68 = load i32, ptr %9, align 1, !tbaa !5
  %69 = zext i32 %68 to i64
  %70 = shl nuw nsw i64 %66, 1
  %71 = mul i64 %70, %69
  %72 = sub nsw i64 %67, %71
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %3, i64 noundef %72) #4
  br i1 %32, label %73, label %75

73:                                               ; preds = %45
  %74 = mul i32 %.0, %17
  call void @libxsmm_generator_mateltwise_footer_n_loop(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %8, i32 noundef %5, i32 noundef %74) #4
  br label %75

75:                                               ; preds = %45, %73, %19
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !7, i64 0}
!6 = !{!"libxsmm_meltw_descriptor", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !8, i64 24, !8, i64 25, !8, i64 26, !10, i64 27, !10, i64 29, !8, i64 31}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !8, i64 512}
!16 = !{!"libxsmm_mateltwise_kernel_config_struct", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !7, i64 160, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 188, !7, i64 192, !7, i64 196, !7, i64 200, !7, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !7, i64 288, !7, i64 292, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352, !7, i64 356, !7, i64 360, !7, i64 364, !7, i64 368, !7, i64 372, !7, i64 376, !7, i64 380, !7, i64 384, !7, i64 388, !7, i64 392, !7, i64 396, !7, i64 400, !7, i64 404, !7, i64 408, !7, i64 412, !7, i64 416, !7, i64 420, !7, i64 424, !7, i64 428, !7, i64 432, !7, i64 436, !7, i64 440, !7, i64 444, !7, i64 448, !7, i64 452, !7, i64 456, !7, i64 460, !7, i64 464, !7, i64 468, !7, i64 472, !7, i64 476, !7, i64 480, !7, i64 484, !7, i64 488, !7, i64 492, !7, i64 496, !7, i64 500, !7, i64 504, !7, i64 508, !8, i64 512}
!17 = !{!16, !7, i64 56}
!18 = !{!6, !7, i64 8}
!19 = !{!16, !7, i64 8}
!20 = !{!6, !7, i64 12}
!21 = !{!16, !7, i64 20}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass