github.com/llir/llvm@v0.3.6/asm/testdata/rand.ll (about)

     1  @seed = global i32 0
     2  
     3  declare i32 @abs(i32 %x)
     4  
     5  define i32 @rand() {
     6  0:
     7  	%1 = load i32, i32* @seed
     8  	%2 = mul i32 %1, 22695477
     9  	%3 = add i32 %2, 1
    10  	store i32 %3, i32* @seed
    11  	%4 = call i32 @abs(i32 %3)
    12  	ret i32 %4
    13  }