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

; 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

declare i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef) #2

; 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
declare dso_local i32 @w2c_hermes_sigfillset(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_sigprocmask(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_llvh0x3A0x3Asys0x3A0x3AProcess0x3A0x3ASafelyCloseFileDescriptor0x28int0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %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 i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.w2c_hermes, ptr %13, i32 0, i32 3
  %15 = load i32, ptr %14, align 8, !tbaa !11
  store i32 %15, ptr %10, align 4, !tbaa !9
  store i32 256, ptr %11, align 4, !tbaa !9
  %16 = load i32, ptr %11, align 4, !tbaa !9
  %17 = load i32, ptr %10, align 4, !tbaa !9
  %18 = sub i32 %17, %16
  store i32 %18, ptr %10, align 4, !tbaa !9
  %19 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %19, ptr %7, align 4, !tbaa !9
  %20 = load i32, ptr %10, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.w2c_hermes, ptr %21, i32 0, i32 3
  store i32 %20, ptr %22, align 8, !tbaa !11
  %23 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %23, ptr %10, align 4, !tbaa !9
  store i32 128, ptr %11, align 4, !tbaa !9
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = add i32 %25, %24
  store i32 %26, ptr %10, align 4, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = call i32 @w2c_hermes_sigfillset(ptr noundef %27, i32 noundef %28)
  store i32 %29, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  %33 = zext i1 %32 to i32
  store i32 %33, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %61

36:                                               ; preds = %3
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef %37)
  store i32 %38, ptr %10, align 4, !tbaa !9
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.w2c_hermes, ptr %39, i32 0, i32 6
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = call i32 @i32_load(ptr noundef %40, i64 noundef %42)
  store i32 %43, ptr %10, align 4, !tbaa !9
  %44 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %44, ptr %6, align 4, !tbaa !9
  %45 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %45, ptr %10, align 4, !tbaa !9
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef %46)
  store i32 %47, ptr %11, align 4, !tbaa !9
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.w2c_hermes, ptr %48, i32 0, i32 6
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = add i64 %51, 4
  %53 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %49, i64 noundef %52, i32 noundef %53)
  %54 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %54, ptr %10, align 4, !tbaa !9
  %55 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %55, ptr %11, align 4, !tbaa !9
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.w2c_hermes, ptr %56, i32 0, i32 6
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %57, i64 noundef %59, i32 noundef %60)
  br label %184

61:                                               ; preds = %3
  store i32 2, ptr %10, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %62, ptr %11, align 4, !tbaa !9
  store i32 128, ptr %12, align 4, !tbaa !9
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = add i32 %64, %63
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %66, ptr %12, align 4, !tbaa !9
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = call i32 @w2c_hermes_sigprocmask(ptr noundef %67, i32 noundef %68, i32 noundef %69, i32 noundef %70)
  store i32 %71, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = icmp slt i32 %72, %73
  %75 = zext i1 %74 to i32
  store i32 %75, ptr %10, align 4, !tbaa !9
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %103

78:                                               ; preds = %61
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef %79)
  store i32 %80, ptr %10, align 4, !tbaa !9
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.w2c_hermes, ptr %81, i32 0, i32 6
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = call i32 @i32_load(ptr noundef %82, i64 noundef %84)
  store i32 %85, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %86, ptr %6, align 4, !tbaa !9
  %87 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %87, ptr %10, align 4, !tbaa !9
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef %88)
  store i32 %89, ptr %11, align 4, !tbaa !9
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.w2c_hermes, ptr %90, i32 0, i32 6
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = add i64 %93, 4
  %95 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %91, i64 noundef %94, i32 noundef %95)
  %96 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %97, ptr %11, align 4, !tbaa !9
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.w2c_hermes, ptr %98, i32 0, i32 6
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = zext i32 %100 to i64
  %102 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %99, i64 noundef %101, i32 noundef %102)
  br label %184

103:                                              ; preds = %61
  %104 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %104, ptr %10, align 4, !tbaa !9
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = call i32 @w2c_hermes_close(ptr noundef %105, i32 noundef %106)
  store i32 %107, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = icmp slt i32 %108, %109
  %111 = zext i1 %110 to i32
  store i32 %111, ptr %10, align 4, !tbaa !9
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %123

