program main
implicit none
integer :: r, d, x
integer :: new_x, i

read(*,*) r, d, x

do i = 1, 10
   new_x = r*x - d
   write(*,'(i0)') new_x
   x = new_x
end do


end program main

; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.864ec5439689547217a3356f136259b4 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4219/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 6)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %9 = load i32, ptr %2, align 4, !tbaa !3
  %10 = load i32, ptr %3, align 4, !tbaa !3
  %11 = mul i32 %10, %9
  %12 = load i32, ptr %1, align 4, !tbaa !3
  %13 = sub i32 %11, %12
  %14 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %15 = call i1 @_FortranAioOutputInteger32(ptr %14, i32 %13)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  store i32 %13, ptr %3, align 4, !tbaa !3
  %17 = load i32, ptr %2, align 4, !tbaa !3
  %18 = mul i32 %13, %17
  %19 = load i32, ptr %1, align 4, !tbaa !3
  %20 = sub i32 %18, %19
  %21 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %22 = call i1 @_FortranAioOutputInteger32(ptr %21, i32 %20)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %21)
  store i32 %20, ptr %3, align 4, !tbaa !3
  %24 = load i32, ptr %2, align 4, !tbaa !3
  %25 = mul i32 %20, %24
  %26 = load i32, ptr %1, align 4, !tbaa !3
  %27 = sub i32 %25, %26
  %28 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %29 = call i1 @_FortranAioOutputInteger32(ptr %28, i32 %27)
  %30 = call i32 @_FortranAioEndIoStatement(ptr %28)
  store i32 %27, ptr %3, align 4, !tbaa !3
  %31 = load i32, ptr %2, align 4, !tbaa !3
  %32 = mul i32 %27, %31
  %33 = load i32, ptr %1, align 4, !tbaa !3
  %34 = sub i32 %32, %33
  %35 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %36 = call i1 @_FortranAioOutputInteger32(ptr %35, i32 %34)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %35)
  store i32 %34, ptr %3, align 4, !tbaa !3
  %38 = load i32, ptr %2, align 4, !tbaa !3
  %39 = mul i32 %34, %38
  %40 = load i32, ptr %1, align 4, !tbaa !3
  %41 = sub i32 %39, %40
  %42 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %43 = call i1 @_FortranAioOutputInteger32(ptr %42, i32 %41)
  %44 = call i32 @_FortranAioEndIoStatement(ptr %42)
  store i32 %41, ptr %3, align 4, !tbaa !3
  %45 = load i32, ptr %2, align 4, !tbaa !3
  %46 = mul i32 %41, %45
  %47 = load i32, ptr %1, align 4, !tbaa !3
  %48 = sub i32 %46, %47
  %49 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %50 = call i1 @_FortranAioOutputInteger32(ptr %49, i32 %48)
  %51 = call i32 @_FortranAioEndIoStatement(ptr %49)
  store i32 %48, ptr %3, align 4, !tbaa !3
  %52 = load i32, ptr %2, align 4, !tbaa !3
  %53 = mul i32 %48, %52
  %54 = load i32, ptr %1, align 4, !tbaa !3
  %55 = sub i32 %53, %54
  %56 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %57 = call i1 @_FortranAioOutputInteger32(ptr %56, i32 %55)
  %58 = call i32 @_FortranAioEndIoStatement(ptr %56)
  store i32 %55, ptr %3, align 4, !tbaa !3
  %59 = load i32, ptr %2, align 4, !tbaa !3
  %60 = mul i32 %55, %59
  %61 = load i32, ptr %1, align 4, !tbaa !3
  %62 = sub i32 %60, %61
  %63 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %64 = call i1 @_FortranAioOutputInteger32(ptr %63, i32 %62)
  %65 = call i32 @_FortranAioEndIoStatement(ptr %63)
  store i32 %62, ptr %3, align 4, !tbaa !3
  %66 = load i32, ptr %2, align 4, !tbaa !3
  %67 = mul i32 %62, %66
  %68 = load i32, ptr %1, align 4, !tbaa !3
  %69 = sub i32 %67, %68
  %70 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %71 = call i1 @_FortranAioOutputInteger32(ptr %70, i32 %69)
  %72 = call i32 @_FortranAioEndIoStatement(ptr %70)
  store i32 %69, ptr %3, align 4, !tbaa !3
  %73 = load i32, ptr %2, align 4, !tbaa !3
  %74 = mul i32 %69, %73
  %75 = load i32, ptr %1, align 4, !tbaa !3
  %76 = sub i32 %74, %75
  %77 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.864ec5439689547217a3356f136259b4, i32 10)
  %78 = call i1 @_FortranAioOutputInteger32(ptr %77, i32 %76)
  %79 = call i32 @_FortranAioEndIoStatement(ptr %77)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
