; LLVM IR from generalized-intelligence/GAAS :: algorithms/src/SystemManagement/json_request_response_lib/src/third_party (LLVMFuzzerTestOneInput)

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

@_ZL4Sink = external hidden global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @LLVMFuzzerTestOneInput(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %5 = load i64, ptr %4, align 8, !tbaa !9
  %6 = icmp ugt i64 %5, 0
  br i1 %6, label %7, label %39

7:                                                ; preds = %2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 0
  %10 = load i8, ptr %9, align 1, !tbaa !11
  %11 = zext i8 %10 to i32
  %12 = icmp eq i32 %11, 72
  br i1 %12, label %13, label %39

13:                                               ; preds = %7
  store volatile i32 1, ptr @_ZL4Sink, align 4, !tbaa !12
  %14 = load i64, ptr %4, align 8, !tbaa !9
  %15 = icmp ugt i64 %14, 1
  br i1 %15, label %16, label %38

16:                                               ; preds = %13
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 1
  %19 = load i8, ptr %18, align 1, !tbaa !11
  %20 = zext i8 %19 to i32
  %21 = icmp eq i32 %20, 105
  br i1 %21, label %22, label %38

22:                                               ; preds = %16
  store volatile i32 2, ptr @_ZL4Sink, align 4, !tbaa !12
  %23 = load i64, ptr %4, align 8, !tbaa !9
  %24 = icmp ugt i64 %23, 2
  br i1 %24, label %25, label %37

25:                                               ; preds = %22
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 2
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = zext i8 %28 to i32
  %30 = icmp eq i32 %29, 33
  br i1 %30, label %31, label %37

31:                                               ; preds = %25
  store volatile i32 2, ptr @_ZL4Sink, align 4, !tbaa !12
  br label %32

32:                                               ; preds = %35, %31
  %33 = load volatile i32, ptr @_ZL4Sink, align 4, !tbaa !12
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  br label %32, !llvm.loop !14

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36, %25, %22
  br label %38

38:                                               ; preds = %37, %16, %13
  br label %39

39:                                               ; preds = %38, %7, %2
  ret i32 0
}

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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"

@_ZL4Sink = external hidden global i32, align 4

; Function Attrs: mustprogress nofree norecurse nounwind memory(readwrite, argmem: read) uwtable
define dso_local noundef i32 @LLVMFuzzerTestOneInput(ptr nocapture noundef readonly %0, i64 noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq i64 %1, 0
  br i1 %.not, label %.loopexit, label %3

3:                                                ; preds = %2
  %4 = load i8, ptr %0, align 1, !tbaa !5
  %5 = icmp eq i8 %4, 72
  br i1 %5, label %6, label %.loopexit

6:                                                ; preds = %3
  store volatile i32 1, ptr @_ZL4Sink, align 4, !tbaa !8
  %.not5 = icmp eq i64 %1, 1
  br i1 %.not5, label %.loopexit, label %7

7:                                                ; preds = %6
  %8 = getelementptr inbounds i8, ptr %0, i64 1
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %10 = icmp eq i8 %9, 105
  br i1 %10, label %11, label %.loopexit

11:                                               ; preds = %7
  store volatile i32 2, ptr @_ZL4Sink, align 4, !tbaa !8
  %12 = icmp ugt i64 %1, 2
  br i1 %12, label %13, label %.loopexit

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 2
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = icmp eq i8 %15, 33
  br i1 %16, label %17, label %.loopexit

17:                                               ; preds = %13
  store volatile i32 2, ptr @_ZL4Sink, align 4, !tbaa !8
  br label %18

18:                                               ; preds = %18, %17
  %19 = load volatile i32, ptr @_ZL4Sink, align 4, !tbaa !8
  %.not6 = icmp eq i32 %19, 0
  br i1 %.not6, label %.loopexit, label %18, !llvm.loop !10

.loopexit:                                        ; preds = %18, %6, %7, %13, %11, %3, %2
  ret i32 0
}

attributes #0 = { mustprogress nofree norecurse nounwind memory(readwrite, argmem: read) 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass