; LLVM IR from cashapp/zipline :: zipline/native (OutboundCallChannel)

; 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.JSValue = type { %union.JSValueUnion, i64 }
%union.JSValueUnion = type { double }
%union.jvalue = type { i64 }
%class.Context = type { ptr, i32, ptr, ptr, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.7", %"class.std::unordered_map" }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<InboundCallChannel *, std::allocator<InboundCallChannel *>>::_Vector_impl" }
%"struct.std::_Vector_base<InboundCallChannel *, std::allocator<InboundCallChannel *>>::_Vector_impl" = type { %"struct.std::_Vector_base<InboundCallChannel *, std::allocator<InboundCallChannel *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<InboundCallChannel *, std::allocator<InboundCallChannel *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%class.OutboundCallChannel = type { ptr, %"class.std::__cxx11::basic_string", ptr, ptr, ptr, ptr, %"class.std::vector" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<JSCFunctionListEntry, std::allocator<JSCFunctionListEntry>>::_Vector_impl" }
%"struct.std::_Vector_base<JSCFunctionListEntry, std::allocator<JSCFunctionListEntry>>::_Vector_impl" = type { %"struct.std::_Vector_base<JSCFunctionListEntry, std::allocator<JSCFunctionListEntry>>::_Vector_impl_data" }
%"struct.std::_Vector_base<JSCFunctionListEntry, std::allocator<JSCFunctionListEntry>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_ = external hidden unnamed_addr constant [85 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: mustprogress uwtable
define dso_local { i64, i64 } @_ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4) #1 align 2 {
  %6 = alloca %struct.JSValue, align 8
  %7 = alloca %struct.JSValue, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %struct.JSValue, align 8
  %15 = alloca ptr, align 8
  %16 = alloca [1 x %union.jvalue], align 8
  %17 = alloca i8, align 1
  %18 = alloca %struct.JSValue, align 8
  %19 = alloca %struct.JSValue, align 8
  %20 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  store i64 %1, ptr %20, align 8
  %21 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  store i64 %2, ptr %21, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = call ptr @JS_GetRuntime(ptr noundef %22)
  %24 = call ptr @JS_GetRuntimeOpaque(ptr noundef %23)
  store ptr %24, ptr %11, align 8, !tbaa !5
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %34, label %27

27:                                               ; preds = %5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = call { i64, i64 } (ptr, ptr, ...) @JS_ThrowReferenceError(ptr noundef %28, ptr noundef @.str.5)
  %30 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %31 = extractvalue { i64, i64 } %29, 0
  store i64 %31, ptr %30, align 8
  %32 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %33 = extractvalue { i64, i64 } %29, 1
  store i64 %33, ptr %32, align 8
  store i32 1, ptr %12, align 4
  br label %106

34:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.Context, ptr %35, i32 0, i32 5
  %37 = load i32, ptr %36, align 8, !tbaa !15
  %38 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %39 = load i64, ptr %38, align 8
  %40 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %41 = load i64, ptr %40, align 8
  %42 = call ptr @JS_GetOpaque(i64 %39, i64 %41, i32 noundef %37)
  store ptr %42, ptr %13, align 8, !tbaa !5
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %52, label %45

45:                                               ; preds = %34
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call { i64, i64 } (ptr, ptr, ...) @JS_ThrowReferenceError(ptr noundef %46, ptr noundef @.str.6)
  %48 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %49 = extractvalue { i64, i64 } %47, 0
  store i64 %49, ptr %48, align 8
  %50 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %51 = extractvalue { i64, i64 } %47, 1
  store i64 %51, ptr %50, align 8
  store i32 1, ptr %12, align 4
  br label %105

52:                                               ; preds = %34
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  br label %58

56:                                               ; preds = %52
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 82, ptr noundef @__PRETTY_FUNCTION__._ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_) #7
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = call noundef ptr @_ZNK7Context6getEnvEv(ptr noundef nonnull align 8 dereferenceable(280) %59)
  store ptr %60, ptr %15, align 8, !tbaa !5
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  %64 = call noundef i32 @_ZN7JNIEnv_14PushLocalFrameEi(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.JSValue, ptr %67, i64 0
  %69 = call noundef ptr @_ZNK7Context12toJavaStringEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %65, ptr noundef %66, ptr noundef nonnull align 8 dereferenceable(16) %68)
  %70 = getelementptr inbounds [1 x %union.jvalue], ptr %16, i64 0, i64 0
  store ptr %69, ptr %70, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.OutboundCallChannel, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !26
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %class.OutboundCallChannel, ptr %75, i32 0, i32 5
  %77 = load ptr, ptr %76, align 8, !tbaa !34
  %78 = getelementptr inbounds [1 x %union.jvalue], ptr %16, i64 0, i64 0
  %79 = call noundef zeroext i8 @_ZN7JNIEnv_18CallBooleanMethodAEP8_jobjectP10_jmethodIDPK6jvalue(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef %74, ptr noundef %77, ptr noundef %78)
  store i8 %79, ptr %17, align 1, !tbaa !12
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = call noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8) %80)
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %94, label %83

83:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.Context, ptr %84, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !35
  %87 = load i8, ptr %17, align 1, !tbaa !12
  %88 = zext i8 %87 to i32
  %89 = call { i64, i64 } @_ZL10JS_NewBoolP9JSContexti(ptr noundef %86, i32 noundef %88)
  %90 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %91 = extractvalue { i64, i64 } %89, 0
  store i64 %91, ptr %90, align 8
  %92 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %93 = extractvalue { i64, i64 } %89, 1
  store i64 %93, ptr %92, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %102

94:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = call { i64, i64 } @_ZNK7Context24throwJavaExceptionFromJsEP7JNIEnv_(ptr noundef nonnull align 8 dereferenceable(280) %95, ptr noundef %96)
  %98 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %99 = extractvalue { i64, i64 } %97, 0
  store i64 %99, ptr %98, align 8
  %100 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %101 = extractvalue { i64, i64 } %97, 1
  store i64 %101, ptr %100, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %102

102:                                              ; preds = %94, %83
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = call noundef ptr @_ZN7JNIEnv_13PopLocalFrameEP8_jobject(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef null)
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %105

105:                                              ; preds = %102, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %106

106:                                              ; preds = %105, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %107 = load { i64, i64 }, ptr %6, align 8
  ret { i64, i64 } %107
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare noundef ptr @_ZNK7Context6getEnvEv(ptr noundef nonnull align 8 dereferenceable(280)) #3

declare ptr @JS_GetRuntimeOpaque(ptr noundef) #3

declare ptr @JS_GetRuntime(ptr noundef) #3

declare { i64, i64 } @JS_ThrowReferenceError(ptr noundef, ptr noundef, ...) #3

