#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 */
scalar_t__ overlap(int ***);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main(int argc, char *argv[]) {
  int rect[2][2][2];
  scanf(" %i %i %i %i", &rect[0][0][0], &rect[0][0][1], &rect[0][1][0],
        &rect[0][1][1]);
  scanf(" %i %i %i %i", &rect[1][0][0], &rect[1][0][1], &rect[1][1][0],
        &rect[1][1][1]);
  if (overlap(rect)) {
    printf("overlap\n");
  } else {
    printf("no overlap\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x4,%rdx
lea    -0x30(%rbp),%rcx
add    $0x8,%rcx
lea    -0x30(%rbp),%r8
add    $0x8,%r8
add    $0x4,%r8
lea    0xe93(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rsi
add    $0x10,%rsi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
add    $0x4,%rdx
lea    -0x30(%rbp),%rcx
add    $0x10,%rcx
add    $0x8,%rcx
lea    -0x30(%rbp),%r8
add    $0x10,%r8
add    $0x8,%r8
add    $0x4,%r8
lea    0xe57(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <overlap@plt>
cmp    $0x0,%rax
je     11d2 <main+0xa2>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    11de <main+0xae>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0xeb3(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1040 <overlap@plt>
test   %rax,%rax
lea    0xe84(%rip),%rax
lea    0xe80(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c" %i %i %i %i\00"
@.str.1 = [9 x i8] c"overlap\0A\00"
@.str.2 = [12 x i8] c"no overlap\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x [2 x [2 x i32]]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 0
%8 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%10 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 0
%11 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %10, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%13 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 0
%14 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%16 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 0
%17 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 1
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 1
%19 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %12, i32* %15, i32* %18)
%20 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 1
%21 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %20, i64 0, i64 0
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 0
%23 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 1
%24 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %23, i64 0, i64 0
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 0, i64 1
%26 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 1
%27 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %26, i64 0, i64 1
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %27, i64 0, i64 0
%29 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 1
%30 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %29, i64 0, i64 1
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
%32 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %22, i32* %25, i32* %28, i32* %31)
%33 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %6, i64 0, i64 0
%34 = bitcast [2 x [2 x i32]]* %33 to i32***
%35 = call i64 @overlap(i32*** %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %2
%38 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %41
39: ; preds = %2
%40 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [13 x i8] c" %i %i %i %i\00"
@str = [11 x i8] c"no overlap\00"
@str.3 = [8 x i8] c"overlap\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x [2 x [2 x i32]]]
%4 = bitcast [2 x [2 x [2 x i32]]]* %3 to i8*
%5 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 0, i64 0, i64 0
%6 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 0, i64 0, i64 1
%7 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 0, i64 1, i64 0
%8 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 0, i64 1, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%10 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 1, i64 0, i64 0
%11 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 1, i64 0, i64 1
%12 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 1, i64 1, i64 0
%13 = getelementptr inbounds [2 x [2 x [2 x i32]]], [2 x [2 x [2 x i32]]]* %3, i64 0, i64 1, i64 1, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13)
%15 = bitcast [2 x [2 x [2 x i32]]]* %3 to i32***
%16 = call i64 @overlap(i32*** %15)
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0)
%19 = call i32 @puts(i8* dereferenceable(1) %18)
ret i32 0
}