; LLVM IR from ARM-software/Arm-2D :: Helper/Source (arm_2d_helper_font)

; 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.anon.13 = type { %struct.arm_2d_region_t, %struct.arm_2d_region_t, %struct.arm_2d_location_t, %struct.anon.14, ptr, i32, i32, i8, i8, %struct.anon.15, %struct.anon.16, %struct.anon.17, %struct.arm_2d_scratch_mem_t, %struct.arm_2d_region_t, ptr }
%struct.arm_2d_location_t = type { i16, i16 }
%struct.anon.14 = type { i16, i16 }
%struct.anon.15 = type { i8, i8 }
%struct.anon.16 = type { %struct.arm_2d_size_t, %struct.arm_2d_size_t, %struct.arm_2d_region_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.anon.17 = type { %union.anon.18, i16, i16, [65 x i8] }
%union.anon.18 = type { i16 }
%struct.arm_2d_scratch_mem_t = type { %union.anon.19, i64 }
%union.anon.19 = type { %union.anon.20 }
%union.anon.20 = type { %struct.anon.21 }
%struct.anon.21 = type { i32 }
%struct.arm_2d_region_t = type { %union.anon.10, %union.anon.11 }
%union.anon.10 = type { %struct.arm_2d_location_t }
%union.anon.11 = type { %struct.arm_2d_size_t }

@s_tLCDTextControl = external hidden global %struct.anon.13, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @arm_lcd_text_get_actual_char_box() #2

; Function Attrs: nounwind uwtable
declare hidden void @__arm_lcd_draw_region_line_wrapping(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local signext i16 @lcd_draw_char(i16 noundef signext, i16 noundef signext, ptr noundef, i8 noundef zeroext) #2

declare zeroext i1 @__arm_2d_helper_pfb_is_region_active0(ptr noundef, ptr noundef, i1 noundef zeroext) #3

; Function Attrs: nounwind uwtable
define dso_local void @arm_lcd_puts(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.arm_2d_size_t, align 2
  %4 = alloca i32, align 4
  %5 = alloca %struct.arm_2d_size_t, align 2
  %6 = alloca i16, align 2
  %7 = alloca i16, align 2
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %8 = call i32 @arm_lcd_text_get_actual_char_box()
  store i32 %8, ptr %3, align 2
  %9 = load ptr, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 4), align 8, !tbaa !9
  %10 = call zeroext i1 @__arm_2d_helper_pfb_is_region_active0(ptr noundef %9, ptr noundef getelementptr inbounds (%struct.anon.16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 10), i32 0, i32 2), i1 noundef zeroext true)
  br i1 %10, label %12, label %11

11:                                               ; preds = %1
  store i32 1, ptr %4, align 4
  br label %120

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %5, ptr align 4 getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 1), i32 0, i32 1), i64 4, i1 false), !tbaa.struct !22
  br label %13

13:                                               ; preds = %116, %91, %12
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = load i8, ptr %14, align 1, !tbaa !24
  %16 = icmp ne i8 %15, 0
  br i1 %16, label %17, label %119

17:                                               ; preds = %13
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = load i8, ptr %18, align 1, !tbaa !24
  %20 = sext i8 %19 to i32
  %21 = icmp eq i32 %20, 13
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  store i16 0, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  br label %116

23:                                               ; preds = %17
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = load i8, ptr %24, align 1, !tbaa !24
  %26 = sext i8 %25 to i32
  %27 = icmp eq i32 %26, 10
  br i1 %27, label %28, label %44

28:                                               ; preds = %23
  store i16 0, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %29 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 1
  %30 = load i16, ptr %29, align 2, !tbaa !26
  %31 = sext i16 %30 to i32
  %32 = load i16, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !27
  %33 = sext i16 %32 to i32
  %34 = add nsw i32 %33, %31
  %35 = trunc i32 %34 to i16
  store i16 %35, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !27
  %36 = load i16, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !27
  %37 = sext i16 %36 to i32
  %38 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 1
  %39 = load i16, ptr %38, align 2, !tbaa !26
  %40 = sext i16 %39 to i32
  %41 = icmp sge i32 %37, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %28
  store i16 0, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !27
  br label %43

43:                                               ; preds = %42, %28
  br label %115

44:                                               ; preds = %23
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !24
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 9
  br i1 %48, label %49, label %69

49:                                               ; preds = %44
  %50 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %51 = load i16, ptr %50, align 2, !tbaa !28
  %52 = sext i16 %51 to i32
  %53 = mul nsw i32 %52, 4
  %54 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %55 = sext i16 %54 to i32
  %56 = add nsw i32 %55, %53
  %57 = trunc i32 %56 to i16
  store i16 %57, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %58 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %59 = sext i16 %58 to i32
  %60 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %61 = load i16, ptr %60, align 2, !tbaa !28
  %62 = sext i16 %61 to i32
  %63 = mul nsw i32 %62, 4
  %64 = srem i32 %59, %63
  %65 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %66 = sext i16 %65 to i32
  %67 = sub nsw i32 %66, %64
  %68 = trunc i32 %67 to i16
  store i16 %68, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  call void @__arm_lcd_draw_region_line_wrapping(ptr noundef %3, ptr noundef %5)
  br label %114

69:                                               ; preds = %44
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = load i8, ptr %70, align 1, !tbaa !24
  %72 = sext i8 %71 to i32
  %73 = icmp eq i32 %72, 8
  br i1 %73, label %74, label %91

74:                                               ; preds = %69
  %75 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %76 = sext i16 %75 to i32
  %77 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %78 = load i16, ptr %77, align 2, !tbaa !28
  %79 = sext i16 %78 to i32
  %80 = icmp sge i32 %76, %79
  br i1 %80, label %81, label %89

81:                                               ; preds = %74
  %82 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %83 = load i16, ptr %82, align 2, !tbaa !28
  %84 = sext i16 %83 to i32
  %85 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %86 = sext i16 %85 to i32
  %87 = sub nsw i32 %86, %84
  %88 = trunc i32 %87 to i16
  store i16 %88, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  br label %90

89:                                               ; preds = %74
  store i16 0, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  br label %90

90:                                               ; preds = %89, %81
  br label %113

91:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #4
  %92 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %93 = sext i16 %92 to i32
  %94 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 1), align 8, !tbaa !24
  %95 = sext i16 %94 to i32
  %96 = add nsw i32 %93, %95
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %6, align 2, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  %98 = load i16, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !27
  %99 = sext i16 %98 to i32
  %100 = load i16, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 1), i32 0, i32 1), align 2, !tbaa !24
  %101 = sext i16 %100 to i32
  %102 = add nsw i32 %99, %101
  %103 = trunc i32 %102 to i16
  store i16 %103, ptr %7, align 2, !tbaa !23
  %104 = load i16, ptr %6, align 2, !tbaa !23
  %105 = load i16, ptr %7, align 2, !tbaa !23
  %106 = load i8, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 8), align 1, !tbaa !29
  %107 = call signext i16 @lcd_draw_char(i16 noundef signext %104, i16 noundef signext %105, ptr noundef %2, i8 noundef zeroext %106)
  %108 = sext i16 %107 to i32
  %109 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %110 = sext i16 %109 to i32
  %111 = add nsw i32 %110, %108
  %112 = trunc i32 %111 to i16
  store i16 %112, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  call void @__arm_lcd_draw_region_line_wrapping(ptr noundef %3, ptr noundef %5)
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #4
  br label %13

113:                                              ; preds = %90
  br label %114

114:                                              ; preds = %113, %49
  br label %115

115:                                              ; preds = %114, %43
  br label %116

116:                                              ; preds = %115, %22
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i32 1
  store ptr %118, ptr %2, align 8, !tbaa !5
  br label %13, !llvm.loop !30

119:                                              ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  store i32 0, ptr %4, align 4
  br label %120

120:                                              ; preds = %119, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %121 = load i32, ptr %4, align 4
  switch i32 %121, label %123 [
    i32 0, label %122
    i32 1, label %122
  ]

122:                                              ; preds = %120, %120
  ret void

123:                                              ; preds = %120
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"", !11, i64 0, !11, i64 8, !12, i64 16, !14, i64 20, !6, i64 24, !15, i64 32, !15, i64 36, !7, i64 40, !7, i64 41, !16, i64 42, !17, i64 44, !19, i64 60, !20, i64 136, !11, i64 152, !6, i64 160}
!11 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!12 = !{!"arm_2d_location_t", !13, i64 0, !13, i64 2}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 2}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 1}
!17 = !{!"", !18, i64 0, !18, i64 4, !11, i64 8}
!18 = !{!"arm_2d_size_t", !13, i64 0, !13, i64 2}
!19 = !{!"", !7, i64 0, !13, i64 2, !13, i64 4, !7, i64 6}
!20 = !{!"arm_2d_scratch_mem_t", !7, i64 0, !21, i64 8}
!21 = !{!"long", !7, i64 0}
!22 = !{i64 0, i64 2, !23, i64 2, i64 2, !23}
!23 = !{!13, !13, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !13, i64 16}
!26 = !{!18, !13, i64 2}
!27 = !{!10, !13, i64 18}
!28 = !{!18, !13, i64 0}
!29 = !{!10, !7, i64 41}
!30 = distinct !{!30, !31}
!31 = !{!"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"

%struct.anon.13 = type { %struct.arm_2d_region_t, %struct.arm_2d_region_t, %struct.arm_2d_location_t, %struct.anon.14, ptr, i32, i32, i8, i8, %struct.anon.15, %struct.anon.16, %struct.anon.17, %struct.arm_2d_scratch_mem_t, %struct.arm_2d_region_t, ptr }
%struct.arm_2d_location_t = type { i16, i16 }
%struct.anon.14 = type { i16, i16 }
%struct.anon.15 = type { i8, i8 }
%struct.anon.16 = type { %struct.arm_2d_size_t, %struct.arm_2d_size_t, %struct.arm_2d_region_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.anon.17 = type { %union.anon.18, i16, i16, [65 x i8] }
%union.anon.18 = type { i16 }
%struct.arm_2d_scratch_mem_t = type { %union.anon.19, i64 }
%union.anon.19 = type { %union.anon.20 }
%union.anon.20 = type { %struct.anon.21 }
%struct.anon.21 = type { i32 }
%struct.arm_2d_region_t = type { %union.anon.10, %union.anon.11 }
%union.anon.10 = type { %struct.arm_2d_location_t }
%union.anon.11 = type { %struct.arm_2d_size_t }

@s_tLCDTextControl = external hidden global %struct.anon.13, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @arm_lcd_text_get_actual_char_box() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @__arm_lcd_draw_region_line_wrapping(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local signext i16 @lcd_draw_char(i16 noundef signext, i16 noundef signext, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

declare zeroext i1 @__arm_2d_helper_pfb_is_region_active0(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @arm_lcd_puts(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.arm_2d_size_t, align 4
  %4 = alloca %struct.arm_2d_size_t, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %5 = tail call i32 @arm_lcd_text_get_actual_char_box()
  store i32 %5, ptr %3, align 4
  %6 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 24), align 8, !tbaa !9
  %7 = tail call zeroext i1 @__arm_2d_helper_pfb_is_region_active0(ptr noundef %6, ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 52), i1 noundef zeroext true) #3
  br i1 %7, label %8, label %52

8:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 12), align 4
  store i32 %9, ptr %4, align 4
  %10 = getelementptr inbounds i8, ptr %3, i64 2
  %11 = getelementptr inbounds i8, ptr %4, i64 2
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %8
  %12 = phi ptr [ %0, %8 ], [ %.be, %.backedge.backedge ]
  %13 = load i8, ptr %12, align 1, !tbaa !22
  switch i8 %13, label %37 [
    i8 0, label %51
    i8 13, label %14
    i8 10, label %15
    i8 9, label %20
    i8 8, label %31
  ]

14:                                               ; preds = %.backedge
  store i16 0, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  br label %48

15:                                               ; preds = %.backedge
  store i16 0, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %16 = load i16, ptr %10, align 2, !tbaa !24
  %17 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 18), align 2, !tbaa !25
  %18 = add i16 %17, %16
  %19 = load i16, ptr %11, align 2, !tbaa !24
  %.not6 = icmp slt i16 %18, %19
  %spec.store.select = select i1 %.not6, i16 %18, i16 0
  store i16 %spec.store.select, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 18), align 2
  br label %48

20:                                               ; preds = %.backedge
  %21 = load i16, ptr %3, align 4, !tbaa !26
  %22 = shl i16 %21, 2
  %23 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %24 = add i16 %22, %23
  %25 = sext i16 %24 to i32
  %26 = sext i16 %21 to i32
  %27 = shl nsw i32 %26, 2
  %28 = srem i32 %25, %27
  %29 = trunc nsw i32 %28 to i16
  %30 = sub i16 %24, %29
  store i16 %30, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  call void @__arm_lcd_draw_region_line_wrapping(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.pre7 = load ptr, ptr %2, align 8, !tbaa !5
  br label %48

31:                                               ; preds = %.backedge
  %32 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %33 = load i16, ptr %3, align 4, !tbaa !26
  %.not5 = icmp slt i16 %32, %33
  br i1 %.not5, label %36, label %34

34:                                               ; preds = %31
  %35 = sub i16 %32, %33
  store i16 %35, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  br label %48

36:                                               ; preds = %31
  store i16 0, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  br label %48

37:                                               ; preds = %.backedge
  %38 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %39 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 8), align 8, !tbaa !22
  %40 = add i16 %39, %38
  %41 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 18), align 2, !tbaa !25
  %42 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 10), align 2, !tbaa !22
  %43 = add i16 %42, %41
  %44 = load i8, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 41), align 1, !tbaa !27
  %45 = call signext i16 @lcd_draw_char(i16 noundef signext %40, i16 noundef signext %43, ptr noundef nonnull %2, i8 noundef zeroext %44)
  %46 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %47 = add i16 %46, %45
  store i16 %47, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  call void @__arm_lcd_draw_region_line_wrapping(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.pre.pre = load ptr, ptr %2, align 8, !tbaa !5
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %37, %48
  %.be = phi ptr [ %.pre.pre, %37 ], [ %50, %48 ]
  br label %.backedge, !llvm.loop !28

48:                                               ; preds = %15, %36, %34, %20, %14
  %49 = phi ptr [ %12, %15 ], [ %12, %36 ], [ %12, %34 ], [ %.pre7, %20 ], [ %12, %14 ]
  %50 = getelementptr inbounds i8, ptr %49, i64 1
  store ptr %50, ptr %2, align 8, !tbaa !5
  br label %.backedge.backedge

51:                                               ; preds = %.backedge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %52

52:                                               ; preds = %1, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret void
}

attributes #0 = { mustprogress 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 = { "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, !6, i64 24}
!10 = !{!"", !11, i64 0, !11, i64 8, !12, i64 16, !14, i64 20, !6, i64 24, !15, i64 32, !15, i64 36, !7, i64 40, !7, i64 41, !16, i64 42, !17, i64 44, !19, i64 60, !20, i64 136, !11, i64 152, !6, i64 160}
!11 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!12 = !{!"arm_2d_location_t", !13, i64 0, !13, i64 2}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 2}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 1}
!17 = !{!"", !18, i64 0, !18, i64 4, !11, i64 8}
!18 = !{!"arm_2d_size_t", !13, i64 0, !13, i64 2}
!19 = !{!"", !7, i64 0, !13, i64 2, !13, i64 4, !7, i64 6}
!20 = !{!"arm_2d_scratch_mem_t", !7, i64 0, !21, i64 8}
!21 = !{!"long", !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!10, !13, i64 16}
!24 = !{!18, !13, i64 2}
!25 = !{!10, !13, i64 18}
!26 = !{!18, !13, i64 0}
!27 = !{!10, !7, i64 41}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass