; LLVM IR from alekmaul/pvsneslib :: snes-examples/input/superscope (superscope)

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

@sscope_disconnected = external dso_local global i8, align 1
@pause_adjust = external dso_local global i8, align 1
@ready_to_fire = external dso_local global i8, align 1
@cool_down = external dso_local global i8, align 1
@bullet_id = external dso_local global i8, align 1
@bullet_num = external dso_local global i8, align 1
@shot_bullets = external dso_local global i8, align 1
@difuse_xn = external dso_local global [32 x i16], align 16
@difuse_yn = external dso_local global [32 x i16], align 16
@difuse_x = external dso_local global [32 x i8], align 16
@difuse_y = external dso_local global [32 x i8], align 16
@bullet_frame = external dso_local global [32 x i8], align 16
@bullet_draw = external dso_local global [32 x i8], align 16
@bullet_frame_n = external dso_local global [32 x i8], align 16
@bullet_gravity = external dso_local global [32 x i8], align 16
@bullet_diff = external dso_local global <{ i8, [31 x i8] }>, align 16
@bullet_frames = external dso_local global [8 x i8], align 1
@enable_fire = external dso_local global i8, align 1
@enable_pause = external dso_local global i8, align 1
@enable_cursor = external dso_local global i8, align 1
@target_id = external dso_local global i8, align 1
@target_kill = external dso_local global [64 x i8], align 16
@target_kill_count = external dso_local global [64 x i8], align 16
@target_gravity = external dso_local global [64 x i8], align 16
@targets_shot = external dso_local global i8, align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@tilfont = external global i8, align 1
@palfont = external global i8, align 1
@aim_target_tileset = external global i8, align 1
@aim_target_palette = external global i8, align 1
@aim_target_tileset_end = external global i8, align 1
@sprites_map = external global i8, align 1
@sprites_map_end = external global i8, align 1
@sprites_palette = external global i8, align 1
@aim_target_map = external global i8, align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@snes_sscope = external global i8, align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1
@scope_down = external global i16, align 2
@scope_shothraw = external global i16, align 2
@scope_centerh = external global i16, align 2
@scope_shotvraw = external global i16, align 2
@scope_centerv = external global i16, align 2
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@scope_shoth = external global i16, align 2
@scope_shotv = external global i16, align 2
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1
@scope_holddelay = external global i16, align 2
@scope_repdelay = external global i16, align 2
@target_x_inc = external dso_local global [64 x i16], align 16
@target_y_inc = external dso_local global [64 x i16], align 16
@target_oam_id = external dso_local global [64 x i8], align 16
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [22 x i8], align 1
@scope_held = external global i16, align 2
@bullet_x = external dso_local global [32 x i16], align 16
@bullet_y = external dso_local global [32 x i8], align 16
@target_x = external dso_local global [64 x i16], align 16
@target_y = external dso_local global [64 x i8], align 16
@oamMemory = external global [544 x i8], align 16
@target_collision_x = external dso_local global [64 x i8], align 16
@target_collision_y = external dso_local global [64 x i8], align 16
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @sin_table(i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cos_table(i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @hideSprites() #0

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

declare void @oamSetVisible(i16 noundef zeroext, i8 noundef zeroext) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @resetGame() #0

declare void @consoleDrawText(i16 noundef zeroext, i16 noundef zeroext, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @consoleSetTextMapPtr(i16 noundef zeroext 8192)
  call void @consoleSetTextGfxPtr(i16 noundef zeroext 14336)
  call void @consoleSetTextOffset(i16 noundef zeroext 128)
  call void @consoleInitText(i8 noundef zeroext 1, i8 noundef zeroext 32, ptr noundef @tilfont, ptr noundef @palfont)
  call void @bgInitTileSet(i8 noundef zeroext 0, ptr noundef @aim_target_tileset, ptr noundef @aim_target_palette, i8 noundef zeroext 0, i16 noundef zeroext trunc (i64 sub (i64 ptrtoint (ptr @aim_target_tileset_end to i64), i64 ptrtoint (ptr @aim_target_tileset to i64)) to i16), i16 noundef zeroext 32, i16 noundef zeroext 16, i16 noundef zeroext 12288)
  call void @bgSetGfxPtr(i8 noundef zeroext 1, i16 noundef zeroext 14336)
  call void @bgSetMapPtr(i8 noundef zeroext 1, i16 noundef zeroext 8192, i8 noundef zeroext 0)
  call void @oamInitGfxSet(ptr noundef @sprites_map, i16 noundef zeroext trunc (i64 sub (i64 ptrtoint (ptr @sprites_map_end to i64), i64 ptrtoint (ptr @sprites_map to i64)) to i16), ptr noundef @sprites_palette, i16 noundef zeroext 96, i8 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 96)
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #3
  store i8 0, ptr %2, align 1, !tbaa !5
  br label %6

6:                                                ; preds = %21, %0
  %7 = load i8, ptr %2, align 1, !tbaa !5
  %8 = zext i8 %7 to i32
  %9 = icmp slt i32 %8, 64
  br i1 %9, label %10, label %24

10:                                               ; preds = %6
  %11 = load i8, ptr %2, align 1, !tbaa !5
  %12 = zext i8 %11 to i32
  %13 = shl i32 %12, 2
  %14 = add nsw i32 16, %13
  %15 = trunc i32 %14 to i16
  call void @oamSet(i16 noundef zeroext %15, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 132, i8 noundef zeroext 1)
  %16 = load i8, ptr %2, align 1, !tbaa !5
  %17 = zext i8 %16 to i32
  %18 = shl i32 %17, 2
  %19 = add nsw i32 16, %18
  %20 = trunc i32 %19 to i16
  call void @oamSetEx(i16 noundef zeroext %20, i8 noundef zeroext 0, i8 noundef zeroext 1)
  br label %21

21:                                               ; preds = %10
  %22 = load i8, ptr %2, align 1, !tbaa !5
  %23 = add i8 %22, 1
  store i8 %23, ptr %2, align 1, !tbaa !5
  br label %6, !llvm.loop !8

24:                                               ; preds = %6
  call void @setMode(i8 noundef zeroext 1, i8 noundef zeroext 0)
  call void @bgSetDisable(i8 noundef zeroext 2)
  call void @bgSetScroll(i8 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext -1)
  call void @bgSetScroll(i8 noundef zeroext 1, i16 noundef zeroext 0, i16 noundef zeroext -1)
  br label %25

25:                                               ; preds = %959, %642, %24
  call void @bgInitMapSet(i8 noundef zeroext 0, ptr noundef @aim_target_map, i16 noundef zeroext 1792, i8 noundef zeroext 0, i16 noundef zeroext 10240)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 1, ptr noundef @.str.4)
  %26 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef @.str.5)
  br label %36

29:                                               ; preds = %25
  call void @detectSuperScope()
  %30 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %31 = zext i8 %30 to i32
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.6)
  br label %35

34:                                               ; preds = %29
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 26, ptr noundef @.str.7)
  br label %35

35:                                               ; preds = %34, %33
  br label %36

36:                                               ; preds = %35, %28
  call void @oamSet(i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 128, i8 noundef zeroext 2)
  call void @oamSetEx(i16 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @setScreenOn()
  br label %37

37:                                               ; preds = %45, %36
  %38 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %39 = zext i8 %38 to i32
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %46

41:                                               ; preds = %37
  call void @WaitForVBlank()
  call void @detectSuperScope()
  %42 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.8)
  br label %45

45:                                               ; preds = %44, %41
  br label %37, !llvm.loop !10

46:                                               ; preds = %37
  %47 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %48 = zext i8 %47 to i32
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  call void @WaitNVBlank(i16 noundef zeroext 60)
  br label %51

51:                                               ; preds = %50, %46
  br label %52

52:                                               ; preds = %183, %171, %161, %113, %62, %51
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef @.str.9)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 25, ptr noundef @.str.10)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef @.str.11)
  br label %53

53:                                               ; preds = %90, %52
  br label %54

54:                                               ; preds = %53
  %55 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %56 = zext i8 %55 to i32
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  call void @detectSuperScope()
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef @.str.12)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.6)
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %90

59:                                               ; preds = %54
  %60 = load i8, ptr @sscope_disconnected, align 1, !tbaa !5
  %61 = icmp ne i8 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.8)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %52

63:                                               ; preds = %59
  %64 = load i16, ptr @scope_down, align 2, !tbaa !11
  %65 = zext i16 %64 to i32
  %66 = and i32 %65, 32768
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %63
  store i8 -1, ptr @enable_fire, align 1, !tbaa !5
  br label %69

69:                                               ; preds = %68, %63
  %70 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %79

72:                                               ; preds = %69
  %73 = load i16, ptr @scope_down, align 2, !tbaa !11
  %74 = zext i16 %73 to i32
  %75 = and i32 %74, 4096
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %72
  call void @setFadeEffect(i8 noundef zeroext 1)
  call void @oamSet(i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 0)
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  store i8 0, ptr @pause_adjust, align 1, !tbaa !5
  br label %260

78:                                               ; preds = %72
  br label %79

79:                                               ; preds = %78, %69
  %80 = load i8, ptr @enable_fire, align 1, !tbaa !5
  %81 = icmp ne i8 %80, 0
  br i1 %81, label %82, label %89

82:                                               ; preds = %79
  %83 = load i16, ptr @scope_down, align 2, !tbaa !11
  %84 = zext i16 %83 to i32
  %85 = and i32 %84, 32768
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %82
  store i8 0, ptr @enable_fire, align 1, !tbaa !5
  br label %91

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88, %79
  br label %90

90:                                               ; preds = %89, %58
  call void @WaitForVBlank()
  br label %53

91:                                               ; preds = %87
  %92 = load i16, ptr @scope_shothraw, align 2, !tbaa !11
  %93 = zext i16 %92 to i32
  %94 = sub nsw i32 128, %93
  %95 = trunc i32 %94 to i16
  store i16 %95, ptr @scope_centerh, align 2, !tbaa !11
  %96 = load i16, ptr @scope_shotvraw, align 2, !tbaa !11
  %97 = zext i16 %96 to i32
  %98 = sub nsw i32 112, %97
  %99 = trunc i32 %98 to i16
  store i16 %99, ptr @scope_centerv, align 2, !tbaa !11
  %100 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %91
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef @.str.13)
  br label %103

103:                                              ; preds = %102, %91
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef @.str.14)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 26, ptr noundef @.str.15)
  call void @oamSetXY(i16 noundef zeroext 0, i16 noundef zeroext 120, i16 noundef zeroext 104)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 25, ptr noundef @.str.16)
  br label %104

104:                                              ; preds = %131, %103
  br label %105

105:                                              ; preds = %104
  %106 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %107 = zext i8 %106 to i32
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %105
  call void @detectSuperScope()
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef @.str.12)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.6)
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %131

110:                                              ; preds = %105
  %111 = load i8, ptr @sscope_disconnected, align 1, !tbaa !5
  %112 = icmp ne i8 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.8)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %52

114:                                              ; preds = %110
  %115 = load i16, ptr @scope_down, align 2, !tbaa !11
  %116 = zext i16 %115 to i32
  %117 = and i32 %116, 32768
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %120

119:                                              ; preds = %114
  store i8 -1, ptr @enable_fire, align 1, !tbaa !5
  br label %120

120:                                              ; preds = %119, %114
  %121 = load i8, ptr @enable_fire, align 1, !tbaa !5
  %122 = icmp ne i8 %121, 0
  br i1 %122, label %123, label %130

123:                                              ; preds = %120
  %124 = load i16, ptr @scope_down, align 2, !tbaa !11
  %125 = zext i16 %124 to i32
  %126 = and i32 %125, 32768
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %123
  store i8 0, ptr @enable_fire, align 1, !tbaa !5
  br label %132

129:                                              ; preds = %123
  br label %130

130:                                              ; preds = %129, %120
  br label %131

131:                                              ; preds = %130, %109
  call void @WaitForVBlank()
  br label %104

132:                                              ; preds = %128
  %133 = load i16, ptr @scope_shoth, align 2, !tbaa !11
  %134 = zext i16 %133 to i32
  %135 = sub nsw i32 %134, 8
  %136 = trunc i32 %135 to i16
  %137 = load i16, ptr @scope_shotv, align 2, !tbaa !11
  %138 = zext i16 %137 to i32
  %139 = sub nsw i32 %138, 8
  %140 = trunc i32 %139 to i16
  call void @oamSetXY(i16 noundef zeroext 0, i16 noundef zeroext %136, i16 noundef zeroext %140)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef @.str.17)
  %141 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %142 = icmp ne i8 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %132
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef @.str.18)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef @.str.19)
  br label %145

144:                                              ; preds = %132
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef @.str.20)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 26, ptr noundef @.str.21)
  br label %145

145:                                              ; preds = %144, %143
  br label %146

146:                                              ; preds = %187, %145
  br label %147

147:                                              ; preds = %146
  %148 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %149 = zext i8 %148 to i32
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %147
  call void @detectSuperScope()
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 2, i16 noundef zeroext 24, ptr noundef @.str.13)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef @.str.3)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.6)
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %187

152:                                              ; preds = %147
  %153 = load i16, ptr @scope_down, align 2, !tbaa !11
  %154 = zext i16 %153 to i32
  %155 = and i32 %154, 16384
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %152
  store i8 -1, ptr @enable_cursor, align 1, !tbaa !5
  br label %158

158:                                              ; preds = %157, %152
  %159 = load i8, ptr @sscope_disconnected, align 1, !tbaa !5
  %160 = icmp ne i8 %159, 0
  br i1 %160, label %161, label %162

161:                                              ; preds = %158
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef @.str.8)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %52

162:                                              ; preds = %158
  %163 = load i16, ptr @scope_down, align 2, !tbaa !11
  %164 = zext i16 %163 to i32
  %165 = and i32 %164, 4096
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %172

167:                                              ; preds = %162
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  %168 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %169 = icmp ne i8 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %167
  call void @setFadeEffect(i8 noundef zeroext 1)
  call void @oamSet(i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 0)
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  store i8 0, ptr @pause_adjust, align 1, !tbaa !5
  br label %260

171:                                              ; preds = %167
  br label %52

172:                                              ; preds = %162
  %173 = load i8, ptr @enable_cursor, align 1, !tbaa !5
  %174 = icmp ne i8 %173, 0
  br i1 %174, label %175, label %186

175:                                              ; preds = %172
  %176 = load i16, ptr @scope_down, align 2, !tbaa !11
  %177 = zext i16 %176 to i32
  %178 = and i32 %177, 16384
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %185

180:                                              ; preds = %175
  store i8 0, ptr @enable_cursor, align 1, !tbaa !5
  %181 = load i8, ptr @pause_adjust, align 1, !tbaa !5
  %182 = icmp ne i8 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %180
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef @.str.5)
  br label %52

184:                                              ; preds = %180
  br label %188

185:                                              ; preds = %175
  br label %186

186:                                              ; preds = %185, %172
  br label %187

187:                                              ; preds = %186, %151
  call void @WaitForVBlank()
  br label %146

188:                                              ; preds = %184
  call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1)
  br label %189

189:                                              ; preds = %226, %188
  %190 = load i8, ptr @bullet_frame, align 16, !tbaa !5
  %191 = zext i8 %190 to i32
  %192 = icmp slt i32 %191, 8
  br i1 %192, label %193, label %227

193:                                              ; preds = %189
  %194 = load i8, ptr @bullet_draw, align 16, !tbaa !5
  %195 = zext i8 %194 to i32
  %196 = shl i32 %195, 2
  %197 = trunc i32 %196 to i16
  %198 = load i8, ptr @bullet_frame, align 16, !tbaa !5
  %199 = zext i8 %198 to i64
  %200 = getelementptr inbounds [8 x i8], ptr @bullet_frames, i64 0, i64 %199
  %201 = load i8, ptr %200, align 1, !tbaa !5
  %202 = zext i8 %201 to i16
  call void @oamSet(i16 noundef zeroext %197, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext %202, i8 noundef zeroext 0)
  %203 = load i8, ptr @bullet_draw, align 16, !tbaa !5
  %204 = zext i8 %203 to i32
  %205 = shl i32 %204, 2
  %206 = trunc i32 %205 to i16
  call void @oamSetVisible(i16 noundef zeroext %206, i8 noundef zeroext 1)
  %207 = load i8, ptr @bullet_draw, align 16, !tbaa !5
  %208 = add i8 %207, 1
  store i8 %208, ptr @bullet_draw, align 16, !tbaa !5
  %209 = load i8, ptr @bullet_draw, align 16, !tbaa !5
  %210 = zext i8 %209 to i32
  %211 = icmp eq i32 %210, 4
  br i1 %211, label %212, label %213

212:                                              ; preds = %193
  store i8 68, ptr @bullet_draw, align 16, !tbaa !5
  br label %213

213:                                              ; preds = %212, %193
  %214 = load i8, ptr @bullet_frame_n, align 16, !tbaa !5
  %215 = add i8 %214, 1
  store i8 %215, ptr @bullet_frame_n, align 16, !tbaa !5
  %216 = load i8, ptr @bullet_frame_n, align 16, !tbaa !5
  %217 = zext i8 %216 to i32
  %218 = load i8, ptr @bullet_frame, align 16, !tbaa !5
  %219 = zext i8 %218 to i32
  %220 = sub nsw i32 %219, 4
  %221 = shl i32 %220, 3
  %222 = icmp sgt i32 %217, %221
  br i1 %222, label %223, label %226

223:                                              ; preds = %213
  %224 = load i8, ptr @bullet_frame, align 16, !tbaa !5
  %225 = add i8 %224, 1
  store i8 %225, ptr @bullet_frame, align 16, !tbaa !5
  store i8 0, ptr @bullet_frame_n, align 16, !tbaa !5
  br label %226

226:                                              ; preds = %223, %213
  br label %189, !llvm.loop !13

227:                                              ; preds = %189
  store i16 60, ptr @scope_holddelay, align 2, !tbaa !11
  store i16 20, ptr @scope_repdelay, align 2, !tbaa !11
  call void @setFadeEffect(i8 noundef zeroext 1)
  br label %228

228:                                              ; preds = %949, %227
  store i8 0, ptr @target_id, align 1, !tbaa !5
  br label %229

229:                                              ; preds = %256, %228
  %230 = load i8, ptr @target_id, align 1, !tbaa !5
  %231 = zext i8 %230 to i32
  %232 = icmp slt i32 %231, 8
  br i1 %232, label %233, label %259

233:                                              ; preds = %229
  %234 = load i8, ptr @target_id, align 1, !tbaa !5
  %235 = zext i8 %234 to i32
  %236 = shl i32 %235, 6
  %237 = trunc i32 %236 to i16
  %238 = load i8, ptr @target_id, align 1, !tbaa !5
  %239 = zext i8 %238 to i64
  %240 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %239
  store i16 %237, ptr %240, align 2, !tbaa !11
  %241 = load i8, ptr @target_id, align 1, !tbaa !5
  %242 = zext i8 %241 to i32
  %243 = shl i32 %242, 6
  %244 = trunc i32 %243 to i16
  %245 = load i8, ptr @target_id, align 1, !tbaa !5
  %246 = zext i8 %245 to i64
  %247 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %246
  store i16 %244, ptr %247, align 2, !tbaa !11
  %248 = load i8, ptr @target_id, align 1, !tbaa !5
  %249 = zext i8 %248 to i32
  %250 = add nsw i32 16, %249
  %251 = shl i32 %250, 2
  %252 = trunc i32 %251 to i8
  %253 = load i8, ptr @target_id, align 1, !tbaa !5
  %254 = zext i8 %253 to i64
  %255 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %254
  store i8 %252, ptr %255, align 1, !tbaa !5
  br label %256

256:                                              ; preds = %233
  %257 = load i8, ptr @target_id, align 1, !tbaa !5
  %258 = add i8 %257, 1
  store i8 %258, ptr @target_id, align 1, !tbaa !5
  br label %229, !llvm.loop !14

259:                                              ; preds = %229
  store i8 -1, ptr %3, align 1, !tbaa !5
  store i8 0, ptr %4, align 1, !tbaa !5
  br label %260

260:                                              ; preds = %259, %170, %77
  %261 = load i8, ptr %4, align 1, !tbaa !5
  %262 = zext i8 %261 to i32
  %263 = icmp slt i32 %262, 120
  br i1 %263, label %264, label %265

264:                                              ; preds = %260
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef @.str.22)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef @.str.23)
  br label %265

265:                                              ; preds = %264, %260
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 1, ptr noundef @.str.24)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef @.str.13)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 4, ptr noundef @.str.15)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef @.str.9)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef @.str.3)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef @.str.2)
  store volatile i8 0, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !5
  store i8 -1, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  store i8 127, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !5
  store i8 0, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  store i8 0, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  call void @WaitForVBlank()
  call void @dmaFillVram(ptr noundef @aim_target_map, i16 noundef zeroext 10240, i16 noundef zeroext 1792)
  call void @oamInitGfxAttr(i16 noundef zeroext 0, i8 noundef zeroext -96)
  call void @setScreenOn()
  br label %266

266:                                              ; preds = %963, %265
  br label %267

267:                                              ; preds = %266
  %268 = load i8, ptr %4, align 1, !tbaa !5
  %269 = zext i8 %268 to i32
  switch i32 %269, label %271 [
    i32 120, label %270
    i32 121, label %274
  ]

270:                                              ; preds = %267
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef @.str.25)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef @.str.26)
  br label %271

271:                                              ; preds = %270, %267
  %272 = load i8, ptr %4, align 1, !tbaa !5
  %273 = add i8 %272, 1
  store i8 %273, ptr %4, align 1, !tbaa !5
  br label %274

274:                                              ; preds = %271, %267
  %275 = load i8, ptr @snes_sscope, align 1, !tbaa !5
  %276 = zext i8 %275 to i32
  %277 = icmp eq i32 %276, 0
  br i1 %277, label %278, label %279

278:                                              ; preds = %274
  call void @detectSuperScope()
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 13, ptr noundef @.str.6)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 14, ptr noundef @.str.2)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 15, ptr noundef @.str.3)
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %963

279:                                              ; preds = %274
  %280 = load i8, ptr @sscope_disconnected, align 1, !tbaa !5
  %281 = icmp ne i8 %280, 0
  br i1 %281, label %282, label %283

282:                                              ; preds = %279
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 13, ptr noundef @.str.8)
  call void @WaitNVBlank(i16 noundef zeroext 60)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 13, ptr noundef @.str.27)
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !5
  br label %283

283:                                              ; preds = %282, %279
  %284 = load i16, ptr @scope_down, align 2, !tbaa !11
  %285 = zext i16 %284 to i32
  %286 = and i32 %285, 32768
  %287 = icmp eq i32 %286, 0
  br i1 %287, label %288, label %289

288:                                              ; preds = %283
  store i8 -1, ptr @enable_fire, align 1, !tbaa !5
  br label %289

289:                                              ; preds = %288, %283
  %290 = load i16, ptr @scope_down, align 2, !tbaa !11
  %291 = zext i16 %290 to i32
  %292 = and i32 %291, 4096
  %293 = icmp eq i32 %292, 0
  br i1 %293, label %294, label %295

294:                                              ; preds = %289
  store i8 -1, ptr @enable_pause, align 1, !tbaa !5
  br label %295

295:                                              ; preds = %294, %289
  %296 = load i16, ptr @scope_down, align 2, !tbaa !11
  %297 = zext i16 %296 to i32
  %298 = and i32 %297, 16384
  %299 = icmp eq i32 %298, 0
  br i1 %299, label %300, label %301

300:                                              ; preds = %295
  store i8 -1, ptr @enable_cursor, align 1, !tbaa !5
  br label %301

301:                                              ; preds = %300, %295
  %302 = load i8, ptr @enable_fire, align 1, !tbaa !5
  %303 = icmp ne i8 %302, 0
  br i1 %303, label %304, label %630

304:                                              ; preds = %301
  %305 = load i16, ptr @scope_held, align 2, !tbaa !11
  %306 = zext i16 %305 to i32
  %307 = and i32 %306, 32768
  %308 = icmp ne i32 %307, 0
  br i1 %308, label %309, label %317

309:                                              ; preds = %304
  %310 = load i8, ptr @cool_down, align 1, !tbaa !5
  %311 = zext i8 %310 to i32
  %312 = icmp slt i32 %311, 2
  br i1 %312, label %313, label %316

313:                                              ; preds = %309
  %314 = load i8, ptr @cool_down, align 1, !tbaa !5
  %315 = add i8 %314, 1
  store i8 %315, ptr @cool_down, align 1, !tbaa !5
  br label %316

316:                                              ; preds = %313, %309
  br label %317

317:                                              ; preds = %316, %304
  %318 = load i16, ptr @scope_down, align 2, !tbaa !11
  %319 = zext i16 %318 to i32
  %320 = and i32 %319, 32768
  %321 = icmp eq i32 %320, 0
  br i1 %321, label %322, label %323

322:                                              ; preds = %317
  store i8 0, ptr @cool_down, align 1, !tbaa !5
  br label %323

323:                                              ; preds = %322, %317
  %324 = load i16, ptr @scope_held, align 2, !tbaa !11
  %325 = zext i16 %324 to i32
  %326 = and i32 %325, 32768
  %327 = icmp ne i32 %326, 0
  br i1 %327, label %328, label %332

328:                                              ; preds = %323
  %329 = load i8, ptr @cool_down, align 1, !tbaa !5
  %330 = zext i8 %329 to i32
  %331 = icmp eq i32 %330, 2
  br i1 %331, label %341, label %332

332:                                              ; preds = %328, %323
  %333 = load i16, ptr @scope_down, align 2, !tbaa !11
  %334 = zext i16 %333 to i32
  %335 = and i32 %334, 32768
  %336 = icmp ne i32 %335, 0
  br i1 %336, label %337, label %418

337:                                              ; preds = %332
  %338 = load i8, ptr @ready_to_fire, align 1, !tbaa !5
  %339 = zext i8 %338 to i32
  %340 = icmp eq i32 %339, 10
  br i1 %340, label %341, label %418

341:                                              ; preds = %337, %328
  %342 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %343 = add i8 %342, 1
  store i8 %343, ptr @bullet_id, align 1, !tbaa !5
  %344 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %345 = zext i8 %344 to i32
  %346 = icmp eq i32 %345, 32
  br i1 %346, label %347, label %348

347:                                              ; preds = %341
  store i8 0, ptr @bullet_id, align 1, !tbaa !5
  br label %348

348:                                              ; preds = %347, %341
  %349 = load i16, ptr @scope_shoth, align 2, !tbaa !11
  %350 = zext i16 %349 to i32
  %351 = icmp slt i32 %350, 272
  br i1 %351, label %352, label %376

352:                                              ; preds = %348
  %353 = load i16, ptr @scope_shoth, align 2, !tbaa !11
  %354 = zext i16 %353 to i32
  %355 = sub nsw i32 %354, 16
  %356 = trunc i32 %355 to i16
  %357 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %358 = zext i8 %357 to i64
  %359 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %358
  store i16 %356, ptr %359, align 2, !tbaa !11
  %360 = load i16, ptr @scope_shotv, align 2, !tbaa !11
  %361 = zext i16 %360 to i32
  %362 = icmp slt i32 %361, 224
  br i1 %362, label %363, label %371

363:                                              ; preds = %352
  %364 = load i16, ptr @scope_shotv, align 2, !tbaa !11
  %365 = zext i16 %364 to i32
  %366 = sub nsw i32 %365, 16
  %367 = trunc i32 %366 to i8
  %368 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %369 = zext i8 %368 to i64
  %370 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %369
  store i8 %367, ptr %370, align 1, !tbaa !5
  br label %375

371:                                              ; preds = %352
  %372 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %373 = zext i8 %372 to i64
  %374 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %373
  store i8 -32, ptr %374, align 1, !tbaa !5
  br label %375

375:                                              ; preds = %371, %363
  br label %383

376:                                              ; preds = %348
  %377 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %378 = zext i8 %377 to i64
  %379 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %378
  store i16 272, ptr %379, align 2, !tbaa !11
  %380 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %381 = zext i8 %380 to i64
  %382 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %381
  store i8 -32, ptr %382, align 1, !tbaa !5
  br label %383

383:                                              ; preds = %376, %375
  %384 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %385 = zext i8 %384 to i64
  %386 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %385
  store i8 0, ptr %386, align 1, !tbaa !5
  %387 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %388 = zext i8 %387 to i64
  %389 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %388
  store i8 0, ptr %389, align 1, !tbaa !5
  %390 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %391 = zext i8 %390 to i64
  %392 = getelementptr inbounds [32 x i8], ptr @bullet_gravity, i64 0, i64 %391
  store i8 0, ptr %392, align 1, !tbaa !5
  %393 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %394 = zext i8 %393 to i64
  %395 = getelementptr inbounds [32 x i16], ptr @difuse_xn, i64 0, i64 %394
  store i16 0, ptr %395, align 2, !tbaa !11
  %396 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %397 = zext i8 %396 to i64
  %398 = getelementptr inbounds [32 x i16], ptr @difuse_yn, i64 0, i64 %397
  store i16 0, ptr %398, align 2, !tbaa !11
  %399 = call zeroext i16 @rand()
  %400 = zext i16 %399 to i32
  %401 = and i32 %400, 15
  %402 = sub nsw i32 %401, 8
  %403 = trunc i32 %402 to i8
  %404 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %405 = zext i8 %404 to i64
  %406 = getelementptr inbounds [32 x i8], ptr @difuse_x, i64 0, i64 %405
  store i8 %403, ptr %406, align 1, !tbaa !5
  %407 = call zeroext i16 @rand()
  %408 = zext i16 %407 to i32
  %409 = and i32 %408, 240
  %410 = ashr i32 %409, 4
  %411 = sub nsw i32 %410, 8
  %412 = trunc i32 %411 to i8
  %413 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %414 = zext i8 %413 to i64
  %415 = getelementptr inbounds [32 x i8], ptr @difuse_y, i64 0, i64 %414
  store i8 %412, ptr %415, align 1, !tbaa !5
  %416 = load i8, ptr @shot_bullets, align 1, !tbaa !5
  %417 = add i8 %416, 1
  store i8 %417, ptr @shot_bullets, align 1, !tbaa !5
  store i8 0, ptr @ready_to_fire, align 1, !tbaa !5
  br label %418

418:                                              ; preds = %383, %337, %332
  %419 = load i8, ptr @cool_down, align 1, !tbaa !5
  %420 = zext i8 %419 to i32
  %421 = icmp slt i32 %420, 2
  br i1 %421, label %422, label %430

422:                                              ; preds = %418
  %423 = load i8, ptr @ready_to_fire, align 1, !tbaa !5
  %424 = zext i8 %423 to i32
  %425 = icmp slt i32 %424, 10
  br i1 %425, label %426, label %429

426:                                              ; preds = %422
  %427 = load i8, ptr @ready_to_fire, align 1, !tbaa !5
  %428 = add i8 %427, 1
  store i8 %428, ptr @ready_to_fire, align 1, !tbaa !5
  br label %429

429:                                              ; preds = %426, %422
  br label %431

430:                                              ; preds = %418
  store i8 0, ptr @ready_to_fire, align 1, !tbaa !5
  br label %431

431:                                              ; preds = %430, %429
  store i8 0, ptr @bullet_num, align 1, !tbaa !5
  br label %432

432:                                              ; preds = %626, %431
  %433 = load i8, ptr @bullet_num, align 1, !tbaa !5
  %434 = zext i8 %433 to i32
  %435 = load i8, ptr @shot_bullets, align 1, !tbaa !5
  %436 = zext i8 %435 to i32
  %437 = icmp slt i32 %434, %436
  br i1 %437, label %438, label %629

438:                                              ; preds = %432
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %439 = load i8, ptr @bullet_id, align 1, !tbaa !5
  %440 = zext i8 %439 to i32
  %441 = load i8, ptr @bullet_num, align 1, !tbaa !5
  %442 = zext i8 %441 to i32
  %443 = sub nsw i32 %440, %442
  %444 = trunc i32 %443 to i8
  store i8 %444, ptr %5, align 1, !tbaa !5
  %445 = load i8, ptr %5, align 1, !tbaa !5
  %446 = sext i8 %445 to i32
  %447 = icmp slt i32 %446, 0
  br i1 %447, label %448, label %453

448:                                              ; preds = %438
  %449 = load i8, ptr %5, align 1, !tbaa !5
  %450 = sext i8 %449 to i32
  %451 = add nsw i32 %450, 32
  %452 = trunc i32 %451 to i8
  store i8 %452, ptr %5, align 1, !tbaa !5
  br label %453

453:                                              ; preds = %448, %438
  %454 = load i8, ptr %5, align 1, !tbaa !5
  %455 = sext i8 %454 to i64
  %456 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %455
  %457 = load i8, ptr %456, align 1, !tbaa !5
  %458 = zext i8 %457 to i32
  %459 = icmp slt i32 %458, 8
  br i1 %459, label %460, label %601

460:                                              ; preds = %453
  %461 = load i8, ptr %5, align 1, !tbaa !5
  %462 = sext i8 %461 to i64
  %463 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %462
  %464 = load i8, ptr %463, align 1, !tbaa !5
  %465 = icmp ne i8 %464, 0
  br i1 %465, label %466, label %480

466:                                              ; preds = %460
  %467 = load i8, ptr %5, align 1, !tbaa !5
  %468 = sext i8 %467 to i64
  %469 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %468
  %470 = load i8, ptr %469, align 1, !tbaa !5
  %471 = zext i8 %470 to i32
  %472 = load i8, ptr %5, align 1, !tbaa !5
  %473 = sext i8 %472 to i64
  %474 = getelementptr inbounds [32 x i8], ptr @bullet_diff, i64 0, i64 %473
  %475 = load i8, ptr %474, align 1, !tbaa !5
  %476 = zext i8 %475 to i32
  %477 = sub nsw i32 %471, %476
  %478 = shl i32 %477, 2
  %479 = trunc i32 %478 to i16
  call void @oamSetVisible(i16 noundef zeroext %479, i8 noundef zeroext 1)
  br label %480

480:                                              ; preds = %466, %460
  %481 = load i8, ptr %5, align 1, !tbaa !5
  %482 = sext i8 %481 to i64
  %483 = getelementptr inbounds [32 x i8], ptr @difuse_x, i64 0, i64 %482
  %484 = load i8, ptr %483, align 1, !tbaa !5
  %485 = sext i8 %484 to i32
  %486 = load i8, ptr %5, align 1, !tbaa !5
  %487 = sext i8 %486 to i64
  %488 = getelementptr inbounds [32 x i16], ptr @difuse_xn, i64 0, i64 %487
  %489 = load i16, ptr %488, align 2, !tbaa !11
  %490 = sext i16 %489 to i32
  %491 = add nsw i32 %490, %485
  %492 = trunc i32 %491 to i16
  store i16 %492, ptr %488, align 2, !tbaa !11
  %493 = load i8, ptr %5, align 1, !tbaa !5
  %494 = sext i8 %493 to i64
  %495 = getelementptr inbounds [32 x i8], ptr @bullet_gravity, i64 0, i64 %494
  %496 = load i8, ptr %495, align 1, !tbaa !5
  %497 = add i8 %496, 1
  store i8 %497, ptr %495, align 1, !tbaa !5
  %498 = load i8, ptr %5, align 1, !tbaa !5
  %499 = sext i8 %498 to i64
  %500 = getelementptr inbounds [32 x i8], ptr @difuse_y, i64 0, i64 %499
  %501 = load i8, ptr %500, align 1, !tbaa !5
  %502 = sext i8 %501 to i32
  %503 = load i8, ptr %5, align 1, !tbaa !5
  %504 = sext i8 %503 to i64
  %505 = getelementptr inbounds [32 x i8], ptr @bullet_gravity, i64 0, i64 %504
  %506 = load i8, ptr %505, align 1, !tbaa !5
  %507 = zext i8 %506 to i32
  %508 = ashr i32 %507, 2
  %509 = add nsw i32 %502, %508
  %510 = load i8, ptr %5, align 1, !tbaa !5
  %511 = sext i8 %510 to i64
  %512 = getelementptr inbounds [32 x i16], ptr @difuse_yn, i64 0, i64 %511
  %513 = load i16, ptr %512, align 2, !tbaa !11
  %514 = sext i16 %513 to i32
  %515 = add nsw i32 %514, %509
  %516 = trunc i32 %515 to i16
  store i16 %516, ptr %512, align 2, !tbaa !11
  %517 = load i8, ptr %5, align 1, !tbaa !5
  %518 = sext i8 %517 to i64
  %519 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %518
  %520 = load i8, ptr %519, align 1, !tbaa !5
  %521 = zext i8 %520 to i32
  %522 = shl i32 %521, 2
  %523 = trunc i32 %522 to i16
  %524 = load i8, ptr %5, align 1, !tbaa !5
  %525 = sext i8 %524 to i64
  %526 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %525
  %527 = load i16, ptr %526, align 2, !tbaa !11
  %528 = zext i16 %527 to i32
  %529 = load i8, ptr %5, align 1, !tbaa !5
  %530 = sext i8 %529 to i64
  %531 = getelementptr inbounds [32 x i16], ptr @difuse_xn, i64 0, i64 %530
  %532 = load i16, ptr %531, align 2, !tbaa !11
  %533 = sext i16 %532 to i32
  %534 = ashr i32 %533, 6
  %535 = add nsw i32 %528, %534
  %536 = trunc i32 %535 to i16
  %537 = load i8, ptr %5, align 1, !tbaa !5
  %538 = sext i8 %537 to i64
  %539 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %538
  %540 = load i8, ptr %539, align 1, !tbaa !5
  %541 = zext i8 %540 to i32
  %542 = load i8, ptr %5, align 1, !tbaa !5
  %543 = sext i8 %542 to i64
  %544 = getelementptr inbounds [32 x i16], ptr @difuse_yn, i64 0, i64 %543
  %545 = load i16, ptr %544, align 2, !tbaa !11
  %546 = sext i16 %545 to i32
  %547 = ashr i32 %546, 6
  %548 = add nsw i32 %541, %547
  %549 = trunc i32 %548 to i16
  call void @oamSetXY(i16 noundef zeroext %523, i16 noundef zeroext %536, i16 noundef zeroext %549)
  %550 = load i8, ptr %5, align 1, !tbaa !5
  %551 = sext i8 %550 to i64
  %552 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %551
  %553 = load i8, ptr %552, align 1, !tbaa !5
  %554 = add i8 %553, 1
  store i8 %554, ptr %552, align 1, !tbaa !5
  %555 = load i8, ptr %5, align 1, !tbaa !5
  %556 = sext i8 %555 to i64
  %557 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %556
  %558 = load i8, ptr %557, align 1, !tbaa !5
  %559 = zext i8 %558 to i32
  %560 = icmp eq i32 %559, 4
  br i1 %560, label %561, label %568

561:                                              ; preds = %480
  %562 = load i8, ptr %5, align 1, !tbaa !5
  %563 = sext i8 %562 to i64
  %564 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %563
  store i8 68, ptr %564, align 1, !tbaa !5
  %565 = load i8, ptr %5, align 1, !tbaa !5
  %566 = sext i8 %565 to i64
  %567 = getelementptr inbounds [32 x i8], ptr @bullet_diff, i64 0, i64 %566
  store i8 65, ptr %567, align 1, !tbaa !5
  br label %572

568:                                              ; preds = %480
  %569 = load i8, ptr %5, align 1, !tbaa !5
  %570 = sext i8 %569 to i64
  %571 = getelementptr inbounds [32 x i8], ptr @bullet_diff, i64 0, i64 %570
  store i8 1, ptr %571, align 1, !tbaa !5
  br label %572

572:                                              ; preds = %568, %561
  %573 = load i8, ptr %5, align 1, !tbaa !5
  %574 = sext i8 %573 to i64
  %575 = getelementptr inbounds [32 x i8], ptr @bullet_frame_n, i64 0, i64 %574
  %576 = load i8, ptr %575, align 1, !tbaa !5
  %577 = add i8 %576, 1
  store i8 %577, ptr %575, align 1, !tbaa !5
  %578 = load i8, ptr %5, align 1, !tbaa !5
  %579 = sext i8 %578 to i64
  %580 = getelementptr inbounds [32 x i8], ptr @bullet_frame_n, i64 0, i64 %579
  %581 = load i8, ptr %580, align 1, !tbaa !5
  %582 = zext i8 %581 to i32
  %583 = load i8, ptr %5, align 1, !tbaa !5
  %584 = sext i8 %583 to i64
  %585 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %584
  %586 = load i8, ptr %585, align 1, !tbaa !5
  %587 = zext i8 %586 to i32
  %588 = sub nsw i32 %587, 4
  %589 = shl i32 %588, 3
  %590 = icmp sgt i32 %582, %589
  br i1 %590, label %591, label %600

591:                                              ; preds = %572
  %592 = load i8, ptr %5, align 1, !tbaa !5
  %593 = sext i8 %592 to i64
  %594 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %593
  %595 = load i8, ptr %594, align 1, !tbaa !5
  %596 = add i8 %595, 1
  store i8 %596, ptr %594, align 1, !tbaa !5
  %597 = load i8, ptr %5, align 1, !tbaa !5
  %598 = sext i8 %597 to i64
  %599 = getelementptr inbounds [32 x i8], ptr @bullet_frame_n, i64 0, i64 %598
  store i8 0, ptr %599, align 1, !tbaa !5
  br label %600

600:                                              ; preds = %591, %572
  br label %625

601:                                              ; preds = %453
  %602 = load i8, ptr %5, align 1, !tbaa !5
  %603 = sext i8 %602 to i64
  %604 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %603
  %605 = load i8, ptr %604, align 1, !tbaa !5
  %606 = zext i8 %605 to i32
  %607 = icmp eq i32 %606, 8
  br i1 %607, label %608, label %624

608:                                              ; preds = %601
  %609 = load i8, ptr %5, align 1, !tbaa !5
  %610 = sext i8 %609 to i64
  %611 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %610
  %612 = load i8, ptr %611, align 1, !tbaa !5
  %613 = zext i8 %612 to i32
  %614 = sub nsw i32 %613, 1
  %615 = shl i32 %614, 2
  %616 = trunc i32 %615 to i16
  call void @oamSetVisible(i16 noundef zeroext %616, i8 noundef zeroext 1)
  %617 = load i8, ptr @shot_bullets, align 1, !tbaa !5
  %618 = add i8 %617, -1
  store i8 %618, ptr @shot_bullets, align 1, !tbaa !5
  %619 = load i8, ptr %5, align 1, !tbaa !5
  %620 = sext i8 %619 to i64
  %621 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %620
  %622 = load i8, ptr %621, align 1, !tbaa !5
  %623 = add i8 %622, 1
  store i8 %623, ptr %621, align 1, !tbaa !5
  br label %624

624:                                              ; preds = %608, %601
  br label %625

625:                                              ; preds = %624, %600
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  br label %626

626:                                              ; preds = %625
  %627 = load i8, ptr @bullet_num, align 1, !tbaa !5
  %628 = add i8 %627, 1
  store i8 %628, ptr @bullet_num, align 1, !tbaa !5
  br label %432, !llvm.loop !15

629:                                              ; preds = %432
  br label %630

630:                                              ; preds = %629, %301
  %631 = load i8, ptr @targets_shot, align 1, !tbaa !5
  %632 = zext i8 %631 to i32
  %633 = icmp slt i32 %632, 8
  br i1 %633, label %634, label %936

634:                                              ; preds = %630
  %635 = load i8, ptr @enable_pause, align 1, !tbaa !5
  %636 = icmp ne i8 %635, 0
  br i1 %636, label %637, label %644

637:                                              ; preds = %634
  %638 = load i16, ptr @scope_down, align 2, !tbaa !11
  %639 = zext i16 %638 to i32
  %640 = and i32 %639, 4096
  %641 = icmp ne i32 %640, 0
  br i1 %641, label %642, label %643

642:                                              ; preds = %637
  call void @setFadeEffect(i8 noundef zeroext 1)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef @.str.25)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef @.str.26)
  call void @dmaCopyCGram(ptr noundef @aim_target_palette, i16 noundef zeroext 0, i16 noundef zeroext 2)
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !5
  store i8 -1, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  store i8 127, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  call void @hideSprites()
  store i8 -1, ptr @pause_adjust, align 1, !tbaa !5
  store i8 0, ptr @enable_fire, align 1, !tbaa !5
  store i8 0, ptr @enable_cursor, align 1, !tbaa !5
  br label %25

643:                                              ; preds = %637
  br label %644

644:                                              ; preds = %643, %634
  store i8 0, ptr @target_id, align 1, !tbaa !5
  br label %645

645:                                              ; preds = %932, %644
  %646 = load i8, ptr @target_id, align 1, !tbaa !5
  %647 = zext i8 %646 to i32
  %648 = icmp slt i32 %647, 8
  br i1 %648, label %649, label %935

649:                                              ; preds = %645
  %650 = load i8, ptr @target_id, align 1, !tbaa !5
  %651 = zext i8 %650 to i64
  %652 = getelementptr inbounds [64 x i8], ptr @target_kill, i64 0, i64 %651
  %653 = load i8, ptr %652, align 1, !tbaa !5
  %654 = zext i8 %653 to i32
  %655 = icmp eq i32 %654, 0
  br i1 %655, label %656, label %795

656:                                              ; preds = %649
  %657 = load i8, ptr @target_id, align 1, !tbaa !5
  %658 = zext i8 %657 to i64
  %659 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %658
  %660 = load i16, ptr %659, align 2, !tbaa !11
  %661 = add i16 %660, 1
  store i16 %661, ptr %659, align 2, !tbaa !11
  %662 = load i8, ptr @target_id, align 1, !tbaa !5
  %663 = zext i8 %662 to i64
  %664 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %663
  %665 = load i16, ptr %664, align 2, !tbaa !11
  %666 = add i16 %665, 1
  store i16 %666, ptr %664, align 2, !tbaa !11
  %667 = load i8, ptr @target_id, align 1, !tbaa !5
  %668 = zext i8 %667 to i64
  %669 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %668
  %670 = load i16, ptr %669, align 2, !tbaa !11
  %671 = zext i16 %670 to i32
  %672 = icmp sgt i32 %671, 511
  br i1 %672, label %673, label %677

673:                                              ; preds = %656
  %674 = load i8, ptr @target_id, align 1, !tbaa !5
  %675 = zext i8 %674 to i64
  %676 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %675
  store i16 0, ptr %676, align 2, !tbaa !11
  br label %677

677:                                              ; preds = %673, %656
  %678 = load i8, ptr @target_id, align 1, !tbaa !5
  %679 = zext i8 %678 to i64
  %680 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %679
  %681 = load i16, ptr %680, align 2, !tbaa !11
  %682 = zext i16 %681 to i32
  %683 = icmp sgt i32 %682, 511
  br i1 %683, label %684, label %688

684:                                              ; preds = %677
  %685 = load i8, ptr @target_id, align 1, !tbaa !5
  %686 = zext i8 %685 to i64
  %687 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %686
  store i16 0, ptr %687, align 2, !tbaa !11
  br label %688

688:                                              ; preds = %684, %677
  %689 = load i8, ptr @target_id, align 1, !tbaa !5
  %690 = zext i8 %689 to i64
  %691 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %690
  %692 = load i16, ptr %691, align 2, !tbaa !11
  %693 = call zeroext i8 @cos_table(i16 noundef zeroext %692)
  %694 = zext i8 %693 to i32
  %695 = shl i32 %694, 1
  %696 = sdiv i32 %695, 3
  %697 = add nsw i32 %696, 27
  %698 = trunc i32 %697 to i16
  %699 = load i8, ptr @target_id, align 1, !tbaa !5
  %700 = zext i8 %699 to i64
  %701 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %700
  store i16 %698, ptr %701, align 2, !tbaa !11
  %702 = load i8, ptr @target_id, align 1, !tbaa !5
  %703 = zext i8 %702 to i64
  %704 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %703
  %705 = load i16, ptr %704, align 2, !tbaa !11
  %706 = call zeroext i8 @sin_table(i16 noundef zeroext %705)
  %707 = zext i8 %706 to i32
  %708 = shl i32 %707, 1
  %709 = sdiv i32 %708, 3
  %710 = add nsw i32 %709, 11
  %711 = trunc i32 %710 to i8
  %712 = load i8, ptr @target_id, align 1, !tbaa !5
  %713 = zext i8 %712 to i64
  %714 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %713
  store i8 %711, ptr %714, align 1, !tbaa !5
  %715 = load i8, ptr @target_id, align 1, !tbaa !5
  %716 = zext i8 %715 to i64
  %717 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %716
  %718 = load i8, ptr %717, align 1, !tbaa !5
  %719 = zext i8 %718 to i16
  %720 = load i8, ptr @target_id, align 1, !tbaa !5
  %721 = zext i8 %720 to i64
  %722 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %721
  %723 = load i16, ptr %722, align 2, !tbaa !11
  %724 = load i8, ptr @target_id, align 1, !tbaa !5
  %725 = zext i8 %724 to i64
  %726 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %725
  %727 = load i8, ptr %726, align 1, !tbaa !5
  %728 = zext i8 %727 to i16
  call void @oamSetXY(i16 noundef zeroext %719, i16 noundef zeroext %723, i16 noundef zeroext %728)
  %729 = load i8, ptr @target_id, align 1, !tbaa !5
  %730 = zext i8 %729 to i64
  %731 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %730
  %732 = load i8, ptr %731, align 1, !tbaa !5
  %733 = zext i8 %732 to i32
  %734 = add nsw i32 %733, 0
  %735 = sext i32 %734 to i64
  %736 = getelementptr inbounds [544 x i8], ptr @oamMemory, i64 0, i64 %735
  %737 = load i8, ptr %736, align 1, !tbaa !5
  %738 = zext i8 %737 to i32
  %739 = load i8, ptr getelementptr inbounds ([544 x i8], ptr @oamMemory, i64 0, i64 12), align 4, !tbaa !5
  %740 = zext i8 %739 to i32
  %741 = sub nsw i32 %738, %740
  %742 = trunc i32 %741 to i8
  %743 = load i8, ptr @target_id, align 1, !tbaa !5
  %744 = zext i8 %743 to i64
  %745 = getelementptr inbounds [64 x i8], ptr @target_collision_x, i64 0, i64 %744
  store i8 %742, ptr %745, align 1, !tbaa !5
  %746 = load i8, ptr @target_id, align 1, !tbaa !5
  %747 = zext i8 %746 to i64
  %748 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %747
  %749 = load i8, ptr %748, align 1, !tbaa !5
  %750 = zext i8 %749 to i32
  %751 = add nsw i32 %750, 1
  %752 = sext i32 %751 to i64
  %753 = getelementptr inbounds [544 x i8], ptr @oamMemory, i64 0, i64 %752
  %754 = load i8, ptr %753, align 1, !tbaa !5
  %755 = zext i8 %754 to i32
  %756 = load i8, ptr getelementptr inbounds ([544 x i8], ptr @oamMemory, i64 0, i64 13), align 1, !tbaa !5
  %757 = zext i8 %756 to i32
  %758 = sub nsw i32 %755, %757
  %759 = trunc i32 %758 to i8
  %760 = load i8, ptr @target_id, align 1, !tbaa !5
  %761 = zext i8 %760 to i64
  %762 = getelementptr inbounds [64 x i8], ptr @target_collision_y, i64 0, i64 %761
  store i8 %759, ptr %762, align 1, !tbaa !5
  %763 = load i8, ptr @target_id, align 1, !tbaa !5
  %764 = zext i8 %763 to i64
  %765 = getelementptr inbounds [64 x i8], ptr @target_collision_x, i64 0, i64 %764
  %766 = load i8, ptr %765, align 1, !tbaa !5
  %767 = sext i8 %766 to i32
  %768 = icmp sgt i32 %767, -12
  br i1 %768, label %769, label %794

769:                                              ; preds = %688
  %770 = load i8, ptr @target_id, align 1, !tbaa !5
  %771 = zext i8 %770 to i64
  %772 = getelementptr inbounds [64 x i8], ptr @target_collision_x, i64 0, i64 %771
  %773 = load i8, ptr %772, align 1, !tbaa !5
  %774 = sext i8 %773 to i32
  %775 = icmp slt i32 %774, 12
  br i1 %775, label %776, label %794

776:                                              ; preds = %769
  %777 = load i8, ptr @target_id, align 1, !tbaa !5
  %778 = zext i8 %777 to i64
  %779 = getelementptr inbounds [64 x i8], ptr @target_collision_y, i64 0, i64 %778
  %780 = load i8, ptr %779, align 1, !tbaa !5
  %781 = sext i8 %780 to i32
  %782 = icmp sgt i32 %781, -12
  br i1 %782, label %783, label %794

783:                                              ; preds = %776
  %784 = load i8, ptr @target_id, align 1, !tbaa !5
  %785 = zext i8 %784 to i64
  %786 = getelementptr inbounds [64 x i8], ptr @target_collision_y, i64 0, i64 %785
  %787 = load i8, ptr %786, align 1, !tbaa !5
  %788 = sext i8 %787 to i32
  %789 = icmp slt i32 %788, 12
  br i1 %789, label %790, label %794

790:                                              ; preds = %783
  %791 = load i8, ptr @target_id, align 1, !tbaa !5
  %792 = zext i8 %791 to i64
  %793 = getelementptr inbounds [64 x i8], ptr @target_kill, i64 0, i64 %792
  store i8 -1, ptr %793, align 1, !tbaa !5
  br label %794

794:                                              ; preds = %790, %783, %776, %769, %688
  br label %795

795:                                              ; preds = %794, %649
  %796 = load i8, ptr @target_id, align 1, !tbaa !5
  %797 = zext i8 %796 to i64
  %798 = getelementptr inbounds [64 x i8], ptr @target_kill, i64 0, i64 %797
  %799 = load i8, ptr %798, align 1, !tbaa !5
  %800 = icmp ne i8 %799, 0
  br i1 %800, label %801, label %931

801:                                              ; preds = %795
  %802 = load i8, ptr @target_id, align 1, !tbaa !5
  %803 = zext i8 %802 to i64
  %804 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %803
  %805 = load i8, ptr %804, align 1, !tbaa !5
  %806 = zext i8 %805 to i32
  switch i32 %806, label %876 [
    i32 0, label %807
    i32 3, label %846
    i32 6, label %852
    i32 12, label %858
  ]

807:                                              ; preds = %801
  %808 = load i8, ptr @target_id, align 1, !tbaa !5
  %809 = zext i8 %808 to i64
  %810 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %809
  %811 = load i8, ptr %810, align 1, !tbaa !5
  %812 = zext i8 %811 to i16
  call void @oamSetGfxOffset(i16 noundef zeroext %812, i16 noundef zeroext 136)
  %813 = load i8, ptr @target_id, align 1, !tbaa !5
  %814 = zext i8 %813 to i64
  %815 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %814
  %816 = load i16, ptr %815, align 2, !tbaa !11
  %817 = zext i16 %816 to i32
  %818 = sub nsw i32 %817, 16
  %819 = trunc i32 %818 to i16
  store i16 %819, ptr %815, align 2, !tbaa !11
  %820 = load i8, ptr @target_id, align 1, !tbaa !5
  %821 = zext i8 %820 to i64
  %822 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %821
  %823 = load i8, ptr %822, align 1, !tbaa !5
  %824 = zext i8 %823 to i32
  %825 = sub nsw i32 %824, 16
  %826 = trunc i32 %825 to i8
  store i8 %826, ptr %822, align 1, !tbaa !5
  %827 = load i8, ptr @target_id, align 1, !tbaa !5
  %828 = zext i8 %827 to i64
  %829 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %828
  %830 = load i8, ptr %829, align 1, !tbaa !5
  %831 = zext i8 %830 to i16
  %832 = load i8, ptr @target_id, align 1, !tbaa !5
  %833 = zext i8 %832 to i64
  %834 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %833
  %835 = load i16, ptr %834, align 2, !tbaa !11
  %836 = load i8, ptr @target_id, align 1, !tbaa !5
  %837 = zext i8 %836 to i64
  %838 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %837
  %839 = load i8, ptr %838, align 1, !tbaa !5
  %840 = zext i8 %839 to i16
  call void @oamSetXY(i16 noundef zeroext %831, i16 noundef zeroext %835, i16 noundef zeroext %840)
  %841 = load i8, ptr @target_id, align 1, !tbaa !5
  %842 = zext i8 %841 to i64
  %843 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %842
  %844 = load i8, ptr %843, align 1, !tbaa !5
  %845 = zext i8 %844 to i16
  call void @oamSetEx(i16 noundef zeroext %845, i8 noundef zeroext 1, i8 noundef zeroext 0)
  br label %876

846:                                              ; preds = %801
  %847 = load i8, ptr @target_id, align 1, !tbaa !5
  %848 = zext i8 %847 to i64
  %849 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %848
  %850 = load i8, ptr %849, align 1, !tbaa !5
  %851 = zext i8 %850 to i16
  call void @oamSetGfxOffset(i16 noundef zeroext %851, i16 noundef zeroext 256)
  br label %876

852:                                              ; preds = %801
  %853 = load i8, ptr @target_id, align 1, !tbaa !5
  %854 = zext i8 %853 to i64
  %855 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %854
  %856 = load i8, ptr %855, align 1, !tbaa !5
  %857 = zext i8 %856 to i16
  call void @oamSetGfxOffset(i16 noundef zeroext %857, i16 noundef zeroext 264)
  br label %876

858:                                              ; preds = %801
  %859 = load i8, ptr @target_id, align 1, !tbaa !5
  %860 = zext i8 %859 to i64
  %861 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %860
  %862 = load i8, ptr %861, align 1, !tbaa !5
  %863 = zext i8 %862 to i16
  call void @oamSetGfxOffset(i16 noundef zeroext %863, i16 noundef zeroext 132)
  %864 = load i8, ptr @target_id, align 1, !tbaa !5
  %865 = zext i8 %864 to i64
  %866 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %865
  %867 = load i8, ptr %866, align 1, !tbaa !5
  %868 = zext i8 %867 to i16
  call void @oamSetEx(i16 noundef zeroext %868, i8 noundef zeroext 0, i8 noundef zeroext 1)
  %869 = load i8, ptr @targets_shot, align 1, !tbaa !5
  %870 = add i8 %869, 1
  store i8 %870, ptr @targets_shot, align 1, !tbaa !5
  store i8 0, ptr @enable_pause, align 1, !tbaa !5
  store i8 0, ptr @enable_cursor, align 1, !tbaa !5
  %871 = load i8, ptr @target_id, align 1, !tbaa !5
  %872 = zext i8 %871 to i64
  %873 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %872
  %874 = load i8, ptr %873, align 1, !tbaa !5
  %875 = add i8 %874, 1
  store i8 %875, ptr %873, align 1, !tbaa !5
  br label %876

876:                                              ; preds = %858, %852, %846, %807, %801
  %877 = load i8, ptr @target_id, align 1, !tbaa !5
  %878 = zext i8 %877 to i64
  %879 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %878
  %880 = load i8, ptr %879, align 1, !tbaa !5
  %881 = zext i8 %880 to i32
  %882 = icmp slt i32 %881, 12
  br i1 %882, label %883, label %930

883:                                              ; preds = %876
  %884 = load i8, ptr @target_id, align 1, !tbaa !5
  %885 = zext i8 %884 to i64
  %886 = getelementptr inbounds [64 x i8], ptr @target_gravity, i64 0, i64 %885
  %887 = load i8, ptr %886, align 1, !tbaa !5
  %888 = add i8 %887, 1
  store i8 %888, ptr %886, align 1, !tbaa !5
  %889 = load i8, ptr @target_id, align 1, !tbaa !5
  %890 = zext i8 %889 to i64
  %891 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %890
  %892 = load i8, ptr %891, align 1, !tbaa !5
  %893 = zext i8 %892 to i16
  %894 = load i8, ptr @target_id, align 1, !tbaa !5
  %895 = zext i8 %894 to i64
  %896 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %895
  %897 = load i16, ptr %896, align 2, !tbaa !11
  %898 = load i8, ptr @target_id, align 1, !tbaa !5
  %899 = zext i8 %898 to i64
  %900 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %899
  %901 = load i8, ptr %900, align 1, !tbaa !5
  %902 = zext i8 %901 to i32
  %903 = load i8, ptr @target_id, align 1, !tbaa !5
  %904 = zext i8 %903 to i64
  %905 = getelementptr inbounds [64 x i8], ptr @target_gravity, i64 0, i64 %904
  %906 = load i8, ptr %905, align 1, !tbaa !5
  %907 = zext i8 %906 to i32
  %908 = ashr i32 %907, 2
  %909 = add nsw i32 %902, %908
  %910 = trunc i32 %909 to i16
  call void @oamSetXY(i16 noundef zeroext %893, i16 noundef zeroext %897, i16 noundef zeroext %910)
  %911 = load i8, ptr @target_id, align 1, !tbaa !5
  %912 = zext i8 %911 to i64
  %913 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %912
  %914 = load i8, ptr %913, align 1, !tbaa !5
  %915 = add i8 %914, 1
  store i8 %915, ptr %913, align 1, !tbaa !5
  %916 = load i8, ptr @target_id, align 1, !tbaa !5
  %917 = zext i8 %916 to i64
  %918 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %917
  %919 = load i8, ptr %918, align 1, !tbaa !5
  %920 = zext i8 %919 to i32
  %921 = and i32 %920, 2
  %922 = icmp ne i32 %921, 0
  br i1 %922, label %923, label %929

923:                                              ; preds = %883
  %924 = load i8, ptr @target_id, align 1, !tbaa !5
  %925 = zext i8 %924 to i64
  %926 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %925
  %927 = load i8, ptr %926, align 1, !tbaa !5
  %928 = zext i8 %927 to i16
  call void @oamSetVisible(i16 noundef zeroext %928, i8 noundef zeroext 1)
  br label %929

929:                                              ; preds = %923, %883
  br label %930

930:                                              ; preds = %929, %876
  br label %931

931:                                              ; preds = %930, %795
  br label %932

932:                                              ; preds = %931
  %933 = load i8, ptr @target_id, align 1, !tbaa !5
  %934 = add i8 %933, 1
  store i8 %934, ptr @target_id, align 1, !tbaa !5
  br label %645, !llvm.loop !16

935:                                              ; preds = %645
  br label %962

936:                                              ; preds = %630
  %937 = load i8, ptr %3, align 1, !tbaa !5
  %938 = zext i8 %937 to i32
  %939 = icmp eq i32 %938, 255
  br i1 %939, label %940, label %941

940:                                              ; preds = %936
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 12, i16 noundef zeroext 8, ptr noundef @.str.28)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 11, i16 noundef zeroext 10, ptr noundef @.str.29)
  store i8 0, ptr %3, align 1, !tbaa !5
  br label %941

941:                                              ; preds = %940, %936
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 14, ptr noundef @.str.30)
  call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 15, ptr noundef @.str.20)
  %942 = load i8, ptr @enable_cursor, align 1, !tbaa !5
  %943 = icmp ne i8 %942, 0
  br i1 %943, label %944, label %951

944:                                              ; preds = %941
  %945 = load i16, ptr @scope_down, align 2, !tbaa !11
  %946 = zext i16 %945 to i32
  %947 = and i32 %946, 16384
  %948 = icmp ne i32 %947, 0
  br i1 %948, label %949, label %950

949:                                              ; preds = %944
  call void @setFadeEffect(i8 noundef zeroext 1)
  call void @resetGame()
  br label %228

950:                                              ; preds = %944
  br label %951

951:                                              ; preds = %950, %941
  %952 = load i8, ptr @enable_pause, align 1, !tbaa !5
  %953 = icmp ne i8 %952, 0
  br i1 %953, label %954, label %961

954:                                              ; preds = %951
  %955 = load i16, ptr @scope_down, align 2, !tbaa !11
  %956 = zext i16 %955 to i32
  %957 = and i32 %956, 4096
  %958 = icmp ne i32 %957, 0
  br i1 %958, label %959, label %960

959:                                              ; preds = %954
  call void @setFadeEffect(i8 noundef zeroext 1)
  call void @resetGame()
  call void @dmaCopyCGram(ptr noundef @aim_target_palette, i16 noundef zeroext 0, i16 noundef zeroext 2)
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !5
  store i8 -1, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  store i8 127, ptr inttoptr (i64 8482 to ptr), align 1, !tbaa !5
  br label %25

960:                                              ; preds = %954
  br label %961

961:                                              ; preds = %960, %951
  br label %962

962:                                              ; preds = %961, %935
  br label %963

963:                                              ; preds = %962, %278
  call void @WaitForVBlank()
  br label %266
}

declare void @consoleSetTextMapPtr(i16 noundef zeroext) #2

declare void @consoleSetTextGfxPtr(i16 noundef zeroext) #2

declare void @consoleSetTextOffset(i16 noundef zeroext) #2

declare void @consoleInitText(i8 noundef zeroext, i8 noundef zeroext, ptr noundef, ptr noundef) #2

declare void @bgInitTileSet(i8 noundef zeroext, ptr noundef, ptr noundef, i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @bgSetGfxPtr(i8 noundef zeroext, i16 noundef zeroext) #2

declare void @bgSetMapPtr(i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) #2

declare void @oamInitGfxSet(ptr noundef, i16 noundef zeroext, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) #2

declare void @oamSet(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) #2

declare void @oamSetEx(i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #2

declare void @setMode(i8 noundef zeroext, i8 noundef zeroext) #2

declare void @bgSetDisable(i8 noundef zeroext) #2

declare void @bgSetScroll(i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @bgInitMapSet(i8 noundef zeroext, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext) #2

declare void @detectSuperScope() #2

declare void @setScreenOn() #2

declare void @WaitForVBlank() #2

declare void @WaitNVBlank(i16 noundef zeroext) #2

declare void @setFadeEffect(i8 noundef zeroext) #2

declare void @oamSetXY(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @dmaFillVram(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @oamInitGfxAttr(i16 noundef zeroext, i8 noundef zeroext) #2

declare zeroext i16 @rand() #2

declare void @dmaCopyCGram(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @oamSetGfxOffset(i16 noundef zeroext, i16 noundef zeroext) #2

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


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

@sscope_disconnected = external dso_local local_unnamed_addr global i8, align 1
@pause_adjust = external dso_local local_unnamed_addr global i8, align 1
@ready_to_fire = external dso_local local_unnamed_addr global i8, align 1
@cool_down = external dso_local local_unnamed_addr global i8, align 1
@bullet_id = external dso_local local_unnamed_addr global i8, align 1
@bullet_num = external dso_local local_unnamed_addr global i8, align 1
@shot_bullets = external dso_local local_unnamed_addr global i8, align 1
@difuse_xn = external dso_local local_unnamed_addr global [32 x i16], align 16
@difuse_yn = external dso_local local_unnamed_addr global [32 x i16], align 16
@difuse_x = external dso_local local_unnamed_addr global [32 x i8], align 16
@difuse_y = external dso_local local_unnamed_addr global [32 x i8], align 16
@bullet_frame = external dso_local local_unnamed_addr global [32 x i8], align 16
@bullet_draw = external dso_local local_unnamed_addr global [32 x i8], align 16
@bullet_frame_n = external dso_local local_unnamed_addr global [32 x i8], align 16
@bullet_gravity = external dso_local local_unnamed_addr global [32 x i8], align 16
@bullet_diff = external dso_local local_unnamed_addr global <{ i8, [31 x i8] }>, align 16
@bullet_frames = external dso_local local_unnamed_addr global [8 x i8], align 1
@enable_fire = external dso_local local_unnamed_addr global i8, align 1
@enable_pause = external dso_local local_unnamed_addr global i8, align 1
@enable_cursor = external dso_local local_unnamed_addr global i8, align 1
@target_id = external dso_local local_unnamed_addr global i8, align 1
@target_kill = external dso_local local_unnamed_addr global [64 x i8], align 16
@target_kill_count = external dso_local local_unnamed_addr global [64 x i8], align 16
@target_gravity = external dso_local local_unnamed_addr global [64 x i8], align 16
@targets_shot = external dso_local local_unnamed_addr global i8, align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@tilfont = external global i8, align 1
@palfont = external global i8, align 1
@aim_target_tileset = external global i8, align 1
@aim_target_palette = external global i8, align 1
@aim_target_tileset_end = external global i8, align 1
@sprites_map = external global i8, align 1
@sprites_map_end = external global i8, align 1
@sprites_palette = external global i8, align 1
@aim_target_map = external global i8, align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@snes_sscope = external local_unnamed_addr global i8, align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1
@scope_down = external local_unnamed_addr global i16, align 2
@scope_shothraw = external local_unnamed_addr global i16, align 2
@scope_centerh = external local_unnamed_addr global i16, align 2
@scope_shotvraw = external local_unnamed_addr global i16, align 2
@scope_centerv = external local_unnamed_addr global i16, align 2
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@scope_shoth = external local_unnamed_addr global i16, align 2
@scope_shotv = external local_unnamed_addr global i16, align 2
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1
@scope_holddelay = external local_unnamed_addr global i16, align 2
@scope_repdelay = external local_unnamed_addr global i16, align 2
@target_x_inc = external dso_local local_unnamed_addr global [64 x i16], align 16
@target_y_inc = external dso_local local_unnamed_addr global [64 x i16], align 16
@target_oam_id = external dso_local local_unnamed_addr global [64 x i8], align 16
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [22 x i8], align 1
@scope_held = external local_unnamed_addr global i16, align 2
@bullet_x = external dso_local local_unnamed_addr global [32 x i16], align 16
@bullet_y = external dso_local local_unnamed_addr global [32 x i8], align 16
@target_x = external dso_local local_unnamed_addr global [64 x i16], align 16
@target_y = external dso_local local_unnamed_addr global [64 x i8], align 16
@oamMemory = external local_unnamed_addr global [544 x i8], align 16
@target_collision_x = external dso_local local_unnamed_addr global [64 x i8], align 16
@target_collision_y = external dso_local local_unnamed_addr global [64 x i8], align 16
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @sin_table(i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cos_table(i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @hideSprites() local_unnamed_addr #0

declare void @oamSetVisible(i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @resetGame() local_unnamed_addr #0

declare void @consoleDrawText(i16 noundef zeroext, i16 noundef zeroext, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  tail call void @consoleSetTextMapPtr(i16 noundef zeroext 8192) #3
  tail call void @consoleSetTextGfxPtr(i16 noundef zeroext 14336) #3
  tail call void @consoleSetTextOffset(i16 noundef zeroext 128) #3
  tail call void @consoleInitText(i8 noundef zeroext 1, i8 noundef zeroext 32, ptr noundef nonnull @tilfont, ptr noundef nonnull @palfont) #3
  tail call void @bgInitTileSet(i8 noundef zeroext 0, ptr noundef nonnull @aim_target_tileset, ptr noundef nonnull @aim_target_palette, i8 noundef zeroext 0, i16 noundef zeroext trunc (i64 sub (i64 ptrtoint (ptr @aim_target_tileset_end to i64), i64 ptrtoint (ptr @aim_target_tileset to i64)) to i16), i16 noundef zeroext 32, i16 noundef zeroext 16, i16 noundef zeroext 12288) #3
  tail call void @bgSetGfxPtr(i8 noundef zeroext 1, i16 noundef zeroext 14336) #3
  tail call void @bgSetMapPtr(i8 noundef zeroext 1, i16 noundef zeroext 8192, i8 noundef zeroext 0) #3
  tail call void @oamInitGfxSet(ptr noundef nonnull @sprites_map, i16 noundef zeroext trunc (i64 sub (i64 ptrtoint (ptr @sprites_map_end to i64), i64 ptrtoint (ptr @sprites_map to i64)) to i16), ptr noundef nonnull @sprites_palette, i16 noundef zeroext 96, i8 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 96) #3
  br label %1

1:                                                ; preds = %0, %1
  %indvars.iv = phi i16 [ 0, %0 ], [ %indvars.iv.next, %1 ]
  %2 = shl nuw i16 %indvars.iv, 2
  %3 = add nuw nsw i16 %2, 16
  tail call void @oamSet(i16 noundef zeroext %3, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 132, i8 noundef zeroext 1) #3
  tail call void @oamSetEx(i16 noundef zeroext %3, i8 noundef zeroext 0, i8 noundef zeroext 1) #3
  %indvars.iv.next = add nuw nsw i16 %indvars.iv, 1
  %exitcond.not = icmp eq i16 %indvars.iv.next, 64
  br i1 %exitcond.not, label %4, label %1, !llvm.loop !5

4:                                                ; preds = %1
  tail call void @setMode(i8 noundef zeroext 1, i8 noundef zeroext 0) #3
  tail call void @bgSetDisable(i8 noundef zeroext 2) #3
  tail call void @bgSetScroll(i8 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext -1) #3
  tail call void @bgSetScroll(i8 noundef zeroext 1, i16 noundef zeroext 0, i16 noundef zeroext -1) #3
  br label %.backedge112

.backedge112:                                     ; preds = %.backedge112.backedge, %4
  %.048 = phi i8 [ undef, %4 ], [ %.048.be, %.backedge112.backedge ]
  %.047 = phi i8 [ undef, %4 ], [ %.3, %.backedge112.backedge ]
  tail call void @bgInitMapSet(i8 noundef zeroext 0, ptr noundef nonnull @aim_target_map, i16 noundef zeroext 1792, i8 noundef zeroext 0, i16 noundef zeroext 10240) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 1, ptr noundef nonnull @.str.4) #3
  %5 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %7, label %6

6:                                                ; preds = %.backedge112
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef nonnull @.str.5) #3
  br label %12

7:                                                ; preds = %.backedge112
  tail call void @detectSuperScope() #3
  %8 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %9 = icmp eq i8 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %7
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.6) #3
  br label %12

11:                                               ; preds = %7
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 26, ptr noundef nonnull @.str.7) #3
  br label %12

12:                                               ; preds = %10, %11, %6
  tail call void @oamSet(i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 128, i8 noundef zeroext 2) #3
  tail call void @oamSetEx(i16 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 1) #3
  tail call void @setScreenOn() #3
  %13 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %14 = icmp eq i8 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12, %17
  tail call void @WaitForVBlank() #3
  tail call void @detectSuperScope() #3
  %15 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %.not92 = icmp eq i8 %15, 0
  br i1 %.not92, label %17, label %16

16:                                               ; preds = %.lr.ph
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.8) #3
  %.pre = load i8, ptr @snes_sscope, align 1, !tbaa !7
  br label %17

17:                                               ; preds = %16, %.lr.ph
  %18 = phi i8 [ %.pre, %16 ], [ 0, %.lr.ph ]
  %19 = icmp eq i8 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %17, %12
  %20 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %21 = icmp eq i8 %20, 0
  br i1 %21, label %22, label %.backedge.preheader

22:                                               ; preds = %._crit_edge
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  br label %.backedge.preheader

.backedge.preheader:                              ; preds = %22, %._crit_edge
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %.backedge.preheader
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef nonnull @.str.9) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 25, ptr noundef nonnull @.str.10) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef nonnull @.str.11) #3
  br label %23

23:                                               ; preds = %44, %.backedge
  %24 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  tail call void @detectSuperScope() #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef nonnull @.str.12) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.6) #3
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %44

27:                                               ; preds = %23
  %28 = load i8, ptr @sscope_disconnected, align 1, !tbaa !7
  %.not63 = icmp eq i8 %28, 0
  br i1 %.not63, label %30, label %29

29:                                               ; preds = %27
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.8) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %29, %53, %79, %90, %83
  br label %.backedge

30:                                               ; preds = %27
  %31 = load i16, ptr @scope_down, align 2
  %32 = icmp sgt i16 %31, -1
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store i8 -1, ptr @enable_fire, align 1, !tbaa !7
  br label %34

34:                                               ; preds = %33, %30
  %35 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %.not64 = icmp eq i8 %35, 0
  %36 = and i16 %31, 4096
  %.not65 = icmp eq i16 %36, 0
  %or.cond107 = or i1 %.not65, %.not64
  br i1 %or.cond107, label %37, label %.loopexit170

37:                                               ; preds = %34
  %38 = load i8, ptr @enable_fire, align 1, !tbaa !7
  %.not66 = icmp eq i8 %38, 0
  %or.cond93 = or i1 %32, %.not66
  br i1 %or.cond93, label %44, label %39

39:                                               ; preds = %37
  store i8 0, ptr @enable_fire, align 1, !tbaa !7
  %40 = load i16, ptr @scope_shothraw, align 2, !tbaa !11
  %41 = sub i16 128, %40
  store i16 %41, ptr @scope_centerh, align 2, !tbaa !11
  %42 = load i16, ptr @scope_shotvraw, align 2, !tbaa !11
  %43 = sub i16 112, %42
  store i16 %43, ptr @scope_centerv, align 2, !tbaa !11
  br i1 %.not64, label %46, label %45

44:                                               ; preds = %37, %26
  tail call void @WaitForVBlank() #3
  br label %23

45:                                               ; preds = %39
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef nonnull @.str.13) #3
  br label %46

46:                                               ; preds = %45, %39
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef nonnull @.str.14) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 26, ptr noundef nonnull @.str.15) #3
  tail call void @oamSetXY(i16 noundef zeroext 0, i16 noundef zeroext 120, i16 noundef zeroext 104) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  tail call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 25, ptr noundef nonnull @.str.16) #3
  br label %47

47:                                               ; preds = %65, %46
  %48 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %49 = icmp eq i8 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  tail call void @detectSuperScope() #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef nonnull @.str.12) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.6) #3
  br label %.sink.split

51:                                               ; preds = %47
  %52 = load i8, ptr @sscope_disconnected, align 1, !tbaa !7
  %.not69 = icmp eq i8 %52, 0
  br i1 %.not69, label %54, label %53

53:                                               ; preds = %51
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.8) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %.backedge.backedge

54:                                               ; preds = %51
  %55 = load i16, ptr @scope_down, align 2
  %56 = icmp sgt i16 %55, -1
  br i1 %56, label %.sink.split, label %57

57:                                               ; preds = %54
  %58 = load i8, ptr @enable_fire, align 1, !tbaa !7
  %.not70 = icmp eq i8 %58, 0
  br i1 %.not70, label %65, label %59

59:                                               ; preds = %57
  store i8 0, ptr @enable_fire, align 1, !tbaa !7
  %60 = load i16, ptr @scope_shoth, align 2, !tbaa !11
  %61 = add i16 %60, -8
  %62 = load i16, ptr @scope_shotv, align 2, !tbaa !11
  %63 = add i16 %62, -8
  tail call void @oamSetXY(i16 noundef zeroext 0, i16 noundef zeroext %61, i16 noundef zeroext %63) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef nonnull @.str.17) #3
  %64 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %.not72 = icmp eq i8 %64, 0
  br i1 %.not72, label %67, label %66

.sink.split:                                      ; preds = %54, %50
  %enable_fire.sink = phi ptr [ @sscope_disconnected, %50 ], [ @enable_fire, %54 ]
  store i8 -1, ptr %enable_fire.sink, align 1, !tbaa !7
  br label %65

65:                                               ; preds = %.sink.split, %57
  tail call void @WaitForVBlank() #3
  br label %47

66:                                               ; preds = %59
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 5, i16 noundef zeroext 25, ptr noundef nonnull @.str.18) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef nonnull @.str.19) #3
  br label %.preheader

67:                                               ; preds = %59
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef nonnull @.str.20) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 26, ptr noundef nonnull @.str.21) #3
  br label %.preheader

.preheader:                                       ; preds = %67, %66
  br label %68

68:                                               ; preds = %.preheader, %91
  %69 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %70 = icmp eq i8 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  tail call void @detectSuperScope() #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 2, i16 noundef zeroext 24, ptr noundef nonnull @.str.13) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef nonnull @.str.3) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.6) #3
  tail call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1) #3
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %91

72:                                               ; preds = %68
  %73 = load i16, ptr @scope_down, align 2, !tbaa !11
  %74 = and i16 %73, 16384
  %75 = icmp eq i16 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  store i8 -1, ptr @enable_cursor, align 1, !tbaa !7
  br label %77

77:                                               ; preds = %76, %72
  %78 = load i8, ptr @sscope_disconnected, align 1, !tbaa !7
  %.not73 = icmp eq i8 %78, 0
  br i1 %.not73, label %80, label %79

79:                                               ; preds = %77
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 26, ptr noundef nonnull @.str.8) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %.backedge.backedge

80:                                               ; preds = %77
  %81 = zext i16 %73 to i32
  %82 = and i32 %81, 4096
  %.not74 = icmp eq i32 %82, 0
  br i1 %.not74, label %85, label %83

83:                                               ; preds = %80
  tail call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1) #3
  %84 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %.not78 = icmp eq i8 %84, 0
  br i1 %.not78, label %.backedge.backedge, label %.loopexit170

85:                                               ; preds = %80
  %86 = load i8, ptr @enable_cursor, align 1, !tbaa !7
  %.not75 = icmp eq i8 %86, 0
  %87 = and i32 %81, 16384
  %.not76 = icmp eq i32 %87, 0
  %or.cond95 = or i1 %.not76, %.not75
  br i1 %or.cond95, label %91, label %88

88:                                               ; preds = %85
  store i8 0, ptr @enable_cursor, align 1, !tbaa !7
  %89 = load i8, ptr @pause_adjust, align 1, !tbaa !7
  %.not77 = icmp eq i8 %89, 0
  tail call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1) #3
  br i1 %.not77, label %92, label %90

90:                                               ; preds = %88
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef nonnull @.str.5) #3
  br label %.backedge.backedge

91:                                               ; preds = %85, %71
  tail call void @WaitForVBlank() #3
  br label %68

92:                                               ; preds = %88
  %93 = load i8, ptr @bullet_frame, align 16, !tbaa !7
  %94 = icmp ult i8 %93, 8
  br i1 %94, label %.lr.ph122.preheader, label %._crit_edge123

.lr.ph122.preheader:                              ; preds = %92
  %.pre142 = load i8, ptr @bullet_draw, align 16, !tbaa !7
  br label %.lr.ph122

.lr.ph122:                                        ; preds = %.lr.ph122.preheader, %119
  %95 = phi i8 [ %spec.store.select, %119 ], [ %.pre142, %.lr.ph122.preheader ]
  %96 = phi i8 [ %120, %119 ], [ %93, %.lr.ph122.preheader ]
  %97 = zext i8 %95 to i16
  %98 = shl nuw nsw i16 %97, 2
  %99 = zext nneg i8 %96 to i64
  %100 = getelementptr inbounds [8 x i8], ptr @bullet_frames, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !7
  %102 = zext i8 %101 to i16
  tail call void @oamSet(i16 noundef zeroext %98, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext %102, i8 noundef zeroext 0) #3
  %103 = load i8, ptr @bullet_draw, align 16, !tbaa !7
  %104 = zext i8 %103 to i16
  %105 = shl nuw nsw i16 %104, 2
  tail call void @oamSetVisible(i16 noundef zeroext %105, i8 noundef zeroext 1) #3
  %106 = load i8, ptr @bullet_draw, align 16, !tbaa !7
  %107 = add i8 %106, 1
  %108 = icmp eq i8 %107, 4
  %spec.store.select = select i1 %108, i8 68, i8 %107
  store i8 %spec.store.select, ptr @bullet_draw, align 16
  %109 = load i8, ptr @bullet_frame_n, align 16, !tbaa !7
  %110 = add i8 %109, 1
  store i8 %110, ptr @bullet_frame_n, align 16, !tbaa !7
  %111 = zext i8 %110 to i32
  %112 = load i8, ptr @bullet_frame, align 16, !tbaa !7
  %113 = zext i8 %112 to i32
  %114 = shl nuw nsw i32 %113, 3
  %115 = add nsw i32 %114, -32
  %116 = icmp slt i32 %115, %111
  br i1 %116, label %117, label %119

117:                                              ; preds = %.lr.ph122
  %118 = add i8 %112, 1
  store i8 %118, ptr @bullet_frame, align 16, !tbaa !7
  store i8 0, ptr @bullet_frame_n, align 16, !tbaa !7
  br label %119

119:                                              ; preds = %117, %.lr.ph122
  %120 = phi i8 [ %118, %117 ], [ %112, %.lr.ph122 ]
  %121 = icmp ult i8 %120, 8
  br i1 %121, label %.lr.ph122, label %._crit_edge123, !llvm.loop !13

._crit_edge123:                                   ; preds = %119, %92
  store i16 60, ptr @scope_holddelay, align 2, !tbaa !11
  store i16 20, ptr @scope_repdelay, align 2, !tbaa !11
  tail call void @setFadeEffect(i8 noundef zeroext 1) #3
  br label %.thread100.loopexit

.thread100.loopexit:                              ; preds = %458, %._crit_edge123
  store <8 x i16> <i16 0, i16 64, i16 128, i16 192, i16 256, i16 320, i16 384, i16 448>, ptr @target_x_inc, align 16, !tbaa !11
  store <8 x i16> <i16 0, i16 64, i16 128, i16 192, i16 256, i16 320, i16 384, i16 448>, ptr @target_y_inc, align 16, !tbaa !11
  store <8 x i8> <i8 64, i8 68, i8 72, i8 76, i8 80, i8 84, i8 88, i8 92>, ptr @target_oam_id, align 16, !tbaa !7
  store i8 8, ptr @target_id, align 1, !tbaa !7
  br label %.thread100

.loopexit170:                                     ; preds = %83, %34
  tail call void @setFadeEffect(i8 noundef zeroext 1) #3
  tail call void @oamSet(i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 2, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 0, i8 noundef zeroext 0) #3
  tail call void @oamSetVisible(i16 noundef zeroext 0, i8 noundef zeroext 1) #3
  store i8 0, ptr @pause_adjust, align 1, !tbaa !7
  %122 = icmp ult i8 %.047, 120
  br i1 %122, label %.thread100, label %123

.thread100:                                       ; preds = %.thread100.loopexit, %.loopexit170
  %.1106 = phi i8 [ %.047, %.loopexit170 ], [ 0, %.thread100.loopexit ]
  %.149104 = phi i8 [ %.048, %.loopexit170 ], [ -1, %.thread100.loopexit ]
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef nonnull @.str.22) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef nonnull @.str.23) #3
  br label %123

123:                                              ; preds = %.thread100, %.loopexit170
  %.1105 = phi i8 [ %.1106, %.thread100 ], [ %.047, %.loopexit170 ]
  %.149103 = phi i8 [ %.149104, %.thread100 ], [ %.048, %.loopexit170 ]
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 1, ptr noundef nonnull @.str.24) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 3, ptr noundef nonnull @.str.13) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 8, i16 noundef zeroext 4, ptr noundef nonnull @.str.15) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 9, i16 noundef zeroext 24, ptr noundef nonnull @.str.9) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 4, i16 noundef zeroext 25, ptr noundef nonnull @.str.3) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 26, ptr noundef nonnull @.str.2) #3
  store volatile i8 0, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !7
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !7
  store i8 0, ptr inttoptr (i64 8482 to ptr), align 2, !tbaa !7
  tail call void @WaitForVBlank() #3
  tail call void @dmaFillVram(ptr noundef nonnull @aim_target_map, i16 noundef zeroext 10240, i16 noundef zeroext 1792) #3
  tail call void @oamInitGfxAttr(i16 noundef zeroext 0, i8 noundef zeroext -96) #3
  tail call void @setScreenOn() #3
  br label %124

124:                                              ; preds = %.loopexit, %123
  %.250 = phi i8 [ %.149103, %123 ], [ %.4, %.loopexit ]
  %.2 = phi i8 [ %.1105, %123 ], [ %.3, %.loopexit ]
  switch i8 %.2, label %126 [
    i8 120, label %125
    i8 121, label %128
  ]

125:                                              ; preds = %124
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef nonnull @.str.25) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef nonnull @.str.26) #3
  br label %126

126:                                              ; preds = %125, %124
  %127 = add i8 %.2, 1
  br label %128

128:                                              ; preds = %126, %124
  %.3 = phi i8 [ %127, %126 ], [ %.2, %124 ]
  %129 = load i8, ptr @snes_sscope, align 1, !tbaa !7
  %130 = icmp eq i8 %129, 0
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  tail call void @detectSuperScope() #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 13, ptr noundef nonnull @.str.6) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 14, ptr noundef nonnull @.str.2) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 15, ptr noundef nonnull @.str.3) #3
  store i8 -1, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %.loopexit

132:                                              ; preds = %128
  %133 = load i8, ptr @sscope_disconnected, align 1, !tbaa !7
  %.not79 = icmp eq i8 %133, 0
  br i1 %.not79, label %135, label %134

134:                                              ; preds = %132
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 1, i16 noundef zeroext 13, ptr noundef nonnull @.str.8) #3
  tail call void @WaitNVBlank(i16 noundef zeroext 60) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 6, i16 noundef zeroext 13, ptr noundef nonnull @.str.27) #3
  store i8 0, ptr @sscope_disconnected, align 1, !tbaa !7
  br label %135

135:                                              ; preds = %134, %132
  %136 = load i16, ptr @scope_down, align 2, !tbaa !11
  %137 = icmp sgt i16 %136, -1
  br i1 %137, label %138, label %139

138:                                              ; preds = %135
  store i8 -1, ptr @enable_fire, align 1, !tbaa !7
  br label %139

139:                                              ; preds = %138, %135
  %140 = and i16 %136, 4096
  %141 = icmp eq i16 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  store i8 -1, ptr @enable_pause, align 1, !tbaa !7
  br label %143

143:                                              ; preds = %142, %139
  %144 = and i16 %136, 16384
  %145 = icmp eq i16 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %143
  store i8 -1, ptr @enable_cursor, align 1, !tbaa !7
  br label %147

147:                                              ; preds = %146, %143
  %148 = load i8, ptr @enable_fire, align 1, !tbaa !7
  %.not80 = icmp eq i8 %148, 0
  br i1 %.not80, label %.loopexit111, label %149

149:                                              ; preds = %147
  %150 = load i16, ptr @scope_held, align 2, !tbaa !11
  %151 = icmp slt i16 %150, 0
  %152 = load i8, ptr @cool_down, align 1
  %153 = icmp ult i8 %152, 2
  %or.cond9.not = select i1 %151, i1 %153, i1 false
  %154 = or i1 %137, %or.cond9.not
  br i1 %154, label %155, label %157

155:                                              ; preds = %149
  %156 = add nuw nsw i8 %152, 1
  %simplifycfg.merge108 = select i1 %137, i8 0, i8 %156
  store i8 %simplifycfg.merge108, ptr @cool_down, align 1, !tbaa !7
  br label %157

157:                                              ; preds = %149, %155
  %158 = phi i8 [ %152, %149 ], [ %simplifycfg.merge108, %155 ]
  %159 = icmp eq i8 %158, 2
  %or.cond = select i1 %151, i1 %159, i1 false
  br i1 %or.cond, label %164, label %160

160:                                              ; preds = %157
  %161 = icmp slt i16 %136, 0
  %162 = load i8, ptr @ready_to_fire, align 1
  %163 = icmp eq i8 %162, 10
  %or.cond5 = select i1 %161, i1 %163, i1 false
  br i1 %or.cond5, label %164, label %182

164:                                              ; preds = %160, %157
  %165 = load i8, ptr @bullet_id, align 1, !tbaa !7
  %166 = add i8 %165, 1
  %167 = icmp eq i8 %166, 32
  %spec.store.select6 = select i1 %167, i8 0, i8 %166
  store i8 %spec.store.select6, ptr @bullet_id, align 1
  %168 = load i16, ptr @scope_shoth, align 2, !tbaa !11
  %169 = icmp ult i16 %168, 272
  br i1 %169, label %170, label %179

170:                                              ; preds = %164
  %171 = add nsw i16 %168, -16
  %172 = zext i8 %spec.store.select6 to i64
  %173 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %172
  store i16 %171, ptr %173, align 2, !tbaa !11
  %174 = load i16, ptr @scope_shotv, align 2, !tbaa !11
  %175 = icmp ult i16 %174, 224
  br i1 %175, label %176, label %.thread149

176:                                              ; preds = %170
  %177 = trunc nuw i16 %174 to i8
  %178 = add i8 %177, -16
  br label %.thread149

179:                                              ; preds = %164
  %180 = zext i8 %spec.store.select6 to i64
  %181 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %180
  store i16 272, ptr %181, align 2, !tbaa !11
  br label %.thread149

182:                                              ; preds = %160
  %183 = icmp ult i8 %158, 2
  br i1 %183, label %207, label %.sink.split166

.thread149:                                       ; preds = %170, %179, %176
  %.sink165 = phi i64 [ %180, %179 ], [ %172, %176 ], [ %172, %170 ]
  %.sink163 = phi i8 [ -32, %179 ], [ %178, %176 ], [ -32, %170 ]
  %184 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %.sink165
  store i8 %.sink163, ptr %184, align 1, !tbaa !7
  %185 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %.sink165
  store i8 0, ptr %185, align 1, !tbaa !7
  %186 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %.sink165
  store i8 0, ptr %186, align 1, !tbaa !7
  %187 = getelementptr inbounds [32 x i8], ptr @bullet_gravity, i64 0, i64 %.sink165
  store i8 0, ptr %187, align 1, !tbaa !7
  %188 = getelementptr inbounds [32 x i16], ptr @difuse_xn, i64 0, i64 %.sink165
  store i16 0, ptr %188, align 2, !tbaa !11
  %189 = getelementptr inbounds [32 x i16], ptr @difuse_yn, i64 0, i64 %.sink165
  store i16 0, ptr %189, align 2, !tbaa !11
  %190 = tail call zeroext i16 @rand() #3
  %191 = trunc i16 %190 to i8
  %192 = and i8 %191, 15
  %193 = add nsw i8 %192, -8
  %194 = load i8, ptr @bullet_id, align 1, !tbaa !7
  %195 = zext i8 %194 to i64
  %196 = getelementptr inbounds [32 x i8], ptr @difuse_x, i64 0, i64 %195
  store i8 %193, ptr %196, align 1, !tbaa !7
  %197 = tail call zeroext i16 @rand() #3
  %198 = trunc i16 %197 to i8
  %199 = lshr i8 %198, 4
  %200 = add nsw i8 %199, -8
  %201 = load i8, ptr @bullet_id, align 1, !tbaa !7
  %202 = zext i8 %201 to i64
  %203 = getelementptr inbounds [32 x i8], ptr @difuse_y, i64 0, i64 %202
  store i8 %200, ptr %203, align 1, !tbaa !7
  %204 = load i8, ptr @shot_bullets, align 1, !tbaa !7
  %205 = add i8 %204, 1
  store i8 %205, ptr @shot_bullets, align 1, !tbaa !7
  store i8 0, ptr @ready_to_fire, align 1, !tbaa !7
  %.pre143 = load i8, ptr @cool_down, align 1, !tbaa !7
  %206 = icmp ult i8 %.pre143, 2
  br i1 %206, label %.thread150, label %.sink.split166

207:                                              ; preds = %182
  %208 = icmp ult i8 %162, 10
  br i1 %208, label %.thread150, label %211

.thread150:                                       ; preds = %.thread149, %207
  %209 = phi i8 [ %162, %207 ], [ 0, %.thread149 ]
  %210 = add nuw nsw i8 %209, 1
  br label %.sink.split166

.sink.split166:                                   ; preds = %182, %.thread149, %.thread150
  %.sink167 = phi i8 [ %210, %.thread150 ], [ 0, %.thread149 ], [ 0, %182 ]
  store i8 %.sink167, ptr @ready_to_fire, align 1, !tbaa !7
  br label %211

211:                                              ; preds = %.sink.split166, %207
  store i8 0, ptr @bullet_num, align 1, !tbaa !7
  %212 = load i8, ptr @shot_bullets, align 1, !tbaa !7
  %.not129 = icmp eq i8 %212, 0
  br i1 %.not129, label %.loopexit111, label %.lr.ph127

.lr.ph127:                                        ; preds = %211, %289
  %storemerge125 = phi i8 [ %291, %289 ], [ 0, %211 ]
  %213 = load i8, ptr @bullet_id, align 1, !tbaa !7
  %214 = sub i8 %213, %storemerge125
  %215 = lshr i8 %214, 2
  %216 = and i8 %215, 32
  %spec.select = add i8 %216, %214
  %217 = sext i8 %spec.select to i64
  %218 = getelementptr inbounds [32 x i8], ptr @bullet_frame, i64 0, i64 %217
  %219 = load i8, ptr %218, align 1, !tbaa !7
  %220 = icmp ult i8 %219, 8
  br i1 %220, label %221, label %277

221:                                              ; preds = %.lr.ph127
  %222 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %217
  %223 = load i8, ptr %222, align 1, !tbaa !7
  %.not91 = icmp eq i8 %223, 0
  br i1 %.not91, label %231, label %224

224:                                              ; preds = %221
  %225 = zext i8 %223 to i16
  %226 = getelementptr inbounds [32 x i8], ptr @bullet_diff, i64 0, i64 %217
  %227 = load i8, ptr %226, align 1, !tbaa !7
  %228 = zext i8 %227 to i16
  %229 = sub nsw i16 %225, %228
  %230 = shl nsw i16 %229, 2
  tail call void @oamSetVisible(i16 noundef zeroext %230, i8 noundef zeroext 1) #3
  %.pre144 = load i8, ptr %222, align 1, !tbaa !7
  br label %231

231:                                              ; preds = %224, %221
  %232 = phi i8 [ %.pre144, %224 ], [ 0, %221 ]
  %233 = getelementptr inbounds [32 x i8], ptr @difuse_x, i64 0, i64 %217
  %234 = load i8, ptr %233, align 1, !tbaa !7
  %235 = sext i8 %234 to i16
  %236 = getelementptr inbounds [32 x i16], ptr @difuse_xn, i64 0, i64 %217
  %237 = load i16, ptr %236, align 2, !tbaa !11
  %238 = add i16 %237, %235
  store i16 %238, ptr %236, align 2, !tbaa !11
  %239 = getelementptr inbounds [32 x i8], ptr @bullet_gravity, i64 0, i64 %217
  %240 = load i8, ptr %239, align 1, !tbaa !7
  %241 = add i8 %240, 1
  store i8 %241, ptr %239, align 1, !tbaa !7
  %242 = getelementptr inbounds [32 x i8], ptr @difuse_y, i64 0, i64 %217
  %243 = load i8, ptr %242, align 1, !tbaa !7
  %244 = sext i8 %243 to i16
  %245 = lshr i8 %241, 2
  %246 = zext nneg i8 %245 to i16
  %247 = add nsw i16 %244, %246
  %248 = getelementptr inbounds [32 x i16], ptr @difuse_yn, i64 0, i64 %217
  %249 = load i16, ptr %248, align 2, !tbaa !11
  %250 = add i16 %247, %249
  store i16 %250, ptr %248, align 2, !tbaa !11
  %251 = zext i8 %232 to i16
  %252 = shl nuw nsw i16 %251, 2
  %253 = getelementptr inbounds [32 x i16], ptr @bullet_x, i64 0, i64 %217
  %254 = load i16, ptr %253, align 2, !tbaa !11
  %255 = ashr i16 %238, 6
  %256 = add i16 %254, %255
  %257 = getelementptr inbounds [32 x i8], ptr @bullet_y, i64 0, i64 %217
  %258 = load i8, ptr %257, align 1, !tbaa !7
  %259 = zext i8 %258 to i16
  %260 = ashr i16 %250, 6
  %261 = add nsw i16 %260, %259
  tail call void @oamSetXY(i16 noundef zeroext %252, i16 noundef zeroext %256, i16 noundef zeroext %261) #3
  %262 = load i8, ptr %222, align 1, !tbaa !7
  %263 = add i8 %262, 1
  %264 = icmp eq i8 %263, 4
  %spec.store.select168 = select i1 %264, i8 68, i8 %263
  store i8 %spec.store.select168, ptr %222, align 1
  %spec.select169 = select i1 %264, i8 65, i8 1
  %265 = getelementptr inbounds [32 x i8], ptr @bullet_diff, i64 0, i64 %217
  store i8 %spec.select169, ptr %265, align 1
  %266 = getelementptr inbounds [32 x i8], ptr @bullet_frame_n, i64 0, i64 %217
  %267 = load i8, ptr %266, align 1, !tbaa !7
  %268 = add i8 %267, 1
  store i8 %268, ptr %266, align 1, !tbaa !7
  %269 = zext i8 %268 to i32
  %270 = load i8, ptr %218, align 1, !tbaa !7
  %271 = zext i8 %270 to i32
  %272 = shl nuw nsw i32 %271, 3
  %273 = add nsw i32 %272, -32
  %274 = icmp slt i32 %273, %269
  br i1 %274, label %275, label %289

275:                                              ; preds = %231
  %276 = add i8 %270, 1
  store i8 %276, ptr %218, align 1, !tbaa !7
  store i8 0, ptr %266, align 1, !tbaa !7
  br label %289

277:                                              ; preds = %.lr.ph127
  %278 = icmp eq i8 %219, 8
  br i1 %278, label %279, label %289

279:                                              ; preds = %277
  %280 = getelementptr inbounds [32 x i8], ptr @bullet_draw, i64 0, i64 %217
  %281 = load i8, ptr %280, align 1, !tbaa !7
  %282 = zext i8 %281 to i16
  %283 = shl nuw nsw i16 %282, 2
  %284 = add nsw i16 %283, -4
  tail call void @oamSetVisible(i16 noundef zeroext %284, i8 noundef zeroext 1) #3
  %285 = load i8, ptr @shot_bullets, align 1, !tbaa !7
  %286 = add i8 %285, -1
  store i8 %286, ptr @shot_bullets, align 1, !tbaa !7
  %287 = load i8, ptr %218, align 1, !tbaa !7
  %288 = add i8 %287, 1
  store i8 %288, ptr %218, align 1, !tbaa !7
  br label %289

289:                                              ; preds = %277, %279, %231, %275
  %290 = load i8, ptr @bullet_num, align 1, !tbaa !7
  %291 = add i8 %290, 1
  store i8 %291, ptr @bullet_num, align 1, !tbaa !7
  %292 = load i8, ptr @shot_bullets, align 1, !tbaa !7
  %293 = icmp ult i8 %291, %292
  br i1 %293, label %.lr.ph127, label %.loopexit111, !llvm.loop !14

.loopexit111:                                     ; preds = %289, %211, %147
  %294 = load i8, ptr @targets_shot, align 1, !tbaa !7
  %295 = icmp ult i8 %294, 8
  br i1 %295, label %296, label %450

296:                                              ; preds = %.loopexit111
  %297 = load i8, ptr @enable_pause, align 1, !tbaa !7
  %.not86 = icmp eq i8 %297, 0
  br i1 %.not86, label %302, label %298

298:                                              ; preds = %296
  %299 = load i16, ptr @scope_down, align 2, !tbaa !11
  %300 = and i16 %299, 4096
  %.not87 = icmp eq i16 %300, 0
  br i1 %.not87, label %302, label %301

301:                                              ; preds = %298
  tail call void @setFadeEffect(i8 noundef zeroext 1) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 13, i16 noundef zeroext 13, ptr noundef nonnull @.str.25) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 10, i16 noundef zeroext 14, ptr noundef nonnull @.str.26) #3
  tail call void @dmaCopyCGram(ptr noundef nonnull @aim_target_palette, i16 noundef zeroext 0, i16 noundef zeroext 2) #3
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !7
  store i8 127, ptr inttoptr (i64 8482 to ptr), align 2, !tbaa !7
  tail call void @hideSprites()
  store i8 -1, ptr @pause_adjust, align 1, !tbaa !7
  store i8 0, ptr @enable_fire, align 1, !tbaa !7
  store i8 0, ptr @enable_cursor, align 1, !tbaa !7
  br label %.backedge112.backedge

.backedge112.backedge:                            ; preds = %301, %464
  %.048.be = phi i8 [ %.250, %301 ], [ %.351, %464 ]
  br label %.backedge112

302:                                              ; preds = %298, %296
  store i8 0, ptr @target_id, align 1, !tbaa !7
  br label %303

303:                                              ; preds = %302, %446
  %storemerge88128 = phi i8 [ 0, %302 ], [ %448, %446 ]
  %304 = zext nneg i8 %storemerge88128 to i64
  %305 = getelementptr inbounds [64 x i8], ptr @target_kill, i64 0, i64 %304
  %306 = load i8, ptr %305, align 1, !tbaa !7
  %307 = icmp eq i8 %306, 0
  br i1 %307, label %308, label %.thread152

308:                                              ; preds = %303
  %309 = getelementptr inbounds [64 x i16], ptr @target_x_inc, i64 0, i64 %304
  %310 = load i16, ptr %309, align 2, !tbaa !11
  %311 = add i16 %310, 1
  store i16 %311, ptr %309, align 2, !tbaa !11
  %312 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %304
  %313 = load i16, ptr %312, align 2, !tbaa !11
  %314 = add i16 %313, 1
  store i16 %314, ptr %312, align 2, !tbaa !11
  %315 = icmp ugt i16 %311, 511
  br i1 %315, label %316, label %317

316:                                              ; preds = %308
  store i16 0, ptr %309, align 2, !tbaa !11
  br label %317

317:                                              ; preds = %316, %308
  %318 = phi i16 [ 0, %316 ], [ %311, %308 ]
  %319 = icmp ugt i16 %314, 511
  br i1 %319, label %320, label %321

320:                                              ; preds = %317
  store i16 0, ptr %312, align 2, !tbaa !11
  br label %321

321:                                              ; preds = %320, %317
  %322 = tail call zeroext i8 @cos_table(i16 noundef zeroext %318)
  %323 = zext i8 %322 to i16
  %324 = shl nuw nsw i16 %323, 1
  %325 = udiv i16 %324, 3
  %326 = add nuw nsw i16 %325, 27
  %327 = load i8, ptr @target_id, align 1, !tbaa !7
  %328 = zext i8 %327 to i64
  %329 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %328
  store i16 %326, ptr %329, align 2, !tbaa !11
  %330 = getelementptr inbounds [64 x i16], ptr @target_y_inc, i64 0, i64 %328
  %331 = load i16, ptr %330, align 2, !tbaa !11
  %332 = tail call zeroext i8 @sin_table(i16 noundef zeroext %331)
  %333 = zext i8 %332 to i16
  %334 = shl nuw nsw i16 %333, 1
  %335 = udiv i16 %334, 3
  %336 = trunc nuw i16 %335 to i8
  %337 = add nuw i8 %336, 11
  %338 = load i8, ptr @target_id, align 1, !tbaa !7
  %339 = zext i8 %338 to i64
  %340 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %339
  store i8 %337, ptr %340, align 1, !tbaa !7
  %341 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %339
  %342 = load i8, ptr %341, align 1, !tbaa !7
  %343 = zext i8 %342 to i16
  %344 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %339
  %345 = load i16, ptr %344, align 2, !tbaa !11
  %346 = zext i8 %337 to i16
  tail call void @oamSetXY(i16 noundef zeroext %343, i16 noundef zeroext %345, i16 noundef zeroext %346) #3
  %347 = load i8, ptr @target_id, align 1, !tbaa !7
  %348 = zext i8 %347 to i64
  %349 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %348
  %350 = load i8, ptr %349, align 1, !tbaa !7
  %351 = zext i8 %350 to i64
  %352 = getelementptr inbounds [544 x i8], ptr @oamMemory, i64 0, i64 %351
  %353 = load i8, ptr %352, align 1, !tbaa !7
  %354 = load i8, ptr getelementptr inbounds (i8, ptr @oamMemory, i64 12), align 4, !tbaa !7
  %355 = sub i8 %353, %354
  %356 = getelementptr inbounds [64 x i8], ptr @target_collision_x, i64 0, i64 %348
  store i8 %355, ptr %356, align 1, !tbaa !7
  %357 = add nuw nsw i64 %351, 1
  %358 = getelementptr inbounds [544 x i8], ptr @oamMemory, i64 0, i64 %357
  %359 = load i8, ptr %358, align 1, !tbaa !7
  %360 = load i8, ptr getelementptr inbounds (i8, ptr @oamMemory, i64 13), align 1, !tbaa !7
  %361 = sub i8 %359, %360
  %362 = getelementptr inbounds [64 x i8], ptr @target_collision_y, i64 0, i64 %348
  store i8 %361, ptr %362, align 1, !tbaa !7
  %363 = add i8 %355, 11
  %or.cond96 = icmp ult i8 %363, 23
  %364 = add i8 %361, 11
  %or.cond97 = icmp ult i8 %364, 23
  %or.cond110 = select i1 %or.cond96, i1 %or.cond97, i1 false
  %365 = getelementptr inbounds [64 x i8], ptr @target_kill, i64 0, i64 %348
  br i1 %or.cond110, label %366, label %367

366:                                              ; preds = %321
  store i8 -1, ptr %365, align 1, !tbaa !7
  br label %.thread152

367:                                              ; preds = %321
  %.pre146 = load i8, ptr %365, align 1, !tbaa !7
  %.not89 = icmp eq i8 %.pre146, 0
  br i1 %.not89, label %446, label %.thread152

.thread152:                                       ; preds = %303, %366, %367
  %.pre-phi155 = phi i64 [ %348, %367 ], [ %304, %303 ], [ %348, %366 ]
  %368 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %.pre-phi155
  %369 = load i8, ptr %368, align 1, !tbaa !7
  switch i8 %369, label %415 [
    i8 0, label %370
    i8 3, label %391
    i8 6, label %395
    i8 12, label %399
  ]

370:                                              ; preds = %.thread152
  %371 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %.pre-phi155
  %372 = load i8, ptr %371, align 1, !tbaa !7
  %373 = zext i8 %372 to i16
  tail call void @oamSetGfxOffset(i16 noundef zeroext %373, i16 noundef zeroext 136) #3
  %374 = load i8, ptr @target_id, align 1, !tbaa !7
  %375 = zext i8 %374 to i64
  %376 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %375
  %377 = load i16, ptr %376, align 2, !tbaa !11
  %378 = add i16 %377, -16
  store i16 %378, ptr %376, align 2, !tbaa !11
  %379 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %375
  %380 = load i8, ptr %379, align 1, !tbaa !7
  %381 = add i8 %380, -16
  store i8 %381, ptr %379, align 1, !tbaa !7
  %382 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %375
  %383 = load i8, ptr %382, align 1, !tbaa !7
  %384 = zext i8 %383 to i16
  %385 = zext i8 %381 to i16
  tail call void @oamSetXY(i16 noundef zeroext %384, i16 noundef zeroext %378, i16 noundef zeroext %385) #3
  %386 = load i8, ptr @target_id, align 1, !tbaa !7
  %387 = zext i8 %386 to i64
  %388 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %387
  %389 = load i8, ptr %388, align 1, !tbaa !7
  %390 = zext i8 %389 to i16
  tail call void @oamSetEx(i16 noundef zeroext %390, i8 noundef zeroext 1, i8 noundef zeroext 0) #3
  br label %415

391:                                              ; preds = %.thread152
  %392 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %.pre-phi155
  %393 = load i8, ptr %392, align 1, !tbaa !7
  %394 = zext i8 %393 to i16
  tail call void @oamSetGfxOffset(i16 noundef zeroext %394, i16 noundef zeroext 256) #3
  br label %415

395:                                              ; preds = %.thread152
  %396 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %.pre-phi155
  %397 = load i8, ptr %396, align 1, !tbaa !7
  %398 = zext i8 %397 to i16
  tail call void @oamSetGfxOffset(i16 noundef zeroext %398, i16 noundef zeroext 264) #3
  br label %415

399:                                              ; preds = %.thread152
  %400 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %.pre-phi155
  %401 = load i8, ptr %400, align 1, !tbaa !7
  %402 = zext i8 %401 to i16
  tail call void @oamSetGfxOffset(i16 noundef zeroext %402, i16 noundef zeroext 132) #3
  %403 = load i8, ptr @target_id, align 1, !tbaa !7
  %404 = zext i8 %403 to i64
  %405 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %404
  %406 = load i8, ptr %405, align 1, !tbaa !7
  %407 = zext i8 %406 to i16
  tail call void @oamSetEx(i16 noundef zeroext %407, i8 noundef zeroext 0, i8 noundef zeroext 1) #3
  %408 = load i8, ptr @targets_shot, align 1, !tbaa !7
  %409 = add i8 %408, 1
  store i8 %409, ptr @targets_shot, align 1, !tbaa !7
  store i8 0, ptr @enable_pause, align 1, !tbaa !7
  store i8 0, ptr @enable_cursor, align 1, !tbaa !7
  %410 = load i8, ptr @target_id, align 1, !tbaa !7
  %411 = zext i8 %410 to i64
  %412 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %411
  %413 = load i8, ptr %412, align 1, !tbaa !7
  %414 = add i8 %413, 1
  store i8 %414, ptr %412, align 1, !tbaa !7
  br label %415

415:                                              ; preds = %399, %395, %391, %370, %.thread152
  %416 = load i8, ptr @target_id, align 1, !tbaa !7
  %417 = zext i8 %416 to i64
  %418 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %417
  %419 = load i8, ptr %418, align 1, !tbaa !7
  %420 = icmp ult i8 %419, 12
  br i1 %420, label %421, label %446

421:                                              ; preds = %415
  %422 = getelementptr inbounds [64 x i8], ptr @target_gravity, i64 0, i64 %417
  %423 = load i8, ptr %422, align 1, !tbaa !7
  %424 = add i8 %423, 1
  store i8 %424, ptr %422, align 1, !tbaa !7
  %425 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %417
  %426 = load i8, ptr %425, align 1, !tbaa !7
  %427 = zext i8 %426 to i16
  %428 = getelementptr inbounds [64 x i16], ptr @target_x, i64 0, i64 %417
  %429 = load i16, ptr %428, align 2, !tbaa !11
  %430 = getelementptr inbounds [64 x i8], ptr @target_y, i64 0, i64 %417
  %431 = load i8, ptr %430, align 1, !tbaa !7
  %432 = zext i8 %431 to i16
  %433 = lshr i8 %424, 2
  %434 = zext nneg i8 %433 to i16
  %435 = add nuw nsw i16 %432, %434
  tail call void @oamSetXY(i16 noundef zeroext %427, i16 noundef zeroext %429, i16 noundef zeroext %435) #3
  %436 = load i8, ptr @target_id, align 1, !tbaa !7
  %437 = zext i8 %436 to i64
  %438 = getelementptr inbounds [64 x i8], ptr @target_kill_count, i64 0, i64 %437
  %439 = load i8, ptr %438, align 1, !tbaa !7
  %440 = add i8 %439, 1
  store i8 %440, ptr %438, align 1, !tbaa !7
  %441 = and i8 %440, 2
  %.not90 = icmp eq i8 %441, 0
  br i1 %.not90, label %446, label %442

442:                                              ; preds = %421
  %443 = getelementptr inbounds [64 x i8], ptr @target_oam_id, i64 0, i64 %437
  %444 = load i8, ptr %443, align 1, !tbaa !7
  %445 = zext i8 %444 to i16
  tail call void @oamSetVisible(i16 noundef zeroext %445, i8 noundef zeroext 1) #3
  %.pre147 = load i8, ptr @target_id, align 1, !tbaa !7
  br label %446

446:                                              ; preds = %367, %421, %442, %415
  %447 = phi i8 [ %347, %367 ], [ %436, %421 ], [ %.pre147, %442 ], [ %416, %415 ]
  %448 = add i8 %447, 1
  store i8 %448, ptr @target_id, align 1, !tbaa !7
  %449 = icmp ult i8 %448, 8
  br i1 %449, label %303, label %.loopexit, !llvm.loop !15

450:                                              ; preds = %.loopexit111
  %451 = icmp eq i8 %.250, -1
  br i1 %451, label %452, label %453

452:                                              ; preds = %450
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 12, i16 noundef zeroext 8, ptr noundef nonnull @.str.28) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 11, i16 noundef zeroext 10, ptr noundef nonnull @.str.29) #3
  br label %453

453:                                              ; preds = %452, %450
  %.351 = phi i8 [ 0, %452 ], [ %.250, %450 ]
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 14, ptr noundef nonnull @.str.30) #3
  tail call void (i16, i16, ptr, ...) @consoleDrawText(i16 noundef zeroext 3, i16 noundef zeroext 15, ptr noundef nonnull @.str.20) #3
  %454 = load i8, ptr @enable_cursor, align 1, !tbaa !7
  %.not81 = icmp eq i8 %454, 0
  br i1 %.not81, label %459, label %455

455:                                              ; preds = %453
  %456 = load i16, ptr @scope_down, align 2, !tbaa !11
  %457 = and i16 %456, 16384
  %.not82 = icmp eq i16 %457, 0
  br i1 %.not82, label %459, label %458

458:                                              ; preds = %455
  tail call void @setFadeEffect(i8 noundef zeroext 1) #3
  tail call void @resetGame()
  br label %.thread100.loopexit

459:                                              ; preds = %455, %453
  %460 = load i8, ptr @enable_pause, align 1, !tbaa !7
  %.not83 = icmp eq i8 %460, 0
  br i1 %.not83, label %.loopexit, label %461

461:                                              ; preds = %459
  %462 = load i16, ptr @scope_down, align 2, !tbaa !11
  %463 = and i16 %462, 4096
  %.not84 = icmp eq i16 %463, 0
  br i1 %.not84, label %.loopexit, label %464

464:                                              ; preds = %461
  tail call void @setFadeEffect(i8 noundef zeroext 1) #3
  tail call void @resetGame()
  tail call void @dmaCopyCGram(ptr noundef nonnull @aim_target_palette, i16 noundef zeroext 0, i16 noundef zeroext 2) #3
  store volatile i8 17, ptr inttoptr (i64 8481 to ptr), align 1, !tbaa !7
  store i8 127, ptr inttoptr (i64 8482 to ptr), align 2, !tbaa !7
  br label %.backedge112.backedge

.loopexit:                                        ; preds = %446, %461, %459, %131
  %.4 = phi i8 [ %.250, %131 ], [ %.351, %461 ], [ %.351, %459 ], [ %.250, %446 ]
  tail call void @WaitForVBlank() #3
  br label %124
}

declare void @consoleSetTextMapPtr(i16 noundef zeroext) local_unnamed_addr #1

declare void @consoleSetTextGfxPtr(i16 noundef zeroext) local_unnamed_addr #1

declare void @consoleSetTextOffset(i16 noundef zeroext) local_unnamed_addr #1

declare void @consoleInitText(i8 noundef zeroext, i8 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @bgInitTileSet(i8 noundef zeroext, ptr noundef, ptr noundef, i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @bgSetGfxPtr(i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @bgSetMapPtr(i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare void @oamInitGfxSet(ptr noundef, i16 noundef zeroext, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare void @oamSet(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare void @oamSetEx(i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare void @setMode(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare void @bgSetDisable(i8 noundef zeroext) local_unnamed_addr #1

declare void @bgSetScroll(i8 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @bgInitMapSet(i8 noundef zeroext, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @detectSuperScope() local_unnamed_addr #1

declare void @setScreenOn() local_unnamed_addr #1

declare void @WaitForVBlank() local_unnamed_addr #1

declare void @WaitNVBlank(i16 noundef zeroext) local_unnamed_addr #1

declare void @setFadeEffect(i8 noundef zeroext) local_unnamed_addr #1

declare void @oamSetXY(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @dmaFillVram(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @oamInitGfxAttr(i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare zeroext i16 @rand() local_unnamed_addr #1

declare void @dmaCopyCGram(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

declare void @oamSetGfxOffset(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #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 = { "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 = { noreturn 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}


; Effective O3 passes: BDCEPass,ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass