; LLVM IR from n0bel/ESPrinkler :: espfs/mkespfsimage (main)

; 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.EspFsHeader = type { i32, i8, i8, i16, i32, i32 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local signext i16 @htoxs(i16 noundef signext) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @htoxl(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @handleFile(i32 noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %struct.EspFsHeader, align 1
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  store i8 0, ptr %18, align 1, !tbaa !11
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = call i64 @lseek(i32 noundef %20, i64 noundef 0, i32 noundef 2) #6
  store i64 %21, ptr %14, align 8, !tbaa !12
  %22 = load i64, ptr %14, align 8, !tbaa !12
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = call ptr @mmap(ptr noundef null, i64 noundef %22, i32 noundef 1, i32 noundef 1, i32 noundef %23, i64 noundef 0) #6
  store ptr %24, ptr %12, align 8, !tbaa !9
  %25 = load ptr, ptr %12, align 8, !tbaa !9
  %26 = icmp eq ptr %25, inttoptr (i64 -1 to ptr)
  br i1 %26, label %27, label %28

27:                                               ; preds = %5
  call void @perror(ptr noundef @.str)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %151

28:                                               ; preds = %5
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load i64, ptr %14, align 8, !tbaa !12
  store i64 %32, ptr %15, align 8, !tbaa !12
  %33 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %33, ptr %13, align 8, !tbaa !9
  br label %38

34:                                               ; preds = %28
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.1, i32 noundef %36) #6
  call void @exit(i32 noundef 1) #7
  unreachable

38:                                               ; preds = %31
  %39 = load i64, ptr %15, align 8, !tbaa !12
  %40 = load i64, ptr %14, align 8, !tbaa !12
  %41 = icmp sgt i64 %39, %40
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  store i32 0, ptr %9, align 4, !tbaa !5
  %43 = load i64, ptr %14, align 8, !tbaa !12
  store i64 %43, ptr %15, align 8, !tbaa !12
  %44 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %44, ptr %13, align 8, !tbaa !9
  store i8 0, ptr %18, align 1, !tbaa !11
  br label %45

45:                                               ; preds = %42, %38
  %46 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 0
  store i32 1936085829, ptr %46, align 1, !tbaa !14
  %47 = load i8, ptr %18, align 1, !tbaa !11
  %48 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 1
  store i8 %47, ptr %48, align 1, !tbaa !17
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = trunc i32 %49 to i8
  %51 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 2
  store i8 %50, ptr %51, align 1, !tbaa !18
  %52 = load ptr, ptr %8, align 8, !tbaa !9
  %53 = call i64 @strlen(ptr noundef %52) #8
  %54 = add i64 %53, 1
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr %17, align 4, !tbaa !5
  %56 = trunc i32 %55 to i16
  %57 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  store i16 %56, ptr %57, align 1, !tbaa !19
  %58 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  %59 = load i16, ptr %58, align 1, !tbaa !19
  %60 = sext i16 %59 to i32
  %61 = and i32 %60, 3
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %74

63:                                               ; preds = %45
  %64 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  %65 = load i16, ptr %64, align 1, !tbaa !19
  %66 = sext i16 %65 to i32
  %67 = and i32 %66, 3
  %68 = sub nsw i32 4, %67
  %69 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  %70 = load i16, ptr %69, align 1, !tbaa !19
  %71 = sext i16 %70 to i32
  %72 = add nsw i32 %71, %68
  %73 = trunc i32 %72 to i16
  store i16 %73, ptr %69, align 1, !tbaa !19
  br label %74

74:                                               ; preds = %63, %45
  %75 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  %76 = load i16, ptr %75, align 1, !tbaa !19
  %77 = call signext i16 @htoxs(i16 noundef signext %76)
  %78 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 3
  store i16 %77, ptr %78, align 1, !tbaa !19
  %79 = load i64, ptr %15, align 8, !tbaa !12
  %80 = trunc i64 %79 to i32
  %81 = call i32 @htoxl(i32 noundef %80)
  %82 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 4
  store i32 %81, ptr %82, align 1, !tbaa !20
  %83 = load i64, ptr %14, align 8, !tbaa !12
  %84 = trunc i64 %83 to i32
  %85 = call i32 @htoxl(i32 noundef %84)
  %86 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 5
  store i32 %85, ptr %86, align 1, !tbaa !21
  %87 = call i64 @write(i32 noundef 1, ptr noundef %16, i64 noundef 16)
  %88 = load ptr, ptr %8, align 8, !tbaa !9
  %89 = load i32, ptr %17, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = call i64 @write(i32 noundef 1, ptr noundef %88, i64 noundef %90)
  br label %92

92:                                               ; preds = %96, %74
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = and i32 %93, 3
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %100

96:                                               ; preds = %92
  %97 = call i64 @write(i32 noundef 1, ptr noundef @.str.2, i64 noundef 1)
  %98 = load i32, ptr %17, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %17, align 4, !tbaa !5
  br label %92, !llvm.loop !22

100:                                              ; preds = %92
  %101 = load ptr, ptr %13, align 8, !tbaa !9
  %102 = load i64, ptr %15, align 8, !tbaa !12
  %103 = call i64 @write(i32 noundef 1, ptr noundef %101, i64 noundef %102)
  br label %104

104:                                              ; preds = %108, %100
  %105 = load i64, ptr %15, align 8, !tbaa !12
  %106 = and i64 %105, 3
  %107 = icmp ne i64 %106, 0
  br i1 %107, label %108, label %112

108:                                              ; preds = %104
  %109 = call i64 @write(i32 noundef 1, ptr noundef @.str.2, i64 noundef 1)
  %110 = load i64, ptr %15, align 8, !tbaa !12
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %15, align 8, !tbaa !12
  br label %104, !llvm.loop !24

112:                                              ; preds = %104
  %113 = load ptr, ptr %12, align 8, !tbaa !9
  %114 = load i64, ptr %14, align 8, !tbaa !12
  %115 = call i32 @munmap(ptr noundef %113, i64 noundef %114) #6
  %116 = load ptr, ptr %11, align 8, !tbaa !9
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %145

118:                                              ; preds = %112
  %119 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 2
  %120 = load i8, ptr %119, align 1, !tbaa !18
  %121 = sext i8 %120 to i32
  %122 = icmp eq i32 %121, 1
  br i1 %122, label %123, label %125

123:                                              ; preds = %118
  %124 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr @.str.3, ptr %124, align 8, !tbaa !9
  br label %144

125:                                              ; preds = %118
  %126 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 2
  %127 = load i8, ptr %126, align 1, !tbaa !18
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %141

130:                                              ; preds = %125
  %131 = getelementptr inbounds %struct.EspFsHeader, ptr %16, i32 0, i32 1
  %132 = load i8, ptr %131, align 1, !tbaa !17
  %133 = sext i8 %132 to i32
  %134 = and i32 %133, 2
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %138

136:                                              ; preds = %130
  %137 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr @.str.4, ptr %137, align 8, !tbaa !9
  br label %140

138:                                              ; preds = %130
  %139 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr @.str.5, ptr %139, align 8, !tbaa !9
  br label %140

140:                                              ; preds = %138, %136
  br label %143

141:                                              ; preds = %125
  %142 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr @.str.6, ptr %142, align 8, !tbaa !9
  br label %143

143:                                              ; preds = %141, %140
  br label %144

144:                                              ; preds = %143, %123
  br label %145

145:                                              ; preds = %144, %112
  %146 = load i64, ptr %15, align 8, !tbaa !12
  %147 = mul nsw i64 %146, 100
  %148 = load i64, ptr %14, align 8, !tbaa !12
  %149 = sdiv i64 %147, %148
  %150 = trunc i64 %149 to i32
  store i32 %150, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %151

151:                                              ; preds = %145, %27
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %152 = load i32, ptr %6, align 4
  ret i32 %152
}

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #2

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

declare void @perror(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #3

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #5 = { nounwind willreturn memory(read) "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 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"", !6, i64 0, !7, i64 4, !7, i64 5, !16, i64 6, !6, i64 8, !6, i64 12}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !7, i64 4}
!18 = !{!15, !7, i64 5}
!19 = !{!15, !16, i64 6}
!20 = !{!15, !6, i64 8}
!21 = !{!15, !6, i64 12}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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.EspFsHeader = type { i32, i8, i8, i16, i32, i32 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local signext i16 @htoxs(i16 noundef signext) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @htoxl(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @handleFile(i32 noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3, ptr noundef writeonly %4) local_unnamed_addr #0 {
  %6 = alloca %struct.EspFsHeader, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %7 = tail call i64 @lseek(i32 noundef %0, i64 noundef 0, i32 noundef 2) #7
  %8 = tail call ptr @mmap(ptr noundef null, i64 noundef %7, i32 noundef 1, i32 noundef 1, i32 noundef %0, i64 noundef 0) #7
  %9 = icmp eq ptr %8, inttoptr (i64 -1 to ptr)
  br i1 %9, label %10, label %11

10:                                               ; preds = %5
  tail call void @perror(ptr noundef nonnull @.str) #8
  br label %50

11:                                               ; preds = %5
  %12 = icmp eq i32 %2, 0
  br i1 %12, label %16, label %13

13:                                               ; preds = %11
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.1, i32 noundef %2) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

16:                                               ; preds = %11
  store i32 1936085829, ptr %6, align 4, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %6, i64 4
  store i8 0, ptr %17, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %6, i64 5
  store i8 0, ptr %18, align 1, !tbaa !14
  %19 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #11
  %20 = trunc i64 %19 to i32
  %21 = add i32 %20, 1
  %22 = trunc i32 %21 to i16
  %23 = getelementptr inbounds i8, ptr %6, i64 6
  %24 = and i32 %21, 3
  %.not = icmp eq i32 %24, 0
  %25 = and i16 %22, -4
  %26 = add i16 %25, 4
  %storemerge = select i1 %.not, i16 %22, i16 %26
  %27 = tail call signext i16 @htoxs(i16 noundef signext %storemerge)
  store i16 %27, ptr %23, align 2, !tbaa !15
  %28 = trunc i64 %7 to i32
  %29 = tail call i32 @htoxl(i32 noundef %28)
  %30 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %29, ptr %30, align 4, !tbaa !16
  %31 = tail call i32 @htoxl(i32 noundef %28)
  %32 = getelementptr inbounds i8, ptr %6, i64 12
  store i32 %31, ptr %32, align 4, !tbaa !17
  %33 = call i64 @write(i32 noundef 1, ptr noundef nonnull %6, i64 noundef 16) #7
  %34 = sext i32 %21 to i64
  %35 = tail call i64 @write(i32 noundef 1, ptr noundef %1, i64 noundef %34) #7
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %16, %.lr.ph
  %.03449 = phi i32 [ %37, %.lr.ph ], [ %21, %16 ]
  %36 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str.2, i64 noundef 1) #7
  %37 = add nsw i32 %.03449, 1
  %38 = and i32 %37, 3
  %.not44 = icmp eq i32 %38, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %16
  %39 = tail call i64 @write(i32 noundef 1, ptr noundef %8, i64 noundef %7) #7
  %40 = and i64 %7, 3
  %.not4550 = icmp eq i64 %40, 0
  br i1 %.not4550, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %._crit_edge, %.lr.ph53
  %.151 = phi i64 [ %42, %.lr.ph53 ], [ %7, %._crit_edge ]
  %41 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str.2, i64 noundef 1) #7
  %42 = add nsw i64 %.151, 1
  %43 = and i64 %42, 3
  %.not45 = icmp eq i64 %43, 0
  br i1 %.not45, label %._crit_edge54, label %.lr.ph53, !llvm.loop !20

._crit_edge54:                                    ; preds = %.lr.ph53, %._crit_edge
  %.1.lcssa = phi i64 [ %7, %._crit_edge ], [ %42, %.lr.ph53 ]
  %44 = tail call i32 @munmap(ptr noundef %8, i64 noundef %7) #7
  %.not46 = icmp eq ptr %4, null
  br i1 %.not46, label %46, label %45

45:                                               ; preds = %._crit_edge54
  store ptr @.str.5, ptr %4, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %45, %._crit_edge54
  %47 = mul nsw i64 %.1.lcssa, 100
  %48 = sdiv i64 %47, %7
  %49 = trunc i64 %48 to i32
  br label %50

50:                                               ; preds = %46, %10
  %.036 = phi i32 [ 0, %10 ], [ %49, %46 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  ret i32 %.036
}

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 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 #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #6

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

attributes #0 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #7 = { nounwind }
attributes #8 = { cold }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(read) }

!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, !11, i64 0}
!10 = !{!"", !11, i64 0, !7, i64 4, !7, i64 5, !12, i64 6, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!10, !7, i64 4}
!14 = !{!10, !7, i64 5}
!15 = !{!10, !12, i64 6}
!16 = !{!10, !11, i64 8}
!17 = !{!10, !11, i64 12}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass