; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_opt_compiled_2)

; 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.w2c_hermes = type { ptr, ptr, ptr, i32, i32, i32, %struct.wasm_rt_memory_t, %struct.wasm_rt_funcref_table_t }
%struct.wasm_rt_memory_t = type { ptr, i64, i64, i64, i8 }
%struct.wasm_rt_funcref_table_t = type { ptr, i32, i32 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store16(ptr noundef, i64 noundef, i32 noundef) #1

declare void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Aplatform_unicode0x3A0x3AdateFormat0x28double0x2C0x20bool0x2C0x20bool0x2C0x20llvh0x3A0x3ASmallVectorImpl0x3Cchar16_t0x3E0x260x29(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %12 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %12, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.w2c_hermes, ptr %13, i32 0, i32 6
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = zext i32 %15 to i64
  %17 = add i64 %16, 4
  %18 = load i32, ptr %8, align 4, !tbaa !9
  call void @i32_store(ptr noundef %14, i64 noundef %17, i32 noundef %18)
  %19 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %19, ptr %7, align 4, !tbaa !9
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.w2c_hermes, ptr %20, i32 0, i32 6
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  %24 = add i64 %23, 8
  %25 = call i32 @i32_load(ptr noundef %21, i64 noundef %24)
  store i32 %25, ptr %7, align 4, !tbaa !9
  store i32 26, ptr %8, align 4, !tbaa !9
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = icmp ule i32 %26, %27
  %29 = zext i1 %28 to i32
  store i32 %29, ptr %7, align 4, !tbaa !9
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %51

32:                                               ; preds = %2
  %33 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %33, ptr %7, align 4, !tbaa !9
  %34 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %34, ptr %8, align 4, !tbaa !9
  store i32 12, ptr %9, align 4, !tbaa !9
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = add i32 %36, %35
  store i32 %37, ptr %8, align 4, !tbaa !9
  store i32 27, ptr %9, align 4, !tbaa !9
  store i32 2, ptr %10, align 4, !tbaa !9
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %10, align 4, !tbaa !9
  call void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef %38, i32 noundef %39, i32 noundef %40, i32 noundef %41, i32 noundef %42)
  %43 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %43, ptr %7, align 4, !tbaa !9
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.w2c_hermes, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = add i64 %47, 4
  %49 = call i32 @i32_load(ptr noundef %45, i64 noundef %48)
  store i32 %49, ptr %7, align 4, !tbaa !9
  %50 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %50, ptr %6, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %32, %2
  %52 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %52, ptr %7, align 4, !tbaa !9
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.w2c_hermes, ptr %53, i32 0, i32 6
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = call i32 @i32_load(ptr noundef %54, i64 noundef %56)
  store i32 %57, ptr %7, align 4, !tbaa !9
  %58 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %58, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = and i32 %59, 31
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = shl i32 %61, %60
  store i32 %62, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = add i32 %64, %63
  store i32 %65, ptr %7, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %66, ptr %5, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.w2c_hermes, ptr %67, i32 0, i32 6
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = add i64 %70, 52
  %72 = load i32, ptr %8, align 4, !tbaa !9
  call void @i32_store16(ptr noundef %68, i64 noundef %71, i32 noundef %72)
  %73 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %73, ptr %7, align 4, !tbaa !9
  store i32 6553701, ptr %8, align 4, !tbaa !9
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.w2c_hermes, ptr %74, i32 0, i32 6
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = add i64 %77, 48
  %79 = load i32, ptr %8, align 4, !tbaa !9
  call void @i32_store(ptr noundef %75, i64 noundef %78, i32 noundef %79)
  %80 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %80, ptr %7, align 4, !tbaa !9
  store i64 32651569751457901, ptr %11, align 8, !tbaa !11
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.w2c_hermes, ptr %81, i32 0, i32 6
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = add i64 %84, 40
  %86 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %82, i64 noundef %85, i64 noundef %86)
  %87 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %87, ptr %7, align 4, !tbaa !9
  store i64 28429436511584365, ptr %11, align 8, !tbaa !11
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.w2c_hermes, ptr %88, i32 0, i32 6
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = add i64 %91, 32
  %93 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %89, i64 noundef %92, i64 noundef %93)
  %94 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %94, ptr %7, align 4, !tbaa !9
  store i64 29555010001174639, ptr %11, align 8, !tbaa !11
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.w2c_hermes, ptr %95, i32 0, i32 6
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = add i64 %98, 24
  %100 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %96, i64 noundef %99, i64 noundef %100)
  %101 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %101, ptr %7, align 4, !tbaa !9
  store i64 30962384884727905, ptr %11, align 8, !tbaa !11
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.w2c_hermes, ptr %102, i32 0, i32 6
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = add i64 %105, 16
  %107 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %103, i64 noundef %106, i64 noundef %107)
  %108 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %108, ptr %7, align 4, !tbaa !9
  store i64 30681262095007814, ptr %11, align 8, !tbaa !11
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.w2c_hermes, ptr %109, i32 0, i32 6
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = add i64 %112, 8
  %114 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %110, i64 noundef %113, i64 noundef %114)
  %115 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %115, ptr %7, align 4, !tbaa !9
  store i64 28429470870339684, ptr %11, align 8, !tbaa !11
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.w2c_hermes, ptr %116, i32 0, i32 6
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = zext i32 %118 to i64
  %120 = load i64, ptr %11, align 8, !tbaa !11
  call void @i64_store(ptr noundef %117, i64 noundef %119, i64 noundef %120)
  %121 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %121, ptr %7, align 4, !tbaa !9
  %122 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %122, ptr %8, align 4, !tbaa !9
  store i32 27, ptr %9, align 4, !tbaa !9
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = add i32 %124, %123
  store i32 %125, ptr %8, align 4, !tbaa !9
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.w2c_hermes, ptr %126, i32 0, i32 6
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = zext i32 %128 to i64
  %130 = add i64 %129, 4
  %131 = load i32, ptr %8, align 4, !tbaa !9
  call void @i32_store(ptr noundef %127, i64 noundef %130, i32 noundef %131)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, 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"

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store16(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

declare void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Aplatform_unicode0x3A0x3AdateFormat0x28double0x2C0x20bool0x2C0x20bool0x2C0x20llvh0x3A0x3ASmallVectorImpl0x3Cchar16_t0x3E0x260x29(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  %4 = zext i32 %1 to i64
  %5 = add nuw nsw i64 %4, 4
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %5, i32 noundef 0)
  %6 = add nuw nsw i64 %4, 8
  %7 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %6)
  %8 = icmp ult i32 %7, 27
  br i1 %8, label %9, label %12

9:                                                ; preds = %2
  %10 = add i32 %1, 12
  tail call void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef %0, i32 noundef %1, i32 noundef %10, i32 noundef 27, i32 noundef 2) #3
  %11 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %5)
  br label %12

12:                                               ; preds = %9, %2
  %.0 = phi i32 [ %11, %9 ], [ 0, %2 ]
  %13 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %4)
  %14 = shl i32 %.0, 1
  %15 = add i32 %13, %14
  %16 = zext i32 %15 to i64
  %17 = add nuw nsw i64 %16, 52
  tail call void @i32_store16(ptr noundef nonnull %3, i64 noundef %17, i32 noundef 0)
  %18 = add nuw nsw i64 %16, 48
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %18, i32 noundef 6553701)
  %19 = add nuw nsw i64 %16, 40
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %19, i64 noundef 32651569751457901)
  %20 = add nuw nsw i64 %16, 32
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %20, i64 noundef 28429436511584365)
  %21 = add nuw nsw i64 %16, 24
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %21, i64 noundef 29555010001174639)
  %22 = add nuw nsw i64 %16, 16
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %22, i64 noundef 30962384884727905)
  %23 = add nuw nsw i64 %16, 8
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %23, i64 noundef 30681262095007814)
  tail call void @i64_store(ptr noundef nonnull %3, i64 noundef %16, i64 noundef 28429470870339684)
  %24 = add i32 %.0, 27
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %5, i32 noundef %24)
  ret void
}

attributes #0 = { inlinehint 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 #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 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 = { 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)"}


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