; 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_generated_code = type { ptr, i32, i32, i32, i32, i32, i32 }
%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 }
%struct.libxsmm_meltw_descriptor = type <{ i32, i32, i32, i32, i32, i32, i8, i8, i8, i16, i16, 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
@__func__.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel = external hidden unnamed_addr constant [76 x i8], align 1
@__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx = external hidden unnamed_addr constant [4 x i8], align 1
@__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx.17 = external hidden unnamed_addr constant [4 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: nounwind uwtable
declare dso_local void @libxsmm_generator_transform_Xway_permutevar1_network_avx512(ptr noundef, i8 noundef signext, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 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) #2 {
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %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 i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca [4 x i8], align 1
  %29 = alloca [4 x i8], align 1
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  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 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %30 = load i32, ptr %18, align 4, !tbaa !9
  %31 = add i32 %30, 3
  %32 = udiv i32 %31, 4
  %33 = mul i32 %32, 4
  store i32 %33, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %34 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %34, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %35 = load i32, ptr %17, align 4, !tbaa !9
  %36 = mul i32 %35, 4
  %37 = udiv i32 %36, 64
  store i32 %37, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %38 = load i32, ptr %17, align 4, !tbaa !9
  %39 = mul i32 %38, 4
  %40 = urem i32 %39, 64
  store i32 %40, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  store i32 0, ptr %26, align 4, !tbaa !9
  %41 = load i32, ptr %23, align 4, !tbaa !9
  %42 = icmp ugt i32 %41, 27
  br i1 %42, label %43, label %52

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

47:                                               ; preds = %43
  %48 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  br label %50

49:                                               ; preds = %43
  br label %50

50:                                               ; preds = %49, %47
  %51 = phi i32 [ %48, %47 ], [ 1, %49 ]
  call void @libxsmm_handle_error(ptr noundef %44, i32 noundef 90016, ptr noundef @__func__.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel, ptr noundef @.str, i32 noundef 2877, i32 noundef %51)
  store i32 1, ptr %27, align 4
  br label %222

52:                                               ; preds = %10
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %80, %52
  %54 = load i32, ptr %21, align 4, !tbaa !9
  %55 = load i32, ptr %18, align 4, !tbaa !9
  %56 = icmp ult i32 %54, %55
  br i1 %56, label %57, label %83

57:                                               ; preds = %53
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %59, i32 0, i32 6
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = load ptr, ptr %19, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %62, i32 0, i32 6
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = load i32, ptr %21, align 4, !tbaa !9
  %67 = load ptr, ptr %20, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 1, !tbaa !15
  %70 = mul i32 %66, %69
  %71 = load ptr, ptr %19, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !18
  %74 = mul i32 %70, %73
  %75 = load ptr, ptr %19, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %75, i32 0, i32 128
  %77 = load i8, ptr %76, align 4, !tbaa !19
  %78 = load i32, ptr %21, align 4, !tbaa !9
  %79 = load i32, ptr %14, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %58, i32 noundef %61, i32 noundef %64, i32 noundef %65, i32 noundef 127, i32 noundef 0, i32 noundef %74, i8 noundef signext %77, i32 noundef %78, i32 noundef %79, i32 noundef 1, i32 noundef 0)
  br label %80

80:                                               ; preds = %57
  %81 = load i32, ptr %21, align 4, !tbaa !9
  %82 = add i32 %81, 1
  store i32 %82, ptr %21, align 4, !tbaa !9
  br label %53, !llvm.loop !20

83:                                               ; preds = %53
  br label %84

84:                                               ; preds = %96, %83
  %85 = load i32, ptr %21, align 4, !tbaa !9
  %86 = load i32, ptr %22, align 4, !tbaa !9
  %87 = icmp ult i32 %85, %86
  br i1 %87, label %88, label %99

88:                                               ; preds = %84
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %19, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %90, i32 0, i32 128
  %92 = load i8, ptr %91, align 4, !tbaa !19
  %93 = load i32, ptr %21, align 4, !tbaa !9
  %94 = load i32, ptr %21, align 4, !tbaa !9
  %95 = load i32, ptr %21, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_vec_compute_3reg(ptr noundef %89, i32 noundef 805639919, i8 noundef signext %92, i32 noundef %93, i32 noundef %94, i32 noundef %95)
  br label %96

96:                                               ; preds = %88
  %97 = load i32, ptr %21, align 4, !tbaa !9
  %98 = add i32 %97, 1
  store i32 %98, ptr %21, align 4, !tbaa !9
  br label %84, !llvm.loop !22

99:                                               ; preds = %84
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %104, i32 0, i32 2
  %106 = load i32, ptr %105, align 4, !tbaa !18
  %107 = zext i32 %106 to i64
  %108 = mul nsw i64 %103, %107
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %100, i32 noundef 30000, i32 noundef %101, i64 noundef %108)
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %208, %99
  %110 = load i32, ptr %21, align 4, !tbaa !9
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = icmp ult i32 %110, %111
  br i1 %112, label %113, label %211

113:                                              ; preds = %109
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %19, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %115, i32 0, i32 128
  %117 = load i8, ptr %116, align 4, !tbaa !19
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = load i32, ptr %21, align 4, !tbaa !9
  call void @libxsmm_generator_transform_Xway_permutevar1_network_avx512(ptr noundef %114, i8 noundef signext %117, i32 noundef %118, i32 noundef %119, i32 noundef 805643830, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %28, ptr align 1 @__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx, i64 4, i1 false)
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %121, i32 0, i32 128
  %123 = load i8, ptr %122, align 4, !tbaa !19
  %124 = getelementptr inbounds [4 x i8], ptr %28, i64 0, i64 0
  %125 = load i32, ptr %21, align 4, !tbaa !9
  %126 = load i32, ptr %23, align 4, !tbaa !9
  call void @libxsmm_generator_transform_Xway_unpack_network_avx_avx512(ptr noundef %120, i8 noundef signext %123, ptr noundef %124, i32 noundef %125, i32 noundef %126, i32 noundef 1, i32 noundef 805639776, i32 noundef 805639784, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %29, ptr align 1 @__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx.17, i64 4, i1 false)
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %128, i32 0, i32 128
  %130 = load i8, ptr %129, align 4, !tbaa !19
  %131 = getelementptr inbounds [4 x i8], ptr %29, i64 0, i64 0
  %132 = load i32, ptr %23, align 4, !tbaa !9
  %133 = load i32, ptr %21, align 4, !tbaa !9
  call void @libxsmm_generator_transform_Xway_unpack_network_avx_avx512(ptr noundef %127, i8 noundef signext %130, ptr noundef %131, i32 noundef %132, i32 noundef %133, i32 noundef 2, i32 noundef 805639777, i32 noundef 805639785, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %169, %113
  %135 = load i32, ptr %26, align 4, !tbaa !9
  %136 = load i32, ptr %24, align 4, !tbaa !9
  %137 = icmp ult i32 %135, %136
  br i1 %137, label %138, label %172

138:                                              ; preds = %134
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %140, i32 0, i32 6
  %142 = load i32, ptr %141, align 4, !tbaa !11
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %143, i32 0, i32 9
  %145 = load i32, ptr %144, align 4, !tbaa !23
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = load i32, ptr %21, align 4, !tbaa !9
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %148, i32 0, i32 3
  %150 = load i32, ptr %149, align 1, !tbaa !24
  %151 = mul i32 %147, %150
  %152 = load ptr, ptr %19, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %152, i32 0, i32 5
  %154 = load i32, ptr %153, align 4, !tbaa !25
  %155 = mul i32 %151, %154
  %156 = load i32, ptr %26, align 4, !tbaa !9
  %157 = mul i32 %156, 64
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %158, i32 0, i32 5
  %160 = load i32, ptr %159, align 4, !tbaa !25
  %161 = mul i32 %157, %160
  %162 = add i32 %155, %161
  %163 = load ptr, ptr %19, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %163, i32 0, i32 128
  %165 = load i8, ptr %164, align 4, !tbaa !19
  %166 = load i32, ptr %21, align 4, !tbaa !9
  %167 = load i32, ptr %26, align 4, !tbaa !9
  %168 = add i32 %166, %167
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %139, i32 noundef %142, i32 noundef %145, i32 noundef %146, i32 noundef 127, i32 noundef 0, i32 noundef %162, i8 noundef signext %165, i32 noundef %168, i32 noundef 0, i32 noundef 1, i32 noundef 1)
  br label %169

169:                                              ; preds = %138
  %170 = load i32, ptr %26, align 4, !tbaa !9
  %171 = add i32 %170, 1
  store i32 %171, ptr %26, align 4, !tbaa !9
  br label %134, !llvm.loop !26

172:                                              ; preds = %134
  %173 = load i32, ptr %25, align 4, !tbaa !9
  %174 = icmp ugt i32 %173, 0
  br i1 %174, label %175, label %207

175:                                              ; preds = %172
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %177, i32 0, i32 6
  %179 = load i32, ptr %178, align 4, !tbaa !11
  %180 = load ptr, ptr %19, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %180, i32 0, i32 9
  %182 = load i32, ptr %181, align 4, !tbaa !23
  %183 = load i32, ptr %13, align 4, !tbaa !9
  %184 = load i32, ptr %21, align 4, !tbaa !9
  %185 = load ptr, ptr %20, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.libxsmm_meltw_descriptor, ptr %185, i32 0, i32 3
  %187 = load i32, ptr %186, align 1, !tbaa !24
  %188 = mul i32 %184, %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 !25
  %192 = mul i32 %188, %191
  %193 = load i32, ptr %26, align 4, !tbaa !9
  %194 = mul i32 %193, 64
  %195 = load ptr, ptr %19, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %195, i32 0, i32 5
  %197 = load i32, ptr %196, align 4, !tbaa !25
  %198 = mul i32 %194, %197
  %199 = add i32 %192, %198
  %200 = load ptr, ptr %19, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %200, i32 0, i32 128
  %202 = load i8, ptr %201, align 4, !tbaa !19
  %203 = load i32, ptr %21, align 4, !tbaa !9
  %204 = load i32, ptr %26, align 4, !tbaa !9
  %205 = add i32 %203, %204
  %206 = load i32, ptr %15, align 4, !tbaa !9
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %176, i32 noundef %179, i32 noundef %182, i32 noundef %183, i32 noundef 127, i32 noundef 0, i32 noundef %199, i8 noundef signext %202, i32 noundef %205, i32 noundef %206, i32 noundef 0, i32 noundef 1)
  br label %207

207:                                              ; preds = %175, %172
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %21, align 4, !tbaa !9
  %210 = add i32 %209, 4
  store i32 %210, ptr %21, align 4, !tbaa !9
  br label %109, !llvm.loop !27

211:                                              ; preds = %109
  %212 = load ptr, ptr %11, align 8, !tbaa !5
  %213 = load i32, ptr %13, align 4, !tbaa !9
  %214 = load i32, ptr %17, align 4, !tbaa !9
  %215 = zext i32 %214 to i64
  %216 = mul nsw i64 %215, 4
  %217 = load ptr, ptr %19, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.libxsmm_mateltwise_kernel_config_struct, ptr %217, i32 0, i32 5
  %219 = load i32, ptr %218, align 4, !tbaa !25
  %220 = zext i32 %219 to i64
  %221 = mul nsw i64 %216, %220
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %212, i32 noundef 30000, i32 noundef %213, i64 noundef %221)
  store i32 0, ptr %27, align 4
  br label %222

222:                                              ; preds = %211, %50
  call void @llvm.lifetime.end.p0(i64 4, 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
  %223 = load i32, ptr %27, align 4
  switch i32 %223, label %225 [
    i32 0, label %224
    i32 1, label %224
  ]

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

225:                                              ; preds = %222
  unreachable
}

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

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 28}
!12 = !{!"libxsmm_generated_code", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!14, !10, i64 24}
!14 = !{!"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}
!15 = !{!16, !10, i64 8}
!16 = !{!"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, !17, i64 27, !17, i64 29, !7, i64 31}
!17 = !{!"short", !7, i64 0}
!18 = !{!14, !10, i64 8}
!19 = !{!14, !7, i64 512}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!14, !10, i64 36}
!24 = !{!16, !10, i64 12}
!25 = !{!14, !10, i64 20}
!26 = distinct !{!26, !21}
!27 = distinct !{!27, !21}


; 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
@__func__.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel = external hidden unnamed_addr constant [76 x i8], align 1
@__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx = external hidden unnamed_addr constant [4 x i8], align 1
@__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx.17 = external hidden unnamed_addr constant [4 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: nounwind uwtable
declare dso_local void @libxsmm_generator_transform_Xway_permutevar1_network_avx512(ptr noundef, i8 noundef signext, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr nocapture noundef readonly %8, ptr nocapture noundef readonly %9) local_unnamed_addr #2 {
  %11 = alloca [4 x i8], align 4
  %12 = alloca [4 x i8], align 4
  %13 = add i32 %7, 3
  %14 = and i32 %13, -4
  %15 = lshr i32 %6, 4
  %16 = and i32 %15, 67108863
  %17 = icmp ugt i32 %13, 27
  br i1 %17, label %23, label %.preheader80

.preheader80:                                     ; preds = %10
  %.not93 = icmp eq i32 %7, 0
  br i1 %.not93, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader80
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  %19 = getelementptr inbounds i8, ptr %8, i64 24
  %20 = getelementptr inbounds i8, ptr %9, i64 8
  %21 = getelementptr inbounds i8, ptr %8, i64 8
  %22 = getelementptr inbounds i8, ptr %8, i64 512
  br label %30

23:                                               ; preds = %10
  %24 = load i32, ptr @libxsmm_ninit, align 4, !tbaa !5
  %25 = icmp ugt i32 %24, 1
  %26 = load i32, ptr @libxsmm_verbosity, align 4
  %27 = select i1 %25, i32 %26, i32 1
  tail call void @libxsmm_handle_error(ptr noundef %0, i32 noundef 90016, ptr noundef nonnull @__func__.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel, ptr noundef nonnull @.str, i32 noundef 2877, i32 noundef %27) #3
  br label %89

.preheader:                                       ; preds = %30, %.preheader80
  %28 = icmp ugt i32 %14, %7
  br i1 %28, label %.lr.ph83, label %._crit_edge

.lr.ph83:                                         ; preds = %.preheader
  %29 = getelementptr inbounds i8, ptr %8, i64 512
  br label %39

30:                                               ; preds = %.lr.ph, %30
  %.07881 = phi i32 [ 0, %.lr.ph ], [ %38, %30 ]
  %31 = load i32, ptr %18, align 4, !tbaa !9
  %32 = load i32, ptr %19, align 4, !tbaa !12
  %33 = load i32, ptr %20, align 1, !tbaa !14
  %34 = mul i32 %33, %.07881
  %35 = load i32, ptr %21, align 4, !tbaa !17
  %36 = mul i32 %34, %35
  %37 = load i8, ptr %22, align 4, !tbaa !18
  tail call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %31, i32 noundef %32, i32 noundef %1, i32 noundef 127, i32 noundef 0, i32 noundef %36, i8 noundef signext %37, i32 noundef %.07881, i32 noundef %3, i32 noundef 1, i32 noundef 0) #3
  %38 = add nuw i32 %.07881, 1
  %exitcond.not = icmp eq i32 %38, %7
  br i1 %exitcond.not, label %.preheader, label %30, !llvm.loop !19

39:                                               ; preds = %.lr.ph83, %39
  %.182 = phi i32 [ %7, %.lr.ph83 ], [ %41, %39 ]
  %40 = load i8, ptr %29, align 4, !tbaa !18
  tail call void @libxsmm_x86_instruction_vec_compute_3reg(ptr noundef %0, i32 noundef 805639919, i8 noundef signext %40, i32 noundef %.182, i32 noundef %.182, i32 noundef %.182) #3
  %41 = add i32 %.182, 1
  %exitcond97.not = icmp eq i32 %41, %14
  br i1 %exitcond97.not, label %._crit_edge, label %39, !llvm.loop !21

._crit_edge:                                      ; preds = %39, %.preheader
  %42 = zext i32 %6 to i64
  %43 = getelementptr inbounds i8, ptr %8, i64 8
  %44 = load i32, ptr %43, align 4, !tbaa !17
  %45 = zext i32 %44 to i64
  %46 = mul nuw nsw i64 %45, %42
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %1, i64 noundef %46) #3
  br i1 %.not93, label %._crit_edge92, label %.lr.ph91

.lr.ph91:                                         ; preds = %._crit_edge
  %47 = getelementptr inbounds i8, ptr %8, i64 512
  %48 = load i32, ptr @__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx, align 1
  %49 = load i32, ptr @__const.libxsmm_generator_transform_norm_to_vnni4_08bit_avx512_mnblock_micro_kernel.l_in_idx.17, align 1
  %.not95 = icmp eq i32 %16, 0
  %50 = getelementptr inbounds i8, ptr %0, i64 28
  %51 = getelementptr inbounds i8, ptr %8, i64 36
  %52 = getelementptr inbounds i8, ptr %9, i64 12
  %53 = getelementptr inbounds i8, ptr %8, i64 20
  %54 = and i32 %6, 15
  %.not = icmp eq i32 %54, 0
  %55 = shl nuw i32 %16, 6
  br label %56

56:                                               ; preds = %.lr.ph91, %81
  %.289 = phi i32 [ 0, %.lr.ph91 ], [ %82, %81 ]
  %57 = load i8, ptr %47, align 4, !tbaa !18
  call void @libxsmm_generator_transform_Xway_permutevar1_network_avx512(ptr noundef %0, i8 noundef signext %57, i32 noundef %5, i32 noundef %.289, i32 noundef 805643830, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #3
  store i32 %48, ptr %11, align 4
  %58 = load i8, ptr %47, align 4, !tbaa !18
  call void @libxsmm_generator_transform_Xway_unpack_network_avx_avx512(ptr noundef %0, i8 noundef signext %58, ptr noundef nonnull %11, i32 noundef %.289, i32 noundef %14, i32 noundef 1, i32 noundef 805639776, i32 noundef 805639784, i32 noundef 4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #3
  store i32 %49, ptr %12, align 4
  %59 = load i8, ptr %47, align 4, !tbaa !18
  call void @libxsmm_generator_transform_Xway_unpack_network_avx_avx512(ptr noundef %0, i8 noundef signext %59, ptr noundef nonnull %12, i32 noundef %14, i32 noundef %.289, i32 noundef 2, i32 noundef 805639777, i32 noundef 805639785, i32 noundef 4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  br i1 %.not95, label %._crit_edge87, label %.lr.ph86

.lr.ph86:                                         ; preds = %56, %.lr.ph86
  %.084 = phi i32 [ %70, %.lr.ph86 ], [ 0, %56 ]
  %60 = load i32, ptr %50, align 4, !tbaa !9
  %61 = load i32, ptr %51, align 4, !tbaa !22
  %62 = load i32, ptr %52, align 1, !tbaa !23
  %63 = mul i32 %62, %.289
  %64 = load i32, ptr %53, align 4, !tbaa !24
  %65 = shl nuw i32 %.084, 6
  %66 = add i32 %63, %65
  %67 = mul i32 %66, %64
  %68 = load i8, ptr %47, align 4, !tbaa !18
  %69 = add i32 %.084, %.289
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %60, i32 noundef %61, i32 noundef %2, i32 noundef 127, i32 noundef 0, i32 noundef %67, i8 noundef signext %68, i32 noundef %69, i32 noundef 0, i32 noundef 1, i32 noundef 1) #3
  %70 = add nuw nsw i32 %.084, 1
  %exitcond98.not = icmp eq i32 %70, %16
  br i1 %exitcond98.not, label %._crit_edge87, label %.lr.ph86, !llvm.loop !25

._crit_edge87:                                    ; preds = %.lr.ph86, %56
  br i1 %.not, label %81, label %71

71:                                               ; preds = %._crit_edge87
  %72 = load i32, ptr %50, align 4, !tbaa !9
  %73 = load i32, ptr %51, align 4, !tbaa !22
  %74 = load i32, ptr %52, align 1, !tbaa !23
  %75 = mul i32 %74, %.289
  %76 = load i32, ptr %53, align 4, !tbaa !24
  %77 = add i32 %75, %55
  %78 = mul i32 %77, %76
  %79 = load i8, ptr %47, align 4, !tbaa !18
  %80 = add i32 %16, %.289
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %72, i32 noundef %73, i32 noundef %2, i32 noundef 127, i32 noundef 0, i32 noundef %78, i8 noundef signext %79, i32 noundef %80, i32 noundef %4, i32 noundef 0, i32 noundef 1) #3
  br label %81

81:                                               ; preds = %._crit_edge87, %71
  %82 = add i32 %.289, 4
  %83 = icmp ult i32 %82, %7
  br i1 %83, label %56, label %._crit_edge92, !llvm.loop !26

._crit_edge92:                                    ; preds = %81, %._crit_edge
  %84 = shl nuw nsw i64 %42, 2
  %85 = getelementptr inbounds i8, ptr %8, i64 20
  %86 = load i32, ptr %85, align 4, !tbaa !24
  %87 = zext i32 %86 to i64
  %88 = mul nuw nsw i64 %84, %87
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef %2, i64 noundef %88) #3
  br label %89

89:                                               ; preds = %._crit_edge92, %23
  ret void
}

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass