; LLVM IR from stivalaa/EstimNetDirected :: src/Random123-1.09/examples (ut_uniform_IEEEkat)

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

@checking = external dso_local global i8, align 1
@nfail = external dso_local global i32, align 4
@nuntested = external dso_local global i32, align 4
@notfound = external dso_local global i32, align 4
@.str.2673 = external hidden unnamed_addr constant [700 x i8], align 1
@.str.2674 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.2675 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.2676 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2677 = external hidden unnamed_addr constant [764 x i8], align 1
@.str.2678 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11fill_katmapv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6DO3264i(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %6 = load i32, ptr %4, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 1
  br i1 %7, label %8, label %22

8:                                                ; preds = %2
  store i8 0, ptr @checking, align 1, !tbaa !11
  %9 = load ptr, ptr %5, align 8, !tbaa !9
  %10 = getelementptr inbounds ptr, ptr %9, i64 0
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 1
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !9
  %16 = getelementptr inbounds ptr, ptr %15, i64 0
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2673, ptr noundef %11, ptr noundef %14, ptr noundef %17, ptr noundef %20)
  br label %22

22:                                               ; preds = %8, %2
  call void @_Z11fill_katmapv()
  call void @_Z6DO3264i(i32 noundef 0)
  call void @_Z6DO3264i(i32 noundef 1)
  call void @_Z6DO3264i(i32 noundef 2)
  call void @_Z6DO3264i(i32 noundef 3)
  call void @_Z6DO3264i(i32 noundef 4)
  call void @_Z6DO3264i(i32 noundef 5)
  call void @_Z6DO3264i(i32 noundef 63)
  call void @_Z6DO3264i(i32 noundef 64)
  call void @_Z6DO3264i(i32 noundef 65)
  call void @_Z6DO3264i(i32 noundef 127)
  call void @_Z6DO3264i(i32 noundef 128)
  call void @_Z6DO3264i(i32 noundef 129)
  call void @_Z6DO3264i(i32 noundef 191)
  call void @_Z6DO3264i(i32 noundef 192)
  call void @_Z6DO3264i(i32 noundef 193)
  call void @_Z6DO3264i(i32 noundef 255)
  call void @_Z6DO3264i(i32 noundef 256)
  call void @_Z6DO3264i(i32 noundef 257)
  call void @_Z6DO3264i(i32 noundef 319)
  call void @_Z6DO3264i(i32 noundef 320)
  call void @_Z6DO3264i(i32 noundef 321)
  call void @_Z6DO3264i(i32 noundef 382)
  call void @_Z6DO3264i(i32 noundef 383)
  call void @_Z6DO3264i(i32 noundef 384)
  call void @_Z6DO3264i(i32 noundef 639)
  call void @_Z6DO3264i(i32 noundef 640)
  call void @_Z6DO3264i(i32 noundef 641)
  call void @_Z6DO3264i(i32 noundef 1023)
  call void @_Z6DO3264i(i32 noundef 1024)
  call void @_Z6DO3264i(i32 noundef 1025)
  call void @_Z6DO3264i(i32 noundef 3070)
  call void @_Z6DO3264i(i32 noundef 3071)
  call void @_Z6DO3264i(i32 noundef 3072)
  call void @_Z6DO3264i(i32 noundef 5119)
  call void @_Z6DO3264i(i32 noundef 5120)
  call void @_Z6DO3264i(i32 noundef 5121)
  %23 = load i32, ptr @notfound, align 4, !tbaa !5
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %22
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = load i32, ptr @notfound, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.2674, ptr noundef %28, i32 noundef %29)
  br label %31

31:                                               ; preds = %25, %22
  %32 = load i32, ptr @nuntested, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %40

34:                                               ; preds = %31
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = getelementptr inbounds ptr, ptr %35, i64 0
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = load i32, ptr @nuntested, align 4, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.2675, ptr noundef %37, i32 noundef %38)
  br label %40

40:                                               ; preds = %34, %31
  %41 = load i32, ptr @nfail, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %50

43:                                               ; preds = %40
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = getelementptr inbounds ptr, ptr %44, i64 0
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load i32, ptr @nfail, align 4, !tbaa !5
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2676, ptr noundef %46, i32 noundef %47)
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.2677)
  br label %55

50:                                               ; preds = %40
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 0
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.2678, ptr noundef %53)
  br label %55

55:                                               ; preds = %50, %43
  %56 = load i32, ptr @nfail, align 4, !tbaa !5
  %57 = icmp ne i32 %56, 0
  %58 = xor i1 %57, true
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i32
  ret i32 %60
}

declare i32 @printf(ptr noundef, ...) #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse 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 = { "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" }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}


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