declare ptr @JS_GetOpaque(i64, i64, i32 noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7JNIEnv_14PushLocalFrameEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

declare noundef ptr @_ZNK7Context12toJavaStringEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #3

declare { i64, i64 } @_ZNK7Context24throwJavaExceptionFromJsEP7JNIEnv_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7JNIEnv_13PopLocalFrameEP8_jobject(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN7JNIEnv_18CallBooleanMethodAEP8_jobjectP10_jmethodIDPK6jvalue(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden { i64, i64 } @_ZL10JS_NewBoolP9JSContexti(ptr noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #5 = { alwaysinline mustprogress 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !12, i64 8, i64 8, !13}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 40}
!16 = !{!"_ZTS7Context", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !17, i64 200, !21, i64 224}
!17 = !{!"_ZTSSt6vectorIP18InboundCallChannelSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIP18InboundCallChannelSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7_jclassSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S7_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7_jclassESaISA_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSC_18_Mod_range_hashingENSC_20_Default_ranged_hashENSC_20_Prime_rehash_policyENSC_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !14, i64 8, !23, i64 16, !14, i64 24, !24, i64 32, !6, i64 48}
!23 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!24 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !25, i64 0, !14, i64 8}
!25 = !{!"float", !7, i64 0}
!26 = !{!27, !6, i64 40}
!27 = !{!"_ZTS19OutboundCallChannel", !6, i64 0, !28, i64 8, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !30, i64 72}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !14, i64 8, !7, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!30 = !{!"_ZTSSt6vectorI20JSCFunctionListEntrySaIS0_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!27, !6, i64 64}
!35 = !{!16, !6, i64 24}


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

%union.jvalue = type { i64 }

@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [88 x i8], align 1
@__PRETTY_FUNCTION__._ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_ = external hidden unnamed_addr constant [85 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: mustprogress uwtable
define dso_local { i64, i64 } @_ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #1 align 2 {
  %6 = alloca [1 x %union.jvalue], align 8
  %7 = tail call ptr @JS_GetRuntime(ptr noundef %0)
  %8 = tail call ptr @JS_GetRuntimeOpaque(ptr noundef %7)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %11

9:                                                ; preds = %5
  %10 = tail call { i64, i64 } (ptr, ptr, ...) @JS_ThrowReferenceError(ptr noundef %0, ptr noundef nonnull @.str.5)
  br label %39

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %8, i64 40
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %14 = tail call ptr @JS_GetOpaque(i64 %1, i64 %2, i32 noundef %13)
  %.not29 = icmp eq ptr %14, null
  br i1 %.not29, label %15, label %17

15:                                               ; preds = %11
  %16 = tail call { i64, i64 } (ptr, ptr, ...) @JS_ThrowReferenceError(ptr noundef %0, ptr noundef nonnull @.str.6)
  br label %39

17:                                               ; preds = %11
  %18 = icmp eq i32 %3, 1
  br i1 %18, label %20, label %19

19:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 82, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN19OutboundCallChannel10disconnectEP9JSContext7JSValueiPS2_) #5
  unreachable

20:                                               ; preds = %17
  %21 = tail call noundef ptr @_ZNK7Context6getEnvEv(ptr noundef nonnull align 8 dereferenceable(280) %8)
  %22 = tail call noundef i32 @_ZN7JNIEnv_14PushLocalFrameEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %23 = tail call noundef ptr @_ZNK7Context12toJavaStringEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %8, ptr noundef nonnull %21, ptr noundef nonnull align 8 dereferenceable(16) %4)
  store ptr %23, ptr %6, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %14, i64 40
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %14, i64 64
  %27 = load ptr, ptr %26, align 8, !tbaa !30
  %28 = call noundef zeroext i8 @_ZN7JNIEnv_18CallBooleanMethodAEP8_jobjectP10_jmethodIDPK6jvalue(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef %25, ptr noundef %27, ptr noundef nonnull %6)
  %29 = call noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %.not30 = icmp eq i8 %29, 0
  br i1 %.not30, label %30, label %35

30:                                               ; preds = %20
  %31 = getelementptr inbounds i8, ptr %8, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !31
  %33 = zext i8 %28 to i32
  %34 = call { i64, i64 } @_ZL10JS_NewBoolP9JSContexti(ptr noundef %32, i32 noundef %33)
  br label %37

35:                                               ; preds = %20
  %36 = call { i64, i64 } @_ZNK7Context24throwJavaExceptionFromJsEP7JNIEnv_(ptr noundef nonnull align 8 dereferenceable(280) %8, ptr noundef nonnull %21)
  br label %37

37:                                               ; preds = %35, %30
  %.pn = phi { i64, i64 } [ %36, %35 ], [ %34, %30 ]
  %38 = call noundef ptr @_ZN7JNIEnv_13PopLocalFrameEP8_jobject(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %39

39:                                               ; preds = %15, %37, %9
  %.pn.pn.pn = phi { i64, i64 } [ %10, %9 ], [ %.pn, %37 ], [ %16, %15 ]
  ret { i64, i64 } %.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

declare noundef ptr @_ZNK7Context6getEnvEv(ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #2

declare ptr @JS_GetRuntimeOpaque(ptr noundef) local_unnamed_addr #2

declare ptr @JS_GetRuntime(ptr noundef) local_unnamed_addr #2

declare { i64, i64 } @JS_ThrowReferenceError(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @JS_GetOpaque(i64, i64, i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7JNIEnv_14PushLocalFrameEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

declare noundef ptr @_ZNK7Context12toJavaStringEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

declare { i64, i64 } @_ZNK7Context24throwJavaExceptionFromJsEP7JNIEnv_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7JNIEnv_13PopLocalFrameEP8_jobject(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN7JNIEnv_18CallBooleanMethodAEP8_jobjectP10_jmethodIDPK6jvalue(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden { i64, i64 } @_ZL10JS_NewBoolP9JSContexti(ptr noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn 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 = { alwaysinline mustprogress 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !10, i64 40}
!6 = !{!"_ZTS7Context", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !11, i64 200, !15, i64 224}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIP18InboundCallChannelSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIP18InboundCallChannelSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7_jclassSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S7_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7_jclassESaISA_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSC_18_Mod_range_hashingENSC_20_Default_ranged_hashENSC_20_Prime_rehash_policyENSC_17_Hashtable_traitsILb1ELb0ELb1EEEE", !7, i64 0, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !7, i64 48}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !7, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !20, i64 0, !17, i64 8}
!20 = !{!"float", !8, i64 0}
!21 = !{!8, !8, i64 0}
!22 = !{!23, !7, i64 40}
!23 = !{!"_ZTS19OutboundCallChannel", !7, i64 0, !24, i64 8, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !26, i64 72}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !17, i64 8, !8, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!26 = !{!"_ZTSSt6vectorI20JSCFunctionListEntrySaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI20JSCFunctionListEntrySaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!30 = !{!23, !7, i64 64}
!31 = !{!6, !7, i64 24}


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