; LLVM IR from AngoraFuzzer/Angora :: tests/mini2 (mini2)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 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 ptr, align 8
  %7 = alloca [255 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i16, align 2
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = 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
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 2
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  br label %88

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 255, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call noalias ptr @fopen(ptr noundef %21, ptr noundef @.str)
  store ptr %22, ptr %6, align 8, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = icmp ne ptr %23, null
  br i1 %24, label %27, label %25

25:                                               ; preds = %18
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %87

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 20, ptr %10, align 4, !tbaa !5
  %28 = getelementptr inbounds [255 x i8], ptr %7, i64 0, i64 0
  %29 = load i32, ptr %10, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  %32 = call i64 @fread(ptr noundef %28, i64 noundef 1, i64 noundef %30, ptr noundef %31)
  store i64 %32, ptr %8, align 8, !tbaa !11
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = call i32 @fclose(ptr noundef %33)
  %35 = load i64, ptr %8, align 8, !tbaa !11
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp ult i64 %35, %37
  br i1 %38, label %39, label %41

39:                                               ; preds = %27
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %86

41:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #4
  store i16 0, ptr %11, align 2, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  %42 = getelementptr inbounds [255 x i8], ptr %7, i64 0, i64 0
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %11, ptr align 1 %43, i64 2, i1 false)
  %44 = getelementptr inbounds [255 x i8], ptr %7, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 1 %45, i64 4, i1 false)
  %46 = getelementptr inbounds [255 x i8], ptr %7, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 1 %47, i64 4, i1 false)
  %48 = getelementptr inbounds [255 x i8], ptr %7, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 1 %49, i64 4, i1 false)
  %50 = load i16, ptr %11, align 2, !tbaa !13
  %51 = zext i16 %50 to i32
  %52 = sub nsw i32 %51, 12300
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %54, label %85

54:                                               ; preds = %41
  %55 = load i16, ptr %11, align 2, !tbaa !13
  %56 = zext i16 %55 to i32
  %57 = sub nsw i32 %56, 12350
  %58 = icmp slt i32 %57, 0
  br i1 %58, label %59, label %85

59:                                               ; preds = %54
  %60 = load i32, ptr %13, align 4, !tbaa !5
  %61 = add nsw i32 %60, 100000000
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %63, label %85

63:                                               ; preds = %59
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = add nsw i32 %64, 100000005
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %67, label %85

67:                                               ; preds = %63
  %68 = load i32, ptr %13, align 4, !tbaa !5
  %69 = add nsw i32 %68, 100000003
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %85

71:                                               ; preds = %67
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 987654321
  %74 = icmp sge i32 %73, 0
  br i1 %74, label %75, label %85

75:                                               ; preds = %71
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 987654325
  %78 = icmp sle i32 %77, 0
  br i1 %78, label %79, label %85

79:                                               ; preds = %75
  %80 = load i32, ptr %14, align 4, !tbaa !5
  %81 = sub i32 %80, 123456789
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %79
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %85

85:                                               ; preds = %83, %79, %75, %71, %67, %63, %59, %54, %41
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 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 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #4
  br label %86

86:                                               ; preds = %85, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %87

87:                                               ; preds = %86, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 255, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %88

88:                                               ; preds = %87, %17
  %89 = load i32, ptr %3, align 4
  ret i32 %89
}

; 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 i32 @printf(ptr noundef, ...) #2

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

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) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, 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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [255 x i8], align 16
  %4 = icmp slt i32 %0, 2
  br i1 %4, label %26, label %5

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %3) #3
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call noalias ptr @fopen(ptr noundef %7, ptr noundef nonnull @.str)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %.sink.split, label %9

9:                                                ; preds = %5
  %10 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 1, i64 noundef 20, ptr noundef nonnull %8)
  %11 = tail call i32 @fclose(ptr noundef nonnull %8)
  %12 = icmp ult i64 %10, 20
  br i1 %12, label %.sink.split, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %3, i64 1
  %.0.copyload8 = load i16, ptr %14, align 1
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %.0.copyload5 = load i32, ptr %15, align 4
  %16 = getelementptr inbounds i8, ptr %3, i64 10
  %.0.copyload1 = load i32, ptr %16, align 2
  %17 = getelementptr inbounds i8, ptr %3, i64 14
  %.0.copyload = load i32, ptr %17, align 2
  %18 = add i16 %.0.copyload8, -12301
  %or.cond = icmp ult i16 %18, 49
  %19 = and i32 %.0.copyload1, -4
  %20 = icmp eq i32 %19, -100000004
  %.not19 = icmp ne i32 %.0.copyload1, -100000003
  %.not31 = and i1 %.not19, %20
  %or.cond22.not29 = select i1 %or.cond, i1 %.not31, i1 false
  %21 = add i32 %.0.copyload5, -987654321
  %22 = icmp ult i32 %21, 5
  %or.cond24 = select i1 %or.cond22.not29, i1 %22, i1 false
  %23 = icmp eq i32 %.0.copyload, 123456789
  %or.cond25 = select i1 %or.cond24, i1 %23, i1 false
  br i1 %or.cond25, label %.sink.split, label %25

.sink.split:                                      ; preds = %13, %9, %5
  %.str.2.sink = phi ptr [ @.str.1, %5 ], [ @.str.2, %9 ], [ @.str.3, %13 ]
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
  br label %25

25:                                               ; preds = %.sink.split, %13
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %3) #3
  br label %26

26:                                               ; preds = %2, %25
  ret i32 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: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; 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 = { 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 = { 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"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass