#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 calcularOperacoes(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int casos;
  char sa[10001], sb[10001];
  scanf("%d", &casos);
  while (casos-- > 0) {
    scanf("%s %s\n", sa, sb);
    printf("%d\n", calcularOperacoes(sa, sb));
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    11aa <main+0x7a>
lea    -0x2720(%rbp),%rsi
lea    -0x4e40(%rbp),%rdx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x2720(%rbp),%rdi
lea    -0x4e40(%rbp),%rsi
call   1030 <calcularOperacoes@plt>
mov    %eax,%esi
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x4e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x4e48,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jle    11b4 <main+0x84>
lea    0xe9c(%rip),%r14
lea    0x2730(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xe8f(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <calcularOperacoes@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jg     1180 <main+0x50>
xor    %eax,%eax
add    $0x4e48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10001 x i8]
%4 = alloca [10001 x i8]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = getelementptr inbounds [10001 x i8], [10001 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [10001 x i8], [10001 x i8]* %4, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [10001 x i8], [10001 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [10001 x i8], [10001 x i8]* %4, i64 0, i64 0
%16 = call i32 @calcularOperacoes(i8* %14, i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10001 x i8]
%3 = alloca [10001 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10001 x i8], [10001 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @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 sgt i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %0, %11
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%13 = call i32 @calcularOperacoes(i8* %5, i8* %6)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, -1
store i32 %16, i32* %1
%17 = icmp sgt i32 %15, 0
br i1 %17, label %11, label %18
18: ; preds = %11, %0
ret i32 0
}