#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*/ _out_(int, ...);
meminit() {
  int i, pagsiz, zero;
  struct {
    int math : 32;
    int phys : 32;
  } p;
  p.phys = 0xff;
  for (i = 0; i < 32; ++i) {
    _out_(0x40 + i, p);
    p.phys += 0x100;
    p.math += 0x100;
  }
  zero = 0;
  pagsiz = 0xf;
  _out_(0x22, pagsiz << 32);
  _out_(0x29, ~zero);
  _out_(0x2a, zero);
  _out_(0x2b, zero);
}


x86 assembly (clang, -O0):
<meminit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movabs $0xffffffff,%rax
and    -0x18(%rbp),%rax
movabs $0xff00000000,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    11db <meminit+0xcb>
mov    -0x8(%rbp),%edi
add    $0x40,%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <_out_@plt>
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
add    $0x100,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movabs $0xffffffff,%rdx
and    %rdx,%rcx
shl    $0x20,%rcx
movabs $0xffffffff,%rdx
and    %rdx,%rax
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x20,%rax
sar    $0x20,%rax
add    $0x100,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movabs $0xffffffff,%rdx
and    %rdx,%rcx
movabs $0xffffffff00000000,%rdx
ff ff ff
and    %rdx,%rax
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <meminit+0x2e>
movl   $0x0,-0x10(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
shl    %cl,%esi
mov    $0x22,%edi
mov    $0x0,%al
call   1030 <_out_@plt>
mov    -0x10(%rbp),%esi
xor    $0xffffffff,%esi
mov    $0x29,%edi
mov    $0x0,%al
call   1030 <_out_@plt>
mov    -0x10(%rbp),%esi
mov    $0x2a,%edi
mov    $0x0,%al
call   1030 <_out_@plt>
mov    -0x10(%rbp),%esi
mov    $0x2b,%edi
mov    $0x0,%al
call   1030 <_out_@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meminit>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movabs $0xff00000000,%rbx
mov    $0x40,%ebp
movabs $0x10000000000,%r14
movabs $0xffffffff00000000,%r15
ff ff ff
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <_out_@plt>
lea    (%rbx,%r14,1),%rax
and    %r15,%rax
add    $0x100,%ebx
or     %rax,%rbx
add    $0x1,%ebp
cmp    $0x60,%ebp
jne    1140 <meminit+0x30>
mov    $0x22,%edi
xor    %eax,%eax
call   1030 <_out_@plt>
mov    $0x29,%edi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1030 <_out_@plt>
mov    $0x2a,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <_out_@plt>
mov    $0x2b,%edi
xor    %esi,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_out_@plt>

LLVM IR (-O0):
%struct.anon = type { i64 }
define i32 @meminit() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.anon
%6 = bitcast %struct.anon* %5 to i64*
%7 = load i64, i64* %6
%8 = and i64 %7, 4294967295
%9 = or i64 %8, 1095216660480
store i64 %9, i64* %6
store i32 0, i32* %2
br label %10
10: ; preds = %47, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %50
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 64, %14
%16 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
%17 = load i64, i64* %16
%18 = call i32 (i32, ...) @_out_(i32 %15, i64 %17)
%19 = bitcast %struct.anon* %5 to i64*
%20 = load i64, i64* %19
%21 = ashr i64 %20, 32
%22 = trunc i64 %21 to i32
%23 = add nsw i32 %22, 256
%24 = zext i32 %23 to i64
%25 = load i64, i64* %19
%26 = and i64 %24, 4294967295
%27 = shl i64 %26, 32
%28 = and i64 %25, 4294967295
%29 = or i64 %28, %27
store i64 %29, i64* %19
%30 = shl i64 %26, 32
%31 = ashr i64 %30, 32
%32 = trunc i64 %31 to i32
%33 = bitcast %struct.anon* %5 to i64*
%34 = load i64, i64* %33
%35 = shl i64 %34, 32
%36 = ashr i64 %35, 32
%37 = trunc i64 %36 to i32
%38 = add nsw i32 %37, 256
%39 = zext i32 %38 to i64
%40 = load i64, i64* %33
%41 = and i64 %39, 4294967295
%42 = and i64 %40, -4294967296
%43 = or i64 %42, %41
store i64 %43, i64* %33
%44 = shl i64 %41, 32
%45 = ashr i64 %44, 32
%46 = trunc i64 %45 to i32
br label %47
47: ; preds = %13
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %10
50: ; preds = %10
store i32 0, i32* %4
store i32 15, i32* %3
%51 = load i32, i32* %3
%52 = shl i32 %51, 32
%53 = call i32 (i32, ...) @_out_(i32 34, i32 %52)
%54 = load i32, i32* %4
%55 = xor i32 %54, -1
%56 = call i32 (i32, ...) @_out_(i32 41, i32 %55)
%57 = load i32, i32* %4
%58 = call i32 (i32, ...) @_out_(i32 42, i32 %57)
%59 = load i32, i32* %4
%60 = call i32 (i32, ...) @_out_(i32 43, i32 %59)
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
define i32 @meminit() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 1095216660480, %0 ], [ %10, %1 ]
%3 = phi i32 [ 0, %0 ], [ %11, %1 ]
%4 = add nuw nsw i32 %3, 64
%5 = tail call i32 (i32, ...) @_out_(i32 %4, i64 %2)
%6 = add i64 %2, 1099511627776
%7 = and i64 %6, -4294967296
%8 = add i64 %2, 256
%9 = and i64 %8, 4294967295
%10 = or i64 %7, %9
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %1
13: ; preds = %1
%14 = tail call i32 (i32, ...) @_out_(i32 34, i32 poison)
%15 = tail call i32 (i32, ...) @_out_(i32 41, i32 -1)
%16 = tail call i32 (i32, ...) @_out_(i32 42, i32 0)
%17 = tail call i32 (i32, ...) @_out_(i32 43, i32 0)
ret i32 undef
}