@checking = external dso_local local_unnamed_addr global i8, align 1
@nfail = external dso_local local_unnamed_addr global i32, align 4
@nuntested = external dso_local local_unnamed_addr global i32, align 4
@notfound = external dso_local local_unnamed_addr global i32, align 4
@.str.2673 = external hidden unnamed_addr constant [700 x i8], align 1
@.str.2674 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.2675 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.2676 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2677 = external hidden unnamed_addr constant [764 x i8], align 1
@.str.2678 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11fill_katmapv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6DO3264i(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = icmp sgt i32 %0, 1
  br i1 %3, label %4, label %9

4:                                                ; preds = %2
  store i8 0, ptr @checking, align 1, !tbaa !5
  %5 = load ptr, ptr %1, align 8, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2673, ptr noundef %5, ptr noundef %7, ptr noundef %5, ptr noundef %5)
  br label %9

9:                                                ; preds = %4, %2
  tail call void @_Z11fill_katmapv()
  tail call void @_Z6DO3264i(i32 noundef 0)
  tail call void @_Z6DO3264i(i32 noundef 1)
  tail call void @_Z6DO3264i(i32 noundef 2)
  tail call void @_Z6DO3264i(i32 noundef 3)
  tail call void @_Z6DO3264i(i32 noundef 4)
  tail call void @_Z6DO3264i(i32 noundef 5)
  tail call void @_Z6DO3264i(i32 noundef 63)
  tail call void @_Z6DO3264i(i32 noundef 64)
  tail call void @_Z6DO3264i(i32 noundef 65)
  tail call void @_Z6DO3264i(i32 noundef 127)
  tail call void @_Z6DO3264i(i32 noundef 128)
  tail call void @_Z6DO3264i(i32 noundef 129)
  tail call void @_Z6DO3264i(i32 noundef 191)
  tail call void @_Z6DO3264i(i32 noundef 192)
  tail call void @_Z6DO3264i(i32 noundef 193)
  tail call void @_Z6DO3264i(i32 noundef 255)
  tail call void @_Z6DO3264i(i32 noundef 256)
  tail call void @_Z6DO3264i(i32 noundef 257)
  tail call void @_Z6DO3264i(i32 noundef 319)
  tail call void @_Z6DO3264i(i32 noundef 320)
  tail call void @_Z6DO3264i(i32 noundef 321)
  tail call void @_Z6DO3264i(i32 noundef 382)
  tail call void @_Z6DO3264i(i32 noundef 383)
  tail call void @_Z6DO3264i(i32 noundef 384)
  tail call void @_Z6DO3264i(i32 noundef 639)
  tail call void @_Z6DO3264i(i32 noundef 640)
  tail call void @_Z6DO3264i(i32 noundef 641)
  tail call void @_Z6DO3264i(i32 noundef 1023)
  tail call void @_Z6DO3264i(i32 noundef 1024)
  tail call void @_Z6DO3264i(i32 noundef 1025)
  tail call void @_Z6DO3264i(i32 noundef 3070)
  tail call void @_Z6DO3264i(i32 noundef 3071)
  tail call void @_Z6DO3264i(i32 noundef 3072)
  tail call void @_Z6DO3264i(i32 noundef 5119)
  tail call void @_Z6DO3264i(i32 noundef 5120)
  tail call void @_Z6DO3264i(i32 noundef 5121)
  %10 = load i32, ptr @notfound, align 4, !tbaa !11
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %14, label %11

11:                                               ; preds = %9
  %12 = load ptr, ptr %1, align 8, !tbaa !9
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2674, ptr noundef %12, i32 noundef %10)
  br label %14

14:                                               ; preds = %11, %9
  %15 = load i32, ptr @nuntested, align 4, !tbaa !11
  %.not10 = icmp eq i32 %15, 0
  br i1 %.not10, label %19, label %16

16:                                               ; preds = %14
  %17 = load ptr, ptr %1, align 8, !tbaa !9
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2675, ptr noundef %17, i32 noundef %15)
  br label %19

19:                                               ; preds = %16, %14
  %20 = load i32, ptr @nfail, align 4, !tbaa !11
  %.not11 = icmp eq i32 %20, 0
  %21 = load ptr, ptr %1, align 8, !tbaa !9
  br i1 %.not11, label %25, label %22

22:                                               ; preds = %19
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2676, ptr noundef %21, i32 noundef %20)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2677)
  br label %27

25:                                               ; preds = %19
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2678, ptr noundef %21)
  br label %27

27:                                               ; preds = %25, %22
  %28 = load i32, ptr @nfail, align 4, !tbaa !11
  %29 = icmp ne i32 %28, 0
  %30 = zext i1 %29 to i32
  ret i32 %30
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass