; LLVM IR from eclipse-threadx/threadx :: common_modules/module_manager/utilities (module_to_binary)

; 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.ELF_HEADER_STRUCT = type { [16 x i8], i16, i16, i64, i64, i64, i64, i64, i16, i16, i16, i16, i16, i16 }
%struct.CODE_SECTION_ENTRY_STRUCT = type { i64, i64, i64 }
%struct.ELF_SECTION_HEADER_STRUCT = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }

@source_file = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [65 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@binary_file = external dso_local global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@header = external dso_local global %struct.ELF_HEADER_STRUCT, align 8
@program_header = external dso_local global ptr, align 8
@section_header = external dso_local global ptr, align 8
@section_string_table = external dso_local global ptr, align 8
@code_section_array = external dso_local global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @elf_object_read(i64 noundef, ptr noundef, i32 noundef) #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
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.CODE_SECTION_ENTRY_STRUCT, align 8
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp ne i32 %16, 3
  br i1 %17, label %18, label %23

18:                                               ; preds = %2
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %351

23:                                               ; preds = %2
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call noalias ptr @fopen(ptr noundef %26, ptr noundef @.str.4)
  store ptr %27, ptr @source_file, align 8, !tbaa !9
  %28 = load ptr, ptr @source_file, align 8, !tbaa !9
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %36

30:                                               ; preds = %23
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 1
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %34)
  store i32 2, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %351

36:                                               ; preds = %23
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 2
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call noalias ptr @fopen(ptr noundef %39, ptr noundef @.str.7)
  store ptr %40, ptr @binary_file, align 8, !tbaa !9
  %41 = load ptr, ptr @binary_file, align 8, !tbaa !9
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %49

43:                                               ; preds = %36
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 2
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %47)
  store i32 3, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %351

49:                                               ; preds = %36
  %50 = call i32 @elf_object_read(i64 noundef 0, ptr noundef @header, i32 noundef 80)
  %51 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 10), align 4, !tbaa !11
  %52 = zext i16 %51 to i64
  %53 = mul i64 64, %52
  %54 = call noalias ptr @malloc(i64 noundef %53) #6
  store ptr %54, ptr @program_header, align 8, !tbaa !9
  %55 = load i64, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 5), align 8, !tbaa !15
  %56 = load ptr, ptr @program_header, align 8, !tbaa !9
  %57 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 10), align 4, !tbaa !11
  %58 = zext i16 %57 to i64
  %59 = mul i64 64, %58
  %60 = trunc i64 %59 to i32
  %61 = call i32 @elf_object_read(i64 noundef %55, ptr noundef %56, i32 noundef %60)
  %62 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 12), align 8, !tbaa !16
  %63 = zext i16 %62 to i64
  %64 = mul i64 80, %63
  %65 = call noalias ptr @malloc(i64 noundef %64) #6
  store ptr %65, ptr @section_header, align 8, !tbaa !9
  %66 = load i64, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 6), align 8, !tbaa !17
  %67 = load ptr, ptr @section_header, align 8, !tbaa !9
  %68 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 12), align 8, !tbaa !16
  %69 = zext i16 %68 to i64
  %70 = mul i64 80, %69
  %71 = trunc i64 %70 to i32
  %72 = call i32 @elf_object_read(i64 noundef %66, ptr noundef %67, i32 noundef %71)
  %73 = load ptr, ptr @section_header, align 8, !tbaa !9
  %74 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 13), align 2, !tbaa !18
  %75 = zext i16 %74 to i64
  %76 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %73, i64 %75
  %77 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %76, i32 0, i32 5
  %78 = load i64, ptr %77, align 8, !tbaa !19
  %79 = call noalias ptr @malloc(i64 noundef %78) #6
  store ptr %79, ptr @section_string_table, align 8, !tbaa !9
  %80 = load ptr, ptr @section_header, align 8, !tbaa !9
  %81 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 13), align 2, !tbaa !18
  %82 = zext i16 %81 to i64
  %83 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %83, i32 0, i32 4
  %85 = load i64, ptr %84, align 8, !tbaa !21
  %86 = load ptr, ptr @section_string_table, align 8, !tbaa !9
  %87 = load ptr, ptr @section_header, align 8, !tbaa !9
  %88 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 13), align 2, !tbaa !18
  %89 = zext i16 %88 to i64
  %90 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %90, i32 0, i32 5
  %92 = load i64, ptr %91, align 8, !tbaa !19
  %93 = trunc i64 %92 to i32
  %94 = call i32 @elf_object_read(i64 noundef %85, ptr noundef %86, i32 noundef %93)
  %95 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 12), align 8, !tbaa !16
  %96 = zext i16 %95 to i64
  %97 = mul i64 24, %96
  %98 = call noalias ptr @malloc(i64 noundef %97) #6
  store ptr %98, ptr @code_section_array, align 8, !tbaa !9
  store i64 0, ptr %12, align 8, !tbaa !22
  store i64 0, ptr %6, align 8, !tbaa !22
  br label %99

99:                                               ; preds = %219, %49
  %100 = load i64, ptr %6, align 8, !tbaa !22
  %101 = load i16, ptr getelementptr inbounds (%struct.ELF_HEADER_STRUCT, ptr @header, i32 0, i32 12), align 8, !tbaa !16
  %102 = zext i16 %101 to i64
  %103 = icmp ult i64 %100, %102
  br i1 %103, label %104, label %222

104:                                              ; preds = %99
  %105 = load ptr, ptr @section_header, align 8, !tbaa !9
  %106 = load i64, ptr %6, align 8, !tbaa !22
  %107 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %105, i64 %106
  %108 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %107, i32 0, i32 1
  %109 = load i64, ptr %108, align 8, !tbaa !23
  %110 = icmp eq i64 %109, 1
  br i1 %110, label %111, label %218

111:                                              ; preds = %104
  %112 = load ptr, ptr @section_header, align 8, !tbaa !9
  %113 = load i64, ptr %6, align 8, !tbaa !22
  %114 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %112, i64 %113
  %115 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %114, i32 0, i32 5
  %116 = load i64, ptr %115, align 8, !tbaa !19
  %117 = icmp ne i64 %116, 0
  br i1 %117, label %118, label %218

118:                                              ; preds = %111
  %119 = load ptr, ptr @section_header, align 8, !tbaa !9
  %120 = load i64, ptr %6, align 8, !tbaa !22
  %121 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %119, i64 %120
  %122 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %121, i32 0, i32 2
  %123 = load i64, ptr %122, align 8, !tbaa !24
  %124 = and i64 %123, 4
  %125 = icmp ne i64 %124, 0
  br i1 %125, label %134, label %126

126:                                              ; preds = %118
  %127 = load ptr, ptr @section_header, align 8, !tbaa !9
  %128 = load i64, ptr %6, align 8, !tbaa !22
  %129 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %127, i64 %128
  %130 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %129, i32 0, i32 2
  %131 = load i64, ptr %130, align 8, !tbaa !24
  %132 = and i64 %131, 2
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %134, label %217

134:                                              ; preds = %126, %118
  store i64 0, ptr %7, align 8, !tbaa !22
  br label %135

135:                                              ; preds = %183, %134
  %136 = load i64, ptr %7, align 8, !tbaa !22
  %137 = load i64, ptr %12, align 8, !tbaa !22
  %138 = icmp ult i64 %136, %137
  br i1 %138, label %139, label %186

139:                                              ; preds = %135
  %140 = load ptr, ptr @section_header, align 8, !tbaa !9
  %141 = load i64, ptr %6, align 8, !tbaa !22
  %142 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %140, i64 %141
  %143 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %142, i32 0, i32 3
  %144 = load i64, ptr %143, align 8, !tbaa !25
  %145 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %146 = load i64, ptr %7, align 8, !tbaa !22
  %147 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %145, i64 %146
  %148 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %147, i32 0, i32 1
  %149 = load i64, ptr %148, align 8, !tbaa !26
  %150 = icmp uge i64 %144, %149
  br i1 %150, label %151, label %182

151:                                              ; preds = %139
  %152 = load ptr, ptr @section_header, align 8, !tbaa !9
  %153 = load i64, ptr %6, align 8, !tbaa !22
  %154 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %152, i64 %153
  %155 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %154, i32 0, i32 3
  %156 = load i64, ptr %155, align 8, !tbaa !25
  %157 = load ptr, ptr @section_header, align 8, !tbaa !9
  %158 = load i64, ptr %6, align 8, !tbaa !22
  %159 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %157, i64 %158
  %160 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %159, i32 0, i32 5
  %161 = load i64, ptr %160, align 8, !tbaa !19
  %162 = add i64 %156, %161
  %163 = load ptr, ptr @section_header, align 8, !tbaa !9
  %164 = load i64, ptr %6, align 8, !tbaa !22
  %165 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %163, i64 %164
  %166 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %165, i32 0, i32 4
  %167 = load i64, ptr %166, align 8, !tbaa !21
  %168 = add i64 %162, %167
  %169 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %170 = load i64, ptr %7, align 8, !tbaa !22
  %171 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %169, i64 %170
  %172 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %171, i32 0, i32 1
  %173 = load i64, ptr %172, align 8, !tbaa !26
  %174 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %175 = load i64, ptr %7, align 8, !tbaa !22
  %176 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %174, i64 %175
  %177 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %176, i32 0, i32 2
  %178 = load i64, ptr %177, align 8, !tbaa !28
  %179 = add i64 %173, %178
  %180 = icmp ult i64 %168, %179
  br i1 %180, label %181, label %182

181:                                              ; preds = %151
  br label %186

182:                                              ; preds = %151, %139
  br label %183

183:                                              ; preds = %182
  %184 = load i64, ptr %7, align 8, !tbaa !22
  %185 = add i64 %184, 1
  store i64 %185, ptr %7, align 8, !tbaa !22
  br label %135, !llvm.loop !29

