#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 */
typedef int uint32_t;

/* Variables and functions */
void php_mt_initialize(uint32_t seed, uint32_t *state) {
  register uint32_t *s = state;
  register uint32_t *r = state;
  register int i = 1;
  *s++ = seed & 0xffffffffU;
  for (; i < (624) - 200; ++i) {
    *s++ = (1812433253U * (*r ^ (*r >> 30)) + i) & 0xffffffffU;
    r++;
  }
}


x86 assembly (clang, -O0):
<php_mt_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xffffffff,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
cmpl   $0x1a8,-0x24(%rbp)
jge    118e <php_mt_initialize+0x8e>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
sar    $0x1e,%ecx
xor    %ecx,%eax
imul   $0x6c078965,%eax,%ecx
add    -0x24(%rbp),%ecx
and    $0xffffffff,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <php_mt_initialize+0x39>
pop    %rbp
ret

x86 assembly (clang, -O2):
<php_mt_initialize>:
mov    %edi,(%rsi)
mov    $0x1,%eax
mov    $0x2,%ecx
nopl   0x0(%rax)
mov    %edi,%edx
sar    $0x1e,%edx
xor    %edi,%edx
imul   $0x6c078965,%edx,%edx
add    %eax,%edx
mov    %edx,(%rsi,%rax,4)
mov    %edx,%edi
sar    $0x1e,%edi
xor    %edx,%edi
imul   $0x6c078965,%edi,%edx
add    %ecx,%edx
mov    %edx,0x4(%rsi,%rax,4)
mov    %edx,%edi
sar    $0x1e,%edi
xor    %edx,%edi
imul   $0x6c078965,%edi,%edx
lea    (%rax,%rdx,1),%edi
add    $0x2,%edi
mov    %edi,0x8(%rsi,%rax,4)
add    $0x3,%rax
add    $0x3,%ecx
cmp    $0x1a8,%eax
jne    1110 <php_mt_initialize+0x10>
ret

LLVM IR (-O0):
define void @php_mt_initialize(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
store i32* %8, i32** %5
%9 = load i32*, i32** %4
store i32* %9, i32** %6
store i32 1, i32* %7
%10 = load i32, i32* %3
%11 = and i32 %10, -1
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %5
store i32 %11, i32* %12
br label %14
14: ; preds = %32, %2
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 424
br i1 %16, label %17, label %35
17: ; preds = %14
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = ashr i32 %21, 30
%23 = xor i32 %19, %22
%24 = mul i32 1812433253, %23
%25 = load i32, i32* %7
%26 = add i32 %24, %25
%27 = and i32 %26, -1
%28 = load i32*, i32** %5
%29 = getelementptr inbounds i32, i32* %28, i32 1
store i32* %29, i32** %5
store i32 %27, i32* %28
%30 = load i32*, i32** %6
%31 = getelementptr inbounds i32, i32* %30, i32 1
store i32* %31, i32** %6
br label %32
32: ; preds = %17
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %14
35: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @php_mt_initialize(i32 %0, i32* nocapture %1) {
store i32 %0, i32* %1
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %23, %3 ]
%5 = phi i32* [ %1, %2 ], [ %19, %3 ]
%6 = phi i32 [ 1, %2 ], [ %24, %3 ]
%7 = getelementptr inbounds i32, i32* %5, i64 1
%8 = ashr i32 %4, 30
%9 = xor i32 %8, %4
%10 = mul i32 %9, 1812433253
%11 = add i32 %10, %6
store i32 %11, i32* %7
%12 = add nuw nsw i32 %6, 1
%13 = getelementptr inbounds i32, i32* %5, i64 2
%14 = ashr i32 %11, 30
%15 = xor i32 %14, %11
%16 = mul i32 %15, 1812433253
%17 = add i32 %16, %12
store i32 %17, i32* %13
%18 = add nuw nsw i32 %6, 2
%19 = getelementptr inbounds i32, i32* %5, i64 3
%20 = ashr i32 %17, 30
%21 = xor i32 %20, %17
%22 = mul i32 %21, 1812433253
%23 = add i32 %22, %18
store i32 %23, i32* %19
%24 = add nuw nsw i32 %6, 3
%25 = icmp eq i32 %24, 424
br i1 %25, label %26, label %3
26: ; preds = %3
ret void
}