#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *, int *);
int max(int, int);
int min(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  FILE *file;
  int seq1begin = (100000000), seq1end = (-(100000000)),
      seq2begin = (100000000), seq2end = (-(100000000));
  int a, b, c, d, e = 0;
  file = fopen(argv[1], "r");
  assert(file);
  while (!feof(file)) {
    if (fscanf(file, "(%d %d)=(%d %d) %*f\n", &a, &b, &c, &d) == 4) {
      seq1begin = min(seq1begin, a);
      seq1end = max(seq1end, b);
      seq2begin = min(seq2begin, c);
      seq2end = max(seq2end, d);
      e++;
    }
  }
  fclose(file);
  if (!e)
    printf("-1 -1 -1 -1\n");
  else
    printf("%d %d %d %d\n", seq1begin, seq1end, seq2begin, seq2end);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5f5e100,-0x1c(%rbp)
movl   $0xfa0a1f00,-0x20(%rbp)
movl   $0x5f5e100,-0x24(%rbp)
movl   $0xfa0a1f00,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe38(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11f8 <main+0x78>
jmp    1267 <main+0xe7>
mov    -0x18(%rbp),%rdi
lea    0xdff(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r8
lea    -0x38(%rbp),%r9
call   1070 <fscanf@plt>
cmp    $0x4,%eax
jne    1262 <main+0xe2>
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1050 <min@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1060 <max@plt>
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1050 <min@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1060 <max@plt>
mov    %eax,-0x28(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11da <main+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x3c(%rbp)
jne    128d <main+0x10d>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12a8 <main+0x128>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rsi),%rdi
lea    0xe57(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <assert@plt>
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     11de <main+0x4e>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe50(%rip),%rdi
call   1030 <puts@plt>
jmp    129e <main+0x10e>
mov    $0x5f5e100,%r14d
mov    $0xfa0a1f00,%r15d
xor    %r13d,%r13d
mov    $0xfa0a1f00,%r12d
mov    $0x5f5e100,%ebp
jmp    120c <main+0x7c>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    1274 <main+0xe4>
mov    %rbx,%rdi
lea    0xdec(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
call   1080 <fscanf@plt>
cmp    $0x4,%eax
jne    1200 <main+0x70>
mov    0x14(%rsp),%esi
mov    %ebp,%edi
call   1060 <min@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%esi
mov    %r12d,%edi
call   1070 <max@plt>
mov    %eax,%r12d
mov    0xc(%rsp),%esi
mov    %r14d,%edi
call   1060 <min@plt>
mov    %eax,%r14d
mov    0x8(%rsp),%esi
mov    %r15d,%edi
call   1070 <max@plt>
mov    %eax,%r15d
add    $0x1,%r13d
jmp    1200 <main+0x70>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %r13d,%r13d
je     11cd <main+0x3d>
lea    0xd8b(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [21 x i8] c"(%d %d)=(%d %d) %*f\0A\00"
@.str.2 = [13 x i8] c"-1 -1 -1 -1\0A\00"
@.str.3 = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100000000, i32* %7
store i32 -100000000, i32* %8
store i32 100000000, i32* %9
store i32 -100000000, i32* %10
store i32 0, i32* %15
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i32*, i32** %6
%21 = call i32 @assert(i32* %20)
br label %22
22: ; preds = %46, %2
%23 = load i32*, i32** %6
%24 = call i32 @feof(i32* %23)
%25 = icmp ne i32 %24, 0
%26 = xor i1 %25, true
br i1 %26, label %27, label %47
27: ; preds = %22
%28 = load i32*, i32** %6
%29 = call i32 @fscanf(i32* %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %12, i32* %13, i32* %14)
%30 = icmp eq i32 %29, 4
br i1 %30, label %31, label %46
31: ; preds = %27
%32 = load i32, i32* %7
%33 = load i32, i32* %11
%34 = call i32 @min(i32 %32, i32 %33)
store i32 %34, i32* %7
%35 = load i32, i32* %8
%36 = load i32, i32* %12
%37 = call i32 @max(i32 %35, i32 %36)
store i32 %37, i32* %8
%38 = load i32, i32* %9
%39 = load i32, i32* %13
%40 = call i32 @min(i32 %38, i32 %39)
store i32 %40, i32* %9
%41 = load i32, i32* %10
%42 = load i32, i32* %14
%43 = call i32 @max(i32 %41, i32 %42)
store i32 %43, i32* %10
%44 = load i32, i32* %15
%45 = add nsw i32 %44, 1
store i32 %45, i32* %15
br label %46
46: ; preds = %31, %27
br label %22
47: ; preds = %22
%48 = load i32*, i32** %6
%49 = call i32 @fclose(i32* %48)
%50 = load i32, i32* %15
%51 = icmp ne i32 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %47
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %60
54: ; preds = %47
%55 = load i32, i32* %7
%56 = load i32, i32* %8
%57 = load i32, i32* %9
%58 = load i32, i32* %10
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %55, i32 %56, i32 %57, i32 %58)
br label %60
60: ; preds = %54, %52
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [21 x i8] c"(%d %d)=(%d %d) %*f\0A\00"
@.str.3 = [13 x i8] c"%d %d %d %d\0A\00"
@str = [12 x i8] c"-1 -1 -1 -1\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @assert(i32* %13)
%15 = call i32 @feof(i32* %13)
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @fclose(i32* %13)
br label %48
19: ; preds = %2, %37
%20 = phi i32 [ %42, %37 ], [ 0, %2 ]
%21 = phi i32 [ %41, %37 ], [ -100000000, %2 ]
%22 = phi i32 [ %40, %37 ], [ 100000000, %2 ]
%23 = phi i32 [ %39, %37 ], [ -100000000, %2 ]
%24 = phi i32 [ %38, %37 ], [ 100000000, %2 ]
%25 = call i32 @fscanf(i32* %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %37
27: ; preds = %19
%28 = load i32, i32* %3
%29 = call i32 @min(i32 %24, i32 %28)
%30 = load i32, i32* %4
%31 = call i32 @max(i32 %23, i32 %30)
%32 = load i32, i32* %5
%33 = call i32 @min(i32 %22, i32 %32)
%34 = load i32, i32* %6
%35 = call i32 @max(i32 %21, i32 %34)
%36 = add nsw i32 %20, 1
br label %37
37: ; preds = %27, %19
%38 = phi i32 [ %29, %27 ], [ %24, %19 ]
%39 = phi i32 [ %31, %27 ], [ %23, %19 ]
%40 = phi i32 [ %33, %27 ], [ %22, %19 ]
%41 = phi i32 [ %35, %27 ], [ %21, %19 ]
%42 = phi i32 [ %36, %27 ], [ %20, %19 ]
%43 = call i32 @feof(i32* %13)
%44 = icmp eq i32 %43, 0
br i1 %44, label %19, label %45
45: ; preds = %37
%46 = call i32 @fclose(i32* %13)
%47 = icmp eq i32 %42, 0
br i1 %47, label %48, label %50
48: ; preds = %17, %45
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %52
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %38, i32 %39, i32 %40, i32 %41)
br label %52
52: ; preds = %50, %48
ret i32 0
}