#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, int);
void checker(int line, int col, int pr) {
  static int line_r, col_r, i = 0;
  if (pr == 0) {
    if (i == 0) {
      line_r = line;
      col_r = col;
    }
    i++;
    if (line < line_r) {
      line_r = line;
      col_r = col;
    } else if (line == line_r)
      if (col < col_r)
        col_r = col;
  } else {
    printf("%d %d\n", line_r + 1, col_r + 1);
    i = 0;
  }
}


x86 assembly (clang, -O0):
<checker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11b5 <checker+0xa5>
cmpl   $0x0,0x2f02(%rip)
jne    114a <checker+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,0x2eeb(%rip)
mov    -0x8(%rbp),%eax
mov    %eax,0x2ee6(%rip)
mov    0x2ee4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edb(%rip)
mov    -0x4(%rbp),%eax
cmp    0x2eca(%rip),%eax
jge    117f <checker+0x6f>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ebb(%rip)
mov    -0x8(%rbp),%eax
mov    %eax,0x2eb6(%rip)
jmp    11b0 <checker+0xa0>
mov    -0x4(%rbp),%eax
cmp    0x2ea4(%rip),%eax
jne    11ab <checker+0x9b>
mov    -0x8(%rbp),%eax
cmp    0x2e99(%rip),%eax
jge    11a6 <checker+0x96>
mov    -0x8(%rbp),%eax
mov    %eax,0x2e8a(%rip)
jmp    11ab <checker+0x9b>
jmp    11b0 <checker+0xa0>
jmp    11dd <checker+0xcd>
mov    0x2e71(%rip),%esi
add    $0x1,%esi
mov    0x2e6c(%rip),%edx
add    $0x1,%edx
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,0x2e57(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker>:
push   %rax
test   %edx,%edx
je     113f <checker+0x2f>
mov    0x2f11(%rip),%esi
add    $0x1,%esi
mov    0x2f0c(%rip),%edx
add    $0x1,%edx
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,0x2ef7(%rip)
pop    %rax
ret
mov    0x2eef(%rip),%eax
test   %eax,%eax
je     1164 <checker+0x54>
mov    0x2edd(%rip),%ecx
add    $0x1,%eax
mov    %eax,0x2edc(%rip)
cmp    %edi,%ecx
jle    117b <checker+0x6b>
mov    %edi,0x2eca(%rip)
jmp    1187 <checker+0x77>
mov    %edi,0x2ec2(%rip)
mov    %esi,0x2ec0(%rip)
add    $0x1,%eax
mov    %eax,0x2ebb(%rip)
mov    %edi,%ecx
cmp    %edi,%ecx
jne    113d <checker+0x2d>
cmp    %esi,0x2eab(%rip)
jle    113d <checker+0x2d>
mov    %esi,0x2ea3(%rip)
pop    %rax
ret

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

LLVM IR (-O2):
@checker.line_r = internal unnamed_addr global i32 0
@checker.col_r = internal unnamed_addr global i32 0
@checker.i = internal unnamed_addr global i32 0
@.str = [7 x i8] c"%d %d\0A\00"
define void @checker(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %22
5: ; preds = %3
%6 = load i32, i32* @checker.i
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
store i32 %0, i32* @checker.line_r
store i32 %1, i32* @checker.col_r
%9 = add nuw nsw i32 %6, 1
store i32 %9, i32* @checker.i
br label %15
10: ; preds = %5
%11 = load i32, i32* @checker.line_r
%12 = add nsw i32 %6, 1
store i32 %12, i32* @checker.i
%13 = icmp sgt i32 %11, %0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 %0, i32* @checker.line_r
store i32 %1, i32* @checker.col_r
br label %28
15: ; preds = %8, %10
%16 = phi i32 [ %0, %8 ], [ %11, %10 ]
%17 = icmp eq i32 %16, %0
%18 = load i32, i32* @checker.col_r
%19 = icmp sgt i32 %18, %1
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %21, label %28
21: ; preds = %15
store i32 %1, i32* @checker.col_r
br label %28
22: ; preds = %3
%23 = load i32, i32* @checker.line_r
%24 = add nsw i32 %23, 1
%25 = load i32, i32* @checker.col_r
%26 = add nsw i32 %25, 1
%27 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %26)
store i32 0, i32* @checker.i
br label %28
28: ; preds = %14, %21, %15, %22
ret void
}