#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*/ MAP_SHARED;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ close(int);
float *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int main(void) {
  int fd;
  float *left, *right, *disp;
  fd = open("../left.bin", O_RDONLY);
  left = mmap(NULL, 1 * 70 * 370 * 1226 * sizeof(float), PROT_READ, MAP_SHARED,
              fd, 0);
  close(fd);
  fd = open("../right.bin", O_RDONLY);
  right = mmap(NULL, 1 * 70 * 370 * 1226 * sizeof(float), PROT_READ, MAP_SHARED,
               fd, 0);
  close(fd);
  fd = open("../disp.bin", O_RDONLY);
  disp = mmap(NULL, 1 * 1 * 370 * 1226 * sizeof(float), PROT_READ, MAP_SHARED,
              fd, 0);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    0x2e81(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x79212e0,%esi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%esi
lea    0xe72(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e4f(%rip),%rax
mov    (%rax),%edx
mov    0x2e36(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x79212e0,%esi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%esi
lea    0xe34(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e04(%rip),%rax
mov    (%rax),%edx
mov    0x2deb(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1bafd0,%esi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e99(%rip),%r14
mov    (%r14),%esi
lea    0xeb7(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2ea1(%rip),%r15
mov    (%r15),%edx
mov    0x2e87(%rip),%r12
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x79212e0,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    (%r14),%esi
lea    0xe84(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    (%r15),%edx
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x79212e0,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    (%r14),%esi
lea    0xe60(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    (%r15),%edx
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x1bafd0,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"../left.bin\00"
@O_RDONLY = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [13 x i8] c"../right.bin\00"
@.str.2 = [12 x i8] c"../disp.bin\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float*
%4 = alloca float*
%5 = alloca float*
store i32 0, i32* %1
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* @PROT_READ
%9 = load i32, i32* @MAP_SHARED
%10 = load i32, i32* %2
%11 = call float* @mmap(i32* null, i32 127013600, i32 %8, i32 %9, i32 %10, i32 0)
store float* %11, float** %3
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* @O_RDONLY
%15 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 %15, i32* %2
%16 = load i32, i32* @PROT_READ
%17 = load i32, i32* @MAP_SHARED
%18 = load i32, i32* %2
%19 = call float* @mmap(i32* null, i32 127013600, i32 %16, i32 %17, i32 %18, i32 0)
store float* %19, float** %4
%20 = load i32, i32* %2
%21 = call i32 @close(i32 %20)
%22 = load i32, i32* @O_RDONLY
%23 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %22)
store i32 %23, i32* %2
%24 = load i32, i32* @PROT_READ
%25 = load i32, i32* @MAP_SHARED
%26 = load i32, i32* %2
%27 = call float* @mmap(i32* null, i32 1814480, i32 %24, i32 %25, i32 %26, i32 0)
store float* %27, float** %5
%28 = load i32, i32* %2
%29 = call i32 @close(i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"../left.bin\00"
@O_RDONLY = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [13 x i8] c"../right.bin\00"
@.str.2 = [12 x i8] c"../disp.bin\00"
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @MAP_SHARED
%5 = tail call float* @mmap(i32* null, i32 127013600, i32 %3, i32 %4, i32 %2, i32 0)
%6 = tail call i32 @close(i32 %2)
%7 = load i32, i32* @O_RDONLY
%8 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @PROT_READ
%10 = load i32, i32* @MAP_SHARED
%11 = tail call float* @mmap(i32* null, i32 127013600, i32 %9, i32 %10, i32 %8, i32 0)
%12 = tail call i32 @close(i32 %8)
%13 = load i32, i32* @O_RDONLY
%14 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @PROT_READ
%16 = load i32, i32* @MAP_SHARED
%17 = tail call float* @mmap(i32* null, i32 1814480, i32 %15, i32 %16, i32 %14, i32 0)
%18 = tail call i32 @close(i32 %14)
ret i32 0
}