#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main(void) {
  int x[2][2], y[2][2];
  scanf("%d %d %d %d", &x[0][0], &y[0][0], &x[0][1], &y[0][1]);
  scanf("%d %d %d %d", &x[1][0], &y[1][0], &x[1][1], &y[1][1]);
  if (x[0][1] < x[1][0] || x[1][1] < x[0][0] || y[0][1] < y[1][0] ||
      y[1][1] < y[0][0] || x[0][0] > x[1][1] || x[1][0] > x[0][1] ||
      y[0][0] > y[1][1] || y[1][0] > y[0][1])
    printf("0\n");
  else
    printf("1\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x20(%rbp),%rcx
add    $0x4,%rcx
lea    -0x30(%rbp),%r8
add    $0x4,%r8
lea    0xeb2(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
add    $0x8,%rsi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
add    $0x4,%rcx
lea    -0x30(%rbp),%r8
add    $0x8,%r8
add    $0x4,%r8
lea    0xe7e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     11e7 <main+0xc7>
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     11e7 <main+0xc7>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     11e7 <main+0xc7>
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
jl     11e7 <main+0xc7>
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11e7 <main+0xc7>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11e7 <main+0xc7>
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     11e7 <main+0xc7>
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    11f8 <main+0xd8>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    1204 <main+0xe4>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0x14(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0xeca(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
lea    0xea1(%rip),%rdi
cmp    0x18(%rsp),%eax
jl     11a0 <main+0x80>
mov    0x1c(%rsp),%eax
cmp    0x10(%rsp),%eax
jl     11a0 <main+0x80>
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
jl     11a0 <main+0x80>
mov    0xc(%rsp),%eax
cmp    (%rsp),%eax
lea    0xe79(%rip),%rax
lea    0xe70(%rip),%rdi
cmovl  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [3 x i8] c"0\0A\00"
@.str.2 = [3 x i8] c"1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [2 x i32]]
%3 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%8 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %7, i32* %9, i32* %11)
%13 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%15 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 0
%17 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 1
%19 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%21 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %14, i32* %16, i32* %18, i32* %20)
%22 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %22, i64 0, i64 1
%24 = load i32, i32* %23
%25 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %25, i64 0, i64 0
%27 = load i32, i32* %26
%28 = icmp slt i32 %24, %27
br i1 %28, label %85, label %29
29: ; preds = %0
%30 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
%32 = load i32, i32* %31
%33 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %33, i64 0, i64 0
%35 = load i32, i32* %34
%36 = icmp slt i32 %32, %35
br i1 %36, label %85, label %37
37: ; preds = %29
%38 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %38, i64 0, i64 1
%40 = load i32, i32* %39
%41 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %41, i64 0, i64 0
%43 = load i32, i32* %42
%44 = icmp slt i32 %40, %43
br i1 %44, label %85, label %45
45: ; preds = %37
%46 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 0, i64 1
%48 = load i32, i32* %47
%49 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %49, i64 0, i64 0
%51 = load i32, i32* %50
%52 = icmp slt i32 %48, %51
br i1 %52, label %85, label %53
53: ; preds = %45
%54 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %54, i64 0, i64 0
%56 = load i32, i32* %55
%57 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %57, i64 0, i64 1
%59 = load i32, i32* %58
%60 = icmp sgt i32 %56, %59
br i1 %60, label %85, label %61
61: ; preds = %53
%62 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%63 = getelementptr inbounds [2 x i32], [2 x i32]* %62, i64 0, i64 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %65, i64 0, i64 1
%67 = load i32, i32* %66
%68 = icmp sgt i32 %64, %67
br i1 %68, label %85, label %69
69: ; preds = %61
%70 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %70, i64 0, i64 0
%72 = load i32, i32* %71
%73 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %73, i64 0, i64 1
%75 = load i32, i32* %74
%76 = icmp sgt i32 %72, %75
br i1 %76, label %85, label %77
77: ; preds = %69
%78 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %78, i64 0, i64 0
%80 = load i32, i32* %79
%81 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %81, i64 0, i64 1
%83 = load i32, i32* %82
%84 = icmp sgt i32 %80, %83
br i1 %84, label %85, label %87
85: ; preds = %77, %69, %61, %53, %45, %37, %29, %0
%86 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %89
87: ; preds = %77
%88 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %89
89: ; preds = %87, %85
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@str = [2 x i8] c"1\00"
@str.3 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca [2 x [2 x i32]]
%2 = alloca [2 x [2 x i32]]
%3 = bitcast [2 x [2 x i32]]* %1 to i8*
%4 = bitcast [2 x [2 x i32]]* %2 to i8*
%5 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0, i64 0
%6 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0, i64 1
%8 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 1, i64 0
%11 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1, i64 0
%12 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 1, i64 1
%13 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13)
%15 = load i32, i32* %7
%16 = load i32, i32* %10
%17 = icmp slt i32 %15, %16
br i1 %17, label %31, label %18
18: ; preds = %0
%19 = load i32, i32* %12
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %31, label %22
22: ; preds = %18
%23 = load i32, i32* %8
%24 = load i32, i32* %11
%25 = icmp slt i32 %23, %24
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = load i32, i32* %13
%28 = load i32, i32* %6
%29 = icmp slt i32 %27, %28
%30 = select i1 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
br label %31
31: ; preds = %26, %0, %18, %22
%32 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %22 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %18 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %0 ], [ %30, %26 ]
%33 = call i32 @puts(i8* dereferenceable(1) %32)
ret i32 0
}