114:                                              ; preds = %103
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef %115)
  store i32 %116, ptr %10, align 4, !tbaa !9
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.w2c_hermes, ptr %117, i32 0, i32 6
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = zext i32 %119 to i64
  %121 = call i32 @i32_load(ptr noundef %118, i64 noundef %120)
  store i32 %121, ptr %10, align 4, !tbaa !9
  %122 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %122, ptr %8, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %114, %103
  store i32 2, ptr %10, align 4, !tbaa !9
  %124 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %124, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = load i32, ptr %11, align 4, !tbaa !9
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = call i32 @w2c_hermes_sigprocmask(ptr noundef %125, i32 noundef %126, i32 noundef %127, i32 noundef %128)
  store i32 %129, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  %130 = load i32, ptr %10, align 4, !tbaa !9
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = icmp slt i32 %130, %131
  %133 = zext i1 %132 to i32
  store i32 %133, ptr %10, align 4, !tbaa !9
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %145

136:                                              ; preds = %123
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef %137)
  store i32 %138, ptr %10, align 4, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.w2c_hermes, ptr %139, i32 0, i32 6
  %141 = load i32, ptr %10, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = call i32 @i32_load(ptr noundef %140, i64 noundef %142)
  store i32 %143, ptr %10, align 4, !tbaa !9
  %144 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %144, ptr %9, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %136, %123
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef %146)
  store i32 %147, ptr %10, align 4, !tbaa !9
  %148 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %148, ptr %6, align 4, !tbaa !9
  %149 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %149, ptr %10, align 4, !tbaa !9
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %168

152:                                              ; preds = %145
  %153 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %153, ptr %10, align 4, !tbaa !9
  %154 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %154, ptr %11, align 4, !tbaa !9
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.w2c_hermes, ptr %155, i32 0, i32 6
  %157 = load i32, ptr %10, align 4, !tbaa !9
  %158 = zext i32 %157 to i64
  %159 = add i64 %158, 4
  %160 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %156, i64 noundef %159, i32 noundef %160)
  %161 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %161, ptr %10, align 4, !tbaa !9
  %162 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %162, ptr %11, align 4, !tbaa !9
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.w2c_hermes, ptr %163, i32 0, i32 6
  %165 = load i32, ptr %10, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %164, i64 noundef %166, i32 noundef %167)
  br label %184

168:                                              ; preds = %145
  %169 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %169, ptr %10, align 4, !tbaa !9
  %170 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %170, ptr %11, align 4, !tbaa !9
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.w2c_hermes, ptr %171, i32 0, i32 6
  %173 = load i32, ptr %10, align 4, !tbaa !9
  %174 = zext i32 %173 to i64
  %175 = add i64 %174, 4
  %176 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %172, i64 noundef %175, i32 noundef %176)
  %177 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %177, ptr %10, align 4, !tbaa !9
  %178 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %178, ptr %11, align 4, !tbaa !9
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.w2c_hermes, ptr %179, i32 0, i32 6
  %181 = load i32, ptr %10, align 4, !tbaa !9
  %182 = zext i32 %181 to i64
  %183 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %180, i64 noundef %182, i32 noundef %183)
  br label %184

184:                                              ; preds = %168, %152, %78, %36
  %185 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %185, ptr %10, align 4, !tbaa !9
  store i32 256, ptr %11, align 4, !tbaa !9
  %186 = load i32, ptr %11, align 4, !tbaa !9
  %187 = load i32, ptr %10, align 4, !tbaa !9
  %188 = add i32 %187, %186
  store i32 %188, ptr %10, align 4, !tbaa !9
  %189 = load i32, ptr %10, align 4, !tbaa !9
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.w2c_hermes, ptr %190, i32 0, i32 3
  store i32 %189, ptr %191, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret void
}

declare i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef) #2

declare i32 @w2c_hermes_close(ptr 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}


; 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

declare i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_sigfillset(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_sigprocmask(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_llvh0x3A0x3Asys0x3A0x3AProcess0x3A0x3ASafelyCloseFileDescriptor0x28int0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = add i32 %5, -256
  store i32 %6, ptr %4, align 8, !tbaa !5
  %7 = add i32 %5, -128
  %8 = tail call i32 @w2c_hermes_sigfillset(ptr noundef %0, i32 noundef %7)
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %10, label %18

10:                                               ; preds = %3
  %11 = tail call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef nonnull %0) #3
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  %13 = zext i32 %11 to i64
  %14 = tail call i32 @i32_load(ptr noundef nonnull %12, i64 noundef %13)
  %15 = tail call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef nonnull %0) #3
  %16 = zext i32 %1 to i64
  %17 = add nuw nsw i64 %16, 4
  tail call void @i32_store(ptr noundef nonnull %12, i64 noundef %17, i32 noundef %15)
  tail call void @i32_store(ptr noundef nonnull %12, i64 noundef %16, i32 noundef %14)
  br label %52

18:                                               ; preds = %3
  %19 = tail call i32 @w2c_hermes_sigprocmask(ptr noundef nonnull %0, i32 noundef 2, i32 noundef %7, i32 noundef %6)
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %21, label %29

21:                                               ; preds = %18
  %22 = tail call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef nonnull %0) #3
  %23 = getelementptr inbounds i8, ptr %0, i64 40
  %24 = zext i32 %22 to i64
  %25 = tail call i32 @i32_load(ptr noundef nonnull %23, i64 noundef %24)
  %26 = tail call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef nonnull %0) #3
  %27 = zext i32 %1 to i64
  %28 = add nuw nsw i64 %27, 4
  tail call void @i32_store(ptr noundef nonnull %23, i64 noundef %28, i32 noundef %26)
  tail call void @i32_store(ptr noundef nonnull %23, i64 noundef %27, i32 noundef %25)
  br label %52

29:                                               ; preds = %18
  %30 = tail call i32 @w2c_hermes_close(ptr noundef nonnull %0, i32 noundef %2) #3
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = tail call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef nonnull %0) #3
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  %35 = zext i32 %33 to i64
  %36 = tail call i32 @i32_load(ptr noundef nonnull %34, i64 noundef %35)
  br label %37

37:                                               ; preds = %32, %29
  %.0103 = phi i32 [ %36, %32 ], [ 0, %29 ]
  %38 = tail call i32 @w2c_hermes_sigprocmask(ptr noundef nonnull %0, i32 noundef 2, i32 noundef %6, i32 noundef 0)
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %37
  %41 = tail call i32 @w2c_hermes_0x5F_errno_location_0(ptr noundef nonnull %0) #3
  %42 = getelementptr inbounds i8, ptr %0, i64 40
  %43 = zext i32 %41 to i64
  %44 = tail call i32 @i32_load(ptr noundef nonnull %42, i64 noundef %43)
  br label %45

45:                                               ; preds = %40, %37
  %.0 = phi i32 [ %44, %40 ], [ 0, %37 ]
  %46 = tail call i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef nonnull %0) #3
  %.not = icmp eq i32 %.0103, 0
  %47 = getelementptr inbounds i8, ptr %0, i64 40
  %48 = zext i32 %1 to i64
  %49 = add nuw nsw i64 %48, 4
  tail call void @i32_store(ptr noundef nonnull %47, i64 noundef %49, i32 noundef %46)
  br i1 %.not, label %51, label %50

50:                                               ; preds = %45
  tail call void @i32_store(ptr noundef nonnull %47, i64 noundef %48, i32 noundef %.0103)
  br label %52

51:                                               ; preds = %45
  tail call void @i32_store(ptr noundef nonnull %47, i64 noundef %48, i32 noundef %.0)
  br label %52

52:                                               ; preds = %51, %50, %21, %10
  store i32 %5, ptr %4, align 8, !tbaa !5
  ret void
}

declare i32 @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Ageneric_category0x280x29(ptr noundef) local_unnamed_addr #1

declare i32 @w2c_hermes_close(ptr 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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass