#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 EXIT_SUCCESS;
int intrev(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char **argv) {
  int test;
  int n1, n2;
  scanf("%d", &test);
  while (test--) {
    scanf("%d %d", &n1, &n2);
    printf("%d\n", intrev(intrev(n1) + intrev(n2)));
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb6(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11b2 <main+0x82>
lea    0xe8d(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%edi
call   1040 <intrev@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <intrev@plt>
mov    -0x20(%rbp),%edi
add    %eax,%edi
call   1040 <intrev@plt>
mov    %eax,%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x28>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     11ae <main+0x7e>
lea    0xea3(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0xe98(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <intrev@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%edi
call   1040 <intrev@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1040 <intrev@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1170 <main+0x40>
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
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 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
br label %10
10: ; preds = %14, %2
%11 = load i32, i32* %6
%12 = add nsw i32 %11, -1
store i32 %12, i32* %6
%13 = icmp ne i32 %11, 0
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8)
%16 = load i32, i32* %7
%17 = call i32 @intrev(i32 %16)
%18 = load i32, i32* %8
%19 = call i32 @intrev(i32 %18)
%20 = add nsw i32 %17, %19
%21 = call i32 @intrev(i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %10
23: ; preds = %10
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

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