186:                                              ; preds = %181, %135
  %187 = load i64, ptr %7, align 8, !tbaa !22
  %188 = load i64, ptr %12, align 8, !tbaa !22
  %189 = icmp eq i64 %187, %188
  br i1 %189, label %190, label %216

190:                                              ; preds = %186
  %191 = load i64, ptr %6, align 8, !tbaa !22
  %192 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %193 = load i64, ptr %12, align 8, !tbaa !22
  %194 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %192, i64 %193
  %195 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %194, i32 0, i32 0
  store i64 %191, ptr %195, align 8, !tbaa !31
  %196 = load ptr, ptr @section_header, align 8, !tbaa !9
  %197 = load i64, ptr %6, align 8, !tbaa !22
  %198 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %196, i64 %197
  %199 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %198, i32 0, i32 3
  %200 = load i64, ptr %199, align 8, !tbaa !25
  %201 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %202 = load i64, ptr %12, align 8, !tbaa !22
  %203 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %201, i64 %202
  %204 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %203, i32 0, i32 1
  store i64 %200, ptr %204, align 8, !tbaa !26
  %205 = load ptr, ptr @section_header, align 8, !tbaa !9
  %206 = load i64, ptr %6, align 8, !tbaa !22
  %207 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %205, i64 %206
  %208 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %207, i32 0, i32 5
  %209 = load i64, ptr %208, align 8, !tbaa !19
  %210 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %211 = load i64, ptr %12, align 8, !tbaa !22
  %212 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %210, i64 %211
  %213 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %212, i32 0, i32 2
  store i64 %209, ptr %213, align 8, !tbaa !28
  %214 = load i64, ptr %12, align 8, !tbaa !22
  %215 = add i64 %214, 1
  store i64 %215, ptr %12, align 8, !tbaa !22
  br label %216

216:                                              ; preds = %190, %186
  br label %217

217:                                              ; preds = %216, %126
  br label %218

218:                                              ; preds = %217, %111, %104
  br label %219

219:                                              ; preds = %218
  %220 = load i64, ptr %6, align 8, !tbaa !22
  %221 = add i64 %220, 1
  store i64 %221, ptr %6, align 8, !tbaa !22
  br label %99, !llvm.loop !32

222:                                              ; preds = %99
  %223 = load i64, ptr %12, align 8, !tbaa !22
  %224 = icmp eq i64 %223, 0
  br i1 %224, label %225, label %230

225:                                              ; preds = %222
  %226 = load ptr, ptr @source_file, align 8, !tbaa !9
  %227 = call i32 @fclose(ptr noundef %226)
  %228 = load ptr, ptr @binary_file, align 8, !tbaa !9
  %229 = call i32 @fclose(ptr noundef %228)
  store i32 4, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %351

230:                                              ; preds = %222
  store i64 0, ptr %6, align 8, !tbaa !22
  br label %231

231:                                              ; preds = %271, %230
  %232 = load i64, ptr %6, align 8, !tbaa !22
  %233 = add i64 %232, 1
  %234 = load i64, ptr %12, align 8, !tbaa !22
  %235 = icmp ult i64 %233, %234
  br i1 %235, label %236, label %274

236:                                              ; preds = %231
  %237 = load i64, ptr %6, align 8, !tbaa !22
  %238 = add i64 %237, 1
  store i64 %238, ptr %7, align 8, !tbaa !22
  br label %239

239:                                              ; preds = %267, %236
  %240 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %241 = load i64, ptr %7, align 8, !tbaa !22
  %242 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %240, i64 %241
  %243 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %242, i32 0, i32 1
  %244 = load i64, ptr %243, align 8, !tbaa !26
  %245 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %246 = load i64, ptr %6, align 8, !tbaa !22
  %247 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %245, i64 %246
  %248 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %247, i32 0, i32 1
  %249 = load i64, ptr %248, align 8, !tbaa !26
  %250 = icmp ult i64 %244, %249
  br i1 %250, label %251, label %264

251:                                              ; preds = %239
  %252 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %253 = load i64, ptr %6, align 8, !tbaa !22
  %254 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %252, i64 %253
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %254, i64 24, i1 false), !tbaa.struct !33
  %255 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %256 = load i64, ptr %6, align 8, !tbaa !22
  %257 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %255, i64 %256
  %258 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %259 = load i64, ptr %7, align 8, !tbaa !22
  %260 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %258, i64 %259
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %257, ptr align 8 %260, i64 24, i1 false), !tbaa.struct !33
  %261 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %262 = load i64, ptr %7, align 8, !tbaa !22
  %263 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %261, i64 %262
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %263, ptr align 8 %13, i64 24, i1 false), !tbaa.struct !33
  br label %264

264:                                              ; preds = %251, %239
  %265 = load i64, ptr %7, align 8, !tbaa !22
  %266 = add i64 %265, 1
  store i64 %266, ptr %7, align 8, !tbaa !22
  br label %267

267:                                              ; preds = %264
  %268 = load i64, ptr %7, align 8, !tbaa !22
  %269 = load i64, ptr %12, align 8, !tbaa !22
  %270 = icmp ult i64 %268, %269
  br i1 %270, label %239, label %271, !llvm.loop !34

271:                                              ; preds = %267
  %272 = load i64, ptr %6, align 8, !tbaa !22
  %273 = add i64 %272, 1
  store i64 %273, ptr %6, align 8, !tbaa !22
  br label %231, !llvm.loop !35

274:                                              ; preds = %231
  %275 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %276 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %275, i64 0
  %277 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %276, i32 0, i32 1
  %278 = load i64, ptr %277, align 8, !tbaa !26
  store i64 %278, ptr %9, align 8, !tbaa !22
  store i8 0, ptr %14, align 1, !tbaa !36
  store i64 0, ptr %6, align 8, !tbaa !22
  br label %279

279:                                              ; preds = %343, %274
  %280 = load i64, ptr %6, align 8, !tbaa !22
  %281 = load i64, ptr %12, align 8, !tbaa !22
  %282 = icmp ult i64 %280, %281
  br i1 %282, label %283, label %346

283:                                              ; preds = %279
  br label %284

284:                                              ; preds = %292, %283
  %285 = load i64, ptr %9, align 8, !tbaa !22
  %286 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %287 = load i64, ptr %6, align 8, !tbaa !22
  %288 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %286, i64 %287
  %289 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %288, i32 0, i32 1
  %290 = load i64, ptr %289, align 8, !tbaa !26
  %291 = icmp ult i64 %285, %290
  br i1 %291, label %292, label %297

292:                                              ; preds = %284
  %293 = load ptr, ptr @binary_file, align 8, !tbaa !9
  %294 = call i64 @fwrite(ptr noundef %14, i64 noundef 1, i64 noundef 1, ptr noundef %293)
  %295 = load i64, ptr %9, align 8, !tbaa !22
  %296 = add i64 %295, 1
  store i64 %296, ptr %9, align 8, !tbaa !22
  br label %284, !llvm.loop !37

297:                                              ; preds = %284
  %298 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %299 = load i64, ptr %6, align 8, !tbaa !22
  %300 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %298, i64 %299
  %301 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %300, i32 0, i32 2
  %302 = load i64, ptr %301, align 8, !tbaa !28
  %303 = call noalias ptr @malloc(i64 noundef %302) #6
  store ptr %303, ptr %11, align 8, !tbaa !9
  %304 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %305 = load i64, ptr %6, align 8, !tbaa !22
  %306 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %304, i64 %305
  %307 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %306, i32 0, i32 0
  %308 = load i64, ptr %307, align 8, !tbaa !31
  store i64 %308, ptr %7, align 8, !tbaa !22
  %309 = load ptr, ptr @section_header, align 8, !tbaa !9
  %310 = load i64, ptr %7, align 8, !tbaa !22
  %311 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %309, i64 %310
  %312 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %311, i32 0, i32 4
  %313 = load i64, ptr %312, align 8, !tbaa !21
  %314 = load ptr, ptr %11, align 8, !tbaa !9
  %315 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %316 = load i64, ptr %6, align 8, !tbaa !22
  %317 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %315, i64 %316
  %318 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %317, i32 0, i32 2
  %319 = load i64, ptr %318, align 8, !tbaa !28
  %320 = trunc i64 %319 to i32
  %321 = call i32 @elf_object_read(i64 noundef %313, ptr noundef %314, i32 noundef %320)
  %322 = load ptr, ptr @code_section_array, align 8, !tbaa !9
  %323 = load i64, ptr %6, align 8, !tbaa !22
  %324 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %322, i64 %323
  %325 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %324, i32 0, i32 2
  %326 = load i64, ptr %325, align 8, !tbaa !28
  store i64 %326, ptr %10, align 8, !tbaa !22
  store i64 0, ptr %7, align 8, !tbaa !22
  br label %327

327:                                              ; preds = %330, %297
  %328 = load i64, ptr %10, align 8, !tbaa !22
  %329 = icmp ne i64 %328, 0
  br i1 %329, label %330, label %342

330:                                              ; preds = %327
  %331 = load ptr, ptr %11, align 8, !tbaa !9
  %332 = load i64, ptr %7, align 8, !tbaa !22
  %333 = getelementptr inbounds i8, ptr %331, i64 %332
  %334 = load ptr, ptr @binary_file, align 8, !tbaa !9
  %335 = call i64 @fwrite(ptr noundef %333, i64 noundef 1, i64 noundef 1, ptr noundef %334)
  %336 = load i64, ptr %9, align 8, !tbaa !22
  %337 = add i64 %336, 1
  store i64 %337, ptr %9, align 8, !tbaa !22
  %338 = load i64, ptr %10, align 8, !tbaa !22
  %339 = add i64 %338, -1
  store i64 %339, ptr %10, align 8, !tbaa !22
  %340 = load i64, ptr %7, align 8, !tbaa !22
  %341 = add i64 %340, 1
  store i64 %341, ptr %7, align 8, !tbaa !22
  br label %327, !llvm.loop !38

