#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 */
double fabs(double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, char *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *f[2];
  int current_read;
  double xpoint[2], ypoint[2];
  double max_diff;
  char unused[1024];
  int nread0, nread1;
  if (argc != 3) {
    printf("Invalid number of arguments given\n");
    return -2;
  }
  f[0] = fopen(argv[1], "r");
  f[1] = fopen(argv[2], "r");
  if (f[0] == NULL || f[1] == NULL) {
    printf("Cannot open passed files.\n");
    return -1;
  }
  nread0 = fscanf(f[0], "%s %lf %lf", unused, &xpoint[0], &ypoint[0]);
  nread1 = fscanf(f[1], "%s %lf %lf", unused, &xpoint[1], &ypoint[1]);
  if (nread0 == 3 && nread1 == 3) {
    current_read = 1;
    max_diff = fabs(ypoint[1] - ypoint[0]);
    while (!feof(f[0])) {
      nread0 = fscanf(f[0], "%s %lf %lf", unused, &xpoint[0], &ypoint[0]);
      nread1 = fscanf(f[1], "%s %lf %lf", unused, &xpoint[1], &ypoint[1]);
      if (nread0 != 3 || nread1 != 3)
        break;
      current_read++;
      if (fabs(ypoint[1] - ypoint[0]) > max_diff)
        max_diff = fabs(ypoint[1] - ypoint[0]);
    }
  }
  printf("%lf\n", max_diff);
  fclose(f[0]);
  fclose(f[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     118d <main+0x3d>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1382 <main+0x232>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe97(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe7f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11d3 <main+0x83>
cmpq   $0x0,-0x18(%rbp)
jne    11ed <main+0x9d>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1382 <main+0x232>
mov    -0x20(%rbp),%rdi
lea    -0x460(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    0xe49(%rip),%rsi
call   1050 <fscanf@plt>
mov    %eax,-0x464(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x460(%rbp),%rdx
lea    -0x40(%rbp),%rcx
add    $0x8,%rcx
lea    -0x50(%rbp),%r8
add    $0x8,%r8
lea    0xe1c(%rip),%rsi
call   1050 <fscanf@plt>
mov    %eax,-0x468(%rbp)
cmpl   $0x3,-0x464(%rbp)
jne    1356 <main+0x206>
cmpl   $0x3,-0x468(%rbp)
jne    1356 <main+0x206>
movl   $0x1,-0x24(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movaps 0xd8f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1298 <main+0x148>
jmp    1351 <main+0x201>
mov    -0x20(%rbp),%rdi
lea    -0x460(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    0xd9e(%rip),%rsi
call   1050 <fscanf@plt>
mov    %eax,-0x464(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x460(%rbp),%rdx
lea    -0x40(%rbp),%rcx
add    $0x8,%rcx
lea    -0x50(%rbp),%r8
add    $0x8,%r8
lea    0xd71(%rip),%rsi
call   1050 <fscanf@plt>
mov    %eax,-0x468(%rbp)
cmpl   $0x3,-0x464(%rbp)
jne    1304 <main+0x1b4>
cmpl   $0x3,-0x468(%rbp)
je     1309 <main+0x1b9>
jmp    1351 <main+0x201>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movaps 0xcdd(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    134c <main+0x1fc>
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movaps 0xcbd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    127a <main+0x12a>
jmp    1356 <main+0x206>
movsd  -0x58(%rbp),%xmm0
lea    0xcf9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
cmp    $0x3,%edi
jne    123b <main+0xdb>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe88(%rip),%r14
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
mov    %r14,%rsi
call   1080 <fopen@plt>
test   %rbx,%rbx
je     124e <main+0xee>
mov    %rax,%r14
test   %rax,%rax
je     124e <main+0xee>
lea    0xe57(%rip),%rbp
lea    0x40(%rsp),%r15
lea    0x20(%rsp),%rcx
mov    %rsp,%r8
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
lea    0x28(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
andpd  0xdff(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     1271 <main+0x111>
movapd 0x10(%rsp),%xmm0
lea    0xdfd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
jmp    125f <main+0xff>
lea    0xdfa(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffe,%eax
jmp    125f <main+0xff>
lea    0xdcd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd9a(%rip),%r13
lea    0x40(%rsp),%rbp
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
lea    0x20(%rsp),%rcx
mov    %r12,%r8
call   1060 <fscanf@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
lea    0x28(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1060 <fscanf@plt>
cmp    $0x3,%r15d
jne    1213 <main+0xb3>
cmp    $0x3,%eax
movapd 0x10(%rsp),%xmm0
jne    1219 <main+0xb9>
movsd  0x8(%rsp),%xmm1
subsd  (%rsp),%xmm1
andpd  0xd23(%rip),%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mov    %rbx,%rdi
call   1070 <feof@plt>
movapd 0x30(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
test   %eax,%eax
je     1280 <main+0x120>
jmp    1219 <main+0xb9>

LLVM IR (-O0):
@.str = [35 x i8] c"Invalid number of arguments given\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [27 x i8] c"Cannot open passed files.\0A\00"
@.str.3 = [11 x i8] c"%s %lf %lf\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32*]
%7 = alloca i32
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca double
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 -2, i32* %3
br label %117
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
store i32* %22, i32** %23
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
store i32* %27, i32** %28
%29 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%30 = load i32*, i32** %29
%31 = icmp eq i32* %30, null
br i1 %31, label %36, label %32
32: ; preds = %18
%33 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
%34 = load i32*, i32** %33
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %38
36: ; preds = %32, %18
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %117
38: ; preds = %32
%39 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%40 = load i32*, i32** %39
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%42 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%43 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%44 = call i32 @fscanf(i32* %40, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %41, double* %42, double* %43)
store i32 %44, i32* %12
%45 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
%46 = load i32*, i32** %45
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%48 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%49 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%50 = call i32 @fscanf(i32* %46, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %47, double* %48, double* %49)
store i32 %50, i32* %13
%51 = load i32, i32* %12
%52 = icmp eq i32 %51, 3
br i1 %52, label %53, label %108
53: ; preds = %38
%54 = load i32, i32* %13
%55 = icmp eq i32 %54, 3
br i1 %55, label %56, label %108
56: ; preds = %53
store i32 1, i32* %7
%57 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%58 = load double, double* %57
%59 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%60 = load double, double* %59
%61 = fsub double %58, %60
%62 = call double @llvm.fabs.f64(double %61)
store double %62, double* %10
br label %63
63: ; preds = %106, %56
%64 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%65 = load i32*, i32** %64
%66 = call i32 @feof(i32* %65)
%67 = icmp ne i32 %66, 0
%68 = xor i1 %67, true
br i1 %68, label %69, label %107
69: ; preds = %63
%70 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%71 = load i32*, i32** %70
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%73 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%74 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%75 = call i32 @fscanf(i32* %71, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %72, double* %73, double* %74)
store i32 %75, i32* %12
%76 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
%77 = load i32*, i32** %76
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%79 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%80 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%81 = call i32 @fscanf(i32* %77, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %78, double* %79, double* %80)
store i32 %81, i32* %13
%82 = load i32, i32* %12
%83 = icmp ne i32 %82, 3
br i1 %83, label %87, label %84
84: ; preds = %69
%85 = load i32, i32* %13
%86 = icmp ne i32 %85, 3
br i1 %86, label %87, label %88
87: ; preds = %84, %69
br label %107
88: ; preds = %84
%89 = load i32, i32* %7
%90 = add nsw i32 %89, 1
store i32 %90, i32* %7
%91 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%92 = load double, double* %91
%93 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%94 = load double, double* %93
%95 = fsub double %92, %94
%96 = call double @llvm.fabs.f64(double %95)
%97 = load double, double* %10
%98 = fcmp ogt double %96, %97
br i1 %98, label %99, label %106
99: ; preds = %88
%100 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%101 = load double, double* %100
%102 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%103 = load double, double* %102
%104 = fsub double %101, %103
%105 = call double @llvm.fabs.f64(double %104)
store double %105, double* %10
br label %106
106: ; preds = %99, %88
br label %63
107: ; preds = %87, %63
br label %108
108: ; preds = %107, %53, %38
%109 = load double, double* %10
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %109)
%111 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%112 = load i32*, i32** %111
%113 = call i32 @fclose(i32* %112)
%114 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
%115 = load i32*, i32** %114
%116 = call i32 @fclose(i32* %115)
store i32 0, i32* %3
br label %117
117: ; preds = %108, %36, %16
%118 = load i32, i32* %3
ret i32 %118
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [11 x i8] c"%s %lf %lf\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
@str = [26 x i8] c"Cannot open passed files.\00"
@str.5 = [34 x i8] c"Invalid number of arguments given\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x double]
%4 = alloca [2 x double]
%5 = alloca [1024 x i8]
%6 = bitcast [2 x double]* %3 to i8*
%7 = bitcast [2 x double]* %4 to i8*
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 3
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
br label %60
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32* %15, null
%20 = icmp eq i32* %18, null
%21 = or i1 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %12
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %60
24: ; preds = %12
%25 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%26 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%27 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %8, double* %25, double* %26)
%28 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%29 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%30 = call i32 @fscanf(i32* %18, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %8, double* %28, double* %29)
%31 = icmp eq i32 %27, 3
%32 = icmp eq i32 %30, 3
%33 = load double, double* %29
%34 = load double, double* %26
%35 = fsub double %33, %34
%36 = call double @llvm.fabs.f64(double %35)
%37 = call i32 @feof(i32* %15)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %55
39: ; preds = %24, %46
%40 = phi double [ %52, %46 ], [ %36, %24 ]
%41 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %8, double* %25, double* %26)
%42 = call i32 @fscanf(i32* %18, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %8, double* %28, double* %29)
%43 = icmp ne i32 %41, 3
%44 = icmp ne i32 %42, 3
%45 = or i1 %43, %44
br i1 %45, label %55, label %46
46: ; preds = %39
%47 = load double, double* %29
%48 = load double, double* %26
%49 = fsub double %47, %48
%50 = call double @llvm.fabs.f64(double %49)
%51 = fcmp ogt double %50, %40
%52 = select i1 %51, double %50, double %40
%53 = call i32 @feof(i32* %15)
%54 = icmp eq i32 %53, 0
br i1 %54, label %39, label %55
55: ; preds = %39, %46, %24
%56 = phi double [ %36, %24 ], [ %52, %46 ], [ %40, %39 ]
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %56)
%58 = call i32 @fclose(i32* %15)
%59 = call i32 @fclose(i32* %18)
br label %60
60: ; preds = %55, %22, %10
%61 = phi i32 [ -2, %10 ], [ -1, %22 ], [ 0, %55 ]
ret i32 %61
}