; LLVM IR from intuitive-robots/mdt_policy :: pyhash-0.9.3/src/t1ha/tests (mera)

; 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._ia32_cpu_features = type { %struct.anon, %struct.anon, %struct.anon.0, %struct.anon.1 }
%struct.anon = type { i32, i32, i32 }
%struct.anon.0 = type { i32, i32 }
%struct.anon.1 = type { i32, i32 }
%struct.mera_t = type { ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.perf_event_mmap_page = type { i32, i32, i32, i32, i64, i64, i64, %union.anon, i16, i16, i32, i64, i64, i32, i32, i64, i64, [928 x i8], i64, i64, i64, i64, i64, i64, i64, i64 }
%union.anon = type { i64 }

@ia32_cpu_features = external dso_local global %struct._ia32_cpu_features, align 4
@perf_rdpmc_index = external hidden global i32, align 4
@mera = external dso_local global %struct.mera_t, align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@posix_clockid = external hidden global i32, align 4
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@perf_page = external hidden global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@perf_fd = external hidden global i32, align 4
@perf_error = external hidden global i32, align 4
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [101 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @mera_init() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  store i32 0, ptr getelementptr inbounds (%struct.mera_t, ptr @mera, i32 0, i32 5), align 8, !tbaa !5
  %5 = call i32 @set_single_affinity()
  store i32 %5, ptr getelementptr inbounds (%struct.mera_t, ptr @mera, i32 0, i32 6), align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 2, ptr %1, align 4, !tbaa !12
  %6 = call i32 (i32, ...) @prctl(i32 noundef 25, ptr noundef %1, i32 noundef 0, i32 noundef 0, i32 noundef 0) #5
  %7 = icmp ne i32 %6, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %0
  call void @perror(ptr noundef @.str)
  br label %17

9:                                                ; preds = %0
  %10 = load i32, ptr %1, align 4, !tbaa !12
  %11 = icmp ne i32 %10, 1
  br i1 %11, label %12, label %16

12:                                               ; preds = %9
  %13 = call i32 (i32, ...) @prctl(i32 noundef 26, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 0) #5
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  call void @perror(ptr noundef @.str.1)
  br label %16

16:                                               ; preds = %15, %12, %9
  br label %17

17:                                               ; preds = %16, %8
  %18 = load i32, ptr @posix_clockid, align 4, !tbaa !12
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %24

20:                                               ; preds = %17
  store i32 4, ptr @posix_clockid, align 4, !tbaa !12
  %21 = call zeroext i1 @probe(ptr noundef @clock_posix, ptr noundef @clock_posix, ptr noundef @convert_1to1, i32 noundef 0, ptr noundef @.str.2, ptr noundef @.str.3)
  br i1 %21, label %23, label %22

22:                                               ; preds = %20
  store i32 0, ptr @posix_clockid, align 4, !tbaa !12
  br label %23

23:                                               ; preds = %22, %20
  br label %24

24:                                               ; preds = %23, %17
  %25 = load i32, ptr @posix_clockid, align 4, !tbaa !12
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %31

27:                                               ; preds = %24
  store i32 1, ptr @posix_clockid, align 4, !tbaa !12
  %28 = call zeroext i1 @probe(ptr noundef @clock_posix, ptr noundef @clock_posix, ptr noundef @convert_1to1, i32 noundef 0, ptr noundef @.str.4, ptr noundef @.str.3)
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  store i32 0, ptr @posix_clockid, align 4, !tbaa !12
  br label %30

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

31:                                               ; preds = %30, %24
  %32 = call zeroext i1 @probe(ptr noundef @clock_gettimeofday, ptr noundef @clock_gettimeofday, ptr noundef @convert_us2ns, i32 noundef 0, ptr noundef @.str.5, ptr noundef @.str.3)
  %33 = load i32, ptr getelementptr inbounds (%struct.anon, ptr @ia32_cpu_features, i32 0, i32 2), align 4, !tbaa !13
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  call void @ia32_fetch_cpu_features()
  br label %36

36:                                               ; preds = %35, %31
  %37 = load i32, ptr getelementptr inbounds (%struct.anon, ptr @ia32_cpu_features, i32 0, i32 2), align 4, !tbaa !13
  %38 = and i32 %37, 16
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %69

40:                                               ; preds = %36
  %41 = call zeroext i1 @probe(ptr noundef @clock_rdpmc_start, ptr noundef @clock_rdpmc_finish, ptr noundef @convert_1to1, i32 noundef 26, ptr noundef @.str.6, ptr noundef @.str.7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %42 = load i32, ptr getelementptr inbounds (%struct.anon.1, ptr getelementptr inbounds (%struct._ia32_cpu_features, ptr @ia32_cpu_features, i32 0, i32 3), i32 0, i32 1), align 4, !tbaa !17
  %43 = and i32 %42, 256
  %44 = icmp ne i32 %43, 0
  %45 = zext i1 %44 to i64
  %46 = select i1 %44, i32 10, i32 26
  store i32 %46, ptr %2, align 4, !tbaa !12
  %47 = load i32, ptr %2, align 4, !tbaa !12
  %48 = and i32 %47, 16
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %59, label %50

50:                                               ; preds = %40
  %51 = load i32, ptr getelementptr inbounds (%struct.mera_t, ptr @mera, i32 0, i32 5), align 8, !tbaa !5
  %52 = and i32 %51, 16
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %50
  %55 = call i32 @access(ptr noundef @.str.8, i32 noundef 0) #5
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %59

59:                                               ; preds = %57, %54, %50, %40
  %60 = load i32, ptr getelementptr inbounds (%struct.anon.0, ptr getelementptr inbounds (%struct._ia32_cpu_features, ptr @ia32_cpu_features, i32 0, i32 2), i32 0, i32 1), align 4, !tbaa !18
  %61 = and i32 %60, 134217728
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %59
  %64 = load i32, ptr %2, align 4, !tbaa !12
  %65 = call zeroext i1 @probe(ptr noundef @clock_rdtscp_start, ptr noundef @clock_rdtscp_finish, ptr noundef @convert_1to1, i32 noundef %64, ptr noundef @.str.10, ptr noundef null)
  br label %66

66:                                               ; preds = %63, %59
  %67 = load i32, ptr %2, align 4, !tbaa !12
  %68 = call zeroext i1 @probe(ptr noundef @clock_rdtsc_start, ptr noundef @clock_rdtsc_finish, ptr noundef @convert_1to1, i32 noundef %67, ptr noundef @.str.11, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %69

69:                                               ; preds = %66, %36
  %70 = call i32 @perf_setup()
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %122

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  %73 = call zeroext i1 @probe(ptr noundef @clock_perf, ptr noundef @clock_perf, ptr noundef @convert_1to1, i32 noundef 24, ptr noundef @.str.12, ptr noundef @.str.7)
  %74 = zext i1 %73 to i8
  store i8 %74, ptr %3, align 1, !tbaa !19
  %75 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %115

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  store i8 0, ptr %4, align 1, !tbaa !19
  %78 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %79 = getelementptr inbounds %struct.perf_event_mmap_page, ptr %78, i32 0, i32 7
  %80 = load volatile i64, ptr %79, align 8
  %81 = lshr i64 %80, 1
  %82 = and i64 %81, 1
  %83 = trunc i64 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %105

85:                                               ; preds = %77
  %86 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %87 = getelementptr inbounds %struct.perf_event_mmap_page, ptr %86, i32 0, i32 7
  %88 = load volatile i64, ptr %87, align 8
  %89 = lshr i64 %88, 2
  %90 = and i64 %89, 1
  %91 = trunc i64 %90 to i32
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %105

93:                                               ; preds = %85
  %94 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %95 = getelementptr inbounds %struct.perf_event_mmap_page, ptr %94, i32 0, i32 3
  %96 = load volatile i32, ptr %95, align 4, !tbaa !22
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %105

98:                                               ; preds = %93
  %99 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %100 = getelementptr inbounds %struct.perf_event_mmap_page, ptr %99, i32 0, i32 3
  %101 = load volatile i32, ptr %100, align 4, !tbaa !22
  %102 = sub i32 %101, 1
  store i32 %102, ptr @perf_rdpmc_index, align 4, !tbaa !12
  %103 = call zeroext i1 @probe(ptr noundef @perf_rdpmc_start, ptr noundef @perf_rdpmc_finish, ptr noundef @convert_1to1, i32 noundef 26, ptr noundef @.str.13, ptr noundef @.str.7)
  %104 = zext i1 %103 to i8
  store i8 %104, ptr %4, align 1, !tbaa !19
  br label %105

105:                                              ; preds = %98, %93, %85, %77
  %106 = load i8, ptr %4, align 1, !tbaa !19, !range !26, !noundef !27
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %109

108:                                              ; preds = %105
  store i8 1, ptr %3, align 1, !tbaa !19
  br label %114

109:                                              ; preds = %105
  %110 = load ptr, ptr @perf_page, align 8, !tbaa !21
  %111 = call i32 @getpagesize() #6
  %112 = sext i32 %111 to i64
  %113 = call i32 @munmap(ptr noundef %110, i64 noundef %112) #5
  store ptr null, ptr @perf_page, align 8, !tbaa !21
  br label %114

114:                                              ; preds = %109, %108
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %115

115:                                              ; preds = %114, %72
  %116 = load i8, ptr %3, align 1, !tbaa !19, !range !26, !noundef !27
  %117 = trunc i8 %116 to i1
  br i1 %117, label %121, label %118

118:                                              ; preds = %115
  %119 = load i32, ptr @perf_fd, align 4, !tbaa !12
  %120 = call i32 @close(i32 noundef %119)
  store i32 -1, ptr @perf_fd, align 4, !tbaa !12
  br label %121

121:                                              ; preds = %118, %115
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %135

122:                                              ; preds = %69
  %123 = load i32, ptr getelementptr inbounds (%struct.mera_t, ptr @mera, i32 0, i32 5), align 8, !tbaa !5
  %124 = and i32 %123, 16
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %134, label %126

126:                                              ; preds = %122
  %127 = load i32, ptr @perf_error, align 4, !tbaa !12
  %128 = icmp eq i32 %127, 13
  br i1 %128, label %129, label %134

129:                                              ; preds = %126
  %130 = call i32 @access(ptr noundef @.str.14, i32 noundef 0) #5
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %134

134:                                              ; preds = %132, %129, %126, %122
  br label %135

135:                                              ; preds = %134, %121
  %136 = load i32, ptr getelementptr inbounds (%struct.mera_t, ptr @mera, i32 0, i32 5), align 8, !tbaa !5
  %137 = and i32 %136, 1
  %138 = icmp ne i32 %137, 0
  %139 = zext i1 %138 to i64
  %140 = select i1 %138, i32 1, i32 0
  %141 = icmp ne i32 %140, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret i1 %141
}

; Function Attrs: nounwind uwtable
declare hidden i32 @set_single_affinity() #0

; Function Attrs: nounwind
declare i32 @prctl(i32 noundef, ...) #2

declare void @perror(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @probe(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_posix(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @convert_1to1(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_gettimeofday(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @convert_us2ns(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdpmc_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdpmc_finish(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtscp_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtscp_finish(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtsc_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtsc_finish(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @perf_setup() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_perf(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare i32 @getpagesize() #4

declare i32 @close(i32 noundef) #3

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 willreturn memory(none) "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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }

!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, !10, i64 40}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 44}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ia32_cpu_features", !15, i64 0, !15, i64 12, !16, i64 24, !16, i64 32}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!16 = !{!"", !10, i64 0, !10, i64 4}
!17 = !{!14, !10, i64 36}
!18 = !{!14, !10, i64 28}
!19 = !{!20, !20, i64 0}
!20 = !{!"_Bool", !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !10, i64 12}
!23 = !{!"perf_event_mmap_page", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !24, i64 16, !24, i64 24, !24, i64 32, !8, i64 40, !25, i64 48, !25, i64 50, !10, i64 52, !24, i64 56, !24, i64 64, !10, i64 72, !10, i64 76, !24, i64 80, !24, i64 88, !8, i64 96, !24, i64 1024, !24, i64 1032, !24, i64 1040, !24, i64 1048, !24, i64 1056, !24, i64 1064, !24, i64 1072, !24, i64 1080}
!24 = !{!"long long", !8, i64 0}
!25 = !{!"short", !8, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}


; 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._ia32_cpu_features = type { %struct.anon, %struct.anon, %struct.anon.0, %struct.anon.1 }
%struct.anon = type { i32, i32, i32 }
%struct.anon.0 = type { i32, i32 }
%struct.anon.1 = type { i32, i32 }
%struct.mera_t = type { ptr, ptr, ptr, ptr, ptr, i32, i32 }

@ia32_cpu_features = external dso_local local_unnamed_addr global %struct._ia32_cpu_features, align 4
@perf_rdpmc_index = external hidden local_unnamed_addr global i32, align 4
@mera = external dso_local local_unnamed_addr global %struct.mera_t, align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@posix_clockid = external hidden local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@perf_page = external hidden local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@perf_fd = external hidden local_unnamed_addr global i32, align 4
@perf_error = external hidden local_unnamed_addr global i32, align 4
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [101 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @mera_init() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  store i32 0, ptr getelementptr inbounds (i8, ptr @mera, i64 40), align 8, !tbaa !5
  %2 = tail call i32 @set_single_affinity()
  store i32 %2, ptr getelementptr inbounds (i8, ptr @mera, i64 44), align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 2, ptr %1, align 4, !tbaa !12
  %3 = call i32 (i32, ...) @prctl(i32 noundef 25, ptr noundef nonnull %1, i32 noundef 0, i32 noundef 0, i32 noundef 0) #6
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %4, label %.sink.split

4:                                                ; preds = %0
  %5 = load i32, ptr %1, align 4, !tbaa !12
  %.not8 = icmp eq i32 %5, 1
  br i1 %.not8, label %8, label %6

6:                                                ; preds = %4
  %7 = call i32 (i32, ...) @prctl(i32 noundef 26, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 0) #6
  %.not9 = icmp eq i32 %7, 0
  br i1 %.not9, label %8, label %.sink.split

.sink.split:                                      ; preds = %6, %0
  %.str.1.sink = phi ptr [ @.str, %0 ], [ @.str.1, %6 ]
  call void @perror(ptr noundef nonnull %.str.1.sink) #7
  br label %8

8:                                                ; preds = %.sink.split, %4, %6
  %9 = load i32, ptr @posix_clockid, align 4, !tbaa !12
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %.thread21

11:                                               ; preds = %8
  store i32 4, ptr @posix_clockid, align 4, !tbaa !12
  %12 = call zeroext i1 @probe(ptr noundef nonnull @clock_posix, ptr noundef nonnull @clock_posix, ptr noundef nonnull @convert_1to1, i32 noundef 0, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  %.pr = load i32, ptr @posix_clockid, align 4
  %13 = icmp ne i32 %.pr, 0
  %or.cond24.not = select i1 %12, i1 %13, i1 false
  br i1 %or.cond24.not, label %.thread21, label %.thread

.thread:                                          ; preds = %11
  store i32 1, ptr @posix_clockid, align 4, !tbaa !12
  %14 = call zeroext i1 @probe(ptr noundef nonnull @clock_posix, ptr noundef nonnull @clock_posix, ptr noundef nonnull @convert_1to1, i32 noundef 0, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3)
  br i1 %14, label %.thread21, label %15

15:                                               ; preds = %.thread
  store i32 0, ptr @posix_clockid, align 4, !tbaa !12
  br label %.thread21

.thread21:                                        ; preds = %11, %8, %.thread, %15
  %16 = call zeroext i1 @probe(ptr noundef nonnull @clock_gettimeofday, ptr noundef nonnull @clock_gettimeofday, ptr noundef nonnull @convert_us2ns, i32 noundef 0, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3)
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @ia32_cpu_features, i64 8), align 4, !tbaa !13
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %.thread21
  call void @ia32_fetch_cpu_features()
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @ia32_cpu_features, i64 8), align 4, !tbaa !13
  br label %20

20:                                               ; preds = %19, %.thread21
  %21 = phi i32 [ %.pre, %19 ], [ %17, %.thread21 ]
  %22 = and i32 %21, 16
  %.not10 = icmp eq i32 %22, 0
  br i1 %.not10, label %43, label %23

23:                                               ; preds = %20
  %24 = call zeroext i1 @probe(ptr noundef nonnull @clock_rdpmc_start, ptr noundef nonnull @clock_rdpmc_finish, ptr noundef nonnull @convert_1to1, i32 noundef 26, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7)
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @ia32_cpu_features, i64 36), align 4, !tbaa !17
  %26 = and i32 %25, 256
  %.not11.not = icmp eq i32 %26, 0
  %27 = select i1 %.not11.not, i32 26, i32 10
  br i1 %.not11.not, label %36, label %28

28:                                               ; preds = %23
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @mera, i64 40), align 8, !tbaa !5
  %30 = and i32 %29, 16
  %.not13 = icmp eq i32 %30, 0
  br i1 %.not13, label %31, label %36

31:                                               ; preds = %28
  %32 = call i32 @access(ptr noundef nonnull @.str.8, i32 noundef 0) #6
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %36

36:                                               ; preds = %34, %31, %28, %23
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @ia32_cpu_features, i64 28), align 4, !tbaa !18
  %38 = and i32 %37, 134217728
  %.not14 = icmp eq i32 %38, 0
  br i1 %.not14, label %41, label %39

39:                                               ; preds = %36
  %40 = call zeroext i1 @probe(ptr noundef nonnull @clock_rdtscp_start, ptr noundef nonnull @clock_rdtscp_finish, ptr noundef nonnull @convert_1to1, i32 noundef %27, ptr noundef nonnull @.str.10, ptr noundef null)
  br label %41

41:                                               ; preds = %39, %36
  %42 = call zeroext i1 @probe(ptr noundef nonnull @clock_rdtsc_start, ptr noundef nonnull @clock_rdtsc_finish, ptr noundef nonnull @convert_1to1, i32 noundef %27, ptr noundef nonnull @.str.11, ptr noundef null)
  br label %43

43:                                               ; preds = %41, %20
  %44 = call i32 @perf_setup()
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %71

46:                                               ; preds = %43
  %47 = call zeroext i1 @probe(ptr noundef nonnull @clock_perf, ptr noundef nonnull @clock_perf, ptr noundef nonnull @convert_1to1, i32 noundef 24, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.7)
  %48 = load ptr, ptr @perf_page, align 8, !tbaa !19
  %.not15 = icmp eq ptr %48, null
  br i1 %.not15, label %67, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %48, i64 40
  %51 = load volatile i64, ptr %50, align 8
  %52 = and i64 %51, 2
  %.not16 = icmp eq i64 %52, 0
  br i1 %.not16, label %.critedge, label %53

53:                                               ; preds = %49
  %54 = load volatile i64, ptr %50, align 8
  %55 = and i64 %54, 4
  %.not17 = icmp eq i64 %55, 0
  br i1 %.not17, label %.critedge, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %48, i64 12
  %58 = load volatile i32, ptr %57, align 4, !tbaa !20
  %.not18 = icmp eq i32 %58, 0
  br i1 %.not18, label %.critedge, label %59

59:                                               ; preds = %56
  %60 = load volatile i32, ptr %57, align 4, !tbaa !20
  %61 = add i32 %60, -1
  store i32 %61, ptr @perf_rdpmc_index, align 4, !tbaa !12
  %62 = call zeroext i1 @probe(ptr noundef nonnull @perf_rdpmc_start, ptr noundef nonnull @perf_rdpmc_finish, ptr noundef nonnull @convert_1to1, i32 noundef 26, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.7)
  br i1 %62, label %.critedge20, label %..critedge_crit_edge

..critedge_crit_edge:                             ; preds = %59
  %.pre22 = load ptr, ptr @perf_page, align 8, !tbaa !19
  br label %.critedge

.critedge:                                        ; preds = %..critedge_crit_edge, %56, %53, %49
  %63 = phi ptr [ %.pre22, %..critedge_crit_edge ], [ %48, %56 ], [ %48, %53 ], [ %48, %49 ]
  %64 = tail call i32 @getpagesize() #8
  %65 = sext i32 %64 to i64
  %66 = call i32 @munmap(ptr noundef %63, i64 noundef %65) #6
  store ptr null, ptr @perf_page, align 8, !tbaa !19
  br label %67

67:                                               ; preds = %.critedge, %46
  br i1 %47, label %.critedge20, label %68

68:                                               ; preds = %67
  %69 = load i32, ptr @perf_fd, align 4, !tbaa !12
  %70 = call i32 @close(i32 noundef %69) #6
  store i32 -1, ptr @perf_fd, align 4, !tbaa !12
  br label %.critedge20

71:                                               ; preds = %43
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @mera, i64 40), align 8, !tbaa !5
  %73 = and i32 %72, 16
  %74 = icmp eq i32 %73, 0
  %75 = load i32, ptr @perf_error, align 4
  %76 = icmp eq i32 %75, 13
  %or.cond = select i1 %74, i1 %76, i1 false
  br i1 %or.cond, label %77, label %.critedge20

77:                                               ; preds = %71
  %78 = call i32 @access(ptr noundef nonnull @.str.14, i32 noundef 0) #6
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %.critedge20

80:                                               ; preds = %77
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  br label %.critedge20

.critedge20:                                      ; preds = %67, %68, %59, %71, %77, %80
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @mera, i64 40), align 8, !tbaa !5
  %83 = and i32 %82, 1
  %84 = icmp ne i32 %83, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i1 %84
}

; Function Attrs: nounwind uwtable
declare hidden i32 @set_single_affinity() local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @prctl(i32 noundef, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @probe(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_posix(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @convert_1to1(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_gettimeofday(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @convert_us2ns(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdpmc_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdpmc_finish(ptr noundef) #0

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtscp_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtscp_finish(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtsc_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_rdtsc_finish(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @perf_setup() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @clock_perf(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i32 @getpagesize() local_unnamed_addr #4

declare i32 @close(i32 noundef) local_unnamed_addr #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 #5 = { "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 #6 = { nounwind }
attributes #7 = { cold }
attributes #8 = { nounwind willreturn memory(none) }

!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, !10, i64 40}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 44}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ia32_cpu_features", !15, i64 0, !15, i64 12, !16, i64 24, !16, i64 32}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!16 = !{!"", !10, i64 0, !10, i64 4}
!17 = !{!14, !10, i64 36}
!18 = !{!14, !10, i64 28}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !10, i64 12}
!21 = !{!"perf_event_mmap_page", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !22, i64 16, !22, i64 24, !22, i64 32, !8, i64 40, !23, i64 48, !23, i64 50, !10, i64 52, !22, i64 56, !22, i64 64, !10, i64 72, !10, i64 76, !22, i64 80, !22, i64 88, !8, i64 96, !22, i64 1024, !22, i64 1032, !22, i64 1040, !22, i64 1048, !22, i64 1056, !22, i64 1064, !22, i64 1072, !22, i64 1080}
!22 = !{!"long long", !8, i64 0}
!23 = !{!"short", !8, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass