; LLVM IR from cornell-zhang/rosetta :: BNN/cpp/minizip (miniunz)

; 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.tm_unz_s = type { i32, i32, i32, i32, i32, i32 }
%struct.utimbuf = type { i64, i64 }
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @change_file_date(ptr noundef %0, i64 noundef %1, ptr noundef byval(%struct.tm_unz_s) align 8 %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %struct.utimbuf, align 8
  %7 = alloca %struct.tm, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 56, ptr %7) #3
  %8 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 0
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 0
  store i32 %9, ptr %10, align 8, !tbaa !14
  %11 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 1
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 1
  store i32 %12, ptr %13, align 4, !tbaa !17
  %14 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 2
  %15 = load i32, ptr %14, align 8, !tbaa !18
  %16 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 2
  store i32 %15, ptr %16, align 8, !tbaa !19
  %17 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 3
  %18 = load i32, ptr %17, align 4, !tbaa !20
  %19 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 3
  store i32 %18, ptr %19, align 4, !tbaa !21
  %20 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 4
  %21 = load i32, ptr %20, align 8, !tbaa !22
  %22 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 4
  store i32 %21, ptr %22, align 8, !tbaa !23
  %23 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !24
  %25 = icmp ugt i32 %24, 1900
  br i1 %25, label %26, label %31

26:                                               ; preds = %3
  %27 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 5
  %28 = load i32, ptr %27, align 4, !tbaa !24
  %29 = sub i32 %28, 1900
  %30 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 5
  store i32 %29, ptr %30, align 4, !tbaa !25
  br label %35

31:                                               ; preds = %3
  %32 = getelementptr inbounds %struct.tm_unz_s, ptr %2, i32 0, i32 5
  %33 = load i32, ptr %32, align 4, !tbaa !24
  %34 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 5
  store i32 %33, ptr %34, align 4, !tbaa !25
  br label %35

35:                                               ; preds = %31, %26
  %36 = getelementptr inbounds %struct.tm, ptr %7, i32 0, i32 8
  store i32 -1, ptr %36, align 8, !tbaa !26
  %37 = call i64 @mktime(ptr noundef %7) #3
  %38 = getelementptr inbounds %struct.utimbuf, ptr %6, i32 0, i32 1
  store i64 %37, ptr %38, align 8, !tbaa !27
  %39 = getelementptr inbounds %struct.utimbuf, ptr %6, i32 0, i32 0
  store i64 %37, ptr %39, align 8, !tbaa !29
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call i32 @utime(ptr noundef %40, ptr noundef %6) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  ret void
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"tm_unz_s", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"tm", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !10, i64 40, !6, i64 48}
!16 = !{!12, !13, i64 4}
!17 = !{!15, !13, i64 4}
!18 = !{!12, !13, i64 8}
!19 = !{!15, !13, i64 8}
!20 = !{!12, !13, i64 12}
!21 = !{!15, !13, i64 12}
!22 = !{!12, !13, i64 16}
!23 = !{!15, !13, i64 16}
!24 = !{!12, !13, i64 20}
!25 = !{!15, !13, i64 20}
!26 = !{!15, !13, i64 32}
!27 = !{!28, !10, i64 8}
!28 = !{!"utimbuf", !10, i64 0, !10, i64 8}
!29 = !{!28, !10, i64 0}


; 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.tm_unz_s = type { i32, i32, i32, i32, i32, i32 }
%struct.utimbuf = type { i64, i64 }
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, ptr }

; Function Attrs: nofree nounwind uwtable
define dso_local void @change_file_date(ptr nocapture noundef readonly %0, i64 noundef %1, ptr nocapture noundef readonly byval(%struct.tm_unz_s) align 8 %2) local_unnamed_addr #0 {
  %4 = alloca %struct.utimbuf, align 8
  %5 = alloca %struct.tm, align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #4
  %6 = load <4 x i32>, ptr %2, align 8, !tbaa !5
  store <4 x i32> %6, ptr %5, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 %8, ptr %9, align 16, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %2, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !15
  %12 = icmp ugt i32 %11, 1900
  %13 = add i32 %11, -1900
  %spec.select = select i1 %12, i32 %13, i32 %11
  %14 = getelementptr inbounds i8, ptr %5, i64 20
  store i32 %spec.select, ptr %14, align 4
  %15 = getelementptr inbounds i8, ptr %5, i64 32
  store i32 -1, ptr %15, align 16, !tbaa !16
  %16 = call i64 @mktime(ptr noundef nonnull %5) #4
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %16, ptr %17, align 8, !tbaa !17
  store i64 %16, ptr %4, align 8, !tbaa !19
  %18 = call i32 @utime(ptr noundef %0, ptr noundef nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  ret void
}

; 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 nofree nounwind willreturn
declare noundef i64 @mktime(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !6, i64 16}
!10 = !{!"tm_unz_s", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!11 = !{!12, !6, i64 16}
!12 = !{!"tm", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !13, i64 40, !14, i64 48}
!13 = !{!"long", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!10, !6, i64 20}
!16 = !{!12, !6, i64 32}
!17 = !{!18, !13, i64 8}
!18 = !{!"utimbuf", !13, i64 0, !13, i64 8}
!19 = !{!18, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass