; 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__._ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_ = external hidden unnamed_addr constant [79 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 } @_ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_(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 ptr, align 8
  %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) #5
  %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 %104

34:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  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 %103

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 52, ptr noundef @__PRETTY_FUNCTION__._ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_) #6
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %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) #5
  %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 8, ptr %17) #5
  %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 4
  %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 ptr @_ZN7JNIEnv_17CallObjectMethodAEP8_jobjectP10_jmethodIDPK6jvalue(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef %74, ptr noundef %77, ptr noundef %78)
  store ptr %79, ptr %17, align 8, !tbaa !5
  %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 %92, label %83

83:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = call { i64, i64 } @_ZNK7Context10toJsStringEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280) %84, ptr noundef %85, ptr noundef %86)
  %88 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %89 = extractvalue { i64, i64 } %87, 0
  store i64 %89, ptr %88, align 8
  %90 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %91 = extractvalue { i64, i64 } %87, 1
  store i64 %91, ptr %90, 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) #5
  br label %100

92:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = call { i64, i64 } @_ZNK7Context24throwJavaExceptionFromJsEP7JNIEnv_(ptr noundef nonnull align 8 dereferenceable(280) %93, ptr noundef %94)
  %96 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %97 = extractvalue { i64, i64 } %95, 0
  store i64 %97, ptr %96, align 8
  %98 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %99 = extractvalue { i64, i64 } %95, 1
  store i64 %99, ptr %98, 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) #5
  br label %100

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

103:                                              ; preds = %100, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %104

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

; 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

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

declare { i64, i64 } @_ZNK7Context10toJsStringEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef) #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

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 = { nounwind }
attributes #6 = { 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 56}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%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__._ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_ = external hidden unnamed_addr constant [79 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 } @_ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_(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 %36

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)
  %.not30 = icmp eq ptr %14, null
  br i1 %.not30, 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 %36

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 52, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN19OutboundCallChannel4callEP9JSContext7JSValueiPS2_) #4
  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) #5
  %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 56
  %27 = load ptr, ptr %26, align 8, !tbaa !30
  %28 = call noundef ptr @_ZN7JNIEnv_17CallObjectMethodAEP8_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)
  %.not31 = icmp eq i8 %29, 0
  br i1 %.not31, label %30, label %32

30:                                               ; preds = %20
  %31 = call { i64, i64 } @_ZNK7Context10toJsStringEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280) %8, ptr noundef nonnull %21, ptr noundef %28)
  br label %34

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

34:                                               ; preds = %32, %30
  %.pn = phi { i64, i64 } [ %33, %32 ], [ %31, %30 ]
  %35 = 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) #5
  br label %36

36:                                               ; preds = %15, %34, %9
  %.pn.pn.pn = phi { i64, i64 } [ %10, %9 ], [ %.pn, %34 ], [ %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

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

declare { i64, i64 } @_ZNK7Context10toJsStringEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef) 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

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 = { noreturn nounwind }
attributes #5 = { 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 56}


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