342:                                              ; preds = %327
  br label %343

343:                                              ; preds = %342
  %344 = load i64, ptr %6, align 8, !tbaa !22
  %345 = add i64 %344, 1
  store i64 %345, ptr %6, align 8, !tbaa !22
  br label %279, !llvm.loop !39

346:                                              ; preds = %279
  %347 = load ptr, ptr @source_file, align 8, !tbaa !9
  %348 = call i32 @fclose(ptr noundef %347)
  %349 = load ptr, ptr @binary_file, align 8, !tbaa !9
  %350 = call i32 @fclose(ptr noundef %349)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %351

351:                                              ; preds = %346, %225, %43, %30, %18
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %352 = load i32, ptr %3, align 4
  ret i32 %352
}

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

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

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

declare i32 @fclose(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) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"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 = !{!12, !13, i64 68}
!12 = !{!"ELF_HEADER_STRUCT", !7, i64 0, !13, i64 16, !13, i64 18, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !13, i64 64, !13, i64 66, !13, i64 68, !13, i64 70, !13, i64 72, !13, i64 74}
!13 = !{!"short", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !14, i64 40}
!16 = !{!12, !13, i64 72}
!17 = !{!12, !14, i64 48}
!18 = !{!12, !13, i64 74}
!19 = !{!20, !14, i64 40}
!20 = !{!"ELF_SECTION_HEADER_STRUCT", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72}
!21 = !{!20, !14, i64 32}
!22 = !{!14, !14, i64 0}
!23 = !{!20, !14, i64 8}
!24 = !{!20, !14, i64 16}
!25 = !{!20, !14, i64 24}
!26 = !{!27, !14, i64 8}
!27 = !{!"CODE_SECTION_ENTRY_STRUCT", !14, i64 0, !14, i64 8, !14, i64 16}
!28 = !{!27, !14, i64 16}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!27, !14, i64 0}
!32 = distinct !{!32, !30}
!33 = !{i64 0, i64 8, !22, i64 8, i64 8, !22, i64 16, i64 8, !22}
!34 = distinct !{!34, !30}
!35 = distinct !{!35, !30}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !30}
!38 = distinct !{!38, !30}
!39 = distinct !{!39, !30}


; 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.ELF_HEADER_STRUCT = type { [16 x i8], i16, i16, i64, i64, i64, i64, i64, i16, i16, i16, i16, i16, i16 }
%struct.CODE_SECTION_ENTRY_STRUCT = type { i64, i64, i64 }
%struct.ELF_SECTION_HEADER_STRUCT = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }

@source_file = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [65 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@binary_file = external dso_local local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@header = external dso_local global %struct.ELF_HEADER_STRUCT, align 8
@program_header = external dso_local local_unnamed_addr global ptr, align 8
@section_header = external dso_local local_unnamed_addr global ptr, align 8
@section_string_table = external dso_local local_unnamed_addr global ptr, align 8
@code_section_array = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @elf_object_read(i64 noundef, ptr noundef, i32 noundef) 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
define dso_local range(i32 0, 5) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.CODE_SECTION_ENTRY_STRUCT, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3)
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %9, label %4

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

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call noalias ptr @fopen(ptr noundef %11, ptr noundef nonnull @.str.4)
  store ptr %12, ptr @source_file, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %18

14:                                               ; preds = %9
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %16 = load ptr, ptr %10, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %16)
  br label %159

18:                                               ; preds = %9
  %19 = getelementptr inbounds i8, ptr %1, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = tail call noalias ptr @fopen(ptr noundef %20, ptr noundef nonnull @.str.7)
  store ptr %21, ptr @binary_file, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %27

23:                                               ; preds = %18
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %25 = load ptr, ptr %19, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %25)
  br label %159

27:                                               ; preds = %18
  %28 = tail call i32 @elf_object_read(i64 noundef 0, ptr noundef nonnull @header, i32 noundef 80)
  %29 = load i16, ptr getelementptr inbounds (i8, ptr @header, i64 68), align 4, !tbaa !9
  %30 = zext i16 %29 to i64
  %31 = shl nuw nsw i64 %30, 6
  %32 = tail call noalias ptr @malloc(i64 noundef %31) #6
  store ptr %32, ptr @program_header, align 8, !tbaa !5
  %33 = load i64, ptr getelementptr inbounds (i8, ptr @header, i64 40), align 8, !tbaa !13
  %34 = zext i16 %29 to i32
  %35 = shl nuw nsw i32 %34, 6
  %36 = tail call i32 @elf_object_read(i64 noundef %33, ptr noundef %32, i32 noundef %35)
  %37 = load i16, ptr getelementptr inbounds (i8, ptr @header, i64 72), align 8, !tbaa !14
  %38 = zext i16 %37 to i64
  %39 = mul nuw nsw i64 %38, 80
  %40 = tail call noalias ptr @malloc(i64 noundef %39) #6
  store ptr %40, ptr @section_header, align 8, !tbaa !5
  %41 = load i64, ptr getelementptr inbounds (i8, ptr @header, i64 48), align 8, !tbaa !15
  %42 = zext i16 %37 to i32
  %43 = mul nuw nsw i32 %42, 80
  %44 = tail call i32 @elf_object_read(i64 noundef %41, ptr noundef %40, i32 noundef %43)
  %45 = load ptr, ptr @section_header, align 8, !tbaa !5
  %46 = load i16, ptr getelementptr inbounds (i8, ptr @header, i64 74), align 2, !tbaa !16
  %47 = zext i16 %46 to i64
  %48 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %45, i64 %47, i32 5
  %49 = load i64, ptr %48, align 8, !tbaa !17
  %50 = tail call noalias ptr @malloc(i64 noundef %49) #6
  store ptr %50, ptr @section_string_table, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %45, i64 %47, i32 4
  %52 = load i64, ptr %51, align 8, !tbaa !19
  %53 = trunc i64 %49 to i32
  %54 = tail call i32 @elf_object_read(i64 noundef %52, ptr noundef %50, i32 noundef %53)
  %55 = load i16, ptr getelementptr inbounds (i8, ptr @header, i64 72), align 8, !tbaa !14
  %56 = zext i16 %55 to i64
  %57 = mul nuw nsw i64 %56, 24
  %58 = tail call noalias ptr @malloc(i64 noundef %57) #6
  store ptr %58, ptr @code_section_array, align 8, !tbaa !5
  %.not113 = icmp eq i16 %55, 0
  br i1 %.not113, label %._crit_edge94.thread, label %.lr.ph93

.lr.ph93:                                         ; preds = %27
  %59 = load ptr, ptr @section_header, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %.lr.ph93, %96
  %.091 = phi i64 [ 0, %.lr.ph93 ], [ %.1, %96 ]
  %.06690 = phi i64 [ 0, %.lr.ph93 ], [ %97, %96 ]
  %61 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %59, i64 %.06690
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load i64, ptr %62, align 8, !tbaa !20
  %64 = icmp eq i64 %63, 1
  br i1 %64, label %65, label %96

65:                                               ; preds = %60
  %66 = getelementptr inbounds i8, ptr %61, i64 40
  %67 = load i64, ptr %66, align 8, !tbaa !17
  %.not80 = icmp eq i64 %67, 0
  br i1 %.not80, label %96, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %61, i64 16
  %70 = load i64, ptr %69, align 8, !tbaa !21
  %71 = and i64 %70, 6
  %or.cond = icmp eq i64 %71, 0
  br i1 %or.cond, label %96, label %.preheader86

.preheader86:                                     ; preds = %68
  %.not114 = icmp eq i64 %.091, 0
  br i1 %.not114, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader86
  %72 = getelementptr inbounds i8, ptr %61, i64 24
  %73 = load i64, ptr %72, align 8, !tbaa !22
  %74 = add i64 %73, %67
  %75 = getelementptr inbounds i8, ptr %61, i64 32
  br label %76

76:                                               ; preds = %.lr.ph, %87
  %.06987 = phi i64 [ 0, %.lr.ph ], [ %88, %87 ]
  %77 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %58, i64 %.06987
  %78 = getelementptr inbounds i8, ptr %77, i64 8
  %79 = load i64, ptr %78, align 8, !tbaa !23
  %.not83 = icmp ult i64 %73, %79
  br i1 %.not83, label %87, label %80

80:                                               ; preds = %76
  %81 = load i64, ptr %75, align 8, !tbaa !19
  %82 = add i64 %74, %81
  %83 = getelementptr inbounds i8, ptr %77, i64 16
  %84 = load i64, ptr %83, align 8, !tbaa !25
  %85 = add i64 %84, %79
  %86 = icmp ult i64 %82, %85
  br i1 %86, label %._crit_edge, label %87

87:                                               ; preds = %76, %80
  %88 = add nuw i64 %.06987, 1
  %exitcond.not = icmp eq i64 %88, %.091
  br i1 %exitcond.not, label %._crit_edge.thread, label %76, !llvm.loop !26

._crit_edge:                                      ; preds = %80, %.preheader86
  %.069.lcssa = phi i64 [ 0, %.preheader86 ], [ %.06987, %80 ]
  %89 = icmp eq i64 %.069.lcssa, %.091
  br i1 %89, label %._crit_edge.thread, label %96

._crit_edge.thread:                               ; preds = %87, %._crit_edge
  %90 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %58, i64 %.091
  store i64 %.06690, ptr %90, align 8, !tbaa !28
  %91 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %59, i64 %.06690, i32 3
  %92 = load i64, ptr %91, align 8, !tbaa !22
  %93 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %58, i64 %.091, i32 1
  store i64 %92, ptr %93, align 8, !tbaa !23
  %94 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %58, i64 %.091, i32 2
  store i64 %67, ptr %94, align 8, !tbaa !25
  %95 = add i64 %.091, 1
  br label %96

96:                                               ; preds = %68, %60, %65, %._crit_edge, %._crit_edge.thread
  %.1 = phi i64 [ %95, %._crit_edge.thread ], [ %.091, %._crit_edge ], [ %.091, %65 ], [ %.091, %60 ], [ %.091, %68 ]
  %97 = add nuw nsw i64 %.06690, 1
  %exitcond119.not = icmp eq i64 %97, %56
  br i1 %exitcond119.not, label %._crit_edge94, label %60, !llvm.loop !29

._crit_edge94:                                    ; preds = %96
  switch i64 %.1, label %.preheader84 [
    i64 0, label %._crit_edge94.thread
    i64 1, label %._crit_edge97
  ]

._crit_edge94.thread:                             ; preds = %._crit_edge94, %27
  %98 = load ptr, ptr @source_file, align 8, !tbaa !5
  %99 = tail call i32 @fclose(ptr noundef %98)
  %100 = load ptr, ptr @binary_file, align 8, !tbaa !5
  %101 = tail call i32 @fclose(ptr noundef %100)
  br label %159

.preheader84:                                     ; preds = %._crit_edge94, %119
  %.pre122 = phi ptr [ %.pre122123, %119 ], [ %58, %._crit_edge94 ]
  %102 = phi i64 [ %120, %119 ], [ 1, %._crit_edge94 ]
  %.16796 = phi i64 [ %102, %119 ], [ 0, %._crit_edge94 ]
  br label %103

103:                                              ; preds = %.preheader84, %115
  %.pre122124 = phi ptr [ %.pre122123, %115 ], [ %.pre122, %.preheader84 ]
  %104 = phi ptr [ %116, %115 ], [ %.pre122, %.preheader84 ]
  %.170 = phi i64 [ %117, %115 ], [ %102, %.preheader84 ]
  %105 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %104, i64 %.170, i32 1
  %106 = load i64, ptr %105, align 8, !tbaa !23
  %107 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %104, i64 %.16796
  %108 = getelementptr inbounds i8, ptr %107, i64 8
  %109 = load i64, ptr %108, align 8, !tbaa !23
  %110 = icmp ult i64 %106, %109
  br i1 %110, label %111, label %115

111:                                              ; preds = %103
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %107, i64 24, i1 false), !tbaa.struct !30
  %112 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %104, i64 %.170
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %107, ptr noundef nonnull align 8 dereferenceable(24) %112, i64 24, i1 false), !tbaa.struct !30
  %113 = load ptr, ptr @code_section_array, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %113, i64 %.170
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 8 dereferenceable(24) %3, i64 24, i1 false), !tbaa.struct !30
  %.pre = load ptr, ptr @code_section_array, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %111, %103
  %.pre122123 = phi ptr [ %.pre, %111 ], [ %.pre122124, %103 ]
  %116 = phi ptr [ %.pre, %111 ], [ %104, %103 ]
  %117 = add nuw i64 %.170, 1
  %118 = icmp ult i64 %117, %.1
  br i1 %118, label %103, label %119, !llvm.loop !32

119:                                              ; preds = %115
  %120 = add nuw i64 %102, 1
  %exitcond120.not = icmp eq i64 %120, %.1
  br i1 %exitcond120.not, label %._crit_edge97, label %.preheader84, !llvm.loop !33

._crit_edge97:                                    ; preds = %119, %._crit_edge94
  %121 = phi ptr [ %58, %._crit_edge94 ], [ %116, %119 ]
  %122 = getelementptr inbounds i8, ptr %121, i64 8
  %123 = load i64, ptr %122, align 8, !tbaa !23
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge97, %._crit_edge109
  %.064112 = phi i64 [ %123, %._crit_edge97 ], [ %.2.lcssa, %._crit_edge109 ]
  %.268111 = phi i64 [ 0, %._crit_edge97 ], [ %153, %._crit_edge109 ]
  %124 = load ptr, ptr @code_section_array, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %124, i64 %.268111
  %126 = getelementptr inbounds i8, ptr %125, i64 8
  %127 = load i64, ptr %126, align 8, !tbaa !23
  %128 = icmp ult i64 %.064112, %127
  br i1 %128, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %.preheader, %.lr.ph99
  %.16598 = phi i64 [ %130, %.lr.ph99 ], [ %.064112, %.preheader ]
  %129 = load ptr, ptr @binary_file, align 8, !tbaa !5
  %fputc79 = tail call i32 @fputc(i32 0, ptr %129)
  %130 = add nuw i64 %.16598, 1
  %131 = load ptr, ptr @code_section_array, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %131, i64 %.268111
  %133 = getelementptr inbounds i8, ptr %132, i64 8
  %134 = load i64, ptr %133, align 8, !tbaa !23
  %135 = icmp ult i64 %130, %134
  br i1 %135, label %.lr.ph99, label %._crit_edge100, !llvm.loop !34

._crit_edge100:                                   ; preds = %.lr.ph99, %.preheader
  %.165.lcssa = phi i64 [ %.064112, %.preheader ], [ %130, %.lr.ph99 ]
  %.lcssa = phi ptr [ %125, %.preheader ], [ %132, %.lr.ph99 ]
  %136 = getelementptr inbounds i8, ptr %.lcssa, i64 16
  %137 = load i64, ptr %136, align 8, !tbaa !25
  %138 = tail call noalias ptr @malloc(i64 noundef %137) #6
  %139 = load i64, ptr %.lcssa, align 8, !tbaa !28
  %140 = load ptr, ptr @section_header, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ELF_SECTION_HEADER_STRUCT, ptr %140, i64 %139, i32 4
  %142 = load i64, ptr %141, align 8, !tbaa !19
  %143 = trunc i64 %137 to i32
  %144 = tail call i32 @elf_object_read(i64 noundef %142, ptr noundef %138, i32 noundef %143)
  %145 = load ptr, ptr @code_section_array, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.CODE_SECTION_ENTRY_STRUCT, ptr %145, i64 %.268111, i32 2
  %147 = load i64, ptr %146, align 8, !tbaa !25
  %.not76103 = icmp eq i64 %147, 0
  br i1 %.not76103, label %._crit_edge109, label %.lr.ph108

.lr.ph108:                                        ; preds = %._crit_edge100, %.lr.ph108
  %.063106 = phi i64 [ %150, %.lr.ph108 ], [ %147, %._crit_edge100 ]
  %.271104 = phi i64 [ %151, %.lr.ph108 ], [ 0, %._crit_edge100 ]
  %148 = getelementptr inbounds i8, ptr %138, i64 %.271104
  %149 = load ptr, ptr @binary_file, align 8, !tbaa !5
  %char = load i8, ptr %148, align 1
  %chari = sext i8 %char to i32
  %fputc = tail call i32 @fputc(i32 %chari, ptr %149)
  %150 = add i64 %.063106, -1
  %151 = add nuw i64 %.271104, 1
  %.not76 = icmp eq i64 %150, 0
  br i1 %.not76, label %._crit_edge109.loopexit, label %.lr.ph108, !llvm.loop !35

._crit_edge109.loopexit:                          ; preds = %.lr.ph108
  %152 = add i64 %.165.lcssa, %147
  br label %._crit_edge109

._crit_edge109:                                   ; preds = %._crit_edge109.loopexit, %._crit_edge100
  %.2.lcssa = phi i64 [ %.165.lcssa, %._crit_edge100 ], [ %152, %._crit_edge109.loopexit ]
  %153 = add nuw i64 %.268111, 1
  %exitcond121.not = icmp eq i64 %153, %.1
  br i1 %exitcond121.not, label %154, label %.preheader, !llvm.loop !36

154:                                              ; preds = %._crit_edge109
  %155 = load ptr, ptr @source_file, align 8, !tbaa !5
  %156 = tail call i32 @fclose(ptr noundef %155)
  %157 = load ptr, ptr @binary_file, align 8, !tbaa !5
  %158 = tail call i32 @fclose(ptr noundef %157)
  br label %159

159:                                              ; preds = %154, %._crit_edge94.thread, %23, %14, %4
  %.062 = phi i32 [ 1, %4 ], [ 2, %14 ], [ 3, %23 ], [ 4, %._crit_edge94.thread ], [ 0, %154 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3)
  ret i32 %.062
}

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr 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) #4

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

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 = { 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind }
attributes #6 = { 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, !11, i64 68}
!10 = !{!"ELF_HEADER_STRUCT", !7, i64 0, !11, i64 16, !11, i64 18, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !11, i64 64, !11, i64 66, !11, i64 68, !11, i64 70, !11, i64 72, !11, i64 74}
!11 = !{!"short", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 40}
!14 = !{!10, !11, i64 72}
!15 = !{!10, !12, i64 48}
!16 = !{!10, !11, i64 74}
!17 = !{!18, !12, i64 40}
!18 = !{!"ELF_SECTION_HEADER_STRUCT", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72}
!19 = !{!18, !12, i64 32}
!20 = !{!18, !12, i64 8}
!21 = !{!18, !12, i64 16}
!22 = !{!18, !12, i64 24}
!23 = !{!24, !12, i64 8}
!24 = !{!"CODE_SECTION_ENTRY_STRUCT", !12, i64 0, !12, i64 8, !12, i64 16}
!25 = !{!24, !12, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!24, !12, i64 0}
!29 = distinct !{!29, !27}
!30 = !{i64 0, i64 8, !31, i64 8, i64 8, !31, i64 16, i64 8, !31}
!31 = !{!12, !12, i64 0}
!32 = distinct !{!32, !27}
!33 = distinct !{!33, !27}
!34 = distinct !{!34, !27}
!35 = distinct !{!35, !27}
!36 = distinct !{!36, !27}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass