; LLVM IR from 0xilis/libNeoAppleArchive :: libNeoAppleArchive (neo_aa_header)

; 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.neo_aa_header_impl = type { i32, ptr, ptr, ptr, ptr, ptr, i64, ptr }

@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@__FUNCTION__.neo_aa_header_set_field_string = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, 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
declare void @free(ptr noundef) #2

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @neo_aa_header_get_field_size(ptr noundef, i32 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @neo_aa_header_add_field_string(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #5

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

declare void @internal_do_not_call_is_field_key_available(i32 noundef) #7

; Function Attrs: nounwind uwtable
define dso_local void @neo_aa_header_set_field_string(ptr noundef %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) #5 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i16, align 2
  %21 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %27, label %24

24:                                               ; preds = %4
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.11, ptr noundef @__FUNCTION__.neo_aa_header_set_field_string) #8
  call void @exit(i32 noundef 1) #9
  unreachable

27:                                               ; preds = %4
  %28 = load i32, ptr %6, align 4, !tbaa !9
  call void @internal_do_not_call_is_field_key_available(i32 noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = call i32 @neo_aa_header_get_field_key_index(ptr noundef %29, i32 noundef %30)
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp eq i32 %32, -1
  br i1 %33, label %34, label %39

34:                                               ; preds = %27
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = load i64, ptr %7, align 8, !tbaa !11
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  call void @neo_aa_header_add_field_string(ptr noundef %35, i32 noundef %36, i64 noundef %37, ptr noundef %38)
  store i32 1, ptr %10, align 4
  br label %199

39:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = call i64 @neo_aa_header_get_field_size(ptr noundef %40, i32 noundef %41)
  store i64 %42, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %43 = load i64, ptr %11, align 8, !tbaa !11
  store i64 %43, ptr %12, align 8, !tbaa !11
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %46, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !15
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 2, %51
  br i1 %52, label %53, label %56

53:                                               ; preds = %39
  %54 = load i64, ptr %12, align 8, !tbaa !11
  %55 = add i64 %54, 2
  store i64 %55, ptr %12, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %53, %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %57 = load i64, ptr %7, align 8, !tbaa !11
  %58 = add i64 %57, 2
  store i64 %58, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = call i64 @internal_do_not_call_neo_aa_archive_header_key_pos_in_encoded_data(ptr noundef %59, i32 noundef %60)
  store i64 %61, ptr %14, align 8, !tbaa !11
  %62 = load i64, ptr %14, align 8, !tbaa !11
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %67, label %64

64:                                               ; preds = %56
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.7, ptr noundef @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef @.str.14) #8
  store i32 1, ptr %10, align 4
  br label %198

67:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !16
  store ptr %70, ptr %15, align 8, !tbaa !5
  %71 = load i64, ptr %13, align 8, !tbaa !11
  %72 = load i64, ptr %12, align 8, !tbaa !11
  %73 = icmp ugt i64 %71, %72
  br i1 %73, label %74, label %125

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %75, i32 0, i32 6
  %77 = load i64, ptr %76, align 8, !tbaa !17
  store i64 %77, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %78 = load i64, ptr %16, align 8, !tbaa !11
  %79 = load i64, ptr %13, align 8, !tbaa !11
  %80 = load i64, ptr %12, align 8, !tbaa !11
  %81 = sub i64 %79, %80
  %82 = add i64 %78, %81
  store i64 %82, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = load i64, ptr %17, align 8, !tbaa !11
  %85 = call ptr @realloc(ptr noundef %83, i64 noundef %84) #10
  store ptr %85, ptr %18, align 8, !tbaa !5
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %91, label %88

88:                                               ; preds = %74
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.7, ptr noundef @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef @.str.10) #8
  store i32 1, ptr %10, align 4
  br label %122

91:                                               ; preds = %74
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %93, i32 0, i32 1
  store ptr %92, ptr %94, align 8, !tbaa !16
  %95 = load i64, ptr %17, align 8, !tbaa !11
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %96, i32 0, i32 6
  store i64 %95, ptr %97, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %98 = load i64, ptr %16, align 8, !tbaa !11
  %99 = load i64, ptr %14, align 8, !tbaa !11
  %100 = add i64 %99, 4
  %101 = load i64, ptr %12, align 8, !tbaa !11
  %102 = add i64 %100, %101
  %103 = sub i64 %98, %102
  store i64 %103, ptr %19, align 8, !tbaa !11
  %104 = load i64, ptr %19, align 8, !tbaa !11
  %105 = icmp ugt i64 %104, 0
  br i1 %105, label %106, label %120

