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

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

; 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: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsException7JSValue(i64, i64) #1

; 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

; 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)) #3 align 2

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

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

51:                                               ; preds = %4
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %21, ptr noundef %52, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %53 = getelementptr inbounds %class.Context, ptr %21, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !22
  %55 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %56 = load i64, ptr %55, align 8
  %57 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %58 = load i64, ptr %57, align 8
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %54, i64 %56, i64 %58)
  store ptr null, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %101

59:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %60 = getelementptr inbounds %class.Context, ptr %21, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !22
  %62 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %65 = load i64, ptr %64, align 8
  %66 = call ptr @JS_WriteObject(ptr noundef %61, ptr noundef %16, i64 %63, i64 %65, i32 noundef 9)
  store ptr %66, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %77

69:                                               ; preds = %59
  %70 = load i64, ptr %16, align 8, !tbaa !24
  %71 = icmp ugt i64 %70, 0
  br i1 %71, label %72, label %77

72:                                               ; preds = %69
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load i64, ptr %16, align 8, !tbaa !24
  %75 = trunc i64 %74 to i32
  %76 = call noundef ptr @_ZN7JNIEnv_12NewByteArrayEi(ptr noundef nonnull align 8 dereferenceable(8) %73, i32 noundef %75)
  br label %78

77:                                               ; preds = %69, %59
  br label %78

78:                                               ; preds = %77, %72
  %79 = phi ptr [ %76, %72 ], [ null, %77 ]
  store ptr %79, ptr %19, align 8, !tbaa !5
  %80 = load ptr, ptr %19, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %88

82:                                               ; preds = %78
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = load ptr, ptr %19, align 8, !tbaa !5
  %85 = load i64, ptr %16, align 8, !tbaa !24
  %86 = trunc i64 %85 to i32
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN7JNIEnv_18SetByteArrayRegionEP11_jbyteArrayiiPKa(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef %84, i32 noundef 0, i32 noundef %86, ptr noundef %87)
  br label %90

88:                                               ; preds = %78
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %21, ptr noundef %89, ptr noundef nonnull align 8 dereferenceable(16) %12)
  br label %90

90:                                               ; preds = %88, %82
  %91 = getelementptr inbounds %class.Context, ptr %21, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !22
  %93 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %94 = load i64, ptr %93, align 8
  %95 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %96 = load i64, ptr %95, align 8
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %92, i64 %94, i64 %96)
  %97 = getelementptr inbounds %class.Context, ptr %21, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  call void @js_free(ptr noundef %98, ptr noundef %99)
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %100, ptr %5, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %101

101:                                              ; preds = %90, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %102 = load ptr, ptr %5, align 8
  ret ptr %102
}

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

declare { i64, i64 } @JS_Eval(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) #5

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

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

declare ptr @JS_WriteObject(ptr noundef, ptr noundef, i64, i64, i32 noundef) #5

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

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

declare void @js_free(ptr noundef, ptr noundef) #5

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

!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 32}
!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 }

; 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: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14JS_IsException7JSValue(i64, i64) local_unnamed_addr #1

; 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 #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7Context7compileEP7JNIEnv_P8_jstringS3_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %struct.JSValue, align 8
  %6 = alloca i64, align 8
  %7 = tail call noundef ptr @_ZN7JNIEnv_17GetStringUTFCharsEP8_jstringPh(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef null)
  %8 = tail call noundef ptr @_ZN7JNIEnv_17GetStringUTFCharsEP8_jstringPh(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %3, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #7
  %12 = tail call { i64, i64 } @JS_Eval(ptr noundef %10, ptr noundef %7, i64 noundef %11, ptr noundef %8, i32 noundef 40)
  %13 = extractvalue { i64, i64 } %12, 0
  store i64 %13, ptr %5, align 8
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = extractvalue { i64, i64 } %12, 1
  store i64 %15, ptr %14, align 8
  tail call void @_ZN7JNIEnv_21ReleaseStringUTFCharsEP8_jstringPKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %3, ptr noundef %8)
  tail call void @_ZN7JNIEnv_21ReleaseStringUTFCharsEP8_jstringPKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef %7)
  %16 = tail call noundef i32 @_ZL14JS_IsException7JSValue(i64 %13, i64 %15)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %19, label %17

17:                                               ; preds = %4
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %.sroa.09.0.copyload = load i64, ptr %5, align 8, !tbaa !21
  %.sroa.210.0.copyload = load i64, ptr %14, align 8, !tbaa !22
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %18, i64 %.sroa.09.0.copyload, i64 %.sroa.210.0.copyload)
  br label %35

19:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %6, align 8, !tbaa !22
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = call ptr @JS_WriteObject(ptr noundef %20, ptr noundef nonnull %6, i64 %13, i64 %15, i32 noundef 9)
  %22 = icmp ne ptr %21, null
  %23 = load i64, ptr %6, align 8
  %24 = icmp ne i64 %23, 0
  %or.cond = select i1 %22, i1 %24, i1 false
  br i1 %or.cond, label %25, label %.thread

25:                                               ; preds = %19
  %26 = trunc i64 %23 to i32
  %27 = call noundef ptr @_ZN7JNIEnv_12NewByteArrayEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %26)
  %.not34 = icmp eq ptr %27, null
  br i1 %.not34, label %.thread, label %28

28:                                               ; preds = %25
  %29 = load i64, ptr %6, align 8, !tbaa !22
  %30 = trunc i64 %29 to i32
  call void @_ZN7JNIEnv_18SetByteArrayRegionEP11_jbyteArrayiiPKa(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %27, i32 noundef 0, i32 noundef %30, ptr noundef nonnull %21)
  br label %31

.thread:                                          ; preds = %19, %25
  call void @_ZNK7Context16throwJsExceptionEP7JNIEnv_RK7JSValue(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %5)
  br label %31

31:                                               ; preds = %.thread, %28
  %32 = phi ptr [ null, %.thread ], [ %27, %28 ]
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %.sroa.0.0.copyload = load i64, ptr %5, align 8, !tbaa !21
  %.sroa.2.0.copyload = load i64, ptr %14, align 8, !tbaa !22
  call void @_ZL12JS_FreeValueP9JSContext7JSValue(ptr noundef %33, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  call void @js_free(ptr noundef %34, ptr noundef %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %35

35:                                               ; preds = %31, %17
  %.0 = phi ptr [ null, %17 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  ret ptr %.0
}

; 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 #2 align 2

declare { i64, i64 } @JS_Eval(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; 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 #2 align 2

declare ptr @JS_WriteObject(ptr noundef, ptr noundef, i64, i64, i32 noundef) local_unnamed_addr #4

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

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

declare void @js_free(ptr noundef, ptr noundef) local_unnamed_addr #4

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

!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 32}
!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 = !{!17, !17, i64 0}


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