; LLVM IR from huawei-noah/bolt :: common/model_spec/src (model_deserialize)

; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.ModelSpec = type { i32, i32, [128 x i8], i32, i32, ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr }
%struct.ModelFileDescriptor = type { ptr, i64, i8, i32 }

@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) #1

declare i32 @printf(ptr noundef, ...) #2

declare i32 @fflush(ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z9mt_mallocj(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17deserialize_modelPKhP9ModelSpec8DataType(ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef %0, ptr noundef %1, i32 noundef %2, i1 noundef zeroext %3) #5 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.stat, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %14 = zext i1 %3 to i8
  store i8 %14, ptr %8, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 51, ptr %9, align 4, !tbaa !13
  %15 = call noundef ptr @_Z9mt_mallocj(i32 noundef 24)
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.ModelSpec, ptr %16, i32 0, i32 15
  store ptr %15, ptr %17, align 8, !tbaa !15
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ModelSpec, ptr %18, i32 0, i32 15
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  call void @_Z10UNI_MEMSETPvim(ptr noundef %20, i32 noundef 0, i64 noundef 24)
  %21 = load i8, ptr %8, align 1, !tbaa !11, !range !18, !noundef !19
  %22 = trunc i8 %21 to i1
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ModelSpec, ptr %23, i32 0, i32 15
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  %26 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %25, i32 0, i32 2
  %27 = zext i1 %22 to i8
  store i8 %27, ptr %26, align 8, !tbaa !20
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ModelSpec, ptr %28, i32 0, i32 15
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %30, i32 0, i32 2
  %32 = load i8, ptr %31, align 8, !tbaa !20, !range !18, !noundef !19
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %44

34:                                               ; preds = %4
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ModelSpec, ptr %36, i32 0, i32 15
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %38, i32 0, i32 0
  store ptr %35, ptr %39, align 8, !tbaa !23
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ModelSpec, ptr %40, i32 0, i32 15
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %42, i32 0, i32 1
  store i64 2147483647, ptr %43, align 8, !tbaa !24
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %127

44:                                               ; preds = %4
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 (ptr, i32, ...) @open(ptr noundef %45, i32 noundef 0)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ModelSpec, ptr %47, i32 0, i32 15
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  %50 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %49, i32 0, i32 3
  store i32 %46, ptr %50, align 4, !tbaa !25
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ModelSpec, ptr %51, i32 0, i32 15
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %53, i32 0, i32 3
  %55 = load i32, ptr %54, align 4, !tbaa !25
  %56 = icmp eq i32 -1, %55
  br i1 %56, label %57, label %68

57:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %58 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %10, align 4, !tbaa !26
  %60 = load i32, ptr %10, align 4, !tbaa !26
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %60)
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 @fflush(ptr noundef %62)
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %64)
  %66 = load ptr, ptr @stdout, align 8, !tbaa !5
  %67 = call i32 @fflush(ptr noundef %66)
  call void @exit(i32 noundef 1) #8
  unreachable

68:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 144, ptr %11) #7
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ModelSpec, ptr %69, i32 0, i32 15
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 4, !tbaa !25
  %74 = call i32 @fstat(i32 noundef %73, ptr noundef %11) #7
  %75 = icmp eq i32 -1, %74
  br i1 %75, label %76, label %87

76:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %77 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr %12, align 4, !tbaa !26
  %79 = load i32, ptr %12, align 4, !tbaa !26
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %79)
  %81 = load ptr, ptr @stdout, align 8, !tbaa !5
  %82 = call i32 @fflush(ptr noundef %81)
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %83)
  %85 = load ptr, ptr @stdout, align 8, !tbaa !5
  %86 = call i32 @fflush(ptr noundef %85)
  call void @exit(i32 noundef 1) #8
  unreachable

87:                                               ; preds = %68
  %88 = getelementptr inbounds %struct.stat, ptr %11, i32 0, i32 8
  %89 = load i64, ptr %88, align 8, !tbaa !27
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ModelSpec, ptr %90, i32 0, i32 15
  %92 = load ptr, ptr %91, align 8, !tbaa !15
  %93 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %92, i32 0, i32 1
  store i64 %89, ptr %93, align 8, !tbaa !24
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ModelSpec, ptr %94, i32 0, i32 15
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  %97 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !24
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ModelSpec, ptr %99, i32 0, i32 15
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %102, align 4, !tbaa !25
  %104 = call ptr @mmap(ptr noundef null, i64 noundef %98, i32 noundef 1, i32 noundef 1, i32 noundef %103, i64 noundef 0) #7
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ModelSpec, ptr %105, i32 0, i32 15
  %107 = load ptr, ptr %106, align 8, !tbaa !15
  %108 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %107, i32 0, i32 0
  store ptr %104, ptr %108, align 8, !tbaa !23
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ModelSpec, ptr %109, i32 0, i32 15
  %111 = load ptr, ptr %110, align 8, !tbaa !15
  %112 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !23
  %114 = icmp eq ptr inttoptr (i64 -1 to ptr), %113
  br i1 %114, label %115, label %126

115:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %116 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %13, align 4, !tbaa !26
  %118 = load i32, ptr %13, align 4, !tbaa !26
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %118)
  %120 = load ptr, ptr @stdout, align 8, !tbaa !5
  %121 = call i32 @fflush(ptr noundef %120)
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %122)
  %124 = load ptr, ptr @stdout, align 8, !tbaa !5
  %125 = call i32 @fflush(ptr noundef %124)
  call void @exit(i32 noundef 1) #8
  unreachable

126:                                              ; preds = %87
  call void @llvm.lifetime.end.p0(i64 144, ptr %11) #7
  br label %127

127:                                              ; preds = %126, %34
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ModelSpec, ptr %128, i32 0, i32 15
  %130 = load ptr, ptr %129, align 8, !tbaa !15
  %131 = getelementptr inbounds %struct.ModelFileDescriptor, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !23
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = call noundef i32 @_Z17deserialize_modelPKhP9ModelSpec8DataType(ptr noundef %132, ptr noundef %133, i32 noundef %134)
  store i32 %135, ptr %9, align 4, !tbaa !13
  %136 = load i32, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret i32 %136
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10UNI_MEMSETPvim(ptr noundef, i32 noundef, i64 noundef) #6

declare i32 @open(ptr noundef, i32 noundef, ...) #2

; Function Attrs: nounwind
declare i32 @fstat(i32 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn 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 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 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 #7 = { nounwind }
attributes #8 = { noreturn 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, !10, i64 0}
!10 = !{!"_ZTS8DataType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS2EE", !7, i64 0}
!15 = !{!16, !6, i64 224}
!16 = !{!"_ZTS9ModelSpec", !17, i64 0, !17, i64 4, !7, i64 8, !10, i64 136, !17, i64 140, !6, i64 144, !6, i64 152, !17, i64 160, !6, i64 168, !17, i64 176, !6, i64 184, !17, i64 192, !6, i64 200, !17, i64 208, !6, i64 216, !6, i64 224}
!17 = !{!"int", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !12, i64 16}
!21 = !{!"_ZTS19ModelFileDescriptor", !6, i64 0, !22, i64 8, !12, i64 16, !17, i64 20}
!22 = !{!"long", !7, i64 0}
!23 = !{!21, !6, i64 0}
!24 = !{!21, !22, i64 8}
!25 = !{!21, !17, i64 20}
!26 = !{!17, !17, i64 0}
!27 = !{!28, !22, i64 48}
!28 = !{!"_ZTS4stat", !22, i64 0, !22, i64 8, !22, i64 16, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !22, i64 40, !22, i64 48, !22, i64 56, !22, i64 64, !29, i64 72, !29, i64 88, !29, i64 104, !7, i64 120}
!29 = !{!"_ZTS8timespec", !22, i64 0, !22, i64 8}


; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z9mt_mallocj(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17deserialize_modelPKhP9ModelSpec8DataType(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z27deserialize_model_from_filePKcP9ModelSpec8DataTypeb(ptr noundef %0, ptr noundef %1, i32 noundef %2, i1 noundef zeroext %3) local_unnamed_addr #5 {
  %5 = alloca %struct.stat, align 8
  %6 = zext i1 %3 to i8
  %7 = tail call noundef ptr @_Z9mt_mallocj(i32 noundef 24)
  %8 = getelementptr inbounds i8, ptr %1, i64 224
  store ptr %7, ptr %8, align 8, !tbaa !5
  tail call void @_Z10UNI_MEMSETPvim(ptr noundef %7, i32 noundef 0, i64 noundef 24)
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store i8 %6, ptr %10, align 8, !tbaa !12
  br i1 %3, label %11, label %13

11:                                               ; preds = %4
  store ptr %0, ptr %9, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %9, i64 8
  store i64 2147483647, ptr %12, align 8, !tbaa !17
  br label %59

13:                                               ; preds = %4
  %14 = tail call i32 (ptr, i32, ...) @open(ptr noundef %0, i32 noundef 0)
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 20
  store i32 %14, ptr %16, align 4, !tbaa !18
  %17 = icmp eq i32 %14, -1
  br i1 %17, label %18, label %27

18:                                               ; preds = %13
  %19 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %20 = trunc i64 %19 to i32
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !19
  %23 = tail call i32 @fflush(ptr noundef %22)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %0)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !19
  %26 = tail call i32 @fflush(ptr noundef %25)
  tail call void @exit(i32 noundef 1) #9
  unreachable

27:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %5) #8
  %28 = call i32 @fstat(i32 noundef %14, ptr noundef nonnull %5) #8
  %29 = icmp eq i32 %28, -1
  br i1 %29, label %30, label %39

30:                                               ; preds = %27
  %31 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %32 = trunc i64 %31 to i32
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %32)
  %34 = load ptr, ptr @stdout, align 8, !tbaa !19
  %35 = tail call i32 @fflush(ptr noundef %34)
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %0)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !19
  %38 = tail call i32 @fflush(ptr noundef %37)
  tail call void @exit(i32 noundef 1) #9
  unreachable

39:                                               ; preds = %27
  %40 = getelementptr inbounds i8, ptr %5, i64 48
  %41 = load i64, ptr %40, align 8, !tbaa !20
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  store i64 %41, ptr %43, align 8, !tbaa !17
  %44 = getelementptr inbounds i8, ptr %42, i64 20
  %45 = load i32, ptr %44, align 4, !tbaa !18
  %46 = tail call ptr @mmap(ptr noundef null, i64 noundef %41, i32 noundef 1, i32 noundef 1, i32 noundef %45, i64 noundef 0) #8
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %46, ptr %47, align 8, !tbaa !16
  %48 = icmp eq ptr %46, inttoptr (i64 -1 to ptr)
  br i1 %48, label %49, label %58

49:                                               ; preds = %39
  %50 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %51 = trunc i64 %50 to i32
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %51)
  %53 = load ptr, ptr @stdout, align 8, !tbaa !19
  %54 = tail call i32 @fflush(ptr noundef %53)
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %0)
  %56 = load ptr, ptr @stdout, align 8, !tbaa !19
  %57 = tail call i32 @fflush(ptr noundef %56)
  tail call void @exit(i32 noundef 1) #9
  unreachable

58:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %5) #8
  br label %59

59:                                               ; preds = %58, %11
  %60 = phi ptr [ %46, %58 ], [ %0, %11 ]
  %61 = tail call noundef i32 @_Z17deserialize_modelPKhP9ModelSpec8DataType(ptr noundef %60, ptr noundef nonnull %1, i32 noundef %2)
  ret i32 %61
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10UNI_MEMSETPvim(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @fstat(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nofree 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 = { noreturn 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 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 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 #7 = { nofree "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 = { noreturn 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, !11, i64 224}
!6 = !{!"_ZTS9ModelSpec", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 136, !7, i64 140, !11, i64 144, !11, i64 152, !7, i64 160, !11, i64 168, !7, i64 176, !11, i64 184, !7, i64 192, !11, i64 200, !7, i64 208, !11, i64 216, !11, i64 224}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS8DataType", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !15, i64 16}
!13 = !{!"_ZTS19ModelFileDescriptor", !11, i64 0, !14, i64 8, !15, i64 16, !7, i64 20}
!14 = !{!"long", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!13, !11, i64 0}
!17 = !{!13, !14, i64 8}
!18 = !{!13, !7, i64 20}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !14, i64 48}
!21 = !{!"_ZTS4stat", !14, i64 0, !14, i64 8, !14, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !22, i64 72, !22, i64 88, !22, i64 104, !8, i64 120}
!22 = !{!"_ZTS8timespec", !14, i64 0, !14, i64 8}


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