; 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

; Function Attrs: nounwind uwtable
define dso_local void @arm_lcd_putchar(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 %117

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
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = load i8, ptr %13, align 1, !tbaa !24
  %15 = icmp ne i8 %14, 0
  br i1 %15, label %16, label %116

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

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

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

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

41:                                               ; preds = %27
  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 %42

42:                                               ; preds = %41, %27
  br label %114

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

48:                                               ; preds = %43
  %49 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %50 = load i16, ptr %49, align 2, !tbaa !28
  %51 = sext i16 %50 to i32
  %52 = mul nsw i32 %51, 4
  %53 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %54 = sext i16 %53 to i32
  %55 = add nsw i32 %54, %52
  %56 = trunc i32 %55 to i16
  store i16 %56, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %57 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %58 = sext i16 %57 to i32
  %59 = getelementptr inbounds %struct.arm_2d_size_t, ptr %3, i32 0, i32 0
  %60 = load i16, ptr %59, align 2, !tbaa !28
  %61 = sext i16 %60 to i32
  %62 = mul nsw i32 %61, 4
  %63 = srem i32 %58, %62
  %64 = load i16, ptr getelementptr inbounds (%struct.anon.13, ptr @s_tLCDTextControl, i32 0, i32 2), align 8, !tbaa !25
  %65 = sext i16 %64 to i32
  %66 = sub nsw i32 %65, %63
  %67 = trunc i32 %66 to i16
  store i16 %67, 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 %113

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

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

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

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

89:                                               ; preds = %88, %80
  br label %112

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

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

113:                                              ; preds = %112, %48
  br label %114

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

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

116:                                              ; preds = %115, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  store i32 0, ptr %4, align 4
  br label %117

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

119:                                              ; preds = %117, %117
  ret void

120:                                              ; preds = %117
  unreachable
}

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

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}


; 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

; Function Attrs: nounwind uwtable
define dso_local void @arm_lcd_putchar(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
  %8 = trunc i32 %5 to i16
  %9 = lshr i32 %5, 16
  %10 = trunc nuw i32 %9 to i16
  br i1 %7, label %11, label %46

11:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 12), align 4
  store i32 %12, ptr %4, align 4
  %13 = load i8, ptr %0, align 1, !tbaa !22
  switch i8 %13, label %34 [
    i8 0, label %45
    i8 13, label %14
    i8 10, label %15
    i8 9, label %20
    i8 8, label %29
  ]

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

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

20:                                               ; preds = %11
  %21 = shl i16 %8, 2
  %22 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %23 = add i16 %21, %22
  %24 = sext i16 %23 to i32
  %sext = shl i32 %5, 16
  %25 = ashr exact i32 %sext, 14
  %26 = srem i32 %24, %25
  %27 = trunc nsw i32 %26 to i16
  %28 = sub i16 %23, %27
  store i16 %28, 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)
  br label %45

29:                                               ; preds = %11
  %30 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %.not5 = icmp slt i16 %30, %8
  br i1 %.not5, label %33, label %31

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

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

34:                                               ; preds = %11
  %35 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %36 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 8), align 8, !tbaa !22
  %37 = add i16 %36, %35
  %38 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 18), align 2, !tbaa !24
  %39 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 10), align 2, !tbaa !22
  %40 = add i16 %39, %38
  %41 = load i8, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 41), align 1, !tbaa !25
  %42 = call signext i16 @lcd_draw_char(i16 noundef signext %37, i16 noundef signext %40, ptr noundef nonnull %2, i8 noundef zeroext %41)
  %43 = load i16, ptr getelementptr inbounds (i8, ptr @s_tLCDTextControl, i64 16), align 8, !tbaa !23
  %44 = add i16 %43, %42
  store i16 %44, 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)
  br label %45

45:                                               ; preds = %11, %14, %20, %31, %33, %34, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %46

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

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

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 = !{!10, !13, i64 18}
!25 = !{!10, !7, i64 41}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass