#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__ EOF;
int /*<<< orphan*/ printf(char *, int, int, int, int);
scalar_t__ scanf(char *, int *, int *);
void getgraph(int connected[700][700], int *m, int *n) {
  int i, j;
  for (i = 0; i < 700; i++)
    for (j = 0; j < 700; j++)
      connected[i][j] = 0;
  *m = *n = 0;
  while (scanf("%d %d", &i, &j) != EOF) {
    if (i < 0 || i >= 700 || j < 0 || j >= 700)
      printf("Edge (%d, %d) not in admitted range (0..%d, 0..%d), rejected\n",
             i, j, 700 - 1, 700 - 1);
    else {
      connected[i][j] = 1;
      *m = ((*m) > (i + 1) ? (*m) : (i + 1));
      *n = ((*n) > (j + 1) ? (*n) : (j + 1));
    }
  }
}


x86 assembly (clang, -O0):
<getgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2bc,-0x1c(%rbp)
jge    119a <getgraph+0x7a>
movl   $0x0,-0x20(%rbp)
cmpl   $0x2bc,-0x20(%rbp)
jge    1187 <getgraph+0x67>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0xaf0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114f <getgraph+0x2f>
jmp    118c <getgraph+0x6c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <getgraph+0x1b>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
lea    0xe4b(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e1f(%rip),%rcx
cmp    (%rcx),%rax
je     12aa <getgraph+0x18a>
cmpl   $0x0,-0x1c(%rbp)
jl     1200 <getgraph+0xe0>
cmpl   $0x2bc,-0x1c(%rbp)
jge    1200 <getgraph+0xe0>
cmpl   $0x0,-0x20(%rbp)
jl     1200 <getgraph+0xe0>
cmpl   $0x2bc,-0x20(%rbp)
jl     1220 <getgraph+0x100>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xdf9(%rip),%rdi
mov    $0x2bb,%r8d
mov    %r8d,%ecx
call   1030 <printf@plt>
jmp    12a5 <getgraph+0x185>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0xaf0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    125f <getgraph+0x13f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1268 <getgraph+0x148>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1293 <getgraph+0x173>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    129c <getgraph+0x17c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    11ae <getgraph+0x8e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgraph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x1de840,%edx
mov    %rdi,0x10(%rsp)
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x2bc,0xc(%rsp)
movl   $0x2bc,0x8(%rsp)
movl   $0x0,(%r14)
movl   $0x0,(%rbx)
lea    0xe87(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x2e59(%rip),%r15
cmp    (%r15),%rax
jne    11a3 <getgraph+0x73>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe56(%rip),%r13
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r12
jmp    11ea <getgraph+0xba>
cs nopw 0x0(%rax,%rax,1)
lea    0xe3f(%rip),%rdi
mov    $0x2bb,%ecx
mov    $0x2bb,%r8d
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
call   1050 <scanf@plt>
cmp    (%r15),%rax
je     1194 <getgraph+0x64>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
cmp    $0x2bb,%rsi
ja     11c0 <getgraph+0x90>
test   %edx,%edx
js     11c0 <getgraph+0x90>
cmp    $0x2bc,%edx
jge    11c0 <getgraph+0x90>
imul   $0xaf0,%rsi,%rax
add    0x10(%rsp),%rax
movl   $0x1,(%rax,%rdx,4)
mov    (%rbx),%eax
lea    0x1(%rsi),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
mov    %ecx,(%rbx)
mov    (%r14),%eax
lea    0x1(%rdx),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
mov    %ecx,(%r14)
jmp    11d7 <getgraph+0xa7>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [62 x i8] c"Edge (%d, %d) not in admitted range (0..%d, 0..%d), rejected\0A\00"
define void @getgraph([700 x i32]* nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast [700 x i32]* %0 to i8*
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
store i32 700, i32* %5
store i32 700, i32* %6
store i32 0, i32* %2
store i32 0, i32* %1
%9 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %38, label %12
12: ; preds = %3, %34
%13 = load i32, i32* %5
%14 = icmp ugt i32 %13, 699
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
%17 = select i1 %14, i1 true, i1 %16
%18 = icmp sgt i32 %15, 699
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15, i32 699, i32 699)
br label %34
22: ; preds = %12
%23 = zext i32 %13 to i64
%24 = zext i32 %15 to i64
%25 = getelementptr inbounds [700 x i32], [700 x i32]* %0, i64 %23, i64 %24
store i32 1, i32* %25
%26 = load i32, i32* %1
%27 = add nuw nsw i32 %13, 1
%28 = icmp sgt i32 %26, %27
%29 = select i1 %28, i32 %26, i32 %27
store i32 %29, i32* %1
%30 = load i32, i32* %2
%31 = add nuw nsw i32 %15, 1
%32 = icmp sgt i32 %30, %31
%33 = select i1 %32, i32 %30, i32 %31
store i32 %33, i32* %2
br label %34
34: ; preds = %22, %20
%35 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%36 = load i64, i64* @EOF
%37 = icmp eq i64 %35, %36
br i1 %37, label %38, label %12
38: ; preds = %34, %3
ret void
}