; LLVM IR from holzschu/ios_system :: shell_cmds/seq (seq)

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

@decimal_point = external dso_local global ptr, align 8

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

; Function Attrs: nounwind uwtable
define dso_local i32 @numeric(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = load i8, ptr %5, align 1, !tbaa !9
  %7 = zext i8 %6 to i32
  %8 = icmp eq i32 %7, 45
  br i1 %8, label %14, label %9

9:                                                ; preds = %1
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = load i8, ptr %10, align 1, !tbaa !9
  %12 = zext i8 %11 to i32
  %13 = icmp eq i32 %12, 43
  br i1 %13, label %14, label %17

14:                                               ; preds = %9, %1
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i32 1
  store ptr %16, ptr %2, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %14, %9
  store i32 0, ptr %3, align 4, !tbaa !10
  %18 = load ptr, ptr @decimal_point, align 8, !tbaa !5
  %19 = call i64 @strlen(ptr noundef %18) #5
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %4, align 4, !tbaa !10
  br label %21

21:                                               ; preds = %91, %86, %47, %17
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %94

25:                                               ; preds = %21
  %26 = call ptr @__ctype_b_loc() #6
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = zext i8 %29 to i32
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i16, ptr %27, i64 %31
  %33 = load i16, ptr %32, align 2, !tbaa !12
  %34 = zext i16 %33 to i32
  %35 = and i32 %34, 2048
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %91, label %37

37:                                               ; preds = %25
  %38 = load i32, ptr %3, align 4, !tbaa !10
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %52, label %40

40:                                               ; preds = %37
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = load ptr, ptr @decimal_point, align 8, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !10
  %44 = sext i32 %43 to i64
  %45 = call i32 @strncmp(ptr noundef %41, ptr noundef %42, i64 noundef %44) #5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %40
  %48 = load i32, ptr %4, align 4, !tbaa !10
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  store ptr %51, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !10
  br label %21, !llvm.loop !14

52:                                               ; preds = %40, %37
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = zext i8 %54 to i32
  %56 = icmp eq i32 %55, 101
  br i1 %56, label %62, label %57

57:                                               ; preds = %52
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = load i8, ptr %58, align 1, !tbaa !9
  %60 = zext i8 %59 to i32
  %61 = icmp eq i32 %60, 69
  br i1 %61, label %62, label %90

62:                                               ; preds = %57, %52
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i32 1
  store ptr %64, ptr %2, align 8, !tbaa !5
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = zext i8 %66 to i32
  %68 = icmp eq i32 %67, 45
  br i1 %68, label %86, label %69

69:                                               ; preds = %62
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = load i8, ptr %70, align 1, !tbaa !9
  %72 = zext i8 %71 to i32
  %73 = icmp eq i32 %72, 43
  br i1 %73, label %86, label %74

74:                                               ; preds = %69
  %75 = call ptr @__ctype_b_loc() #6
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = load i8, ptr %77, align 1, !tbaa !9
  %79 = zext i8 %78 to i32
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i16, ptr %76, i64 %80
  %82 = load i16, ptr %81, align 2, !tbaa !12
  %83 = zext i16 %82 to i32
  %84 = and i32 %83, 2048
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %89

86:                                               ; preds = %74, %69, %62
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i32 1
  store ptr %88, ptr %2, align 8, !tbaa !5
  br label %21, !llvm.loop !14

89:                                               ; preds = %74
  br label %90

90:                                               ; preds = %89, %57
  br label %94

91:                                               ; preds = %25
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i32 1
  store ptr %93, ptr %2, align 8, !tbaa !5
  br label %21, !llvm.loop !14

94:                                               ; preds = %90, %21
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = load i8, ptr %95, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = icmp eq i32 %97, 0
  %99 = zext i1 %98 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret i32 %99
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind willreturn memory(read) "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 willreturn memory(none) "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 = { nounwind willreturn memory(read) }
attributes #6 = { nounwind willreturn memory(none) }

!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}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !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"

@decimal_point = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local range(i32 0, 2) i32 @numeric(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = load i8, ptr %0, align 1, !tbaa !5
  switch i8 %2, label %5 [
    i8 45, label %3
    i8 43, label %3
  ]

3:                                                ; preds = %1, %1
  %4 = getelementptr inbounds i8, ptr %0, i64 1
  %.pre = load i8, ptr %4, align 1, !tbaa !5
  br label %5

5:                                                ; preds = %1, %3
  %6 = phi i8 [ %.pre, %3 ], [ %2, %1 ]
  %.0 = phi ptr [ %4, %3 ], [ %0, %1 ]
  %7 = load ptr, ptr @decimal_point, align 8, !tbaa !8
  %.not3150 = icmp eq i8 %6, 0
  br i1 %.not3150, label %.split.loop.exit, label %.lr.ph.lr.ph

.lr.ph.lr.ph:                                     ; preds = %5
  %8 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #3
  %9 = tail call ptr @__ctype_b_loc() #4
  %10 = load ptr, ptr %9, align 8, !tbaa !8
  %sext = shl i64 %8, 32
  %11 = ashr exact i64 %sext, 32
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.lr.ph, %.backedge.us
  %12 = phi i8 [ %30, %.backedge.us ], [ %6, %.lr.ph.lr.ph ]
  %.132.us = phi ptr [ %29, %.backedge.us ], [ %.0, %.lr.ph.lr.ph ]
  %13 = zext i8 %12 to i64
  %14 = getelementptr inbounds i16, ptr %10, i64 %13
  %15 = load i16, ptr %14, align 2, !tbaa !10
  %16 = and i16 %15, 2048
  %.not23.us = icmp eq i16 %16, 0
  br i1 %.not23.us, label %17, label %.backedge.us

17:                                               ; preds = %.lr.ph.split.us
  %18 = tail call i32 @strncmp(ptr noundef nonnull %.132.us, ptr noundef %7, i64 noundef %11) #3
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %.split.us, label %20

20:                                               ; preds = %17
  switch i8 %12, label %.split.loop.exit [
    i8 101, label %21
    i8 69, label %21
  ]

21:                                               ; preds = %20, %20
  %22 = getelementptr inbounds i8, ptr %.132.us, i64 1
  %23 = load i8, ptr %22, align 1, !tbaa !5
  switch i8 %23, label %24 [
    i8 45, label %.backedge.us
    i8 43, label %.backedge.us
  ]

24:                                               ; preds = %21
  %25 = zext i8 %23 to i64
  %26 = getelementptr inbounds i16, ptr %10, i64 %25
  %27 = load i16, ptr %26, align 2, !tbaa !10
  %28 = and i16 %27, 2048
  %.not25.us = icmp eq i16 %28, 0
  br i1 %.not25.us, label %.split.loop.exit, label %.backedge.us

.backedge.us:                                     ; preds = %21, %21, %24, %.lr.ph.split.us
  %.sink = phi i64 [ 1, %.lr.ph.split.us ], [ 2, %24 ], [ 2, %21 ], [ 2, %21 ]
  %29 = getelementptr inbounds i8, ptr %.132.us, i64 %.sink
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %.not.us = icmp eq i8 %30, 0
  br i1 %.not.us, label %.split.loop.exit, label %.lr.ph.split.us, !llvm.loop !12

.split.us:                                        ; preds = %17
  %31 = getelementptr inbounds i8, ptr %.132.us, i64 %11
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %.not31 = icmp eq i8 %32, 0
  br i1 %.not31, label %.split.loop.exit, label %.lr.ph.split, !llvm.loop !12

.lr.ph.split:                                     ; preds = %.split.us, %.backedge
  %33 = phi i8 [ %48, %.backedge ], [ %32, %.split.us ]
  %.132 = phi ptr [ %47, %.backedge ], [ %31, %.split.us ]
  %34 = zext i8 %33 to i64
  %35 = getelementptr inbounds i16, ptr %10, i64 %34
  %36 = load i16, ptr %35, align 2, !tbaa !10
  %37 = and i16 %36, 2048
  %.not23 = icmp eq i16 %37, 0
  br i1 %.not23, label %38, label %.backedge

38:                                               ; preds = %.lr.ph.split
  switch i8 %33, label %.split.loop.exit [
    i8 101, label %39
    i8 69, label %39
  ]

39:                                               ; preds = %38, %38
  %40 = getelementptr inbounds i8, ptr %.132, i64 1
  %41 = load i8, ptr %40, align 1, !tbaa !5
  switch i8 %41, label %42 [
    i8 45, label %.backedge
    i8 43, label %.backedge
  ]

42:                                               ; preds = %39
  %43 = zext i8 %41 to i64
  %44 = getelementptr inbounds i16, ptr %10, i64 %43
  %45 = load i16, ptr %44, align 2, !tbaa !10
  %46 = and i16 %45, 2048
  %.not25 = icmp eq i16 %46, 0
  br i1 %.not25, label %.split.loop.exit, label %.backedge

.backedge:                                        ; preds = %42, %39, %39, %.lr.ph.split
  %.sink78 = phi i64 [ 1, %.lr.ph.split ], [ 2, %39 ], [ 2, %39 ], [ 2, %42 ]
  %47 = getelementptr inbounds i8, ptr %.132, i64 %.sink78
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %.not = icmp eq i8 %48, 0
  br i1 %.not, label %.split.loop.exit, label %.lr.ph.split, !llvm.loop !12

.split.loop.exit:                                 ; preds = %.backedge.us, %20, %24, %.backedge, %38, %42, %.split.us, %5
  %49 = phi i8 [ 0, %5 ], [ 0, %.split.us ], [ 1, %38 ], [ 0, %.backedge ], [ %41, %42 ], [ 0, %.backedge.us ], [ 1, %20 ], [ %23, %24 ]
  %50 = icmp eq i8 %49, 0
  %51 = zext i1 %50 to i32
  ret i32 %51
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { nofree nounwind memory(read, inaccessiblemem: none) 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 nofree nounwind willreturn memory(argmem: read) "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 #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 willreturn memory(read) }
attributes #4 = { nounwind willreturn memory(none) }

!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/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass