; LLVM IR from NOAA-PMEL/Ferret :: fer/ccr (EF_InternalUtil)

; 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.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.ExternalFunction = type { ptr, [40 x i8], [128 x i8], i32, i32, ptr }
%struct.ExternalFunctionInternals = type { float, [128 x i8], [40 x i8], [40 x i8], i32, i32, i32, i32, [9 x [6 x i32]], [9 x [6 x i32]], [6 x i32], [6 x i32], [6 x i32], i32, [6 x i32], [6 x %struct.Axis], [9 x [6 x i32]], [9 x [6 x i32]], [9 x [6 x i32]], [9 x i32], [9 x [40 x i8]], [9 x [40 x i8]], [9 x [128 x i8]] }
%struct.Axis = type { i32, i32, i32, i32, i32, double, double, double, [40 x i8] }

@pyefcn_handle = external hidden global ptr, align 8
@sigjumpbuffer = external hidden global [1 x %struct.__jmp_buf_tag], align 16
@jumpbuffer = external hidden global [1 x %struct.__jmp_buf_tag], align 16
@canjump = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [16 x i8], align 1
@pyefcn_result_limits_func = external hidden global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [64 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

; 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 ptr @ef_ptr_from_id_ptr(ptr noundef) #1

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

; Function Attrs: nounwind
declare ptr @dlerror() #2

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

; Function Attrs: nounwind returns_twice
declare i32 @__sigsetjmp(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #4

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @internal_dlsym(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

declare i32 @fputs(ptr noundef, ptr noundef) #6

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

; Function Attrs: nounwind uwtable
define dso_local void @efcn_get_result_limits_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [40 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca [2048 x i8], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #7
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 3, ptr %15, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  call void @EF_store_globals(ptr noundef %16, ptr noundef %17, ptr noundef null, ptr noundef null)
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call ptr @ef_ptr_from_id_ptr(ptr noundef %18)
  store ptr %19, ptr %9, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  store i32 1, ptr %13, align 4
  br label %150

22:                                               ; preds = %4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ExternalFunction, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds [128 x i8], ptr %24, i64 0, i64 0
  %26 = call i32 @strcmp(ptr noundef %25, ptr noundef @.str.15) #8
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %28, %22
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ExternalFunction, ptr %30, i32 0, i32 5
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %32, i32 0, i32 4
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %36, label %77

36:                                               ; preds = %29
  %37 = call i32 @EF_Util_setsig(ptr noundef @.str.29)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %36
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %40, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %150

41:                                               ; preds = %36
  %42 = call i32 @__sigsetjmp(ptr noundef @sigjumpbuffer, i32 noundef 1) #9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %41
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %45, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %150

46:                                               ; preds = %41
  %47 = call i32 @_setjmp(ptr noundef @jumpbuffer) #9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %46
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %50, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %150

51:                                               ; preds = %46
  store volatile i32 1, ptr @canjump, align 4, !tbaa !9
  %52 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ExternalFunction, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds [40 x i8], ptr %54, i64 0, i64 0
  %56 = call ptr @strcpy(ptr noundef %52, ptr noundef %55) #7
  %57 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %58 = call ptr @strcat(ptr noundef %57, ptr noundef @.str.30) #7
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %67, label %61

61:                                               ; preds = %51
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ExternalFunction, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %66 = call ptr @dlsym(ptr noundef %64, ptr noundef %65) #7
  store ptr %66, ptr %12, align 8, !tbaa !5
  br label %70

67:                                               ; preds = %51
  %68 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 0
  %69 = call ptr @internal_dlsym(ptr noundef %68)
  store ptr %69, ptr %12, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %67, %61
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  call void %71(ptr noundef %72)
  %73 = call i32 @EF_Util_ressig(ptr noundef @.str.29)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %70
  store i32 1, ptr %13, align 4
  br label %150

76:                                               ; preds = %70
  br label %149

77:                                               ; preds = %29
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ExternalFunction, ptr %78, i32 0, i32 5
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %80, i32 0, i32 4
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = icmp eq i32 %82, 3
  br i1 %83, label %84, label %139

84:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 2048, ptr %14) #7
  %85 = load ptr, ptr @pyefcn_result_limits_func, align 8, !tbaa !5
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %105

87:                                               ; preds = %84
  %88 = load ptr, ptr @pyefcn_handle, align 8, !tbaa !5
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %94

90:                                               ; preds = %87
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = call i32 @fputs(ptr noundef @.str.31, ptr noundef %91)
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %93, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %136

94:                                               ; preds = %87
  %95 = load ptr, ptr @pyefcn_handle, align 8, !tbaa !5
  %96 = call ptr @dlsym(ptr noundef %95, ptr noundef @.str.32) #7
  store ptr %96, ptr @pyefcn_result_limits_func, align 8, !tbaa !5
  %97 = load ptr, ptr @pyefcn_result_limits_func, align 8, !tbaa !5
  %98 = icmp eq ptr %97, null
  br i1 %98, label %99, label %104

99:                                               ; preds = %94
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = call ptr @dlerror() #7
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.33, ptr noundef %101) #7
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %103, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %136

104:                                              ; preds = %94
  br label %105

105:                                              ; preds = %104, %84
  %106 = call i32 @EF_Util_setsig(ptr noundef @.str.29)
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %105
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %109, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %136

110:                                              ; preds = %105
  %111 = call i32 @__sigsetjmp(ptr noundef @sigjumpbuffer, i32 noundef 1) #9
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %115

113:                                              ; preds = %110
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %114, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %136

115:                                              ; preds = %110
  %116 = call i32 @_setjmp(ptr noundef @jumpbuffer) #9
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %115
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %119, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  br label %136

120:                                              ; preds = %115
  store volatile i32 1, ptr @canjump, align 4, !tbaa !9
  %121 = load ptr, ptr @pyefcn_result_limits_func, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ExternalFunction, ptr %124, i32 0, i32 2
  %126 = getelementptr inbounds [128 x i8], ptr %125, i64 0, i64 0
  %127 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  call void %121(i32 noundef %123, ptr noundef %126, ptr noundef %127)
  %128 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  %129 = call i64 @strlen(ptr noundef %128) #8
  %130 = icmp ugt i64 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %120
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  call void @ef_err_bail_out_(ptr noundef %132, ptr noundef %133)
  br label %134

134:                                              ; preds = %131, %120
  %135 = call i32 @EF_Util_ressig(ptr noundef @.str.29)
  store i32 0, ptr %13, align 4
  br label %136

136:                                              ; preds = %134, %118, %113, %108, %99, %90
  call void @llvm.lifetime.end.p0(i64 2048, ptr %14) #7
  %137 = load i32, ptr %13, align 4
  switch i32 %137, label %150 [
    i32 0, label %138
  ]

138:                                              ; preds = %136
  br label %148

139:                                              ; preds = %77
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 437, ptr %140, align 4, !tbaa !9
  %141 = load ptr, ptr @stderr, align 8, !tbaa !5
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ExternalFunction, ptr %142, i32 0, i32 5
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  %145 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %144, i32 0, i32 4
  %146 = load i32, ptr %145, align 4, !tbaa !13
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.34, i32 noundef %146) #7
  br label %148

148:                                              ; preds = %139, %138
  br label %149

149:                                              ; preds = %148, %76
  store i32 1, ptr %13, align 4
  br label %150

150:                                              ; preds = %149, %136, %75, %49, %44, %39, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @EF_Util_setsig(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @EF_Util_ressig(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 willreturn memory(read) "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 returns_twice "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind returns_twice }

!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, !6, i64 184}
!12 = !{!"", !6, i64 0, !7, i64 8, !7, i64 48, !10, i64 176, !10, i64 180, !6, i64 184}
!13 = !{!14, !10, i64 212}
!14 = !{!"", !15, i64 0, !7, i64 4, !7, i64 132, !7, i64 172, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !7, i64 228, !7, i64 444, !7, i64 660, !7, i64 684, !7, i64 708, !10, i64 732, !7, i64 736, !7, i64 760, !7, i64 1288, !7, i64 1504, !7, i64 1720, !7, i64 1936, !7, i64 1972, !7, i64 2332, !7, i64 2692}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !6, 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"

%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@pyefcn_handle = external hidden local_unnamed_addr global ptr, align 8
@sigjumpbuffer = external hidden global [1 x %struct.__jmp_buf_tag], align 16
@jumpbuffer = external hidden global [1 x %struct.__jmp_buf_tag], align 16
@canjump = external hidden global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [16 x i8], align 1
@pyefcn_result_limits_func = external hidden local_unnamed_addr global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [64 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

; 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 ptr @ef_ptr_from_id_ptr(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @dlerror() local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @dlsym(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind returns_twice
declare i32 @__sigsetjmp(ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden ptr @internal_dlsym(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @efcn_get_result_limits_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = alloca [40 x i8], align 16
  %6 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  store i32 3, ptr %3, align 4, !tbaa !5
  call void @EF_store_globals(ptr noundef %1, ptr noundef %2, ptr noundef null, ptr noundef null)
  %7 = call ptr @ef_ptr_from_id_ptr(ptr noundef %0)
  %8 = icmp eq ptr %7, null
  br i1 %8, label %68, label %9

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %7, i64 48
  %11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.15) #9
  %.not.not = icmp eq i32 %11, 0
  %12 = getelementptr inbounds i8, ptr %7, i64 184
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %13, i64 212
  %15 = load i32, ptr %14, align 4, !tbaa !12
  switch i32 %15, label %64 [
    i32 2, label %16
    i32 3, label %36
  ]

16:                                               ; preds = %9
  %17 = call i32 @EF_Util_setsig(ptr noundef nonnull @.str.29)
  %.not34 = icmp eq i32 %17, 0
  br i1 %.not34, label %19, label %18

18:                                               ; preds = %16
  store i32 437, ptr %3, align 4, !tbaa !5
  br label %68

19:                                               ; preds = %16
  %20 = call i32 @__sigsetjmp(ptr noundef nonnull @sigjumpbuffer, i32 noundef 1) #10
  %.not35 = icmp eq i32 %20, 0
  br i1 %.not35, label %22, label %21

21:                                               ; preds = %19
  store i32 437, ptr %3, align 4, !tbaa !5
  br label %68

22:                                               ; preds = %19
  %23 = call i32 @_setjmp(ptr noundef nonnull @jumpbuffer) #10
  %.not36 = icmp eq i32 %23, 0
  br i1 %.not36, label %25, label %24

24:                                               ; preds = %22
  store i32 437, ptr %3, align 4, !tbaa !5
  br label %68

25:                                               ; preds = %22
  store volatile i32 1, ptr @canjump, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %7, i64 8
  %27 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %26) #8
  %28 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.30) #8
  br i1 %.not.not, label %32, label %29

29:                                               ; preds = %25
  %30 = load ptr, ptr %7, align 8, !tbaa !15
  %31 = call ptr @dlsym(ptr noundef %30, ptr noundef nonnull %5) #8
  br label %34

32:                                               ; preds = %25
  %33 = call ptr @internal_dlsym(ptr noundef nonnull %5)
  br label %34

34:                                               ; preds = %32, %29
  %.025 = phi ptr [ %33, %32 ], [ %31, %29 ]
  call void %.025(ptr noundef %0) #8
  %35 = call i32 @EF_Util_ressig(ptr noundef nonnull @.str.29)
  br label %68

36:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %6) #8
  %37 = load ptr, ptr @pyefcn_result_limits_func, align 8, !tbaa !16
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %52

39:                                               ; preds = %36
  %40 = load ptr, ptr @pyefcn_handle, align 8, !tbaa !16
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load ptr, ptr @stderr, align 8, !tbaa !16
  %44 = call i32 @fputs(ptr noundef nonnull @.str.31, ptr noundef %43) #11
  br label %.critedge

45:                                               ; preds = %39
  %46 = call ptr @dlsym(ptr noundef nonnull %40, ptr noundef nonnull @.str.32) #8
  store ptr %46, ptr @pyefcn_result_limits_func, align 8, !tbaa !16
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %52

48:                                               ; preds = %45
  %49 = load ptr, ptr @stderr, align 8, !tbaa !16
  %50 = call ptr @dlerror() #8
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.33, ptr noundef %50) #12
  br label %.critedge

52:                                               ; preds = %45, %36
  %53 = call i32 @EF_Util_setsig(ptr noundef nonnull @.str.29)
  %.not30 = icmp eq i32 %53, 0
  br i1 %.not30, label %54, label %.critedge

54:                                               ; preds = %52
  %55 = call i32 @__sigsetjmp(ptr noundef nonnull @sigjumpbuffer, i32 noundef 1) #10
  %.not31 = icmp eq i32 %55, 0
  br i1 %.not31, label %56, label %.critedge

56:                                               ; preds = %54
  %57 = call i32 @_setjmp(ptr noundef nonnull @jumpbuffer) #10
  %.not32 = icmp eq i32 %57, 0
  br i1 %.not32, label %58, label %.critedge

58:                                               ; preds = %56
  store volatile i32 1, ptr @canjump, align 4, !tbaa !5
  %59 = load ptr, ptr @pyefcn_result_limits_func, align 8, !tbaa !16
  %60 = load i32, ptr %0, align 4, !tbaa !5
  call void %59(i32 noundef %60, ptr noundef nonnull %10, ptr noundef nonnull %6) #8
  %char0 = load i8, ptr %6, align 16
  %.not33 = icmp eq i8 %char0, 0
  br i1 %.not33, label %62, label %61

61:                                               ; preds = %58
  call void @ef_err_bail_out_(ptr noundef nonnull %0, ptr noundef nonnull %6)
  br label %62

62:                                               ; preds = %61, %58
  %63 = call i32 @EF_Util_ressig(ptr noundef nonnull @.str.29)
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #8
  br label %68

64:                                               ; preds = %9
  store i32 437, ptr %3, align 4, !tbaa !5
  %65 = load ptr, ptr @stderr, align 8, !tbaa !16
  %66 = load i32, ptr %14, align 4, !tbaa !12
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.34, i32 noundef %66) #12
  br label %68

.critedge:                                        ; preds = %56, %54, %52, %48, %42
  store i32 437, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #8
  br label %68

68:                                               ; preds = %34, %64, %62, %.critedge, %4, %24, %21, %18
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #8
  ret void
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 "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 returns_twice "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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind returns_twice }
attributes #11 = { cold }
attributes #12 = { cold 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, !11, i64 184}
!10 = !{!"", !11, i64 0, !7, i64 8, !7, i64 48, !6, i64 176, !6, i64 180, !11, i64 184}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 212}
!13 = !{!"", !14, i64 0, !7, i64 4, !7, i64 132, !7, i64 172, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !7, i64 228, !7, i64 444, !7, i64 660, !7, i64 684, !7, i64 708, !6, i64 732, !7, i64 736, !7, i64 760, !7, i64 1288, !7, i64 1504, !7, i64 1720, !7, i64 1936, !7, i64 1972, !7, i64 2332, !7, i64 2692}
!14 = !{!"float", !7, i64 0}
!15 = !{!10, !11, i64 0}
!16 = !{!11, !11, i64 0}


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