; LLVM IR from cashapp/zipline :: zipline/native/Context.ll (ZN7Context21getInboundCallChannelEP7JNIEnv_P8_jstring)

; 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 }
%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", %"class.std::unordered_map" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

@.str.22 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [45 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

declare i32 @__gxx_personality_v0(...)

declare void @_Z18throwJavaExceptionP7JNIEnv_PKcS2_z(ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind
declare void @_ZN18InboundCallChannelD1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsException7JSValue(i64, i64) #4

; 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) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef, i64, i64) #7

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7Context21getInboundCallChannelEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1, ptr noundef %2) #6 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.JSValue, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.JSValue, align 8
  %10 = alloca %struct.JSValue, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.JSValue, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.JSValue, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.JSValue, align 8
  %18 = alloca %struct.JSValue, align 8
  %19 = alloca %struct.JSValue, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #9
  %21 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call { i64, i64 } @JS_GetGlobalObject(ptr noundef %22)
  %24 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  %25 = extractvalue { i64, i64 } %23, 0
  store i64 %25, ptr %24, align 8
  %26 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  %27 = extractvalue { i64, i64 } %23, 1
  store i64 %27, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef ptr @_ZN7JNIEnv_17GetStringUTFCharsEP8_jstringPh(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef %29, ptr noundef null)
  store ptr %30, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #9
  %31 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !22
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %37 = load i64, ptr %36, align 8
  %38 = call { i64, i64 } @JS_GetPropertyStr(ptr noundef %32, i64 %35, i64 %37, ptr noundef %33)
  %39 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %40 = extractvalue { i64, i64 } %38, 0
  store i64 %40, ptr %39, align 8
  %41 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %42 = extractvalue { i64, i64 } %38, 1
  store i64 %42, ptr %41, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !22
  %43 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %46 = load i64, ptr %45, align 8
  %47 = call noundef i32 @_ZL11JS_IsObject7JSValue(i64 %44, i64 %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %70

49:                                               ; preds = %3
  %50 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #10
  %51 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN18InboundCallChannelC1EP9JSContextPKc(ptr noundef nonnull align 8 dereferenceable(12) %50, ptr noundef %52, ptr noundef %53)
          to label %54 unwind label %60

54:                                               ; preds = %49
  store ptr %50, ptr %11, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %64, label %58

58:                                               ; preds = %54
  %59 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 27
  call void @_ZNSt6vectorIP18InboundCallChannelSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(8) %11)
  br label %69

60:                                               ; preds = %49
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %13, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %50, i64 noundef 16) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  br label %109

64:                                               ; preds = %54
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  call void @_ZN18InboundCallChannelD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %65) #9
  call void @_ZdlPvm(ptr noundef %65, i64 noundef 16) #11
  br label %68

68:                                               ; preds = %67, %64
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %68, %58
  br label %92

70:                                               ; preds = %3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !22
  %71 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %72 = load i64, ptr %71, align 8
  %73 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %74 = load i64, ptr %73, align 8
  %75 = call noundef i32 @_ZL14JS_IsException7JSValue(i64 %72, i64 %74)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %70
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %20, ptr noundef %78, ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %91

79:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !22
  %80 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %81 = load i64, ptr %80, align 8
  %82 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %83 = load i64, ptr %82, align 8
  %84 = call noundef i32 @_ZL14JS_IsUndefined7JSValue(i64 %81, i64 %83)
  %85 = icmp ne i32 %84, 0
  %86 = zext i1 %85 to i64
  %87 = select i1 %85, ptr @.str.27, ptr @.str.28
  store ptr %87, ptr %16, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @_Z18throwJavaExceptionP7JNIEnv_PKcS2_z(ptr noundef %88, ptr noundef @.str.22, ptr noundef %89, ptr noundef %90)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %91

91:                                               ; preds = %79, %77
  br label %92

92:                                               ; preds = %91, %69
  %93 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !22
  %95 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %96 = load i64, ptr %95, align 8
  %97 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %98 = load i64, ptr %97, align 8
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %94, i64 %96, i64 %98)
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7JNIEnv_21ReleaseStringUTFCharsEP8_jstringPKc(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef %100, ptr noundef %101)
  %102 = getelementptr inbounds %class.Context, ptr %20, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !22
  %104 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %105 = load i64, ptr %104, align 8
  %106 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %107 = load i64, ptr %106, align 8
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %103, i64 %105, i64 %107)
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  ret ptr %108

109:                                              ; preds = %60
  %110 = load ptr, ptr %13, align 8
  %111 = load i32, ptr %14, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

declare { i64, i64 } @JS_GetGlobalObject(ptr noundef) #1

declare { i64, i64 } @JS_GetPropertyStr(ptr noundef, i64, i64, ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11JS_IsObject7JSValue(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #8

declare void @_ZN18InboundCallChannelC1EP9JSContextPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef, ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP18InboundCallChannelSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsUndefined7JSValue(i64, i64) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nobuiltin 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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { inlinehint 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 #8 = { nobuiltin allocsize(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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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, !6, i64 24}
!10 = !{!"_ZTS7Context", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, 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, !12, i64 200, !16, i64 224}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIP18InboundCallChannelSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIP18InboundCallChannelSaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIP18InboundCallChannelSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7_jclassSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S7_EEE", !17, i64 0}
!17 = !{!"_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, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !6, i64 48}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!20 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !21, i64 0, !18, i64 8}
!21 = !{!"float", !7, i64 0}
!22 = !{i64 0, i64 8, !23, i64 8, i64 8, !24}
!23 = !{!7, !7, i64 0}
!24 = !{!18, !18, 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.JSValue = type { %union.JSValueUnion, i64 }
%union.JSValueUnion = type { double }

@.str.22 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [45 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

declare i32 @__gxx_personality_v0(...)

declare void @_Z18throwJavaExceptionP7JNIEnv_PKcS2_z(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN18InboundCallChannelD1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsException7JSValue(i64, i64) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef, i64, i64) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7Context21getInboundCallChannelEP7JNIEnv_P8_jstring(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.JSValue, align 8
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call { i64, i64 } @JS_GetGlobalObject(ptr noundef %7)
  %9 = extractvalue { i64, i64 } %8, 0
  %10 = extractvalue { i64, i64 } %8, 1
  %11 = tail call noundef ptr @_ZN7JNIEnv_17GetStringUTFCharsEP8_jstringPh(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = tail call { i64, i64 } @JS_GetPropertyStr(ptr noundef %12, i64 %9, i64 %10, ptr noundef %11)
  %14 = extractvalue { i64, i64 } %13, 0
  store i64 %14, ptr %4, align 8
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = extractvalue { i64, i64 } %13, 1
  store i64 %16, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr null, ptr %5, align 8, !tbaa !21
  %17 = tail call noundef i32 @_ZL11JS_IsObject7JSValue(i64 %14, i64 %16)
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %28, label %18

18:                                               ; preds = %3
  %19 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #9
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN18InboundCallChannelC1EP9JSContextPKc(ptr noundef nonnull align 8 dereferenceable(12) %19, ptr noundef %20, ptr noundef %11)
          to label %21 unwind label %25

21:                                               ; preds = %18
  store ptr %19, ptr %5, align 8, !tbaa !21
  %22 = tail call noundef zeroext i8 @_ZN7JNIEnv_14ExceptionCheckEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.not29 = icmp eq i8 %22, 0
  br i1 %.not29, label %23, label %27

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %0, i64 200
  call void @_ZNSt6vectorIP18InboundCallChannelSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %34

25:                                               ; preds = %18
  %26 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %19, i64 noundef 16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  resume { ptr, i32 } %26

27:                                               ; preds = %21
  tail call void @_ZN18InboundCallChannelD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %19) #8
  tail call void @_ZdlPvm(ptr noundef nonnull %19, i64 noundef 16) #10
  store ptr null, ptr %5, align 8, !tbaa !21
  br label %34

28:                                               ; preds = %3
  %29 = tail call noundef i32 @_ZL14JS_IsException7JSValue(i64 %14, i64 %16)
  %.not27 = icmp eq i32 %29, 0
  br i1 %.not27, label %31, label %30

30:                                               ; preds = %28
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %.sroa.01.0.copyload.pre = load i64, ptr %4, align 8, !tbaa !22
  %.sroa.22.0.copyload.pre = load i64, ptr %15, align 8, !tbaa !23
  br label %34

31:                                               ; preds = %28
  %32 = tail call noundef i32 @_ZL14JS_IsUndefined7JSValue(i64 %14, i64 %16)
  %.not28 = icmp eq i32 %32, 0
  %33 = select i1 %.not28, ptr @.str.28, ptr @.str.27
  tail call void (ptr, ptr, ptr, ...) @_Z18throwJavaExceptionP7JNIEnv_PKcS2_z(ptr noundef nonnull %1, ptr noundef nonnull @.str.22, ptr noundef nonnull %33, ptr noundef %11)
  br label %34

34:                                               ; preds = %30, %31, %23, %27
  %.sroa.22.0.copyload = phi i64 [ %.sroa.22.0.copyload.pre, %30 ], [ %16, %31 ], [ %16, %23 ], [ %16, %27 ]
  %.sroa.01.0.copyload = phi i64 [ %.sroa.01.0.copyload.pre, %30 ], [ %14, %31 ], [ %14, %23 ], [ %14, %27 ]
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %35, i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload)
  call void @_ZN7JNIEnv_21ReleaseStringUTFCharsEP8_jstringPKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef %11)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %36, i64 %9, i64 %10)
  %37 = load ptr, ptr %5, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  ret ptr %37
}

declare { i64, i64 } @JS_GetGlobalObject(ptr noundef) local_unnamed_addr #1

declare { i64, i64 } @JS_GetPropertyStr(ptr noundef, i64, i64, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11JS_IsObject7JSValue(i64, i64) local_unnamed_addr #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #7

declare void @_ZN18InboundCallChannelC1EP9JSContextPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef, ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP18InboundCallChannelSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsUndefined7JSValue(i64, i64) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nobuiltin 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 = { inlinehint 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 = { 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 #6 = { inlinehint 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 #7 = { nobuiltin allocsize(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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 24}
!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 = !{!7, !7, i64 0}
!22 = !{!8, !8, i64 0}
!23 = !{!17, !17, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass