Structure
Every LLVM program (technically called a module) starts out with a specification of the target architecture (and possibly other global attributes):
target triple = "x86_64-pc-linux-gnu"
Next we should see any global variables. These will most commonly be string literals, for example like:
@msg = constant [14 x i8] c"Hello, world!\00"
Next we have function prototypes for any external functions or system calls, using the declare keyword, such as
declare i32 @puts(i8*)
After this, all that remains is function definitions. One of them should of course be called @main, like
define i32 @main() {
initial:
call i32(i8*) @puts(i8* getelementptr([14 x i8], [14 x i8]* @msg, i32 0, i32 0))
ret i32 0
}