; 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 void @i32_store8(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load8_u(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

; 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

declare i32 @w2c_hermes_strlen(ptr noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3A0x28anonymous0x20namespace0x290x3A0x3AproxyOpFlags0x28hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3APropOpFlags0x2C0x20char0x20const0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ACallResult0x3Cbool0x2C0x200x28hermes0x3A0x3Avm0x3A0x3Adetail0x3A0x3ACallResultSpecialize0x2910x3E0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.w2c_hermes, ptr %20, i32 0, i32 3
  %22 = load i32, ptr %21, align 8, !tbaa !11
  store i32 %22, ptr %15, align 4, !tbaa !9
  store i32 48, ptr %16, align 4, !tbaa !9
  %23 = load i32, ptr %16, align 4, !tbaa !9
  %24 = load i32, ptr %15, align 4, !tbaa !9
  %25 = sub i32 %24, %23
  store i32 %25, ptr %15, align 4, !tbaa !9
  %26 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %26, ptr %13, align 4, !tbaa !9
  %27 = load i32, ptr %15, align 4, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.w2c_hermes, ptr %28, i32 0, i32 3
  store i32 %27, ptr %29, align 8, !tbaa !11
  %30 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %30, ptr %15, align 4, !tbaa !9
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.w2c_hermes, ptr %31, i32 0, i32 6
  %33 = load i32, ptr %15, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = call i32 @i32_load16_u(ptr noundef %32, i64 noundef %34)
  store i32 %35, ptr %15, align 4, !tbaa !9
  %36 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %36, ptr %14, align 4, !tbaa !9
  store i32 255, ptr %16, align 4, !tbaa !9
  %37 = load i32, ptr %16, align 4, !tbaa !9
  %38 = load i32, ptr %15, align 4, !tbaa !9
  %39 = and i32 %38, %37
  store i32 %39, ptr %15, align 4, !tbaa !9
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  %42 = xor i1 %41, true
  %43 = zext i1 %42 to i32
  store i32 %43, ptr %15, align 4, !tbaa !9
  %44 = load i32, ptr %15, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %64

46:                                               ; preds = %6
  %47 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %47, ptr %15, align 4, !tbaa !9
  %48 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %48, ptr %16, align 4, !tbaa !9
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.w2c_hermes, ptr %49, i32 0, i32 6
  %51 = load i32, ptr %16, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = add i64 %52, 1
  %54 = call i32 @i32_load8_u(ptr noundef %50, i64 noundef %53)
  store i32 %54, ptr %16, align 4, !tbaa !9
  store i32 8, ptr %17, align 4, !tbaa !9
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = and i32 %55, 31
  %57 = load i32, ptr %16, align 4, !tbaa !9
  %58 = shl i32 %57, %56
  store i32 %58, ptr %16, align 4, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.w2c_hermes, ptr %59, i32 0, i32 6
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = load i32, ptr %16, align 4, !tbaa !9
  call void @i32_store16(ptr noundef %60, i64 noundef %62, i32 noundef %63)
  br label %188

64:                                               ; preds = %6
  %65 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %65, ptr %15, align 4, !tbaa !9
  store i32 256, ptr %16, align 4, !tbaa !9
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = load i32, ptr %15, align 4, !tbaa !9
  %68 = and i32 %67, %66
  store i32 %68, ptr %15, align 4, !tbaa !9
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %64
  br label %175

72:                                               ; preds = %64
  %73 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %73, ptr %15, align 4, !tbaa !9
  store i32 1, ptr %16, align 4, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !9
  %75 = load i32, ptr %15, align 4, !tbaa !9
  %76 = and i32 %75, %74
  store i32 %76, ptr %15, align 4, !tbaa !9
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  %79 = xor i1 %78, true
  %80 = zext i1 %79 to i32
  store i32 %80, ptr %15, align 4, !tbaa !9
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %72
  br label %175

84:                                               ; preds = %72
  %85 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %85, ptr %15, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %86, ptr %16, align 4, !tbaa !9
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  %89 = xor i1 %88, true
  %90 = zext i1 %89 to i32
  store i32 %90, ptr %16, align 4, !tbaa !9
  %91 = load i32, ptr %16, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %108

93:                                               ; preds = %84
  %94 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %94, ptr %16, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.w2c_hermes, ptr %95, i32 0, i32 6
  %97 = load i32, ptr %16, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = add i64 %98, 40
  %100 = load i32, ptr %17, align 4, !tbaa !9
  call void @i32_store(ptr noundef %96, i64 noundef %99, i32 noundef %100)
  %101 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %101, ptr %16, align 4, !tbaa !9
  store i64 1, ptr %19, align 8, !tbaa !17
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.w2c_hermes, ptr %102, i32 0, i32 6
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = add i64 %105, 32
  %107 = load i64, ptr %19, align 8, !tbaa !17
  call void @i64_store(ptr noundef %103, i64 noundef %106, i64 noundef %107)
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %153

108:                                              ; preds = %84
  %109 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %109, ptr %16, align 4, !tbaa !9
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = load i32, ptr %16, align 4, !tbaa !9
  %112 = call i32 @w2c_hermes_strlen(ptr noundef %110, i32 noundef %111)
  store i32 %112, ptr %16, align 4, !tbaa !9
  %113 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %113, ptr %10, align 4, !tbaa !9
  %114 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %114, ptr %16, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.w2c_hermes, ptr %115, i32 0, i32 6
  %117 = load i32, ptr %16, align 4, !tbaa !9
  %118 = zext i32 %117 to i64
  %119 = add i64 %118, 40
  %120 = load i32, ptr %17, align 4, !tbaa !9
  call void @i32_store(ptr noundef %116, i64 noundef %119, i32 noundef %120)
  %121 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %121, ptr %16, align 4, !tbaa !9
  %122 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %122, ptr %17, align 4, !tbaa !9
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.w2c_hermes, ptr %123, i32 0, i32 6
  %125 = load i32, ptr %16, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = add i64 %126, 36
  %128 = load i32, ptr %17, align 4, !tbaa !9
  call void @i32_store(ptr noundef %124, i64 noundef %127, i32 noundef %128)
  %129 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %129, ptr %16, align 4, !tbaa !9
  store i32 1, ptr %17, align 4, !tbaa !9
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.w2c_hermes, ptr %130, i32 0, i32 6
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = add i64 %133, 32
  %135 = load i32, ptr %17, align 4, !tbaa !9
  call void @i32_store(ptr noundef %131, i64 noundef %134, i32 noundef %135)
  store i32 1, ptr %16, align 4, !tbaa !9
  %136 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %136, ptr %17, align 4, !tbaa !9
  %137 = load i32, ptr %17, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  %139 = xor i1 %138, true
  %140 = zext i1 %139 to i32
  store i32 %140, ptr %17, align 4, !tbaa !9
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %108
  br label %153

144:                                              ; preds = %108
  %145 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %145, ptr %16, align 4, !tbaa !9
  %146 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %146, ptr %17, align 4, !tbaa !9
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.w2c_hermes, ptr %147, i32 0, i32 6
  %149 = load i32, ptr %16, align 4, !tbaa !9
  %150 = zext i32 %149 to i64
  %151 = add i64 %150, 8
  %152 = load i32, ptr %17, align 4, !tbaa !9
  call void @i32_store(ptr noundef %148, i64 noundef %151, i32 noundef %152)
  store i32 3, ptr %16, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %144, %143, %93
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.w2c_hermes, ptr %154, i32 0, i32 6
  %156 = load i32, ptr %15, align 4, !tbaa !9
  %157 = zext i32 %156 to i64
  %158 = add i64 %157, 16
  %159 = load i32, ptr %16, align 4, !tbaa !9
  call void @i32_store(ptr noundef %155, i64 noundef %158, i32 noundef %159)
  %160 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %160, ptr %15, align 4, !tbaa !9
  %161 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %161, ptr %16, align 4, !tbaa !9
  %162 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %162, ptr %17, align 4, !tbaa !9
  store i32 8, ptr %18, align 4, !tbaa !9
  %163 = load i32, ptr %18, align 4, !tbaa !9
  %164 = load i32, ptr %17, align 4, !tbaa !9
  %165 = add i32 %164, %163
  store i32 %165, ptr %17, align 4, !tbaa !9
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = load i32, ptr %16, align 4, !tbaa !9
  %168 = load i32, ptr %17, align 4, !tbaa !9
  %169 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AraiseTypeError0x28hermes0x3A0x3Avm0x3A0x3ATwineChar160x20const0x260x29(ptr noundef %166, i32 noundef %167, i32 noundef %168)
  store i32 %169, ptr %16, align 4, !tbaa !9
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.w2c_hermes, ptr %170, i32 0, i32 6
  %172 = load i32, ptr %15, align 4, !tbaa !9
  %173 = zext i32 %172 to i64
  %174 = load i32, ptr %16, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %171, i64 noundef %173, i32 noundef %174)
  br label %188

175:                                              ; preds = %83, %71
  %176 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %176, ptr %15, align 4, !tbaa !9
  %177 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %177, ptr %16, align 4, !tbaa !9
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.w2c_hermes, ptr %178, i32 0, i32 6
  %180 = load i32, ptr %16, align 4, !tbaa !9
  %181 = zext i32 %180 to i64
  %182 = call i32 @i32_load(ptr noundef %179, i64 noundef %181)
  store i32 %182, ptr %16, align 4, !tbaa !9
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.w2c_hermes, ptr %183, i32 0, i32 6
  %185 = load i32, ptr %15, align 4, !tbaa !9
  %186 = zext i32 %185 to i64
  %187 = load i32, ptr %16, align 4, !tbaa !9
  call void @i32_store(ptr noundef %184, i64 noundef %186, i32 noundef %187)
  br label %188

188:                                              ; preds = %175, %153, %46
  %189 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %189, ptr %15, align 4, !tbaa !9
  store i32 48, ptr %16, align 4, !tbaa !9
  %190 = load i32, ptr %16, align 4, !tbaa !9
  %191 = load i32, ptr %15, align 4, !tbaa !9
  %192 = add i32 %191, %190
  store i32 %192, ptr %15, align 4, !tbaa !9
  %193 = load i32, ptr %15, align 4, !tbaa !9
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.w2c_hermes, ptr %194, i32 0, i32 3
  store i32 %193, ptr %195, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void
}

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AraiseTypeError0x28hermes0x3A0x3Avm0x3A0x3ATwineChar160x20const0x260x29(ptr noundef, i32 noundef, i32 noundef) #2

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, !10, i64 24}
!12 = !{!"w2c_hermes", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !16, i64 80}
!13 = !{!"", !6, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !15, i64 32}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!14, !14, 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 void @i32_store8(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; 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 i32 @i32_load8_u(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

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

declare i32 @w2c_hermes_strlen(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3A0x28anonymous0x20namespace0x290x3A0x3AproxyOpFlags0x28hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3APropOpFlags0x2C0x20char0x20const0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ACallResult0x3Cbool0x2C0x200x28hermes0x3A0x3Avm0x3A0x3Adetail0x3A0x3ACallResultSpecialize0x2910x3E0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = add i32 %8, -48
  store i32 %9, ptr %7, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = zext i32 %5 to i64
  %12 = tail call i32 @i32_load16_u(ptr noundef nonnull %10, i64 noundef %11)
  %13 = and i32 %12, 255
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %19

14:                                               ; preds = %6
  %15 = zext i32 %1 to i64
  %16 = add nuw nsw i64 %15, 1
  %17 = tail call i32 @i32_load8_u(ptr noundef nonnull %10, i64 noundef %16)
  %18 = shl i32 %17, 8
  tail call void @i32_store16(ptr noundef nonnull %10, i64 noundef %15, i32 noundef %18)
  br label %43

19:                                               ; preds = %6
  %20 = and i32 %12, 256
  %.not94 = icmp ne i32 %20, 0
  %21 = and i32 %3, 1
  %.not95 = icmp eq i32 %21, 0
  %or.cond = or i1 %.not95, %.not94
  br i1 %or.cond, label %40, label %22

22:                                               ; preds = %19
  %.not96 = icmp eq i32 %4, 0
  br i1 %.not96, label %23, label %27

23:                                               ; preds = %22
  %24 = zext i32 %9 to i64
  %25 = add nuw nsw i64 %24, 40
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %25, i32 noundef 0)
  %26 = add nuw nsw i64 %24, 32
  tail call void @i64_store(ptr noundef nonnull %10, i64 noundef %26, i64 noundef 1)
  br label %35

27:                                               ; preds = %22
  %28 = tail call i32 @w2c_hermes_strlen(ptr noundef nonnull %0, i32 noundef %4) #3
  %29 = zext i32 %9 to i64
  %30 = add nuw nsw i64 %29, 40
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %30, i32 noundef 0)
  %31 = add nuw nsw i64 %29, 36
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %31, i32 noundef %28)
  %32 = add nuw nsw i64 %29, 32
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %32, i32 noundef 1)
  %.not97 = icmp eq i32 %28, 0
  br i1 %.not97, label %35, label %33

