; LLVM IR from ANL-CESAR/XSBench :: openmp-threading (io)

; 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.Inputs = type { i32, i64, i64, i32, ptr, i32, i32, i32, i32, i32, i32 }

@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @logo(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @border_print() #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @fancy_int(i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @print_inputs(ptr noundef byval(%struct.Inputs) align 8 %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %7 = call i64 @estimate_mem_usage(ptr noundef byval(%struct.Inputs) align 8 %0)
  %8 = trunc i64 %7 to i32
  store i32 %8, ptr %6, align 4, !tbaa !5
  %9 = load i32, ptr %5, align 4, !tbaa !5
  call void @logo(i32 noundef %9)
  call void @center_print(ptr noundef @.str.14, i32 noundef 79)
  call void @border_print()
  %10 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 8
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %13, label %15

13:                                               ; preds = %3
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %17

15:                                               ; preds = %3
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  br label %17

17:                                               ; preds = %15, %13
  %18 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %23

21:                                               ; preds = %17
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  br label %32

23:                                               ; preds = %17
  %24 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %23
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  br label %31

29:                                               ; preds = %23
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %31

31:                                               ; preds = %29, %27
  br label %32

32:                                               ; preds = %31, %21
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, i32 noundef 12)
  %34 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %35)
  %37 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !15
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i64 noundef %38)
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %41 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 2
  %42 = load i64, ptr %41, align 8, !tbaa !16
  call void @fancy_int(i64 noundef %42)
  %43 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = icmp eq i32 %44, 2
  br i1 %45, label %46, label %51

46:                                               ; preds = %32
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %48 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 6
  %49 = load i32, ptr %48, align 4, !tbaa !17
  %50 = sext i32 %49 to i64
  call void @fancy_int(i64 noundef %50)
  br label %51

51:                                               ; preds = %46, %32
  %52 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %53 = load i32, ptr %52, align 8, !tbaa !13
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %62

55:                                               ; preds = %51
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %57 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !15
  %59 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 2
  %60 = load i64, ptr %59, align 8, !tbaa !16
  %61 = mul nsw i64 %58, %60
  call void @fancy_int(i64 noundef %61)
  br label %62

62:                                               ; preds = %55, %51
  %63 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 8
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %75

66:                                               ; preds = %62
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  %68 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 7
  %69 = load i32, ptr %68, align 8, !tbaa !18
  %70 = sext i32 %69 to i64
  call void @fancy_int(i64 noundef %70)
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %72 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %73 = load i32, ptr %72, align 8, !tbaa !19
  %74 = sext i32 %73 to i64
  call void @fancy_int(i64 noundef %74)
  br label %75

75:                                               ; preds = %66, %62
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  %77 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %78 = load i32, ptr %77, align 8, !tbaa !19
  %79 = sext i32 %78 to i64
  call void @fancy_int(i64 noundef %79)
  %80 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !20
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, i32 noundef %81)
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  call void @fancy_int(i64 noundef %85)
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  %87 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 9
  %88 = load i32, ptr %87, align 8, !tbaa !21
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %75
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %101

92:                                               ; preds = %75
  %93 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 9
  %94 = load i32, ptr %93, align 8, !tbaa !21
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %98

96:                                               ; preds = %92
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  br label %100

98:                                               ; preds = %92
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.34)
  br label %100

100:                                              ; preds = %98, %96
  br label %101

101:                                              ; preds = %100, %90
  call void @border_print()
  call void @center_print(ptr noundef @.str.35, i32 noundef 79)
  call void @border_print()
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  ret void
}

declare i64 @estimate_mem_usage(ptr noundef byval(%struct.Inputs) align 8) #1

attributes #0 = { 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
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 52}
!10 = !{!"", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!10, !6, i64 40}
!14 = !{!10, !12, i64 32}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !6, i64 44}
!18 = !{!10, !6, i64 48}
!19 = !{!10, !6, i64 24}
!20 = !{!10, !6, i64 0}
!21 = !{!10, !6, i64 56}


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

%struct.Inputs = type { i32, i64, i64, i32, ptr, i32, i32, i32, i32, i32, i32 }

