#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 findPoint(void) {
  int numTestCases;
  scanf("%d", &numTestCases);
  while (numTestCases--) {
    int initialX, initialY;
    int reflectionX, reflectionY;
    scanf("%d %d", &initialX, &initialY);
    scanf("%d %d", &reflectionX, &reflectionY);
    int dx = reflectionX - initialX;
    int dy = reflectionY - initialY;
    printf("%d %d\n", reflectionX + dx, reflectionY + dy);
  }
  return 0;
}


x86 assembly (clang, -O0):
<findPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     11a9 <findPoint+0x89>
lea    0xeab(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe95(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
add    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
add    -0x1c(%rbp),%edx
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    113a <findPoint+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findPoint>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     11b3 <findPoint+0x93>
lea    0xeb1(%rip),%rbx
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
lea    0xe9c(%rip),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
add    %esi,%esi
sub    0x14(%rsp),%esi
mov    0x8(%rsp),%edx
add    %edx,%edx
sub    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1170 <findPoint+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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