; LLVM IR from jovanlanik/wip :: flipdot.d/src (wip_game)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.wip_window_t = type { i32, ptr }

@glad_glClearColor = external global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.wip_gameLoop = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@wip_globalWindow = external global %struct.wip_window_t, align 8
@glad_glClear = external global ptr, align 8
@glad_glReadPixels = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @wip_gameLoop() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = load ptr, ptr @glad_glClearColor, align 8, !tbaa !5
  call void %19(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %20 = call zeroext i1 @wip_getConfBool(ptr noundef @.str)
  %21 = zext i1 %20 to i32
  store i32 %21, ptr %1, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %22 = call ptr @wip_getConfStr(ptr noundef @.str.1)
  store ptr %22, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %23 = call i32 @wip_getConfInt(ptr noundef @.str.2)
  store i32 %23, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = call ptr @wfdd_initDisplay(ptr noundef %24, i32 noundef %25)
  store ptr %26, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %27 = call i32 @wip_getConfInt(ptr noundef @.str.3)
  store i32 %27, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %28 = call i32 @wip_getConfInt(ptr noundef @.str.4)
  store i32 %28, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = mul nsw i32 %29, %30
  store i32 %31, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = mul i64 %33, 1
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = sdiv i32 %36, 8
  store i32 %37, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = call ptr @_wip_alloc(i64 noundef %39, ptr noundef @__func__.wip_gameLoop)
  store ptr %40, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call ptr @_wip_alloc(i64 noundef %42, ptr noundef @__func__.wip_gameLoop)
  store ptr %43, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %44 = call i32 @wip_getConfInt(ptr noundef @.str.5)
  %45 = sitofp i32 %44 to double
  %46 = fdiv double 1.000000e+00, %45
  store double %46, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %47 = call double @wip_timeWindow()
  store double %47, ptr %13, align 8, !tbaa !11
  br label %48

48:                                               ; preds = %134, %0
  %49 = load i32, ptr @wip_globalWindow, align 8, !tbaa !13
  %50 = icmp ne i32 %49, 0
  %51 = xor i1 %50, true
  br i1 %51, label %52, label %146

52:                                               ; preds = %48
  %53 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %53(i32 noundef 16640)
  call void @drawScreen()
  %54 = load ptr, ptr @glad_glReadPixels, align 8, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  call void %54(i32 noundef 0, i32 noundef 0, i32 noundef %55, i32 noundef %56, i32 noundef 6403, i32 noundef 5121, ptr noundef %57)
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %58, i8 0, i64 %60, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %126, %52
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %129

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %67 = load i32, ptr %14, align 4, !tbaa !9
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = sdiv i32 %67, %68
  %70 = load i32, ptr %14, align 4, !tbaa !9
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = srem i32 %70, %71
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = mul nsw i32 %72, %73
  %75 = add nsw i32 %69, %74
  store i32 %75, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %76 = load i32, ptr %15, align 4, !tbaa !9
  %77 = srem i32 %76, 8
  store i32 %77, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = sdiv i32 %78, 8
  store i32 %79, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !15
  %85 = zext i8 %84 to i32
  %86 = icmp sgt i32 %85, 20
  %87 = zext i1 %86 to i32
  store i32 %87, ptr %18, align 4, !tbaa !9
  %88 = load i32, ptr %1, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %97

90:                                               ; preds = %66
  %91 = load i32, ptr %14, align 4, !tbaa !9
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = srem i32 %91, %92
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %97, label %95

95:                                               ; preds = %90
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %97

97:                                               ; preds = %95, %90, %66
  %98 = load i32, ptr %1, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %97
  %101 = load i32, ptr %18, align 4, !tbaa !9
  %102 = icmp ne i32 %101, 0
  %103 = zext i1 %102 to i64
  %104 = select i1 %102, i32 35, i32 45
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %104)
  br label %106

106:                                              ; preds = %100, %97
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load i32, ptr %17, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i8, ptr %107, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !15
  %112 = zext i8 %111 to i32
  %113 = load i32, ptr %16, align 4, !tbaa !9
  %114 = shl i32 1, %113
  %115 = xor i32 %114, -1
  %116 = and i32 %112, %115
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = shl i32 %117, %118
  %120 = or i32 %116, %119
  %121 = trunc i32 %120 to i8
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load i32, ptr %17, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %122, i64 %124
  store i8 %121, ptr %125, align 1, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %126

126:                                              ; preds = %106
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %14, align 4, !tbaa !9
  br label %61, !llvm.loop !16

129:                                              ; preds = %65
  %130 = load i32, ptr %1, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %134

134:                                              ; preds = %132, %129
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = load i32, ptr %9, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = call i32 @wfdd_sendBuffer(ptr noundef %135, i64 noundef %137, ptr noundef %138)
  %140 = load double, ptr %12, align 8, !tbaa !11
  %141 = load double, ptr %13, align 8, !tbaa !11
  %142 = fadd double %141, %140
  store double %142, ptr %13, align 8, !tbaa !11
  %143 = load double, ptr %13, align 8, !tbaa !11
  %144 = call double @wip_timeWindow()
  %145 = fsub double %143, %144
  call void @wip_sleep(double noundef %145)
  br label %48, !llvm.loop !18

146:                                              ; preds = %48
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  call void @wfdd_closeDisplay(ptr noundef %147)
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_wip_free(ptr noundef %148, ptr noundef @__func__.wip_gameLoop)
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_wip_free(ptr noundef %149, ptr noundef @__func__.wip_gameLoop)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

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

declare zeroext i1 @wip_getConfBool(ptr noundef) #2

declare ptr @wip_getConfStr(ptr noundef) #2

declare i32 @wip_getConfInt(ptr noundef) #2

declare ptr @wfdd_initDisplay(ptr noundef, i32 noundef) #2

declare ptr @_wip_alloc(i64 noundef, ptr noundef) #2

declare double @wip_timeWindow() #2

; Function Attrs: nounwind uwtable
declare hidden void @drawScreen() #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @printf(ptr noundef, ...) #2

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

declare i32 @wfdd_sendBuffer(ptr noundef, i64 noundef, ptr noundef) #2

declare void @wip_sleep(double noundef) #2

declare void @wfdd_closeDisplay(ptr noundef) #2

declare void @_wip_free(ptr noundef, ptr noundef) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !6, i64 8}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.wip_window_t = type { i32, ptr }

@glad_glClearColor = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.wip_gameLoop = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@wip_globalWindow = external local_unnamed_addr global %struct.wip_window_t, align 8
@glad_glClear = external local_unnamed_addr global ptr, align 8
@glad_glReadPixels = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @wip_gameLoop() local_unnamed_addr #0 {
  %1 = load ptr, ptr @glad_glClearColor, align 8, !tbaa !5
  tail call void %1(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00) #4
  %2 = tail call zeroext i1 @wip_getConfBool(ptr noundef nonnull @.str) #4
  %.fr = freeze i1 %2
  %3 = tail call ptr @wip_getConfStr(ptr noundef nonnull @.str.1) #4
  %4 = tail call i32 @wip_getConfInt(ptr noundef nonnull @.str.2) #4
  %5 = tail call ptr @wfdd_initDisplay(ptr noundef %3, i32 noundef %4) #4
  %6 = tail call i32 @wip_getConfInt(ptr noundef nonnull @.str.3) #4
  %7 = tail call i32 @wip_getConfInt(ptr noundef nonnull @.str.4) #4
  %8 = mul nsw i32 %7, %6
  %.fr61 = freeze i32 %8
  %9 = sext i32 %.fr61 to i64
  %10 = sdiv i32 %.fr61, 8
  %11 = tail call ptr @_wip_alloc(i64 noundef %9, ptr noundef nonnull @__func__.wip_gameLoop) #4
  %12 = sext i32 %10 to i64
  %13 = tail call ptr @_wip_alloc(i64 noundef %12, ptr noundef nonnull @__func__.wip_gameLoop) #4
  %14 = tail call i32 @wip_getConfInt(ptr noundef nonnull @.str.5) #4
  %15 = sitofp i32 %14 to double
  %16 = fdiv double 1.000000e+00, %15
  %17 = tail call double @wip_timeWindow() #4
  %18 = load i32, ptr @wip_globalWindow, align 8, !tbaa !9
  %.not49 = icmp eq i32 %18, 0
  br i1 %.not49, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %0
  %19 = icmp sgt i32 %.fr61, 0
  br i1 %19, label %.lr.ph52.split.us, label %.lr.ph52.split

.lr.ph52.split.us:                                ; preds = %.lr.ph52
  %wide.trip.count69 = zext nneg i32 %.fr61 to i64
  br i1 %.fr, label %.lr.ph.us.us, label %.lr.ph.us

.lr.ph.us.us:                                     ; preds = %.lr.ph52.split.us, %22
  %.050.us.us = phi double [ %25, %22 ], [ %17, %.lr.ph52.split.us ]
  %20 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  tail call void %20(i32 noundef 16640) #4
  tail call void @drawScreen()
  %21 = load ptr, ptr @glad_glReadPixels, align 8, !tbaa !5
  tail call void %21(i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef %7, i32 noundef 6403, i32 noundef 5121, ptr noundef %11) #4
  tail call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 %12, i1 false)
  br label %29

22:                                               ; preds = %43
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %24 = tail call i32 @wfdd_sendBuffer(ptr noundef %5, i64 noundef %12, ptr noundef nonnull %13) #4
  %25 = fadd double %16, %.050.us.us
  %26 = tail call double @wip_timeWindow() #4
  %27 = fsub double %25, %26
  tail call void @wip_sleep(double noundef %27) #4
  %28 = load i32, ptr @wip_globalWindow, align 8, !tbaa !9
  %.not.us.us = icmp eq i32 %28, 0
  br i1 %.not.us.us, label %.lr.ph.us.us, label %._crit_edge53, !llvm.loop !12

29:                                               ; preds = %43, %.lr.ph.us.us
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %43 ], [ 0, %.lr.ph.us.us ]
  %30 = trunc nuw nsw i64 %indvars.iv66 to i32
  %31 = sdiv i32 %30, %6
  %32 = srem i32 %30, %6
  %33 = mul nsw i32 %32, %7
  %34 = add nsw i32 %33, %31
  %35 = srem i32 %34, 8
  %36 = sdiv i32 %34, 8
  %37 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv66
  %38 = load i8, ptr %37, align 1, !tbaa !14
  %39 = icmp ugt i8 %38, 20
  %40 = zext i1 %39 to i32
  %.not47.us.us.us = icmp eq i32 %32, 0
  br i1 %.not47.us.us.us, label %41, label %43

41:                                               ; preds = %29
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %43

43:                                               ; preds = %41, %29
  %44 = select i1 %39, i32 35, i32 45
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %44)
  %46 = sext i32 %36 to i64
  %47 = getelementptr inbounds i8, ptr %13, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !14
  %49 = zext i8 %48 to i32
  %50 = shl nuw nsw i32 1, %35
  %51 = xor i32 %50, -1
  %52 = and i32 %49, %51
  %53 = shl nuw nsw i32 %40, %35
  %54 = or i32 %52, %53
  %55 = trunc i32 %54 to i8
  store i8 %55, ptr %47, align 1, !tbaa !14
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
  br i1 %exitcond70.not, label %22, label %29, !llvm.loop !15

.lr.ph.us:                                        ; preds = %.lr.ph52.split.us, %58
  %.050.us = phi double [ %60, %58 ], [ %17, %.lr.ph52.split.us ]
  %56 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  tail call void %56(i32 noundef 16640) #4
  tail call void @drawScreen()
  %57 = load ptr, ptr @glad_glReadPixels, align 8, !tbaa !5
  tail call void %57(i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef %7, i32 noundef 6403, i32 noundef 5121, ptr noundef %11) #4
  tail call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 %12, i1 false)
  br label %64

58:                                               ; preds = %64
  %59 = tail call i32 @wfdd_sendBuffer(ptr noundef %5, i64 noundef %12, ptr noundef nonnull %13) #4
  %60 = fadd double %16, %.050.us
  %61 = tail call double @wip_timeWindow() #4
  %62 = fsub double %60, %61
  tail call void @wip_sleep(double noundef %62) #4
  %63 = load i32, ptr @wip_globalWindow, align 8, !tbaa !9
  %.not.us = icmp eq i32 %63, 0
  br i1 %.not.us, label %.lr.ph.us, label %._crit_edge53, !llvm.loop !12

64:                                               ; preds = %.lr.ph.us, %64
  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %64 ]
  %65 = trunc nuw nsw i64 %indvars.iv to i32
  %66 = sdiv i32 %65, %6
  %67 = srem i32 %65, %6
  %68 = mul nsw i32 %67, %7
  %69 = add nsw i32 %68, %66
  %70 = srem i32 %69, 8
  %71 = sdiv i32 %69, 8
  %72 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv
  %73 = load i8, ptr %72, align 1, !tbaa !14
  %74 = icmp ugt i8 %73, 20
  %75 = zext i1 %74 to i32
  %76 = sext i32 %71 to i64
  %77 = getelementptr inbounds i8, ptr %13, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !14
  %79 = zext i8 %78 to i32
  %80 = shl nuw nsw i32 1, %70
  %81 = xor i32 %80, -1
  %82 = and i32 %79, %81
  %83 = shl nuw nsw i32 %75, %70
  %84 = or i32 %82, %83
  %85 = trunc i32 %84 to i8
  store i8 %85, ptr %77, align 1, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count69
  br i1 %exitcond.not, label %58, label %64, !llvm.loop !15

.lr.ph52.split:                                   ; preds = %.lr.ph52
  br i1 %.fr, label %.lr.ph52.split.split.us, label %.lr.ph52.split.split

.lr.ph52.split.split.us:                          ; preds = %.lr.ph52.split, %.lr.ph52.split.split.us
  %.050.us58 = phi double [ %90, %.lr.ph52.split.split.us ], [ %17, %.lr.ph52.split ]
  %86 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  tail call void %86(i32 noundef 16640) #4
  tail call void @drawScreen()
  %87 = load ptr, ptr @glad_glReadPixels, align 8, !tbaa !5
  tail call void %87(i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef %7, i32 noundef 6403, i32 noundef 5121, ptr noundef %11) #4
  tail call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 %12, i1 false)
  %88 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %89 = tail call i32 @wfdd_sendBuffer(ptr noundef %5, i64 noundef %12, ptr noundef %13) #4
  %90 = fadd double %16, %.050.us58
  %91 = tail call double @wip_timeWindow() #4
  %92 = fsub double %90, %91
  tail call void @wip_sleep(double noundef %92) #4
  %93 = load i32, ptr @wip_globalWindow, align 8, !tbaa !9
  %.not.us59 = icmp eq i32 %93, 0
  br i1 %.not.us59, label %.lr.ph52.split.split.us, label %._crit_edge53, !llvm.loop !12

.lr.ph52.split.split:                             ; preds = %.lr.ph52.split, %.lr.ph52.split.split
  %.050 = phi double [ %97, %.lr.ph52.split.split ], [ %17, %.lr.ph52.split ]
  %94 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  tail call void %94(i32 noundef 16640) #4
  tail call void @drawScreen()
  %95 = load ptr, ptr @glad_glReadPixels, align 8, !tbaa !5
  tail call void %95(i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef %7, i32 noundef 6403, i32 noundef 5121, ptr noundef %11) #4
  tail call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 %12, i1 false)
  %96 = tail call i32 @wfdd_sendBuffer(ptr noundef %5, i64 noundef %12, ptr noundef %13) #4
  %97 = fadd double %16, %.050
  %98 = tail call double @wip_timeWindow() #4
  %99 = fsub double %97, %98
  tail call void @wip_sleep(double noundef %99) #4
  %100 = load i32, ptr @wip_globalWindow, align 8, !tbaa !9
  %.not = icmp eq i32 %100, 0
  br i1 %.not, label %.lr.ph52.split.split, label %._crit_edge53, !llvm.loop !12

._crit_edge53:                                    ; preds = %.lr.ph52.split.split, %.lr.ph52.split.split.us, %58, %22, %0
  tail call void @wfdd_closeDisplay(ptr noundef %5) #4
  tail call void @_wip_free(ptr noundef %13, ptr noundef nonnull @__func__.wip_gameLoop) #4
  tail call void @_wip_free(ptr noundef %11, ptr noundef nonnull @__func__.wip_gameLoop) #4
  ret void
}

declare zeroext i1 @wip_getConfBool(ptr noundef) local_unnamed_addr #1

declare ptr @wip_getConfStr(ptr noundef) local_unnamed_addr #1

declare i32 @wip_getConfInt(ptr noundef) local_unnamed_addr #1

declare ptr @wfdd_initDisplay(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @_wip_alloc(i64 noundef, ptr noundef) local_unnamed_addr #1

declare double @wip_timeWindow() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @drawScreen() local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i32 @wfdd_sendBuffer(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare void @wip_sleep(double noundef) local_unnamed_addr #1

declare void @wfdd_closeDisplay(ptr noundef) local_unnamed_addr #1

declare void @_wip_free(ptr noundef, ptr noundef) 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !13}


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