%ptr = alloca i32 store i32 42, i32* %ptr
%array = alloca [3 x i32] %index = getelementptr [3 x i32], [3 x i32]* %array, i32 0, i32 2 store i32 123, i32* %indexThis example creates an alloca instruction to allocate memory for an array of 3 i32s. It then calculates the correct index pointer for the 3rd element of the array and stores the value 123 into that memory location. Package library: LLVM's IR library.