#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 main() {
  int a, b;
  int ans_diff = 0, ans_same = 0;
  scanf("%d %d", &a, &b);
  while (a > 0 && b > 0) {
    a--;
    b--;
    ans_diff++;
  }
  ans_same = a == 0 ? b : a;
  ans_same /= 2;
  printf("%d %d\n", ans_diff, ans_same);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jle    116a <main+0x4a>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    117a <main+0x5a>
jmp    119a <main+0x7a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main+0x31>
cmpl   $0x0,-0x8(%rbp)
jne    11af <main+0x8f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11b5 <main+0x95>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
xor    %esi,%esi
test   %ecx,%ecx
jle    1166 <main+0x46>
test   %eax,%eax
jle    1166 <main+0x46>
add    $0xffffffff,%ecx
add    $0xffffffff,%eax
cmp    %ecx,%eax
mov    %ecx,%esi
cmovb  %eax,%esi
test   %ecx,%ecx
cmove  %ecx,%esi
sub    %esi,%eax
sub    %esi,%ecx
add    $0x1,%esi
mov    %ecx,0x4(%rsp)
mov    %eax,(%rsp)
test   %ecx,%ecx
cmovne %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%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
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %7
22: ; preds = %13
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = load i32, i32* %3
br label %29
27: ; preds = %22
%28 = load i32, i32* %2
br label %29
29: ; preds = %27, %25
%30 = phi i32 [ %26, %25 ], [ %28, %27 ]
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = sdiv i32 %31, 2
store i32 %32, i32* %5
%33 = load i32, i32* %4
%34 = load i32, i32* %5
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %34)
ret i32 0
}

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