106:                                              ; preds = %91
  %107 = load ptr, ptr %18, align 8, !tbaa !5
  %108 = load i64, ptr %14, align 8, !tbaa !11
  %109 = getelementptr inbounds i8, ptr %107, i64 %108
  %110 = getelementptr inbounds i8, ptr %109, i64 4
  %111 = load i64, ptr %13, align 8, !tbaa !11
  %112 = getelementptr inbounds i8, ptr %110, i64 %111
  %113 = load ptr, ptr %18, align 8, !tbaa !5
  %114 = load i64, ptr %14, align 8, !tbaa !11
  %115 = getelementptr inbounds i8, ptr %113, i64 %114
  %116 = getelementptr inbounds i8, ptr %115, i64 4
  %117 = load i64, ptr %12, align 8, !tbaa !11
  %118 = getelementptr inbounds i8, ptr %116, i64 %117
  %119 = load i64, ptr %19, align 8, !tbaa !11
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %112, ptr align 1 %118, i64 %119, i1 false)
  br label %120

120:                                              ; preds = %106, %91
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %121, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  store i32 0, ptr %10, align 4
  br label %122

122:                                              ; preds = %120, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %123 = load i32, ptr %10, align 4
  switch i32 %123, label %197 [
    i32 0, label %124
  ]

124:                                              ; preds = %122
  br label %125

125:                                              ; preds = %124, %67
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #8
  %126 = load i64, ptr %7, align 8, !tbaa !11
  %127 = trunc i64 %126 to i16
  store i16 %127, ptr %20, align 2, !tbaa !18
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i64, ptr %14, align 8, !tbaa !11
  %130 = getelementptr inbounds i8, ptr %128, i64 %129
  %131 = getelementptr inbounds i8, ptr %130, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %131, ptr align 2 %20, i64 2, i1 false)
  %132 = load i64, ptr %7, align 8, !tbaa !11
  %133 = icmp ugt i64 %132, 0
  br i1 %133, label %134, label %141

134:                                              ; preds = %125
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = load i64, ptr %14, align 8, !tbaa !11
  %137 = getelementptr inbounds i8, ptr %135, i64 %136
  %138 = getelementptr inbounds i8, ptr %137, i64 6
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = load i64, ptr %7, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %138, ptr align 1 %139, i64 %140, i1 false)
  br label %141

141:                                              ; preds = %134, %125
  %142 = load i64, ptr %7, align 8, !tbaa !11
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %143, i32 0, i32 5
  %145 = load ptr, ptr %144, align 8, !tbaa !20
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i64, ptr %145, i64 %147
  store i64 %142, ptr %148, align 8, !tbaa !11
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %149, i32 0, i32 4
  %151 = load ptr, ptr %150, align 8, !tbaa !21
  %152 = load i32, ptr %9, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds ptr, ptr %151, i64 %153
  %155 = load ptr, ptr %154, align 8, !tbaa !5
  call void @free(ptr noundef %155) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  store ptr null, ptr %21, align 8, !tbaa !5
  %156 = load i64, ptr %7, align 8, !tbaa !11
  %157 = icmp ugt i64 %156, 0
  br i1 %157, label %158, label %171

158:                                              ; preds = %141
  %159 = load i64, ptr %7, align 8, !tbaa !11
  %160 = call noalias ptr @malloc(i64 noundef %159) #11
  store ptr %160, ptr %21, align 8, !tbaa !5
  %161 = load ptr, ptr %21, align 8, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %166, label %163

163:                                              ; preds = %158
  %164 = load ptr, ptr @stderr, align 8, !tbaa !5
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.7, ptr noundef @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef @.str.10) #8
  store i32 1, ptr %10, align 4
  br label %196

166:                                              ; preds = %158
  %167 = load ptr, ptr %21, align 8, !tbaa !5
  %168 = load ptr, ptr %8, align 8, !tbaa !5
  %169 = load i64, ptr %7, align 8, !tbaa !11
  %170 = call ptr @strncpy(ptr noundef %167, ptr noundef %168, i64 noundef %169) #8
  br label %171

171:                                              ; preds = %166, %141
  %172 = load ptr, ptr %21, align 8, !tbaa !5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %173, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !21
  %176 = load i32, ptr %9, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds ptr, ptr %175, i64 %177
  store ptr %172, ptr %178, align 8, !tbaa !5
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %179, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !13
  %182 = load i32, ptr %9, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %181, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !15
  %186 = sext i8 %185 to i32
  %187 = icmp ne i32 %186, 2
  br i1 %187, label %188, label %195

188:                                              ; preds = %171
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.neo_aa_header_impl, ptr %189, i32 0, i32 3
  %191 = load ptr, ptr %190, align 8, !tbaa !13
  %192 = load i32, ptr %9, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i8, ptr %191, i64 %193
  store i8 2, ptr %194, align 1, !tbaa !15
  br label %195

195:                                              ; preds = %188, %171
  store i32 0, ptr %10, align 4
  br label %196

196:                                              ; preds = %195, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #8
  br label %197

197:                                              ; preds = %196, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %198

198:                                              ; preds = %197, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %199

199:                                              ; preds = %198, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  %200 = load i32, ptr %10, align 4
  switch i32 %200, label %202 [
    i32 0, label %201
    i32 1, label %201
  ]

201:                                              ; preds = %199, %199
  ret void

202:                                              ; preds = %199
  unreachable
}

declare i64 @internal_do_not_call_neo_aa_archive_header_key_pos_in_encoded_data(ptr noundef, i32 noundef) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind allocsize(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 #5 = { 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 #6 = { 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 #7 = { "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 }
attributes #10 = { nounwind allocsize(1) }
attributes #11 = { nounwind allocsize(0) }

!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}
!13 = !{!14, !6, i64 24}
!14 = !{!"neo_aa_header_impl", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !6, i64 56}
!15 = !{!7, !7, i64 0}
!16 = !{!14, !6, i64 8}
!17 = !{!14, !12, i64 48}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!14, !6, i64 40}
!21 = !{!14, !6, i64 32}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@__FUNCTION__.neo_aa_header_set_field_string = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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) #3

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local i64 @neo_aa_header_get_field_size(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local void @neo_aa_header_add_field_string(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #5

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

declare void @internal_do_not_call_is_field_key_available(i32 noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
define dso_local void @neo_aa_header_set_field_string(ptr noundef %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #5 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %8

5:                                                ; preds = %4
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.11, ptr noundef nonnull @__FUNCTION__.neo_aa_header_set_field_string) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

8:                                                ; preds = %4
  tail call void @internal_do_not_call_is_field_key_available(i32 noundef %1) #11
  %9 = tail call i32 @neo_aa_header_get_field_key_index(ptr noundef nonnull %0, i32 noundef %1)
  %10 = icmp eq i32 %9, -1
  br i1 %10, label %11, label %12

11:                                               ; preds = %8
  tail call void @neo_aa_header_add_field_string(ptr noundef nonnull %0, i32 noundef %1, i64 noundef %2, ptr noundef %3)
  br label %75

12:                                               ; preds = %8
  %13 = tail call i64 @neo_aa_header_get_field_size(ptr noundef nonnull %0, i32 noundef %9)
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = sext i32 %9 to i64
  %17 = getelementptr inbounds i8, ptr %15, i64 %16
  %18 = load i8, ptr %17, align 1, !tbaa !13
  %19 = icmp eq i8 %18, 2
  %20 = add i64 %13, 2
  %spec.select = select i1 %19, i64 %20, i64 %13
  %21 = add i64 %2, 2
  %22 = tail call i64 @internal_do_not_call_neo_aa_archive_header_key_pos_in_encoded_data(ptr noundef nonnull %0, i32 noundef %9) #11
  %.not83 = icmp eq i64 %22, 0
  br i1 %.not83, label %23, label %26

23:                                               ; preds = %12
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.7, ptr noundef nonnull @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef nonnull @.str.14) #9
  br label %75

26:                                               ; preds = %12
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = icmp ugt i64 %21, %spec.select
  br i1 %29, label %30, label %.thread

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 48
  %32 = load i64, ptr %31, align 8, !tbaa !15
  %33 = sub i64 %21, %spec.select
  %34 = add i64 %32, %33
  %35 = tail call ptr @realloc(ptr noundef %28, i64 noundef %34) #12
  %.not84.not = icmp eq ptr %35, null
  br i1 %.not84.not, label %45, label %36

36:                                               ; preds = %30
  store ptr %35, ptr %27, align 8, !tbaa !14
  store i64 %34, ptr %31, align 8, !tbaa !15
  %37 = add i64 %22, 4
  %38 = add i64 %37, %spec.select
  %.not85 = icmp eq i64 %32, %38
  br i1 %.not85, label %.thread, label %39

39:                                               ; preds = %36
  %40 = sub i64 %32, %38
  %41 = getelementptr inbounds i8, ptr %35, i64 %22
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = getelementptr inbounds i8, ptr %42, i64 %21
  %44 = getelementptr inbounds i8, ptr %42, i64 %spec.select
  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %43, ptr nonnull align 1 %44, i64 %40, i1 false)
  br label %.thread

45:                                               ; preds = %30
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.7, ptr noundef nonnull @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef nonnull @.str.10) #9
  br label %75

.thread:                                          ; preds = %39, %36, %26
  %.1 = phi ptr [ %28, %26 ], [ %35, %36 ], [ %35, %39 ]
  %48 = trunc i64 %2 to i16
  %49 = getelementptr inbounds i8, ptr %.1, i64 %22
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  store i16 %48, ptr %50, align 1
  %.not86 = icmp eq i64 %2, 0
  br i1 %.not86, label %53, label %51

51:                                               ; preds = %.thread
  %52 = getelementptr inbounds i8, ptr %49, i64 6
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %52, ptr align 1 %3, i64 %2, i1 false)
  br label %53

53:                                               ; preds = %51, %.thread
  %54 = getelementptr inbounds i8, ptr %0, i64 40
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = getelementptr inbounds i64, ptr %55, i64 %16
  store i64 %2, ptr %56, align 8, !tbaa !17
  %57 = getelementptr inbounds i8, ptr %0, i64 32
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = getelementptr inbounds ptr, ptr %58, i64 %16
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  tail call void @free(ptr noundef %60) #11
  br i1 %.not86, label %68, label %61

61:                                               ; preds = %53
  %62 = tail call noalias ptr @malloc(i64 noundef %2) #13
  %.not87 = icmp eq ptr %62, null
  br i1 %.not87, label %63, label %66

63:                                               ; preds = %61
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.7, ptr noundef nonnull @__FUNCTION__.neo_aa_header_set_field_string, ptr noundef nonnull @.str.10) #9
  br label %75

66:                                               ; preds = %61
  %67 = tail call ptr @strncpy(ptr noundef nonnull %62, ptr noundef %3, i64 noundef %2) #11
  br label %68

68:                                               ; preds = %66, %53
  %.0 = phi ptr [ %62, %66 ], [ null, %53 ]
  %69 = load ptr, ptr %57, align 8, !tbaa !18
  %70 = getelementptr inbounds ptr, ptr %69, i64 %16
  store ptr %.0, ptr %70, align 8, !tbaa !5
  %71 = load ptr, ptr %14, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %71, i64 %16
  %73 = load i8, ptr %72, align 1, !tbaa !13
  %.not88 = icmp eq i8 %73, 2
  br i1 %.not88, label %75, label %74

74:                                               ; preds = %68
  store i8 2, ptr %72, align 1, !tbaa !13
  br label %75

75:                                               ; preds = %45, %23, %63, %74, %68, %11
  ret void
}

declare i64 @internal_do_not_call_neo_aa_archive_header_key_pos_in_encoded_data(ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #2 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { 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 #8 = { "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 #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind }
attributes #12 = { nounwind allocsize(1) }
attributes #13 = { nounwind allocsize(0) }

!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, !6, i64 24}
!10 = !{!"neo_aa_header_impl", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !6, i64 8}
!15 = !{!10, !12, i64 48}
!16 = !{!10, !6, i64 40}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !6, i64 32}


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