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

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

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

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

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

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

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

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_cvthf8ps_avx512(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i8 %1, ptr %6, align 1, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !10
  store i32 %3, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 1, ptr %12, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 2, ptr %13, align 4, !tbaa !10
  br label %14

14:                                               ; preds = %24, %4
  %15 = load i32, ptr %10, align 4, !tbaa !10
  %16 = load i32, ptr %7, align 4, !tbaa !10
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %22, label %18

18:                                               ; preds = %14
  %19 = load i32, ptr %10, align 4, !tbaa !10
  %20 = load i32, ptr %8, align 4, !tbaa !10
  %21 = icmp eq i32 %19, %20
  br label %22

22:                                               ; preds = %18, %14
  %23 = phi i1 [ true, %14 ], [ %21, %18 ]
  br i1 %23, label %24, label %27

24:                                               ; preds = %22
  %25 = load i32, ptr %10, align 4, !tbaa !10
  %26 = add i32 %25, 1
  store i32 %26, ptr %10, align 4, !tbaa !10
  br label %14, !llvm.loop !12

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %42, %27
  %29 = load i32, ptr %11, align 4, !tbaa !10
  %30 = load i32, ptr %7, align 4, !tbaa !10
  %31 = icmp eq i32 %29, %30
  br i1 %31, label %40, label %32

32:                                               ; preds = %28
  %33 = load i32, ptr %11, align 4, !tbaa !10
  %34 = load i32, ptr %8, align 4, !tbaa !10
  %35 = icmp eq i32 %33, %34
  br i1 %35, label %40, label %36

36:                                               ; preds = %32
  %37 = load i32, ptr %11, align 4, !tbaa !10
  %38 = load i32, ptr %10, align 4, !tbaa !10
  %39 = icmp eq i32 %37, %38
  br label %40

40:                                               ; preds = %36, %32, %28
  %41 = phi i1 [ true, %32 ], [ true, %28 ], [ %39, %36 ]
  br i1 %41, label %42, label %45

42:                                               ; preds = %40
  %43 = load i32, ptr %11, align 4, !tbaa !10
  %44 = add i32 %43, 1
  store i32 %44, ptr %11, align 4, !tbaa !10
  br label %28, !llvm.loop !14

45:                                               ; preds = %40
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_push_reg(ptr noundef %46, i32 noundef %47)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %48, i32 noundef 30008, i32 noundef 4, i64 noundef 144)
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load i32, ptr %12, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %49, i32 noundef -1601957487, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 0, i32 noundef %50)
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load i32, ptr %13, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %51, i32 noundef -1601957487, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 8, i32 noundef %52)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %54, i32 0, i32 6
  %56 = load i32, ptr %55, align 4, !tbaa !15
  %57 = load i8, ptr %6, align 1, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %53, i32 noundef %56, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 16, i8 noundef signext %57, i32 noundef %58, i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %60, i32 0, i32 6
  %62 = load i32, ptr %61, align 4, !tbaa !15
  %63 = load i8, ptr %6, align 1, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %59, i32 noundef %62, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 80, i8 noundef signext %63, i32 noundef %64, i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !10
  call void @libxsmm_generator_vcvt_hf8_tofrom_f32_avx512_prep_stack(ptr noundef %65, i32 noundef %66)
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load i8, ptr %6, align 1, !tbaa !9
  %69 = load i32, ptr %7, align 4, !tbaa !10
  %70 = load i32, ptr %8, align 4, !tbaa !10
  %71 = load i32, ptr %10, align 4, !tbaa !10
  %72 = load i32, ptr %11, align 4, !tbaa !10
  %73 = load i32, ptr %12, align 4, !tbaa !10
  %74 = load i32, ptr %13, align 4, !tbaa !10
  call void @libxsmm_generator_vcvthf8_to_f32_avx512_preppedstack(ptr noundef %67, i8 noundef signext %68, i32 noundef %69, i32 noundef %70, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %74)
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !10
  call void @libxsmm_generator_vcvt_hf8_tofrom_f32_avx512_clean_stack(ptr noundef %75, i32 noundef %76)
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %77, i32 noundef -1601957488, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 0, i32 noundef %78)
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load i32, ptr %13, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %79, i32 noundef -1601957488, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 8, i32 noundef %80)
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %82, i32 0, i32 6
  %84 = load i32, ptr %83, align 4, !tbaa !15
  %85 = load i8, ptr %6, align 1, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %81, i32 noundef %84, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 16, i8 noundef signext %85, i32 noundef %86, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %88, i32 0, i32 6
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = load i8, ptr %6, align 1, !tbaa !9
  %92 = load i32, ptr %11, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_vec_move(ptr noundef %87, i32 noundef %90, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 80, i8 noundef signext %91, i32 noundef %92, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libxsmm_x86_instruction_alu_imm(ptr noundef %93, i32 noundef 30000, i32 noundef 4, i64 noundef 144)
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !10
  call void @libxsmm_x86_instruction_pop_reg(ptr noundef %94, i32 noundef %95)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_vcvthf8_to_f32_avx512_preppedstack(ptr noundef, i8 noundef signext, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !11, i64 28}
!16 = !{!"libxsmm_generated_code", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}


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

declare void @libxsmm_x86_instruction_push_reg(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @libxsmm_x86_instruction_pop_reg(ptr noundef, i32 noundef) local_unnamed_addr #0

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 #0

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

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_cvthf8ps_avx512(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  br label %5

5:                                                ; preds = %5, %4
  %.0 = phi i32 [ 0, %4 ], [ %9, %5 ]
  %6 = icmp eq i32 %.0, %2
  %7 = icmp eq i32 %.0, %3
  %8 = or i1 %6, %7
  %9 = add i32 %.0, 1
  br i1 %8, label %5, label %.critedge, !llvm.loop !5

.critedge:                                        ; preds = %5, %.critedge
  %.053 = phi i32 [ %13, %.critedge ], [ 0, %5 ]
  %10 = icmp eq i32 %.053, %2
  %11 = icmp eq i32 %.053, %3
  %or.cond = or i1 %10, %11
  %12 = icmp eq i32 %.053, %.0
  %or.cond56 = or i1 %12, %or.cond
  %13 = add i32 %.053, 1
  br i1 %or.cond56, label %.critedge, label %14, !llvm.loop !7

14:                                               ; preds = %.critedge
  tail call void @libxsmm_x86_instruction_push_reg(ptr noundef %0, i32 noundef 1) #2
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30008, i32 noundef 4, i64 noundef 144) #2
  tail call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %0, i32 noundef -1601957487, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 0, i32 noundef 1) #2
  tail call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %0, i32 noundef -1601957487, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 8, i32 noundef 2) #2
  %15 = getelementptr inbounds i8, ptr %0, i64 28
  %16 = load i32, ptr %15, align 4, !tbaa !8
  tail call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %16, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 16, i8 noundef signext %1, i32 noundef %.0, i32 noundef 0, i32 noundef 0, i32 noundef 1) #2
  %17 = load i32, ptr %15, align 4, !tbaa !8
  tail call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %17, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 80, i8 noundef signext %1, i32 noundef %.053, i32 noundef 0, i32 noundef 0, i32 noundef 1) #2
  tail call void @libxsmm_generator_vcvt_hf8_tofrom_f32_avx512_prep_stack(ptr noundef %0, i32 noundef 1)
  tail call void @libxsmm_generator_vcvthf8_to_f32_avx512_preppedstack(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3, i32 noundef %.0, i32 noundef %.053, i32 noundef 1, i32 noundef 2)
  tail call void @libxsmm_generator_vcvt_hf8_tofrom_f32_avx512_clean_stack(ptr noundef %0, i32 noundef 1)
  tail call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %0, i32 noundef -1601957488, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 0, i32 noundef 1) #2
  tail call void @libxsmm_x86_instruction_mask_move_mem(ptr noundef %0, i32 noundef -1601957488, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 8, i32 noundef 2) #2
  %18 = load i32, ptr %15, align 4, !tbaa !8
  tail call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %18, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 16, i8 noundef signext %1, i32 noundef %.0, i32 noundef 0, i32 noundef 0, i32 noundef 0) #2
  %19 = load i32, ptr %15, align 4, !tbaa !8
  tail call void @libxsmm_x86_instruction_vec_move(ptr noundef %0, i32 noundef %19, i32 noundef 537138704, i32 noundef 4, i32 noundef 127, i32 noundef 0, i32 noundef 80, i8 noundef signext %1, i32 noundef %.053, i32 noundef 0, i32 noundef 0, i32 noundef 0) #2
  tail call void @libxsmm_x86_instruction_alu_imm(ptr noundef %0, i32 noundef 30000, i32 noundef 4, i64 noundef 144) #2
  tail call void @libxsmm_x86_instruction_pop_reg(ptr noundef %0, i32 noundef 1) #2
  ret void
}

declare void @libxsmm_x86_instruction_mask_move_mem(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_vcvthf8_to_f32_avx512_preppedstack(ptr noundef, i8 noundef signext, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !13, i64 28}
!9 = !{!"libxsmm_generated_code", !10, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
!13 = !{!"int", !11, i64 0}


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