33:                                               ; preds = %27
  %34 = add nuw nsw i64 %29, 8
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %34, i32 noundef %4)
  br label %35

35:                                               ; preds = %27, %33, %23
  %.pre-phi = phi i64 [ %29, %27 ], [ %29, %33 ], [ %24, %23 ]
  %.0 = phi i32 [ 1, %27 ], [ 3, %33 ], [ 1, %23 ]
  %36 = add nuw nsw i64 %.pre-phi, 16
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %36, i32 noundef %.0)
  %37 = add i32 %8, -40
  %38 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AraiseTypeError0x28hermes0x3A0x3Avm0x3A0x3ATwineChar160x20const0x260x29(ptr noundef nonnull %0, i32 noundef %2, i32 noundef %37) #3
  %39 = zext i32 %1 to i64
  tail call void @i32_store8(ptr noundef nonnull %10, i64 noundef %39, i32 noundef %38)
  br label %43

40:                                               ; preds = %19
  %41 = tail call i32 @i32_load(ptr noundef nonnull %10, i64 noundef %11)
  %42 = zext i32 %1 to i64
  tail call void @i32_store(ptr noundef nonnull %10, i64 noundef %42, i32 noundef %41)
  br label %43

43:                                               ; preds = %40, %35, %14
  store i32 %8, ptr %7, align 8, !tbaa !5
  ret void
}

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AraiseTypeError0x28hermes0x3A0x3Avm0x3A0x3ATwineChar160x20const0x260x29(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"w2c_hermes", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 40, !14, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12}


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