#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*/ init(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
char *translateSentence(char *);
int main(void) {
  int T;
  char *byteAlphabet = (char *)malloc(sizeof(char *));
  char *sentence = (char *)malloc(sizeof(char *));
  scanf("%d", &T);
  scanf("%s", byteAlphabet);
  init(byteAlphabet);
  while (T) {
    scanf("\n%s", sentence);
    char *nSent = translateSentence(sentence);
    printf("%s", nSent);
    T--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <init@plt>
cmpl   $0x0,-0x8(%rbp)
je     11ef <main+0x9f>
mov    -0x18(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <translateSentence@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11a8 <main+0x58>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe86(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe77(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %r14,%rdi
call   1040 <init@plt>
cmpl   $0x0,0xc(%rsp)
je     11e7 <main+0x97>
lea    0xe56(%rip),%r14
lea    0xe50(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <translateSentence@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
addl   $0xffffffff,0xc(%rsp)
jne    11c0 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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