; LLVM IR from charcole/Z3 :: bios (combinedata)

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

@data = external dso_local global [524288 x i8], align 16
@roms = external dso_local global [4 x ptr], align 16
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %74, %0
  %5 = load i32, ptr %3, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 4
  br i1 %6, label %7, label %77

7:                                                ; preds = %4
  %8 = load i32, ptr %3, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [4 x ptr], ptr @roms, i64 0, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = call noalias ptr @fopen(ptr noundef %11, ptr noundef @.str.4)
  store ptr %12, ptr %2, align 8, !tbaa !9
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = mul nsw i32 131072, %13
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %15
  %17 = load ptr, ptr %2, align 8, !tbaa !9
  %18 = call i64 @fread(ptr noundef %16, i64 noundef 1, i64 noundef 131072, ptr noundef %17)
  %19 = load ptr, ptr %2, align 8, !tbaa !9
  %20 = call i32 @fclose(ptr noundef %19)
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %34

23:                                               ; preds = %7
  %24 = call noalias ptr @fopen(ptr noundef @.str.5, ptr noundef @.str.4)
  store ptr %24, ptr %2, align 8, !tbaa !9
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = mul nsw i32 131072, %25
  %27 = add nsw i32 %26, 92160
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %28
  %30 = load ptr, ptr %2, align 8, !tbaa !9
  %31 = call i64 @fread(ptr noundef %29, i64 noundef 1, i64 noundef 30720, ptr noundef %30)
  %32 = load ptr, ptr %2, align 8, !tbaa !9
  %33 = call i32 @fclose(ptr noundef %32)
  br label %34

34:                                               ; preds = %23, %7
  %35 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.4)
  store ptr %35, ptr %2, align 8, !tbaa !9
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = mul nsw i32 131072, %36
  %38 = add nsw i32 %37, 122880
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %39
  %41 = load ptr, ptr %2, align 8, !tbaa !9
  %42 = call i64 @fread(ptr noundef %40, i64 noundef 1, i64 noundef 1280, ptr noundef %41)
  %43 = load ptr, ptr %2, align 8, !tbaa !9
  %44 = call i32 @fclose(ptr noundef %43)
  %45 = call noalias ptr @fopen(ptr noundef @.str.7, ptr noundef @.str.4)
  store ptr %45, ptr %2, align 8, !tbaa !9
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = mul nsw i32 131072, %46
  %48 = add nsw i32 %47, 124160
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %49
  %51 = load ptr, ptr %2, align 8, !tbaa !9
  %52 = call i64 @fread(ptr noundef %50, i64 noundef 1, i64 noundef 128, ptr noundef %51)
  %53 = load ptr, ptr %2, align 8, !tbaa !9
  %54 = call i32 @fclose(ptr noundef %53)
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = trunc i32 %55 to i8
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = mul nsw i32 131072, %57
  %59 = add nsw i32 %58, 124287
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %60
  store i8 %56, ptr %61, align 1, !tbaa !11
  %62 = call noalias ptr @fopen(ptr noundef @.str.8, ptr noundef @.str.4)
  store ptr %62, ptr %2, align 8, !tbaa !9
  %63 = load ptr, ptr %2, align 8, !tbaa !9
  %64 = call i32 @fseek(ptr noundef %63, i64 noundef 124288, i32 noundef 0)
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = mul nsw i32 131072, %65
  %67 = add nsw i32 %66, 124288
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [524288 x i8], ptr @data, i64 0, i64 %68
  %70 = load ptr, ptr %2, align 8, !tbaa !9
  %71 = call i64 @fread(ptr noundef %69, i64 noundef 1, i64 noundef 6784, ptr noundef %70)
  %72 = load ptr, ptr %2, align 8, !tbaa !9
  %73 = call i32 @fclose(ptr noundef %72)
  br label %74

74:                                               ; preds = %34
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %3, align 4, !tbaa !5
  br label %4, !llvm.loop !12

77:                                               ; preds = %4
  %78 = call noalias ptr @fopen(ptr noundef @.str.9, ptr noundef @.str.10)
  store ptr %78, ptr %2, align 8, !tbaa !9
  %79 = load ptr, ptr %2, align 8, !tbaa !9
  %80 = call i64 @fwrite(ptr noundef @data, i64 noundef 1, i64 noundef 524288, ptr noundef %79)
  %81 = load ptr, ptr %2, align 8, !tbaa !9
  %82 = call i32 @fclose(ptr noundef %81)
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  %84 = load i32, ptr %1, align 4
  ret i32 %84
}

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

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

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

declare i32 @fclose(ptr noundef) #2

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

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

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

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

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 }

!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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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

@data = external dso_local global [524288 x i8], align 16
@roms = external dso_local local_unnamed_addr global [4 x ptr], align 16
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @roms, align 16, !tbaa !5
  %2 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.4)
  %3 = tail call i64 @fread(ptr noundef nonnull @data, i64 noundef 1, i64 noundef 131072, ptr noundef %2)
  %4 = tail call i32 @fclose(ptr noundef %2)
  %5 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4)
  %6 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 92160), i64 noundef 1, i64 noundef 30720, ptr noundef %5)
  %7 = tail call i32 @fclose(ptr noundef %5)
  %8 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4)
  %9 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 122880), i64 noundef 1, i64 noundef 1280, ptr noundef %8)
  %10 = tail call i32 @fclose(ptr noundef %8)
  %11 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4)
  %12 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 124160), i64 noundef 1, i64 noundef 128, ptr noundef %11)
  %13 = tail call i32 @fclose(ptr noundef %11)
  store i8 0, ptr getelementptr inbounds (i8, ptr @data, i64 124287), align 1, !tbaa !9
  %14 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4)
  %15 = tail call i32 @fseek(ptr noundef %14, i64 noundef 124288, i32 noundef 0)
  %16 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 124288), i64 noundef 1, i64 noundef 6784, ptr noundef %14)
  %17 = tail call i32 @fclose(ptr noundef %14)
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @roms, i64 8), align 8, !tbaa !5
  %19 = tail call noalias ptr @fopen(ptr noundef %18, ptr noundef nonnull @.str.4)
  %20 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 131072), i64 noundef 1, i64 noundef 131072, ptr noundef %19)
  %21 = tail call i32 @fclose(ptr noundef %19)
  %22 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4)
  %23 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 253952), i64 noundef 1, i64 noundef 1280, ptr noundef %22)
  %24 = tail call i32 @fclose(ptr noundef %22)
  %25 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4)
  %26 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 255232), i64 noundef 1, i64 noundef 128, ptr noundef %25)
  %27 = tail call i32 @fclose(ptr noundef %25)
  store i8 1, ptr getelementptr inbounds (i8, ptr @data, i64 255359), align 1, !tbaa !9
  %28 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4)
  %29 = tail call i32 @fseek(ptr noundef %28, i64 noundef 124288, i32 noundef 0)
  %30 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 255360), i64 noundef 1, i64 noundef 6784, ptr noundef %28)
  %31 = tail call i32 @fclose(ptr noundef %28)
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @roms, i64 16), align 16, !tbaa !5
  %33 = tail call noalias ptr @fopen(ptr noundef %32, ptr noundef nonnull @.str.4)
  %34 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 262144), i64 noundef 1, i64 noundef 131072, ptr noundef %33)
  %35 = tail call i32 @fclose(ptr noundef %33)
  %36 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4)
  %37 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 385024), i64 noundef 1, i64 noundef 1280, ptr noundef %36)
  %38 = tail call i32 @fclose(ptr noundef %36)
  %39 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4)
  %40 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 386304), i64 noundef 1, i64 noundef 128, ptr noundef %39)
  %41 = tail call i32 @fclose(ptr noundef %39)
  store i8 2, ptr getelementptr inbounds (i8, ptr @data, i64 386431), align 1, !tbaa !9
  %42 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4)
  %43 = tail call i32 @fseek(ptr noundef %42, i64 noundef 124288, i32 noundef 0)
  %44 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 386432), i64 noundef 1, i64 noundef 6784, ptr noundef %42)
  %45 = tail call i32 @fclose(ptr noundef %42)
  %46 = load ptr, ptr getelementptr inbounds (i8, ptr @roms, i64 24), align 8, !tbaa !5
  %47 = tail call noalias ptr @fopen(ptr noundef %46, ptr noundef nonnull @.str.4)
  %48 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 393216), i64 noundef 1, i64 noundef 131072, ptr noundef %47)
  %49 = tail call i32 @fclose(ptr noundef %47)
  %50 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4)
  %51 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 516096), i64 noundef 1, i64 noundef 1280, ptr noundef %50)
  %52 = tail call i32 @fclose(ptr noundef %50)
  %53 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4)
  %54 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 517376), i64 noundef 1, i64 noundef 128, ptr noundef %53)
  %55 = tail call i32 @fclose(ptr noundef %53)
  store i8 3, ptr getelementptr inbounds (i8, ptr @data, i64 517503), align 1, !tbaa !9
  %56 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4)
  %57 = tail call i32 @fseek(ptr noundef %56, i64 noundef 124288, i32 noundef 0)
  %58 = tail call i64 @fread(ptr noundef nonnull getelementptr inbounds (i8, ptr @data, i64 517504), i64 noundef 1, i64 noundef 6784, ptr noundef %56)
  %59 = tail call i32 @fclose(ptr noundef %56)
  %60 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10)
  %61 = tail call i64 @fwrite(ptr noundef nonnull @data, i64 noundef 1, i64 noundef 524288, ptr noundef %60)
  %62 = tail call i32 @fclose(ptr noundef %60)
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  ret i32 0
}

; 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 i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

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

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

attributes #0 = { 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" }

!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 = !{!7, !7, i64 0}


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