int ipmpar(int *i) {
  static int imach[11];
  static int ipmpar;
  imach[1] = 2;
  imach[2] = 31;
  imach[3] = 2147483647;
  imach[4] = 2;
  imach[5] = 24;
  imach[6] = -125;
  imach[7] = 128;
  imach[8] = 53;
  imach[9] = -1021;
  imach[10] = 1024;
  ipmpar = imach[*i];
  return ipmpar;
}


x86 assembly (clang, -O0):
<ipmpar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,0x2f22(%rip)
movl   $0x1f,0x2f1c(%rip)
movl   $0x7fffffff,0x2f16(%rip)
ff ff 7f
movl   $0x2,0x2f10(%rip)
movl   $0x18,0x2f0a(%rip)
movl   $0xffffff83,0x2f04(%rip)
ff ff ff
movl   $0x80,0x2efe(%rip)
movl   $0x35,0x2ef8(%rip)
movl   $0xfffffc03,0x2ef2(%rip)
fc ff ff
movl   $0x400,0x2eec(%rip)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
lea    0x2eb6(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,0x2ed9(%rip)
mov    0x2ed3(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipmpar>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x2f26(%rip)
lea    0x2f1b(%rip),%rax
movaps 0xef4(%rip),%xmm0
movups %xmm0,0x2f21(%rip)
movabs $0x400fffffc03,%rcx
mov    %rcx,0x2f20(%rip)
movslq (%rdi),%rcx
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
@ipmpar.imach = internal global [11 x i32] zeroinitializer
@ipmpar.ipmpar = internal global i32 0
define i32 @ipmpar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
store i32 2, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 1)
store i32 31, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 2)
store i32 2147483647, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 3)
store i32 2, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 4)
store i32 24, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 5)
store i32 -125, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 6)
store i32 128, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 7)
store i32 53, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 8)
store i32 -1021, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 9)
store i32 1024, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 10)
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* @ipmpar.ipmpar
%8 = load i32, i32* @ipmpar.ipmpar
ret i32 %8
}

LLVM IR (-O2):
@ipmpar.imach = internal unnamed_addr global [11 x i32] zeroinitializer
define i32 @ipmpar(i32* nocapture %0) {
store <4 x i32> <i32 2, i32 31, i32 2147483647, i32 2>, <4 x i32>* bitcast (i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 1) to <4 x i32>*)
store <4 x i32> <i32 24, i32 -125, i32 128, i32 53>, <4 x i32>* bitcast (i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 5) to <4 x i32>*)
store i32 -1021, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 9)
store i32 1024, i32* getelementptr inbounds ([11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 10)
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [11 x i32], [11 x i32]* @ipmpar.imach, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}