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

; 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 %80

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 255, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %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 %79

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  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 %78

41:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #5
  store i16 0, ptr %11, align 2, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  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 = icmp sgt i32 %51, 12300
  br i1 %52, label %53, label %77

53:                                               ; preds = %41
  %54 = load i16, ptr %11, align 2, !tbaa !13
  %55 = zext i16 %54 to i32
  %56 = icmp slt i32 %55, 12350
  br i1 %56, label %57, label %77

57:                                               ; preds = %53
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = icmp slt i32 %58, -100000000
  br i1 %59, label %60, label %77

60:                                               ; preds = %57
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, -100000005
  br i1 %62, label %63, label %77

63:                                               ; preds = %60
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = icmp ne i32 %64, -100000003
  br i1 %65, label %66, label %77

66:                                               ; preds = %63
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = icmp sge i32 %67, 987654321
  br i1 %68, label %69, label %77

69:                                               ; preds = %66
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = icmp sle i32 %70, 987654325
  br i1 %71, label %72, label %77

72:                                               ; preds = %69
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 123456789
  br i1 %74, label %75, label %77

75:                                               ; preds = %72
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @abort() #6
  unreachable

77:                                               ; preds = %72, %69, %66, %63, %60, %57, %53, %41
  store i32 7, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #5
  br label %78

78:                                               ; preds = %77, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %79

79:                                               ; preds = %78, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 255, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %80

80:                                               ; preds = %79, %17
  %81 = load i32, ptr %3, align 4
  ret i32 %81
}

; 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: noreturn nounwind
declare void @abort() #4

; 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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { noreturn 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: nounwind uwtable
define dso_local range(i32 0, 8) 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 %30, label %5

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %3) #4
  %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.copyload22 = load i16, ptr %14, align 1
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %.0.copyload19 = load i32, ptr %15, align 4
  %16 = getelementptr inbounds i8, ptr %3, i64 10
  %.0.copyload15 = 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.copyload22, -12301
  %or.cond = icmp ult i16 %18, 49
  %19 = and i32 %.0.copyload15, -4
  %20 = icmp eq i32 %19, -100000004
  %21 = icmp ne i32 %.0.copyload15, -100000003
  %22 = and i1 %21, %20
  %or.cond8 = select i1 %or.cond, i1 %22, i1 false
  %23 = add i32 %.0.copyload19, -987654321
  %24 = icmp ult i32 %23, 5
  %or.cond12 = select i1 %or.cond8, i1 %24, i1 false
  %25 = icmp eq i32 %.0.copyload, 123456789
  %or.cond14 = select i1 %or.cond12, i1 %25, i1 false
  br i1 %or.cond14, label %26, label %29

26:                                               ; preds = %13
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void @abort() #5
  unreachable

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

29:                                               ; preds = %.sink.split, %13
  %.1 = phi i32 [ 7, %13 ], [ 0, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %3) #4
  br label %30

30:                                               ; preds = %2, %29
  %.2 = phi i32 [ %.1, %29 ], [ 0, %2 ]
  ret i32 %.2
}

; 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: noreturn nounwind
declare void @abort() 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 = { 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 = { noreturn 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 }
attributes #5 = { noreturn 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,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass