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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116b <main+0x4b>
cmpl   $0x1,-0xc(%rbp)
jne    116b <main+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
cmpl   $0x1,-0x8(%rbp)
jne    1203 <main+0xe3>
cmpl   $0x1,-0x14(%rbp)
jne    11a0 <main+0x80>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11cd <main+0xad>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
cmpl   $0x1,-0xc(%rbp)
jne    129b <main+0x17b>
cmpl   $0x1,-0x10(%rbp)
jne    1238 <main+0x118>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1265 <main+0x145>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xdb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xd94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xd7f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
cmpl   $0x1,-0x10(%rbp)
jne    1372 <main+0x252>
cmpl   $0x1,-0x14(%rbp)
jne    12e5 <main+0x1c5>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xd4a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xd35(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1327 <main+0x207>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xd08(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xcf3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xcd2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xcbd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xca8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    144b <main+0x32b>
cmpl   $0x1,-0x14(%rbp)
jne    13be <main+0x29e>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xc71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xc5c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1400 <main+0x2e0>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xc2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xc1a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xbf9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xbe4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xbcf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
cmpl   $0x1,-0x14(%rbp)
jne    14a0 <main+0x380>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xba4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xb8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xb7a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    14f7 <main+0x3d7>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xb4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xb38(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xb23(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1552 <main+0x432>
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xb02(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xaed(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xad8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xac3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
cmp    $0x1,%esi
jne    1159 <main+0x39>
cmp    $0x1,%edx
je     134b <main+0x22b>
cmp    $0x1,%esi
jne    117b <main+0x5b>
mov    (%rsp),%eax
cmp    $0x1,%eax
jne    119d <main+0x7d>
mov    0x4(%rsp),%esi
lea    0xe98(%rip),%rdi
mov    $0x2,%edx
jmp    1346 <main+0x226>
mov    0x4(%rsp),%eax
cmp    $0x1,%edx
jne    11b4 <main+0x94>
cmp    $0x1,%eax
jne    11da <main+0xba>
mov    (%rsp),%edx
lea    0xe76(%rip),%rdi
mov    $0x2,%esi
jmp    1346 <main+0x226>
mov    0x4(%rsp),%esi
cmp    %edx,%eax
jne    11f0 <main+0xd0>
add    $0xffffffff,%edx
lea    0xe5a(%rip),%rdi
jmp    1346 <main+0x226>
cmp    $0x1,%eax
jne    1204 <main+0xe4>
mov    (%rsp),%eax
cmp    $0x1,%eax
jne    1227 <main+0x107>
lea    0xe41(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1334 <main+0x214>
cmp    %esi,%eax
jne    1243 <main+0x123>
add    $0xffffffff,%esi
mov    (%rsp),%edx
lea    0xe1e(%rip),%rdi
jmp    1346 <main+0x226>
add    $0xffffffff,%eax
lea    0xe0f(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%edx
jmp    1334 <main+0x214>
mov    (%rsp),%ecx
cmp    %esi,%eax
jne    1269 <main+0x149>
add    $0xffffffff,%esi
lea    0xdf4(%rip),%rbx
cmp    $0x1,%ecx
jne    1296 <main+0x176>
mov    %rbx,%rdi
mov    $0x1,%edx
jmp    1334 <main+0x214>
cmp    %edx,%eax
jne    12b0 <main+0x190>
lea    0xdd3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
jmp    12fd <main+0x1dd>
add    $0x1,%eax
mov    (%rsp),%edx
lea    0xdb9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0xffffffff,%esi
mov    (%rsp),%edx
jmp    1343 <main+0x223>
add    $0xffffffff,%eax
lea    0xd96(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
cmp    $0x1,%ecx
jne    12e7 <main+0x1c7>
mov    $0x1,%edx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    (%rsp),%edx
jmp    1331 <main+0x211>
cmp    %edx,%ecx
je     12fa <main+0x1da>
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
add    $0x1,%edx
jmp    12fa <main+0x1da>
add    $0xffffffff,%eax
lea    0xd4f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
add    $0x1,%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    (%rsp),%edx
jmp    1343 <main+0x223>
cmp    %edx,%ecx
jne    130e <main+0x1ee>
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    (%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
add    $0xffffffff,%edx
jmp    1343 <main+0x223>
mov    %ecx,%edx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    (%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
add    $0xffffffff,%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
add    $0x1,%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %1
br label %204
13: ; preds = %9, %0
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %42
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %22)
store i32 0, i32* %1
br label %204
24: ; preds = %16
%25 = load i32, i32* %5
%26 = load i32, i32* %3
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = sub nsw i32 %30, 1
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %31)
store i32 0, i32* %1
br label %204
33: ; preds = %24
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = sub nsw i32 %35, 1
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %36)
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %40)
store i32 0, i32* %1
br label %204
42: ; preds = %13
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %71
45: ; preds = %42
%46 = load i32, i32* %4
%47 = icmp eq i32 %46, 1
br i1 %47, label %48, label %53
48: ; preds = %45
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
%51 = load i32, i32* %5
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %50, i32 %51)
store i32 0, i32* %1
br label %204
53: ; preds = %45
%54 = load i32, i32* %4
%55 = load i32, i32* %2
%56 = icmp eq i32 %54, %55
br i1 %56, label %57, label %62
57: ; preds = %53
%58 = load i32, i32* %4
%59 = sub nsw i32 %58, 1
%60 = load i32, i32* %5
%61 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %59, i32 %60)
store i32 0, i32* %1
br label %204
62: ; preds = %53
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
%65 = load i32, i32* %5
%66 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 %65)
%67 = load i32, i32* %4
%68 = sub nsw i32 %67, 1
%69 = load i32, i32* %5
%70 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %68, i32 %69)
store i32 0, i32* %1
br label %204
71: ; preds = %42
%72 = load i32, i32* %4
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %112
74: ; preds = %71
%75 = load i32, i32* %5
%76 = icmp eq i32 %75, 1
br i1 %76, label %77, label %86
77: ; preds = %74
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
%80 = load i32, i32* %5
%81 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %79, i32 %80)
%82 = load i32, i32* %4
%83 = load i32, i32* %5
%84 = add nsw i32 %83, 1
%85 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %82, i32 %84)
store i32 0, i32* %1
br label %204
86: ; preds = %74
%87 = load i32, i32* %5
%88 = load i32, i32* %3
%89 = icmp eq i32 %87, %88
br i1 %89, label %90, label %99
90: ; preds = %86
%91 = load i32, i32* %4
%92 = add nsw i32 %91, 1
%93 = load i32, i32* %5
%94 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %92, i32 %93)
%95 = load i32, i32* %4
%96 = load i32, i32* %5
%97 = sub nsw i32 %96, 1
%98 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %95, i32 %97)
store i32 0, i32* %1
br label %204
99: ; preds = %86
%100 = load i32, i32* %4
%101 = load i32, i32* %5
%102 = sub nsw i32 %101, 1
%103 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %100, i32 %102)
%104 = load i32, i32* %4
%105 = load i32, i32* %5
%106 = add nsw i32 %105, 1
%107 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %104, i32 %106)
%108 = load i32, i32* %4
%109 = add nsw i32 %108, 1
%110 = load i32, i32* %5
%111 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %109, i32 %110)
store i32 0, i32* %1
br label %204
112: ; preds = %71
%113 = load i32, i32* %4
%114 = load i32, i32* %2
%115 = icmp eq i32 %113, %114
br i1 %115, label %116, label %154
116: ; preds = %112
%117 = load i32, i32* %5
%118 = icmp eq i32 %117, 1
br i1 %118, label %119, label %128
119: ; preds = %116
%120 = load i32, i32* %4
%121 = sub nsw i32 %120, 1
%122 = load i32, i32* %5
%123 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %121, i32 %122)
%124 = load i32, i32* %4
%125 = load i32, i32* %5
%126 = add nsw i32 %125, 1
%127 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %124, i32 %126)
store i32 0, i32* %1
br label %204
128: ; preds = %116
%129 = load i32, i32* %5
%130 = load i32, i32* %3
%131 = icmp eq i32 %129, %130
br i1 %131, label %132, label %141
132: ; preds = %128
%133 = load i32, i32* %4
%134 = sub nsw i32 %133, 1
%135 = load i32, i32* %5
%136 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %134, i32 %135)
%137 = load i32, i32* %4
%138 = load i32, i32* %5
%139 = sub nsw i32 %138, 1
%140 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %137, i32 %139)
store i32 0, i32* %1
br label %204
141: ; preds = %128
%142 = load i32, i32* %4
%143 = sub nsw i32 %142, 1
%144 = load i32, i32* %5
%145 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %143, i32 %144)
%146 = load i32, i32* %4
%147 = load i32, i32* %5
%148 = add nsw i32 %147, 1
%149 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %146, i32 %148)
%150 = load i32, i32* %4
%151 = load i32, i32* %5
%152 = sub nsw i32 %151, 1
%153 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %150, i32 %152)
store i32 0, i32* %1
br label %204
154: ; preds = %112
%155 = load i32, i32* %5
%156 = icmp eq i32 %155, 1
br i1 %156, label %157, label %170
157: ; preds = %154
%158 = load i32, i32* %4
%159 = sub nsw i32 %158, 1
%160 = load i32, i32* %5
%161 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %159, i32 %160)
%162 = load i32, i32* %4
%163 = add nsw i32 %162, 1
%164 = load i32, i32* %5
%165 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %163, i32 %164)
%166 = load i32, i32* %4
%167 = load i32, i32* %5
%168 = add nsw i32 %167, 1
%169 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %166, i32 %168)
store i32 0, i32* %1
br label %204
170: ; preds = %154
%171 = load i32, i32* %5
%172 = load i32, i32* %3
%173 = icmp eq i32 %171, %172
br i1 %173, label %174, label %187
174: ; preds = %170
%175 = load i32, i32* %4
%176 = sub nsw i32 %175, 1
%177 = load i32, i32* %5
%178 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %176, i32 %177)
%179 = load i32, i32* %4
%180 = add nsw i32 %179, 1
%181 = load i32, i32* %5
%182 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %180, i32 %181)
%183 = load i32, i32* %4
%184 = load i32, i32* %5
%185 = sub nsw i32 %184, 1
%186 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %183, i32 %185)
store i32 0, i32* %1
br label %204
187: ; preds = %170
%188 = load i32, i32* %4
%189 = sub nsw i32 %188, 1
%190 = load i32, i32* %5
%191 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %189, i32 %190)
%192 = load i32, i32* %4
%193 = add nsw i32 %192, 1
%194 = load i32, i32* %5
%195 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %193, i32 %194)
%196 = load i32, i32* %4
%197 = load i32, i32* %5
%198 = sub nsw i32 %197, 1
%199 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %196, i32 %198)
%200 = load i32, i32* %4
%201 = load i32, i32* %5
%202 = add nsw i32 %201, 1
%203 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %200, i32 %202)
store i32 0, i32* %1
br label %204
204: ; preds = %187, %174, %157, %141, %132, %119, %99, %90, %77, %62, %57, %48, %33, %28, %19, %12
%205 = load i32, i32* %1
ret i32 %205
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %155, label %15
15: ; preds = %0
br i1 %11, label %16, label %35
16: ; preds = %15
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 2)
br label %155
22: ; preds = %16
%23 = icmp eq i32 %17, %12
%24 = load i32, i32* %3
br i1 %23, label %25, label %28
25: ; preds = %22
%26 = add nsw i32 %12, -1
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %26)
br label %155
28: ; preds = %22
%29 = add nsw i32 %17, -1
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %29)
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %33)
br label %155
35: ; preds = %15
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 1
br i1 %13, label %38, label %56
38: ; preds = %35
br i1 %37, label %39, label %42
39: ; preds = %38
%40 = load i32, i32* %4
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %40)
br label %155
42: ; preds = %38
%43 = icmp eq i32 %36, %10
br i1 %43, label %44, label %48
44: ; preds = %42
%45 = add nsw i32 %10, -1
%46 = load i32, i32* %4
%47 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %46)
br label %155
48: ; preds = %42
%49 = add nsw i32 %36, 1
%50 = load i32, i32* %4
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %49, i32 %50)
%52 = load i32, i32* %3
%53 = add nsw i32 %52, -1
%54 = load i32, i32* %4
%55 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %53, i32 %54)
br label %155
56: ; preds = %35
br i1 %37, label %57, label %85
57: ; preds = %56
%58 = load i32, i32* %4
%59 = icmp eq i32 %58, 1
br i1 %59, label %60, label %66
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 1)
%62 = load i32, i32* %3
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
%65 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %62, i32 %64)
br label %155
66: ; preds = %57
%67 = icmp eq i32 %58, %12
br i1 %67, label %68, label %74
68: ; preds = %66
%69 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %12)
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = add nsw i32 %71, -1
%73 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %70, i32 %72)
br label %155
74: ; preds = %66
%75 = add nsw i32 %58, -1
%76 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %75)
%77 = load i32, i32* %3
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
%80 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %77, i32 %79)
%81 = load i32, i32* %3
%82 = add nsw i32 %81, 1
%83 = load i32, i32* %4
%84 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %82, i32 %83)
br label %155
85: ; preds = %56
%86 = icmp eq i32 %36, %10
%87 = load i32, i32* %4
%88 = icmp eq i32 %87, 1
br i1 %86, label %89, label %116
89: ; preds = %85
br i1 %88, label %90, label %97
90: ; preds = %89
%91 = add nsw i32 %10, -1
%92 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %91, i32 1)
%93 = load i32, i32* %3
%94 = load i32, i32* %4
%95 = add nsw i32 %94, 1
%96 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %93, i32 %95)
br label %155
97: ; preds = %89
%98 = icmp eq i32 %87, %12
%99 = add nsw i32 %10, -1
br i1 %98, label %100, label %106
100: ; preds = %97
%101 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %99, i32 %12)
%102 = load i32, i32* %3
%103 = load i32, i32* %4
%104 = add nsw i32 %103, -1
%105 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %102, i32 %104)
br label %155
106: ; preds = %97
%107 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %99, i32 %87)
%108 = load i32, i32* %3
%109 = load i32, i32* %4
%110 = add nsw i32 %109, 1
%111 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %108, i32 %110)
%112 = load i32, i32* %3
%113 = load i32, i32* %4
%114 = add nsw i32 %113, -1
%115 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %112, i32 %114)
br label %155
116: ; preds = %85
br i1 %88, label %117, label %128
117: ; preds = %116
%118 = add nsw i32 %36, -1
%119 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %118, i32 1)
%120 = load i32, i32* %3
%121 = add nsw i32 %120, 1
%122 = load i32, i32* %4
%123 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %121, i32 %122)
%124 = load i32, i32* %3
%125 = load i32, i32* %4
%126 = add nsw i32 %125, 1
%127 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %124, i32 %126)
br label %155
128: ; preds = %116
%129 = icmp eq i32 %87, %12
%130 = add nsw i32 %36, -1
br i1 %129, label %131, label %141
131: ; preds = %128
%132 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %130, i32 %12)
%133 = load i32, i32* %3
%134 = add nsw i32 %133, 1
%135 = load i32, i32* %4
%136 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %134, i32 %135)
%137 = load i32, i32* %3
%138 = load i32, i32* %4
%139 = add nsw i32 %138, -1
%140 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %137, i32 %139)
br label %155
141: ; preds = %128
%142 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %130, i32 %87)
%143 = load i32, i32* %3
%144 = add nsw i32 %143, 1
%145 = load i32, i32* %4
%146 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %144, i32 %145)
%147 = load i32, i32* %3
%148 = load i32, i32* %4
%149 = add nsw i32 %148, -1
%150 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %147, i32 %149)
%151 = load i32, i32* %3
%152 = load i32, i32* %4
%153 = add nsw i32 %152, 1
%154 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %151, i32 %153)
br label %155
155: ; preds = %0, %141, %131, %117, %106, %100, %90, %74, %68, %60, %48, %44, %39, %28, %25, %19
ret i32 0
}