#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*/ read2(int, int);
int /*<<< orphan*/ read4(int, int);
int /*<<< orphan*/ writ2(int, int);
int /*<<< orphan*/ writ4(int, int);
int main(void) {
  read4(0, 0x12345678);
  writ4(0, 0x12345678);
  read4(1, 0x12345678);
  writ4(1, 0x12345678);
  read4(2, 0x12345678);
  writ4(2, 0x12345678);
  read4(3, 0x12345678);
  writ4(3, 0x12345678);
  read2(0, 0x1234);
  writ2(0, 0x1234);
  read2(1, 0x1234);
  writ2(1, 0x1234);
  read2(2, 0x1234);
  writ2(2, 0x1234);
  read2(3, 0x1234);
  writ2(3, 0x1234);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
xor    %edi,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x1,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x1,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x2,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x2,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x3,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x3,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
xor    %edi,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
xor    %edi,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x1,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x1,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x2,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x2,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x3,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x3,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
xor    %edi,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x1,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x1,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x2,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x2,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
mov    $0x3,%edi
mov    $0x12345678,%esi
call   1050 <read4@plt>
mov    $0x3,%edi
mov    $0x12345678,%esi
call   1030 <writ4@plt>
xor    %edi,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
xor    %edi,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x1,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x1,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x2,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x2,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
mov    $0x3,%edi
mov    $0x1234,%esi
call   1060 <read2@plt>
mov    $0x3,%edi
mov    $0x1234,%esi
call   1040 <writ2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @read4(i32 0, i32 305419896)
%3 = call i32 @writ4(i32 0, i32 305419896)
%4 = call i32 @read4(i32 1, i32 305419896)
%5 = call i32 @writ4(i32 1, i32 305419896)
%6 = call i32 @read4(i32 2, i32 305419896)
%7 = call i32 @writ4(i32 2, i32 305419896)
%8 = call i32 @read4(i32 3, i32 305419896)
%9 = call i32 @writ4(i32 3, i32 305419896)
%10 = call i32 @read2(i32 0, i32 4660)
%11 = call i32 @writ2(i32 0, i32 4660)
%12 = call i32 @read2(i32 1, i32 4660)
%13 = call i32 @writ2(i32 1, i32 4660)
%14 = call i32 @read2(i32 2, i32 4660)
%15 = call i32 @writ2(i32 2, i32 4660)
%16 = call i32 @read2(i32 3, i32 4660)
%17 = call i32 @writ2(i32 3, i32 4660)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @read4(i32 0, i32 305419896)
%2 = tail call i32 @writ4(i32 0, i32 305419896)
%3 = tail call i32 @read4(i32 1, i32 305419896)
%4 = tail call i32 @writ4(i32 1, i32 305419896)
%5 = tail call i32 @read4(i32 2, i32 305419896)
%6 = tail call i32 @writ4(i32 2, i32 305419896)
%7 = tail call i32 @read4(i32 3, i32 305419896)
%8 = tail call i32 @writ4(i32 3, i32 305419896)
%9 = tail call i32 @read2(i32 0, i32 4660)
%10 = tail call i32 @writ2(i32 0, i32 4660)
%11 = tail call i32 @read2(i32 1, i32 4660)
%12 = tail call i32 @writ2(i32 1, i32 4660)
%13 = tail call i32 @read2(i32 2, i32 4660)
%14 = tail call i32 @writ2(i32 2, i32 4660)
%15 = tail call i32 @read2(i32 3, i32 4660)
%16 = tail call i32 @writ2(i32 3, i32 4660)
ret i32 0
}