#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reduzAND(int *);
int reduzOR(int *);
int reduzSUM(int *);
int main(void) {
  int dat[5];
  int *ptr = dat;
  unsigned int i, m_w, m_z;
  m_w = 17;
  m_z = 31;
  for (i = 0; i < 5; i++, ptr++) {
    m_z = 36969 * (m_z & 65535) + (m_z >> 16);
    m_w = 18000 * (m_w & 65535) + (m_w >> 16);
    *ptr = (m_z << 16) + m_w;
  }
  printf("%08x\n", reduzAND(dat));
  printf("%08x\n", reduzOR(dat));
  printf("%08x\n", reduzSUM(dat));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x11,-0x30(%rbp)
movl   $0x1f,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jae    11d1 <main+0x91>
mov    -0x34(%rbp),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    -0x34(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    -0x30(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%ecx
shl    $0x10,%ecx
add    -0x30(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    116c <main+0x2c>
lea    -0x20(%rbp),%rdi
call   1050 <reduzAND@plt>
mov    %eax,%esi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <reduzOR@plt>
mov    %eax,%esi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1060 <reduzSUM@plt>
mov    %eax,%esi
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xd4d95f2c,0x10(%rsp)
d4
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <reduzAND@plt>
lea    0xea4(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <reduzOR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1060 <reduzSUM@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %7, i32** %3
store i32 17, i32* %5
store i32 31, i32* %6
store i32 0, i32* %4
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %4
%10 = icmp ult i32 %9, 5
br i1 %10, label %11, label %34
11: ; preds = %8
%12 = load i32, i32* %6
%13 = and i32 %12, 65535
%14 = mul i32 36969, %13
%15 = load i32, i32* %6
%16 = lshr i32 %15, 16
%17 = add i32 %14, %16
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = and i32 %18, 65535
%20 = mul i32 18000, %19
%21 = load i32, i32* %5
%22 = lshr i32 %21, 16
%23 = add i32 %20, %22
store i32 %23, i32* %5
%24 = load i32, i32* %6
%25 = shl i32 %24, 16
%26 = load i32, i32* %5
%27 = add i32 %25, %26
%28 = load i32*, i32** %3
store i32 %27, i32* %28
br label %29
29: ; preds = %11
%30 = load i32, i32* %4
%31 = add i32 %30, 1
store i32 %31, i32* %4
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i32 1
store i32* %33, i32** %3
br label %8
34: ; preds = %8
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%36 = call i32 @reduzAND(i32* %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%39 = call i32 @reduzOR(i32* %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%42 = call i32 @reduzSUM(i32* %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08x\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 2092673872, i32 1177381124, i32 -548267955, i32 2009187048>, <4 x i32>* %4
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 -723951828, i32* %5
%6 = call i32 @reduzAND(i32* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @reduzOR(i32* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @reduzSUM(i32* %3)
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}