; 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
@__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_1st_stage = external hidden unnamed_addr constant [64 x i8], align 16
@__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_2nd_stage = external hidden unnamed_addr constant [16 x i32], align 16
@__func__.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel = external hidden unnamed_addr constant [67 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 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_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef, i32 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_norm_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 [64 x i8], align 16
  %27 = alloca i32, align 4
  %28 = alloca [16 x i32], align 16
  %29 = 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
  %30 = load ptr, ptr %20, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 1, !tbaa !11
  %33 = urem i32 %32, 16
  store i32 %33, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %34 = load ptr, ptr %20, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 1, !tbaa !11
  %37 = udiv i32 %36, 16
  store i32 %37, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %38 = load ptr, ptr %20, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 1, !tbaa !14
  %41 = load i32, ptr %21, align 4, !tbaa !9
  %42 = udiv i32 %40, %41
  store i32 %42, 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_norm_08bit_avx512_microkernel.l_perm_table_1st_stage, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 30, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %28) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 @__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_2nd_stage, i64 64, i1 false)
  %43 = load ptr, ptr %20, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 1, !tbaa !14
  %46 = urem i32 %45, 4
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %57

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

52:                                               ; preds = %48
  %53 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  br label %55

54:                                               ; preds = %48
  br label %55

55:                                               ; preds = %54, %52
  %56 = phi i32 [ %53, %52 ], [ 1, %54 ]
  call void @libxsmm_handle_error(ptr noundef %49, i32 noundef 90016, ptr noundef @__func__.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel, ptr noundef @.str, i32 noundef 3760, i32 noundef %56)
  store i32 1, ptr %29, align 4
  br label %220

57:                                               ; preds = %10
  br label %58

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

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

68:                                               ; preds = %58
  %69 = load i32, ptr %22, align 4, !tbaa !9
  %70 = icmp ugt i32 %69, 0
  br i1 %70, label %71, label %83

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

83:                                               ; preds = %71, %68
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %86 = load ptr, ptr %19, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %86, i32 0, i32 128
  %88 = load i8, ptr %87, align 4, !tbaa !17
  %89 = load i32, ptr %25, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef %84, ptr noundef %85, ptr noundef @.str.23, i8 noundef signext %88, i32 noundef %89)
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds [16 x i32], ptr %28, i64 0, i64 0
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %92, i32 0, i32 128
  %94 = load i8, ptr %93, align 4, !tbaa !17
  %95 = load i32, ptr %27, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef %90, ptr noundef %91, ptr noundef @.str.24, i8 noundef signext %94, i32 noundef %95)
  %96 = load i32, ptr %24, align 4, !tbaa !9
  %97 = icmp ugt i32 %96, 1
  br i1 %97, label %98, label %110

98:                                               ; preds = %83
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %100, i32 0, i32 14
  %102 = load i32, ptr %101, align 4, !tbaa !19
  %103 = load i32, ptr %16, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %99, i32 noundef %102, i32 noundef %103, i64 noundef 0)
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load i32, ptr %16, align 4, !tbaa !9
  %108 = load i32, ptr %21, align 4, !tbaa !9
  %109 = zext i32 %108 to i64
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %106, i32 noundef 30000, i32 noundef %107, i64 noundef %109)
  br label %110

110:                                              ; preds = %98, %83
  %111 = load i32, ptr %23, align 4, !tbaa !9
  %112 = icmp ugt i32 %111, 0
  br i1 %112, label %113, label %145

113:                                              ; preds = %110
  %114 = load i32, ptr %23, align 4, !tbaa !9
  %115 = icmp ugt i32 %114, 1
  br i1 %115, label %116, label %126

116:                                              ; preds = %113
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %118, i32 0, i32 14
  %120 = load i32, ptr %119, align 4, !tbaa !19
  %121 = load i32, ptr %15, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %117, i32 noundef %120, i32 noundef %121, i64 noundef 0)
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_register_jump_back_label(ptr noundef %122, ptr noundef %123)
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = load i32, ptr %15, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %124, i32 noundef 30000, i32 noundef %125, i64 noundef 16)
  br label %126

126:                                              ; preds = %116, %113
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = load i32, ptr %13, align 4, !tbaa !9
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = load i32, ptr %25, align 4, !tbaa !9
  %131 = load i32, ptr %27, align 4, !tbaa !9
  %132 = load i32, ptr %21, align 4, !tbaa !9
  %133 = load ptr, ptr %19, align 8, !tbaa !5
  %134 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef %127, i32 noundef %128, i32 noundef %129, i32 noundef 0, i32 noundef %130, i32 noundef %131, i32 noundef 16, i32 noundef %132, ptr noundef %133, ptr noundef %134)
  %135 = load i32, ptr %23, align 4, !tbaa !9
  %136 = icmp ugt i32 %135, 1
  br i1 %136, label %137, label %144

137:                                              ; preds = %126
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = load i32, ptr %23, align 4, !tbaa !9
  %143 = mul i32 %142, 16
  call void @libxsmm_generator_mateltwise_footer_m_loop(ptr noundef %138, ptr noundef %139, ptr noundef %140, i32 noundef %141, i32 noundef %143)
  br label %144

144:                                              ; preds = %137, %126
  br label %145

145:                                              ; preds = %144, %110
  %146 = load i32, ptr %22, align 4, !tbaa !9
  %147 = icmp ugt i32 %146, 0
  br i1 %147, label %148, label %159

148:                                              ; preds = %145
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = load i32, ptr %14, align 4, !tbaa !9
  %152 = load i32, ptr %18, align 4, !tbaa !9
  %153 = load i32, ptr %25, align 4, !tbaa !9
  %154 = load i32, ptr %27, align 4, !tbaa !9
  %155 = load i32, ptr %22, align 4, !tbaa !9
  %156 = load i32, ptr %21, align 4, !tbaa !9
  %157 = load ptr, ptr %19, align 8, !tbaa !5
  %158 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152, i32 noundef %153, i32 noundef %154, i32 noundef %155, i32 noundef %156, ptr noundef %157, ptr noundef %158)
  br label %159

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

211:                                              ; preds = %159
  %212 = load ptr, ptr %11, align 8, !tbaa !5
  %213 = load ptr, ptr %12, align 8, !tbaa !5
  %214 = load ptr, ptr %19, align 8, !tbaa !5
  %215 = load i32, ptr %16, align 4, !tbaa !9
  %216 = load i32, ptr %24, align 4, !tbaa !9
  %217 = load i32, ptr %21, align 4, !tbaa !9
  %218 = mul i32 %216, %217
  call void @libxsmm_generator_mateltwise_footer_n_loop(ptr noundef %212, ptr noundef %213, ptr noundef %214, i32 noundef %215, i32 noundef %218)
  br label %219

219:                                              ; preds = %211, %159
  store i32 0, ptr %29, align 4
  br label %220

220:                                              ; preds = %219, %55
  call void @llvm.lifetime.end.p0(i64 64, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  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
  %221 = load i32, ptr %29, align 4
  switch i32 %221, label %223 [
    i32 0, label %222
    i32 1, label %222
  ]

222:                                              ; preds = %220, %220
  ret void

223:                                              ; preds = %220
  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
@__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_1st_stage = external hidden unnamed_addr constant [64 x i8], align 16
@__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_2nd_stage = external hidden unnamed_addr constant [16 x i32], align 16
@__func__.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel = external hidden unnamed_addr constant [67 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 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_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef, i32 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_norm_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 [64 x i8], align 16
  %12 = alloca [16 x i32], align 16
  %13 = load i32, ptr %9, align 1, !tbaa !5
  %14 = and i32 %13, 15
  %15 = and i32 %13, -16
  %16 = getelementptr inbounds i8, ptr %9, i64 4
  %17 = load i32, ptr %16, align 1, !tbaa !11
  %18 = lshr i32 %17, 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_norm_08bit_avx512_microkernel.l_perm_table_1st_stage, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %12, ptr noundef nonnull align 16 dereferenceable(64) @__const.libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_microkernel.l_perm_table_2nd_stage, i64 64, i1 false)
  %19 = and i32 %17, 3
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %.preheader, label %20

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

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

27:                                               ; preds = %.preheader
  %.not93 = icmp eq i32 %14, 0
  br i1 %.not93, label %30, label %28

28:                                               ; preds = %27
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef -1568407413, i32 noundef %6, i64 noundef 1) #4
  %29 = zext nneg i32 %14 to i64
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30005, i32 noundef %6, i64 noundef %29) #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 %30

30:                                               ; preds = %28, %27
  %31 = getelementptr inbounds i8, ptr %8, i64 512
  %32 = load i8, ptr %31, 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 %32, i32 noundef 31) #4
  %33 = load i8, ptr %31, align 4, !tbaa !15
  call void @libxsmm_x86_instruction_full_vec_load_of_constants(ptr noundef %0, ptr noundef nonnull %12, ptr noundef nonnull @.str.24, i8 noundef signext %33, i32 noundef 30) #4
  %34 = icmp ugt i32 %17, 7
  br i1 %34, label %35, label %39

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

39:                                               ; preds = %35, %30
  %.not94 = icmp ult i32 %13, 16
  br i1 %.not94, label %45, label %40

40:                                               ; preds = %39
  %41 = icmp ugt i32 %13, 31
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %40
  %43 = getelementptr inbounds i8, ptr %8, i64 56
  %44 = load i32, ptr %43, align 4, !tbaa !17
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef %44, 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_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 31, i32 noundef 30, 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 %15) #4
  br label %45

.critedge:                                        ; preds = %40
  call void @libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 31, i32 noundef 30, i32 noundef 16, i32 noundef %.0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  br label %45

45:                                               ; preds = %.critedge, %42, %39
  br i1 %.not93, label %47, label %46

46:                                               ; preds = %45
  call void @libxsmm_generator_transform_vnni4_to_norm_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef %7, i32 noundef 31, i32 noundef 30, i32 noundef %14, i32 noundef %.0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  br label %47

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

73:                                               ; preds = %47
  %74 = mul i32 %.0, %18
  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 = %47, %73, %20
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #4
  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