@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [32 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local void @border_print() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @fancy_int(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @print_inputs(ptr noundef byval(%struct.Inputs) align 8 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call i64 @estimate_mem_usage(ptr noundef nonnull byval(%struct.Inputs) align 8 %0) #3
  tail call void @logo(i32 noundef %2)
  tail call void @center_print(ptr noundef nonnull @.str.14, i32 noundef 79)
  tail call void @border_print()
  %5 = getelementptr inbounds i8, ptr %0, i64 52
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 2
  %.str.15..str.16 = select i1 %7, ptr @.str.15, ptr @.str.16
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.15..str.16)
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  %10 = load i32, ptr %9, align 8, !tbaa !12
  %switch.selectcmp5 = icmp eq i32 %10, 0
  %switch.select6 = select i1 %switch.selectcmp5, ptr @.str.18, ptr @.str.19
  %switch.selectcmp7 = icmp eq i32 %10, 1
  %switch.select8 = select i1 %switch.selectcmp7, ptr @.str.17, ptr %switch.select6
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %switch.select8)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i32 noundef 12)
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef %14)
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i64, ptr %16, align 8, !tbaa !14
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i64 noundef %17)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load i64, ptr %20, align 8, !tbaa !15
  tail call void @fancy_int(i64 noundef %21)
  %22 = load i32, ptr %9, align 8, !tbaa !12
  %23 = icmp eq i32 %22, 2
  br i1 %23, label %24, label %29

24:                                               ; preds = %3
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %26 = getelementptr inbounds i8, ptr %0, i64 44
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = sext i32 %27 to i64
  tail call void @fancy_int(i64 noundef %28)
  %.pr = load i32, ptr %9, align 8, !tbaa !12
  br label %29

29:                                               ; preds = %24, %3
  %30 = phi i32 [ %.pr, %24 ], [ %22, %3 ]
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %34 = load i64, ptr %16, align 8, !tbaa !14
  %35 = load i64, ptr %20, align 8, !tbaa !15
  %36 = mul nsw i64 %35, %34
  tail call void @fancy_int(i64 noundef %36)
  br label %37

37:                                               ; preds = %32, %29
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %49

40:                                               ; preds = %37
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %42 = getelementptr inbounds i8, ptr %0, i64 48
  %43 = load i32, ptr %42, align 8, !tbaa !17
  %44 = sext i32 %43 to i64
  tail call void @fancy_int(i64 noundef %44)
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %46 = getelementptr inbounds i8, ptr %0, i64 24
  %47 = load i32, ptr %46, align 8, !tbaa !18
  %48 = sext i32 %47 to i64
  tail call void @fancy_int(i64 noundef %48)
  br label %49

49:                                               ; preds = %40, %37
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  %51 = getelementptr inbounds i8, ptr %0, i64 24
  %52 = load i32, ptr %51, align 8, !tbaa !18
  %53 = sext i32 %52 to i64
  tail call void @fancy_int(i64 noundef %53)
  %54 = load i32, ptr %0, align 8, !tbaa !19
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, i32 noundef %54)
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  %sext = shl i64 %4, 32
  %57 = ashr exact i64 %sext, 32
  tail call void @fancy_int(i64 noundef %57)
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  %59 = getelementptr inbounds i8, ptr %0, i64 56
  %60 = load i32, ptr %59, align 8, !tbaa !20
  %switch.selectcmp = icmp eq i32 %60, 1
  %switch.select = select i1 %switch.selectcmp, ptr @.str.33, ptr @.str.34
  %switch.selectcmp3 = icmp eq i32 %60, 0
  %switch.select4 = select i1 %switch.selectcmp3, ptr @.str.32, ptr %switch.select
  %61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %switch.select4)
  tail call void @border_print()
  tail call void @center_print(ptr noundef nonnull @.str.35, i32 noundef 79)
  tail call void @border_print()
  ret void
}

declare i64 @estimate_mem_usage(ptr noundef byval(%struct.Inputs) align 8) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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" }
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" }
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, !7, i64 52}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 40}
!13 = !{!6, !11, i64 32}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !7, i64 44}
!17 = !{!6, !7, i64 48}
!18 = !{!6, !7, i64 24}
!19 = !{!6, !7, i64 0}
!20 = !{!6, !7, i64 56}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass