; LLVM IR from JessonYue/LeetCodeLearning :: Array/huyang/07之前/readelf.ll (Z7readElfPcP10Elf32_Ehdr)

; 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.Elf32_Ehdr = type { [16 x i8], i16, i16, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16 }
%struct.Elf32_Shdr = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [33 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: mustprogress uwtable
define dso_local noundef i32 @_Z7readElfPcP10Elf32_Ehdr(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  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 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noalias ptr @fopen(ptr noundef %18, ptr noundef @.str.1)
  store ptr %19, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %2
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %206

24:                                               ; preds = %2
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = call i32 @fseek(ptr noundef %25, i64 noundef 0, i32 noundef 2)
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = call i64 @ftell(ptr noundef %27)
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %7, align 4, !tbaa !9
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = call i32 @fseek(ptr noundef %30, i64 noundef 0, i32 noundef 0)
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = call i64 @fread(ptr noundef %32, i64 noundef 52, i64 noundef 1, ptr noundef %33)
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %35)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %50, %24
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = icmp slt i32 %39, 16
  br i1 %40, label %41, label %53

41:                                               ; preds = %38
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [16 x i8], ptr %43, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = zext i8 %47 to i32
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %48)
  br label %50

50:                                               ; preds = %41
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !9
  br label %38, !llvm.loop !12

53:                                               ; preds = %38
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %55, i32 0, i32 1
  %57 = load i16, ptr %56, align 4, !tbaa !14
  %58 = zext i16 %57 to i32
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %58)
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %60, i32 0, i32 2
  %62 = load i16, ptr %61, align 2, !tbaa !17
  %63 = zext i16 %62 to i32
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %63)
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %65, i32 0, i32 3
  %67 = load i32, ptr %66, align 4, !tbaa !18
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %67)
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 4, !tbaa !19
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %71)
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %73, i32 0, i32 5
  %75 = load i32, ptr %74, align 4, !tbaa !20
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %75)
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %77, i32 0, i32 6
  %79 = load i32, ptr %78, align 4, !tbaa !21
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %79)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %81, i32 0, i32 7
  %83 = load i32, ptr %82, align 4, !tbaa !22
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %83)
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %85, i32 0, i32 8
  %87 = load i16, ptr %86, align 4, !tbaa !23
  %88 = zext i16 %87 to i32
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %88)
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %90, i32 0, i32 9
  %92 = load i16, ptr %91, align 2, !tbaa !24
  %93 = zext i16 %92 to i32
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %93)
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %95, i32 0, i32 10
  %97 = load i16, ptr %96, align 4, !tbaa !25
  %98 = zext i16 %97 to i32
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %98)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %100, i32 0, i32 11
  %102 = load i16, ptr %101, align 2, !tbaa !26
  %103 = zext i16 %102 to i32
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %103)
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %105, i32 0, i32 12
  %107 = load i16, ptr %106, align 4, !tbaa !27
  %108 = zext i16 %107 to i32
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i32 noundef %108)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %110, i32 0, i32 13
  %112 = load i16, ptr %111, align 2, !tbaa !28
  %113 = zext i16 %112 to i32
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i32 noundef %113)
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %116, i32 0, i32 12
  %118 = load i16, ptr %117, align 4, !tbaa !27
  %119 = zext i16 %118 to i32
  store i32 %119, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = mul i64 40, %121
  %123 = call noalias ptr @malloc(i64 noundef %122) #5
  store ptr %123, ptr %12, align 8, !tbaa !5
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.Elf32_Ehdr, ptr %125, i32 0, i32 6
  %127 = load i32, ptr %126, align 4, !tbaa !21
  %128 = zext i32 %127 to i64
  %129 = call i32 @fseek(ptr noundef %124, i64 noundef %128, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = call i64 @fread(ptr noundef %130, i64 noundef 40, i64 noundef %132, ptr noundef %133)
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %13, align 4, !tbaa !9
  %136 = load i32, ptr %13, align 4, !tbaa !9
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, i32 noundef %136)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %202, %53
  %139 = load i32, ptr %17, align 4, !tbaa !9
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %205

143:                                              ; preds = %138
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.Elf32_Shdr, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !29
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %146)
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.Elf32_Shdr, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !31
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i32 noundef %150)
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.Elf32_Shdr, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 4, !tbaa !32
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, i32 noundef %154)
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.Elf32_Shdr, ptr %156, i32 0, i32 3
  %158 = load i32, ptr %157, align 4, !tbaa !33
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, i32 noundef %158)
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.Elf32_Shdr, ptr %160, i32 0, i32 4
  %162 = load i32, ptr %161, align 4, !tbaa !34
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, i32 noundef %162)
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.Elf32_Shdr, ptr %164, i32 0, i32 5
  %166 = load i32, ptr %165, align 4, !tbaa !35
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, i32 noundef %166)
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Elf32_Shdr, ptr %168, i32 0, i32 6
  %170 = load i32, ptr %169, align 4, !tbaa !36
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, i32 noundef %170)
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.Elf32_Shdr, ptr %172, i32 0, i32 7
  %174 = load i32, ptr %173, align 4, !tbaa !37
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, i32 noundef %174)
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.Elf32_Shdr, ptr %176, i32 0, i32 8
  %178 = load i32, ptr %177, align 4, !tbaa !38
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, i32 noundef %178)
  %180 = load ptr, ptr %12, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.Elf32_Shdr, ptr %180, i32 0, i32 9
  %182 = load i32, ptr %181, align 4, !tbaa !39
  %183 = call i32 (ptr, ...) @printf(ptr noundef @.str.31, i32 noundef %182)
  %184 = load ptr, ptr %12, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.Elf32_Shdr, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !31
  %187 = icmp eq i32 %186, 7
  br i1 %187, label %188, label %199

188:                                              ; preds = %143
  %189 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.Elf32_Shdr, ptr %190, i32 0, i32 5
  %192 = load i32, ptr %191, align 4, !tbaa !35
  store i32 %192, ptr %14, align 4, !tbaa !9
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.Elf32_Shdr, ptr %193, i32 0, i32 4
  %195 = load i32, ptr %194, align 4, !tbaa !34
  store i32 %195, ptr %15, align 4, !tbaa !9
  %196 = load ptr, ptr %12, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.Elf32_Shdr, ptr %196, i32 0, i32 5
  %198 = load i32, ptr %197, align 4, !tbaa !35
  store i32 %198, ptr %14, align 4, !tbaa !9
  br label %199

199:                                              ; preds = %188, %143
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.Elf32_Shdr, ptr %200, i32 1
  store ptr %201, ptr %12, align 8, !tbaa !5
  br label %202

202:                                              ; preds = %199
  %203 = load i32, ptr %17, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !9
  br label %138, !llvm.loop !40

205:                                              ; preds = %142
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %206

206:                                              ; preds = %205, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %207 = load i32, ptr %3, align 4
  ret i32 %207
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

declare i64 @ftell(ptr noundef) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 #4 = { nounwind }
attributes #5 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !16, i64 16}
!15 = !{!"_ZTS10Elf32_Ehdr", !7, i64 0, !16, i64 16, !16, i64 18, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !16, i64 40, !16, i64 42, !16, i64 44, !16, i64 46, !16, i64 48, !16, i64 50}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !16, i64 18}
!18 = !{!15, !10, i64 20}
!19 = !{!15, !10, i64 24}
!20 = !{!15, !10, i64 28}
!21 = !{!15, !10, i64 32}
!22 = !{!15, !10, i64 36}
!23 = !{!15, !16, i64 40}
!24 = !{!15, !16, i64 42}
!25 = !{!15, !16, i64 44}
!26 = !{!15, !16, i64 46}
!27 = !{!15, !16, i64 48}
!28 = !{!15, !16, i64 50}
!29 = !{!30, !10, i64 0}
!30 = !{!"_ZTS10Elf32_Shdr", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!31 = !{!30, !10, i64 4}
!32 = !{!30, !10, i64 8}
!33 = !{!30, !10, i64 12}
!34 = !{!30, !10, i64 16}
!35 = !{!30, !10, i64 20}
!36 = !{!30, !10, i64 24}
!37 = !{!30, !10, i64 28}
!38 = !{!30, !10, i64 32}
!39 = !{!30, !10, i64 36}
!40 = distinct !{!40, !13}


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

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z7readElfPcP10Elf32_Ehdr(ptr nocapture noundef readonly %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.1)
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %7

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %51

7:                                                ; preds = %2
  %8 = tail call i32 @fseek(ptr noundef nonnull %3, i64 noundef 0, i32 noundef 2)
  %9 = tail call i64 @ftell(ptr noundef nonnull %3)
  %10 = trunc i64 %9 to i32
  %11 = tail call i32 @fseek(ptr noundef nonnull %3, i64 noundef 0, i32 noundef 0)
  %12 = tail call i64 @fread(ptr noundef undef, i64 noundef 52, i64 noundef 1, ptr noundef nonnull %3)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 0)
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 0)
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 0)
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef undef)
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef undef)
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef undef)
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef undef)
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef undef)
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef 0)
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 0)
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef 0)
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, i32 noundef 0)
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i32 noundef 0)
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef 0)
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %46 = tail call noalias ptr @malloc(i64 noundef 0) #3
  %47 = tail call i32 @fseek(ptr noundef nonnull %3, i64 noundef 0, i32 noundef 0)
  %48 = tail call i64 @fread(ptr noundef %46, i64 noundef 40, i64 noundef 0, ptr noundef nonnull %3)
  %49 = trunc i64 %48 to i32
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, i32 noundef %49)
  br label %51

51:                                               ; preds = %7, %5
  %.051 = phi i32 [ 1, %5 ], [ 0, %7 ]
  ret i32 %.051
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #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 #2

attributes #0 = { mustprogress nofree 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 = { 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 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 #3 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass