CVE-2016-15006: Predictable Seed in Pseudo-Random Number Generator (PRNG) (CWE-337)
value: A vulnerability, which was classified as problematic, has been found in enigmaX up to 2.2. This issue affects the function getSeed of the file main.c of the component Scrambling Table Handler. The manipulation leads to predictable seed in pseudo-random number generator (prng). The attack may be initiated remotely. The complexity of an attack is rather high. The exploitation is known to be difficult. Upgrading to version 2.3 is able to address this issue. The identifier of the patch is 922bf90ca14a681629ba0b807a997a81d70225b5. It is recommended to upgrade the affected component. The identifier VDB-217181 was assigned to this vulnerability.
CWE description: A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time.
CVSS v3 base score: 5.3
Published: 2023-01-02T08:15Z
Repository: https://github.com/pfmonville/enigmaX
Language: Other
Files changed: main.c, main.s
Commit date: 2016-08-29 23:14:29 +0200
Commit message: 2.3

+ now the order of the scrambling tables when using a keyfile is
defined by the keyfile and not only with the password. Even if someone
has the password, without the keyfile it is impossible to do any
frequency analysis attack
~ fix the scrambling when a keyfile is used (previously the 16 tables
were the same)
~ some tweaks to descriptions

Diff: diff --git a/main.c b/main.c
index be768e7..899ff42 100755
--- a/main.c
+++ b/main.c
@@ -89,12 +89,14 @@ static char _isADirectory;
 static uint64_t seed[2];
 static unsigned char scrambleAsciiTables[16][256];
 static unsigned char unscrambleAsciiTables[16][256];
 static char isCrypting = 1;
 static char scrambling = 1;
+static char usingKeyFile = 0;
 static char isCodingInverted = 0;
 static long numberOfBuffer;
+static char scramblingTablesOrder[BUFFER_SIZE];
 
 char passPhrase[16384];
 uint64_t passIndex = 0;
 
 /*
@@ -107,14 +109,14 @@ static void usage(int status)
 {
 	FILE *dest = (status == 0) ? stdout : stderr;
 
 	if(status == 0){
 		fprintf(dest,
-			"%s(1)\t\t\tcopyright <Pierre-François Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de déchiffrer toutes les données entrées en paramètre le mot de passe demandé au début est hashé puis sert de graine pour le PRNG le PRNG permet de fournir une clé unique égale à la longueur du fichier à coder. La clé unique subit un xor avec le mot de passe (le mot de passe est répété autant de fois que nécéssaire). Le fichier subit un xor avec cette clé Puis un brouilleur est utilisé, il mélange la table des caractères (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n", progName, progName, progName, progName, progName, progName, progName, progName);
+			"%s(1)\t\t\tcopyright <Pierre-François Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de déchiffrer toutes les données entrées en paramètre le mot de passe demandé au début est hashé puis sert de graine pour le PRNG le PRNG permet de fournir une clé unique égale à la longueur du fichier à coder. La clé unique subit un xor avec le mot de passe (le mot de passe est répété autant de fois que nécéssaire). Le fichier subit un xor avec cette clé Puis un brouilleur est utilisé, il mélange la table des caractères (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\n\tKEYFILE    \tthe path to a file which will be used to scramble the substitution's tables and choose in which order they will be used instead of the PRNG only (starting at 2.5 ko for the keyfile is great, however not interesting to be too heavy) \n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n", progName, progName, progName, progName, progName, progName, progName, progName);
 	} else{
 		fprintf(dest,
-			"Usage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that generates the scrambler instead of the password\n", progName);
+			"Version : 2.3\nUsage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that scrambles the substitution's tables and choose they order instead of the PRNG only\n", progName);
 	}
 	exit(status);
 }
 
 
@@ -314,28 +316,31 @@ void getSeed(char* password){
 	inspired by the Enigma machine; switching letters but without its weekness,
 	here a letter can be switched by itself and it is not possible to know how many letters
 	have been switched
  */
 void scramble(FILE* keyFile){
+	printf("scrambling substitution's tables...\n");
 	for (int j = 0; j < 16; ++j)
 	{
 		char temp = 0;
 
 		for (int i = 0; i < 256; ++i)
 		{
 			scrambleAsciiTables[j][i] = i;
 		}
 
-		if (keyFile != NULL){
+		if (usingKeyFile){
 			int size;
 			char extractedString[BUFFER_SIZE] = "";
+			unsigned char random256;
 			while((size = fread(extractedString, 1, BUFFER_SIZE, keyFile)) > 0){
 				for (int i = 0; i < size; ++i)
 				{
+					random256 = generateNumber() ^ extractedString[i];
 					temp = scrambleAsciiTables[j][i%256];
-					scrambleAsciiTables[j][i%256] = scrambleAsciiTables[j][(unsigned char)(extractedString[i])];
-					scrambleAsciiTables[j][(unsigned char)(extractedString[i])] = temp;
+					scrambleAsciiTables[j][i%256] = scrambleAsciiTables[j][random256];
+					scrambleAsciiTables[j][random256] = temp;
 				}
 			}
 			rewind(keyFile);
 		} else {
 			unsigned char random256;
@@ -348,10 +353,29 @@ void scramble(FILE* keyFile){
 				scrambleAsciiTables[j][i%256] = scrambleAsciiTables[j][random256];
 				scrambleAsciiTables[j][random256] = temp;
 			}
 		}
 	}
+	if(usingKeyFile){
+		int j = 0;
+		char temp[BUFFER_SIZE];
+		while(j < BUFFER_SIZE){
+			int charactersRead = fread(temp, 1, BUFFER_SIZE, keyFile);
+			if(charactersRead == 0){
+				rewind(keyFile);
+				continue;
+			}
+			for (int i = 0; i < charactersRead; ++i)
+			{
+				scramblingTablesOrder[j] = temp[i] & (1+2+4+8);
+				j++;
+				if(j == BUFFER_SIZE){
+					break;
+				}
+			}
+		}
+	}
 }
 
 
 /*
 	-void unscramble(void)
@@ -391,20 +415,27 @@ void unscramble(){
 	decoding : 	xored(?) -> unxored(x) -> unscrambled(a)
  */
 void codingXOR(char* extractedString, char* keyString, char* xoredString, int bufferLength)
 {
 	int i;
+	char* tablenumber;
+
+	if(usingKeyFile){
+		tablenumber = scramblingTablesOrder;
+	}else{
+		tablenumber = keyString;
+	}
 
 	if(isCodingInverted){
 		for (i = 0; i < bufferLength; ++i)
 		{
-			xoredString[i] = scrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
+			xoredString[i] = scrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
 		}
 	}else{
 		for (i = 0; i < bufferLength; ++i)
 		{
-			xoredString[i] = scrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
+			xoredString[i] = scrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
 		}
 	}
 }
 
 
@@ -424,20 +455,27 @@ void codingXOR(char* extractedString, char* keyString, char* xoredString, int bu
 	decoding : 	xored(?) -> unxored(x) -> unscrambled(a)
  */
 void decodingXOR(char* extractedString, char* keyString, char* xoredString, int bufferLength)
 {
 	int i;
+	char* tablenumber;
+
+	if(usingKeyFile){
+		tablenumber = scramblingTablesOrder;
+	}else{
+		tablenumber = keyString;
+	}
 
 	if(isCodingInverted){
 		for (i = 0; i < bufferLength; ++i)
 		{
-			xoredString[i] = unscrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
+			xoredString[i] = unscrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
 		}
 	}else{
 		for (i = 0; i < bufferLength; ++i)
 		{
-			xoredString[i] = unscrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
+			xoredString[i] = unscrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
 		}
 	}
 }
 
 
@@ -473,11 +511,11 @@ void standardXOR(char* extractedString, char* keyString, char* xoredString, int
 /*
 	-int fillbuffer(FILE* mainFile, char* extractedString, char* keyString)
 	mainFile : pointer to the file given by the user
 	extractedString : will contains the data extracted from the source file in a string format
 	keyString : will contains a part of the unique key in a string format
-	returned value : the size of the data reed
+	returned value : the size of the data read
 
 	read a packet of data from the source file
 	return the length of the packet which is the buffer size (BUFFER_SIZE)
 	it can be less at the final packet (if the file isn't a multiple of the buffer size)
 
@@ -780,10 +818,14 @@ int main(int argc, char const *argv[])
 			usage(1);
 		} else if(keyFile != NULL && argc >= 4){
 			printf("Error: Too many arguments\n");
 			usage(1);
 		}
+
+		if(keyFile != NULL){
+			usingKeyFile = 1;
+		}
 		
 	}
 
 	if (argv[1][strlen(argv[1])-1] == '/' && argv[1][strlen(argv[1])-2] == '/')
 	{
diff --git a/main.s b/main.s
index e52736a..1dc553e 100644
--- a/main.s
+++ b/main.s
@@ -476,205 +476,257 @@ Ltmp31:
 	pushq	%r15
 	pushq	%r14
 	pushq	%r13
 	pushq	%r12
 	pushq	%rbx
-	subq	$16408, %rsp            ## imm = 0x4018
+	subq	$16424, %rsp            ## imm = 0x4028
 Ltmp32:
 	.cfi_offset %rbx, -56
 Ltmp33:
 	.cfi_offset %r12, -48
 Ltmp34:
 	.cfi_offset %r13, -40
 Ltmp35:
 	.cfi_offset %r14, -32
 Ltmp36:
 	.cfi_offset %r15, -24
-	movq	%rdi, %r12
+	movq	%rdi, -16440(%rbp)      ## 8-byte Spill
 	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
 	movq	(%rax), %rax
 	movq	%rax, -48(%rbp)
-	xorl	%r13d, %r13d
-	testq	%r12, %r12
-	je	LBB8_8
-## BB#1:
-	leaq	_scrambleAsciiTables(%rip), %rax
+	leaq	L_str(%rip), %rdi
+	callq	_puts
+	leaq	_scrambleAsciiTables(%rip), %r13
+	xorl	%r14d, %r14d
 	pxor	%xmm1, %xmm1
 	movdqa	LCPI8_0(%rip), %xmm2    ## xmm2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
-	leaq	-16432(%rbp), %r14
-	leaq	_scrambleAsciiTables(%rip), %r15
+	movq	_passPhrase@GOTPCREL(%rip), %rsi
+	movq	%r13, %r12
 	.align	4, 0x90
-LBB8_2:                                 ## %vector.ph
+LBB8_1:                                 ## %vector.ph
                                         ## =>This Loop Header: Depth=1
-                                        ##     Child Loop BB8_3 Depth 2
+                                        ##     Child Loop BB8_2 Depth 2
                                         ##     Child Loop BB8_5 Depth 2
-                                        ##       Child Loop BB8_7 Depth 3
-	movq	%rax, -16440(%rbp)      ## 8-byte Spill
+                                        ##     Child Loop BB8_9 Depth 2
+                                        ##       Child Loop BB8_11 Depth 3
+	movq	%r12, %rax
 	xorl	%ecx, %ecx
 	.align	4, 0x90
-LBB8_3:                                 ## %vector.body
-                                        ##   Parent Loop BB8_2 Depth=1
+LBB8_2:                                 ## %vector.body
+                                        ##   Parent Loop BB8_1 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movd	%ecx, %xmm0
 	pshufb	%xmm1, %xmm0
 	paddb	%xmm2, %xmm0
 	movdqa	%xmm0, (%rax)
 	addq	$16, %rcx
 	addq	$16, %rax
 	cmpq	$256, %rcx              ## imm = 0x100
-	jne	LBB8_3
-## BB#4:                                ## %middle.block
-                                        ##   in Loop: Header=BB8_2 Depth=1
+	jne	LBB8_2
+## BB#3:                                ## %middle.block
+                                        ##   in Loop: Header=BB8_1 Depth=1
+	movb	_usingKeyFile(%rip), %al
+	andb	$1, %al
+	je	LBB8_4
+## BB#7:                                ##   in Loop: Header=BB8_1 Depth=1
 	movl	$16384, %esi            ## imm = 0x4000
-	movq	%r14, %rdi
+	leaq	-16432(%rbp), %rbx
+	movq	%rbx, %rdi
 	callq	___bzero
-	jmp	LBB8_5
-	.align	4, 0x90
-LBB8_6:                                 ## %.lr.ph.preheader
-                                        ##   in Loop: Header=BB8_5 Depth=2
-	movl	%eax, %r8d
-	xorl	%ecx, %ecx
+	movl	$1, %esi
+	movl	$16384, %edx            ## imm = 0x4000
+	movq	%rbx, %rdi
+	jmp	LBB8_9
 	.align	4, 0x90
-LBB8_7:                                 ## %.lr.ph
-                                        ##   Parent Loop BB8_2 Depth=1
-                                        ##     Parent Loop BB8_5 Depth=2
-                                        ## =>    This Inner Loop Header: Depth=3
-	movl	%ecx, %edx
-	sarl	$31, %edx
-	shrl	$24, %edx
-	addl	%ecx, %edx
-	andl	$-256, %edx
-	movl	%ecx, %esi
-	subl	%edx, %esi
-	movslq	%esi, %rdx
-	movq	%r13, %rsi
-	shlq	$8, %rsi
-	addq	%r15, %rsi
-	movb	(%rdx,%rsi), %bl
-	movzbl	-16432(%rbp,%rcx), %edi
-	movb	(%rdi,%rsi), %al
-	movb	%al, (%rdx,%rsi)
-	movb	%bl, (%rdi,%rsi)
-	incq	%rcx
-	cmpl	%ecx, %r8d
-	jne	LBB8_7
-LBB8_5:                                 ## %.loopexit
-                                        ##   Parent Loop BB8_2 Depth=1
-                                        ## =>  This Loop Header: Depth=2
-                                        ##       Child Loop BB8_7 Depth 3
+LBB8_8:                                 ## %.loopexit11
+                                        ##   in Loop: Header=BB8_9 Depth=2
+	movq	%rdx, _seed.0(%rip)
+	movq	%rcx, _seed.1(%rip)
 	movl	$1, %esi
 	movl	$16384, %edx            ## imm = 0x4000
-	movq	%r14, %rdi
-	movq	%r12, %rcx
+	leaq	-16432(%rbp), %rdi
+LBB8_9:                                 ## %.loopexit11
+                                        ##   Parent Loop BB8_1 Depth=1
+                                        ## =>  This Loop Header: Depth=2
+                                        ##       Child Loop BB8_11 Depth 3
+	movq	-16440(%rbp), %rcx      ## 8-byte Reload
 	callq	_fread
 	testl	%eax, %eax
-	jg	LBB8_6
-## BB#16:                               ## %._crit_edge
-                                        ##   in Loop: Header=BB8_2 Depth=1
-	movq	%r12, %rdi
-	callq	_rewind
-	incq	%r13
-	movq	-16440(%rbp), %rax      ## 8-byte Reload
-	addq	$256, %rax              ## imm = 0x100
-	cmpq	$16, %r13
-	pxor	%xmm1, %xmm1
-	movdqa	LCPI8_0(%rip), %xmm2    ## xmm2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
-	jne	LBB8_2
-	jmp	LBB8_14
-LBB8_8:                                 ## %.preheader5.us.preheader
+	jle	LBB8_12
+## BB#10:                               ## %.lr.ph24
+                                        ##   in Loop: Header=BB8_9 Depth=2
 	movq	_seed.0(%rip), %rdx
-	movq	_seed.1(%rip), %r15
-	leaq	_scrambleAsciiTables(%rip), %r9
-	movq	_passIndex(%rip), %r14
-	xorl	%r11d, %r11d
-	pxor	%xmm0, %xmm0
-	movdqa	LCPI8_0(%rip), %xmm1    ## xmm1 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
-	movq	_passPhrase@GOTPCREL(%rip), %r10
-	movq	%r9, %rax
+	movq	_seed.1(%rip), %rcx
+	movl	%eax, %r8d
+	xorl	%esi, %esi
 	.align	4, 0x90
-LBB8_9:                                 ## %vector.ph45
-                                        ## =>This Loop Header: Depth=1
-                                        ##     Child Loop BB8_10 Depth 2
-                                        ##     Child Loop BB8_11 Depth 2
-	movq	%rax, -16440(%rbp)      ## 8-byte Spill
-	movq	%rax, %rbx
-	xorl	%edi, %edi
+LBB8_11:                                ##   Parent Loop BB8_1 Depth=1
+                                        ##     Parent Loop BB8_9 Depth=2
+                                        ## =>    This Inner Loop Header: Depth=3
+	leal	(%rcx,%rdx), %r9d
+	xorq	%rdx, %rcx
+	movq	%rdx, %rbx
+	rolq	$55, %rbx
+	movq	%rcx, %rdx
+	shlq	$14, %rdx
+	xorq	%rcx, %rdx
+	xorq	%rbx, %rdx
+	rolq	$36, %rcx
+	movzbl	-16432(%rbp,%rsi), %r10d
+	movl	%esi, %eax
+	sarl	$31, %eax
+	shrl	$24, %eax
+	addl	%esi, %eax
+	andl	$-256, %eax
+	movl	%esi, %edi
+	subl	%eax, %edi
+	movslq	%edi, %r15
+	movq	%r14, %rdi
+	shlq	$8, %rdi
+	addq	%r13, %rdi
+	movb	(%r15,%rdi), %r11b
+	movzbl	%r9b, %ebx
+	xorq	%r10, %rbx
+	movb	(%rbx,%rdi), %al
+	movb	%al, (%r15,%rdi)
+	movb	%r11b, (%rbx,%rdi)
+	incq	%rsi
+	cmpl	%esi, %r8d
+	jne	LBB8_11
+	jmp	LBB8_8
 	.align	4, 0x90
-LBB8_10:                                ## %vector.body41
-                                        ##   Parent Loop BB8_9 Depth=1
-                                        ## =>  This Inner Loop Header: Depth=2
-	movd	%edi, %xmm2
-	pshufb	%xmm0, %xmm2
-	paddb	%xmm1, %xmm2
-	movdqa	%xmm2, (%rbx)
-	addq	$16, %rdi
-	addq	$16, %rbx
-	xorl	%eax, %eax
-	cmpq	$256, %rdi              ## imm = 0x100
-	jne	LBB8_10
+LBB8_4:                                 ## %.preheader12
+                                        ##   in Loop: Header=BB8_1 Depth=1
+	movq	%r12, -16448(%rbp)      ## 8-byte Spill
+	movq	_seed.0(%rip), %rdx
+	movq	_seed.1(%rip), %rax
+	xorl	%r9d, %r9d
+	movq	_passIndex(%rip), %r15
 	.align	4, 0x90
-LBB8_11:                                ## %.preheader3.us
-                                        ##   Parent Loop BB8_9 Depth=1
+LBB8_5:                                 ##   Parent Loop BB8_1 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-	leal	(%r15,%rdx), %r12d
-	xorq	%rdx, %r15
-	movq	%rdx, %rdi
-	rolq	$55, %rdi
-	movq	%r15, %rdx
+	leal	(%rax,%rdx), %r8d
+	xorq	%rdx, %rax
+	movq	%rdx, %rbx
+	rolq	$55, %rbx
+	movq	%rax, %rdx
 	shlq	$14, %rdx
-	xorq	%r15, %rdx
-	xorq	%rdi, %rdx
-	rolq	$36, %r15
-	movzbl	(%r10,%r14), %r13d
-	incl	%r14d
-	andl	$16383, %r14d           ## imm = 0x3FFF
-	movl	%eax, %esi
+	xorq	%rax, %rdx
+	xorq	%rbx, %rdx
+	rolq	$36, %rax
+	movzbl	(%rsi,%r15), %r10d
+	incl	%r15d
+	andl	$16383, %r15d           ## imm = 0x3FFF
+	movq	%rsi, %r12
+	movl	%r9d, %esi
 	sarl	$31, %esi
 	shrl	$24, %esi
-	addl	%eax, %esi
+	addl	%r9d, %esi
 	andl	$-256, %esi
-	movl	%eax, %ecx
-	subl	%esi, %ecx
-	movslq	%ecx, %rcx
-	movq	%r11, %rsi
-	shlq	$8, %rsi
-	addq	%r9, %rsi
-	movb	(%rcx,%rsi), %r8b
-	movzbl	%r12b, %edi
-	xorq	%r13, %rdi
-	movb	(%rdi,%rsi), %bl
-	movb	%bl, (%rcx,%rsi)
-	movb	%r8b, (%rdi,%rsi)
-	incl	%eax
-	cmpl	$2560, %eax             ## imm = 0xA00
-	jne	LBB8_11
-## BB#12:                               ## %.loopexit4.us
-                                        ##   in Loop: Header=BB8_9 Depth=1
-	incq	%r11
-	movq	-16440(%rbp), %rax      ## 8-byte Reload
-	addq	$256, %rax              ## imm = 0x100
-	cmpq	$16, %r11
-	jne	LBB8_9
-## BB#13:                               ## %.us-lcssa.us.loopexit
+	movl	%r9d, %edi
+	subl	%esi, %edi
+	movslq	%edi, %rsi
+	movq	%r14, %rdi
+	shlq	$8, %rdi
+	addq	%r13, %rdi
+	movb	(%rsi,%rdi), %r11b
+	movzbl	%r8b, %ebx
+	xorq	%r10, %rbx
+	movb	(%rbx,%rdi), %cl
+	movb	%cl, (%rsi,%rdi)
+	movq	%r12, %rsi
+	movb	%r11b, (%rbx,%rdi)
+	incl	%r9d
+	cmpl	$2560, %r9d             ## imm = 0xA00
+	jne	LBB8_5
+## BB#6:                                ## %.loopexit13
+                                        ##   in Loop: Header=BB8_1 Depth=1
 	movq	%rdx, _seed.0(%rip)
-	movq	%r15, _seed.1(%rip)
-	movq	%r14, _passIndex(%rip)
-LBB8_14:                                ## %.us-lcssa.us
+	movq	%rax, _seed.1(%rip)
+	movq	%r15, _passIndex(%rip)
+	movq	-16448(%rbp), %r12      ## 8-byte Reload
+	jmp	LBB8_13
+	.align	4, 0x90
+LBB8_12:                                ## %._crit_edge.25
+                                        ##   in Loop: Header=BB8_1 Depth=1
+	movq	-16440(%rbp), %rdi      ## 8-byte Reload
+	callq	_rewind
+	pxor	%xmm1, %xmm1
+	movdqa	LCPI8_0(%rip), %xmm2    ## xmm2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
+	movq	_passPhrase@GOTPCREL(%rip), %rsi
+LBB8_13:                                ##   in Loop: Header=BB8_1 Depth=1
+	incq	%r14
+	addq	$256, %r12              ## imm = 0x100
+	cmpq	$16, %r14
+	jne	LBB8_1
+## BB#14:
+	movb	_usingKeyFile(%rip), %al
+	andb	$1, %al
+	je	LBB8_23
+## BB#15:
+	xorl	%ebx, %ebx
+	leaq	-16432(%rbp), %r14
+	leaq	_scramblingTablesOrder(%rip), %r15
+	movq	-16440(%rbp), %r12      ## 8-byte Reload
+	jmp	LBB8_18
+	.align	4, 0x90
+LBB8_17:                                ## %.lr.ph.split.us
+                                        ##   in Loop: Header=BB8_18 Depth=1
+	movq	%r12, %rdi
+	callq	_rewind
+LBB8_18:                                ## %.lr.ph.split.us
+                                        ## =>This Loop Header: Depth=1
+                                        ##     Child Loop BB8_22 Depth 2
+	movl	$1, %esi
+	movl	$16384, %edx            ## imm = 0x4000
+	movq	%r14, %rdi
+	movq	%r12, %rcx
+	callq	_fread
+	testl	%eax, %eax
+	je	LBB8_17
+## BB#19:                               ## %.preheader
+                                        ##   in Loop: Header=BB8_18 Depth=1
+	testl	%eax, %eax
+	jle	LBB8_16
+## BB#20:                               ## %.lr.ph17.preheader
+                                        ##   in Loop: Header=BB8_18 Depth=1
+	cltq
+	movslq	%ebx, %rbx
+	xorl	%ecx, %ecx
+	.align	4, 0x90
+LBB8_22:                                ## %.lr.ph17
+                                        ##   Parent Loop BB8_18 Depth=1
+                                        ## =>  This Inner Loop Header: Depth=2
+	movb	-16432(%rbp,%rcx), %dl
+	andb	$15, %dl
+	movb	%dl, (%rbx,%r15)
+	cmpl	$16383, %ebx            ## imm = 0x3FFF
+	je	LBB8_23
+## BB#21:                               ##   in Loop: Header=BB8_22 Depth=2
+	incq	%rcx
+	incq	%rbx
+	cmpq	%rax, %rcx
+	jl	LBB8_22
+LBB8_16:                                ## %.loopexit
+                                        ##   in Loop: Header=BB8_18 Depth=1
+	cmpl	$16383, %ebx            ## imm = 0x3FFF
+	jle	LBB8_18
+LBB8_23:
 	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
 	movq	(%rax), %rax
 	cmpq	-48(%rbp), %rax
-	jne	LBB8_17
-## BB#15:                               ## %.us-lcssa.us
-	addq	$16408, %rsp            ## imm = 0x4018
+	jne	LBB8_25
+## BB#24:
+	addq	$16424, %rsp            ## imm = 0x4028
 	popq	%rbx
 	popq	%r12
 	popq	%r13
 	popq	%r14
 	popq	%r15
 	popq	%rbp
 	retq
-LBB8_17:                                ## %.us-lcssa.us
+LBB8_25:
 	callq	___stack_chk_fail
 	.cfi_endproc
 
 	.globl	_unscramble
 	.align	4, 0x90
@@ -731,10 +783,14 @@ Ltmp40:
 Ltmp41:
 	.cfi_offset %rbp, -16
 	movq	%rsp, %rbp
 Ltmp42:
 	.cfi_def_cfa_register %rbp
+	movb	_usingKeyFile(%rip), %al
+	andb	$1, %al
+	leaq	_scramblingTablesOrder(%rip), %r9
+	cmoveq	%rsi, %r9
 	movb	_isCodingInverted(%rip), %al
 	andb	$1, %al
 	je	LBB10_1
 ## BB#4:                                ## %.preheader
 	testl	%ecx, %ecx
@@ -742,43 +798,44 @@ Ltmp42:
 ## BB#5:
 	leaq	_scrambleAsciiTables(%rip), %r8
 	.align	4, 0x90
 LBB10_6:                                ## %.lr.ph
                                         ## =>This Inner Loop Header: Depth=1
-	movzbl	(%rsi), %r9d
-	movb	(%rdi), %al
-	xorb	%r9b, %al
-	movzbl	%al, %eax
-	andl	$15, %r9d
-	shlq	$8, %r9
-	addq	%r8, %r9
-	movb	(%rax,%r9), %al
+	movb	(%rsi), %al
+	xorb	(%rdi), %al
+	movzbl	%al, %r10d
+	movzbl	(%r9), %eax
+	andl	$15, %eax
+	shlq	$8, %rax
+	addq	%r8, %rax
+	movb	(%r10,%rax), %al
 	movb	%al, (%rdx)
 	incq	%rdi
 	incq	%rsi
+	incq	%r9
 	incq	%rdx
 	decl	%ecx
 	jne	LBB10_6
 	jmp	LBB10_7
-LBB10_1:                                ## %.preheader1
+LBB10_1:                                ## %.preheader2
 	testl	%ecx, %ecx
 	jle	LBB10_7
 ## BB#2:
 	leaq	_scrambleAsciiTables(%rip), %r8
 	.align	4, 0x90
-LBB10_3:                                ## %.lr.ph5
+LBB10_3:                                ## %.lr.ph6
                                         ## =>This Inner Loop Header: Depth=1
-	movzbl	(%rdi), %r9d
-	movzbl	(%rsi), %r10d
-	movl	%r10d, %eax
-	andl	$15, %eax
-	shlq	$8, %rax
-	addq	%r8, %rax
-	movb	(%r9,%rax), %al
-	xorb	%r10b, %al
+	movzbl	(%rdi), %r10d
+	movzbl	(%r9), %r11d
+	andl	$15, %r11d
+	shlq	$8, %r11
+	addq	%r8, %r11
+	movb	(%rsi), %al
+	xorb	(%r10,%r11), %al
 	movb	%al, (%rdx)
 	incq	%rdi
+	incq	%r9
 	incq	%rsi
 	incq	%rdx
 	decl	%ecx
 	jne	LBB10_3
 LBB10_7:                                ## %.loopexit
@@ -797,10 +854,14 @@ Ltmp43:
 Ltmp44:
 	.cfi_offset %rbp, -16
 	movq	%rsp, %rbp
 Ltmp45:
 	.cfi_def_cfa_register %rbp
+	movb	_usingKeyFile(%rip), %al
+	andb	$1, %al
+	leaq	_scramblingTablesOrder(%rip), %r9
+	cmoveq	%rsi, %r9
 	movb	_isCodingInverted(%rip), %al
 	andb	$1, %al
 	je	LBB11_1
 ## BB#4:                                ## %.preheader
 	testl	%ecx, %ecx
@@ -808,44 +869,45 @@ Ltmp45:
 ## BB#5:
 	leaq	_unscrambleAsciiTables(%rip), %r8
 	.align	4, 0x90
 LBB11_6:                                ## %.lr.ph
                                         ## =>This Inner Loop Header: Depth=1
-	movzbl	(%rdi), %r9d
-	movzbl	(%rsi), %r10d
-	movl	%r10d, %eax
-	andl	$15, %eax
-	shlq	$8, %rax
-	addq	%r8, %rax
-	movb	(%r9,%rax), %al
-	xorb	%r10b, %al
+	movzbl	(%rdi), %r10d
+	movzbl	(%r9), %r11d
+	andl	$15, %r11d
+	shlq	$8, %r11
+	addq	%r8, %r11
+	movb	(%rsi), %al
+	xorb	(%r10,%r11), %al
 	movb	%al, (%rdx)
 	incq	%rdi
+	incq	%r9
 	incq	%rsi
 	incq	%rdx
 	decl	%ecx
 	jne	LBB11_6
 	jmp	LBB11_7
-LBB11_1:                                ## %.preheader1
+LBB11_1:                                ## %.preheader2
 	testl	%ecx, %ecx
 	jle	LBB11_7
 ## BB#2:
 	leaq	_unscrambleAsciiTables(%rip), %r8
 	.align	4, 0x90
-LBB11_3:                                ## %.lr.ph5
+LBB11_3:                                ## %.lr.ph6
                                         ## =>This Inner Loop Header: Depth=1
-	movzbl	(%rsi), %r9d
-	movb	(%rdi), %al
-	xorb	%r9b, %al
-	movzbl	%al, %eax
-	andl	$15, %r9d
-	shlq	$8, %r9
-	addq	%r8, %r9
-	movb	(%rax,%r9), %al
+	movb	(%rsi), %al
+	xorb	(%rdi), %al
+	movzbl	%al, %r10d
+	movzbl	(%r9), %eax
+	andl	$15, %eax
+	shlq	$8, %rax
+	addq	%r8, %rax
+	movb	(%r10,%rax), %al
 	movb	%al, (%rdx)
 	incq	%rdi
 	incq	%rsi
+	incq	%r9
 	incq	%rdx
 	decl	%ecx
 	jne	LBB11_3
 LBB11_7:                                ## %.loopexit
 	popq	%rbp
@@ -1060,67 +1122,67 @@ Ltmp63:
 	.cfi_offset %r13, -40
 Ltmp64:
 	.cfi_offset %r14, -32
 Ltmp65:
 	.cfi_offset %r15, -24
-	movq	%rdi, %r14
+	movq	%rdi, %r15
 	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
 	movq	(%rax), %rax
 	movq	%rax, -48(%rbp)
-	movq	_fileName(%rip), %rbx
-	movq	%rbx, %rdi
+	movq	_fileName(%rip), %r14
+	movq	%r14, %rdi
 	callq	_strlen
 	incl	%eax
 	addq	$15, %rax
 	movabsq	$8589934576, %rcx       ## imm = 0x1FFFFFFF0
 	andq	%rax, %rcx
-	movq	%rsp, %r15
-	subq	%rcx, %r15
-	movq	%r15, %rsp
+	movq	%rsp, %rbx
+	subq	%rcx, %rbx
+	movq	%rbx, %rsp
 	leaq	-16432(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
 	movq	%rdi, %r13
 	callq	___bzero
 	leaq	-32816(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
 	callq	___bzero
 	leaq	-49200(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
 	callq	___bzero
-	leaq	L_.str(%rip), %rcx
+	leaq	L_.str.1(%rip), %rcx
 	leaq	_pathToMainFile(%rip), %r8
 	movl	$0, %esi
 	movq	$-1, %rdx
 	xorl	%eax, %eax
-	movq	%r15, %rdi
-	movq	%rbx, %r9
+	movq	%rbx, %rdi
+	movq	%r14, %r9
 	callq	___sprintf_chk
-	leaq	L_.str.1(%rip), %rsi
-	movq	%r15, %rdi
+	leaq	L_.str.2(%rip), %rsi
+	movq	%rbx, %rdi
 	callq	_fopen
 	movq	%rax, -49208(%rbp)      ## 8-byte Spill
 	testq	%rax, %rax
 	je	LBB14_52
 ## BB#1:
-	leaq	L_str(%rip), %rdi
+	leaq	L_str.35(%rip), %rdi
 	callq	_puts
 	movb	_scrambling(%rip), %bl
 	andb	$1, %bl
-	movq	%r14, %rdi
-	movq	%r14, %r12
+	movq	%r15, %rdi
+	movq	%r15, %r12
 	callq	_feof
 	testb	%bl, %bl
 	je	LBB14_2
 ## BB#12:                               ## %loadBar.exit.preheader
 	xorl	%r14d, %r14d
 	testl	%eax, %eax
 	movq	%r12, %rbx
 	movq	%rbx, -49216(%rbp)      ## 8-byte Spill
 	jne	LBB14_35
 ## BB#13:
-	leaq	-16432(%rbp), %r12
-	leaq	-32816(%rbp), %r13
+	leaq	-16432(%rbp), %r13
+	leaq	-32816(%rbp), %r12
 	movq	_passPhrase@GOTPCREL(%rip), %r15
 	.align	4, 0x90
 LBB14_14:                               ## %.lr.ph
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB14_16 Depth 2
@@ -1128,22 +1190,22 @@ LBB14_14:                               ## %.lr.ph
                                         ##     Child Loop BB14_23 Depth 2
                                         ##     Child Loop BB14_50 Depth 2
                                         ##     Child Loop BB14_47 Depth 2
 	movl	$1, %esi
 	movl	$16384, %edx            ## imm = 0x4000
-	movq	%r12, %rdi
+	movq	%r13, %rdi
 	movq	%rbx, %rcx
 	callq	_fread
 	testl	%eax, %eax
 	jle	LBB14_24
-## BB#15:                               ## %.lr.ph.i.30
+## BB#15:                               ## %.lr.ph.i.29
                                         ##   in Loop: Header=BB14_14 Depth=1
 	movq	_seed.0(%rip), %rdx
 	movq	_seed.1(%rip), %rcx
 	movq	_passIndex(%rip), %rsi
 	movl	%eax, %r8d
-	movq	%r13, %r9
+	movq	%r12, %r9
 	.align	4, 0x90
 LBB14_16:                               ##   Parent Loop BB14_14 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	leal	(%rdx,%rcx), %edi
 	xorq	%rdx, %rcx
@@ -1159,11 +1221,11 @@ LBB14_16:                               ##   Parent Loop BB14_14 Depth=1
 	incl	%esi
 	andl	$16383, %esi            ## imm = 0x3FFF
 	incq	%r9
 	decl	%r8d
 	jne	LBB14_16
-## BB#17:                               ## %.lr.ph.i.41.preheader
+## BB#17:                               ## %.lr.ph.i.40.preheader
                                         ##   in Loop: Header=BB14_14 Depth=1
 	movq	%rsi, _passIndex(%rip)
 	movq	%rdx, _seed.0(%rip)
 	movq	%rcx, _seed.1(%rip)
 	leal	-1(%rax), %ecx
@@ -1185,12 +1247,12 @@ LBB14_16:                               ##   Parent Loop BB14_14 Depth=1
 	incq	%rsi
 	movl	%eax, %edx
 	andl	$15, %edx
 	subq	%rdx, %rsi
 	leaq	-49200(%rbp), %rdi
-	movq	%r13, %rbx
-	movq	%r12, %rdx
+	movq	%r12, %rbx
+	movq	%r13, %rdx
 	.align	4, 0x90
 LBB14_20:                               ## %vector.body
                                         ##   Parent Loop BB14_14 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movapd	(%rbx), %xmm0
@@ -1205,19 +1267,19 @@ LBB14_20:                               ## %vector.body
                                         ##   in Loop: Header=BB14_14 Depth=1
 	testq	%r8, %r8
 	movq	%rcx, %rbx
 	je	LBB14_24
 	.align	4, 0x90
-LBB14_22:                               ## %.lr.ph.i.41.preheader87
+LBB14_22:                               ## %.lr.ph.i.40.preheader86
                                         ##   in Loop: Header=BB14_14 Depth=1
 	leaq	-49200(%rbp,%rbx), %rcx
 	leaq	-32816(%rbp,%rbx), %rdx
 	leaq	-16432(%rbp,%rbx), %rsi
 	movl	%eax, %edi
 	subl	%ebx, %edi
 	.align	4, 0x90
-LBB14_23:                               ## %.lr.ph.i.41
+LBB14_23:                               ## %.lr.ph.i.40
                                         ##   Parent Loop BB14_14 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movb	(%rdx), %bl
 	xorb	(%rsi), %bl
 	movb	%bl, (%rcx)
@@ -1254,18 +1316,18 @@ LBB14_26:                               ##   in Loop: Header=BB14_14 Depth=1
 	cltd
 	idivl	%ecx
 	testl	%edx, %edx
 	jne	LBB14_27
 ## BB#49:                               ##   in Loop: Header=BB14_14 Depth=1
-	movq	%r12, %r13
+	movq	%r13, %r12
 	cvtsi2ssl	%r14d, %xmm1
 	cvtsi2ssl	%ebx, %xmm0
 	divss	%xmm0, %xmm1
 	movss	%xmm1, -49228(%rbp)     ## 4-byte Spill
 	movaps	%xmm1, %xmm0
 	mulss	LCPI14_0(%rip), %xmm0
-	cvttss2si	%xmm0, %r12d
+	cvttss2si	%xmm0, %r13d
 	xorl	%edi, %edi
 	callq	_time
 	movq	_loadBar.startingTime(%rip), %rsi
 	movq	%rax, %rdi
 	callq	_difftime
@@ -1279,71 +1341,71 @@ LBB14_26:                               ##   in Loop: Header=BB14_14 Depth=1
 	mulsd	%xmm0, %xmm2
 	movsd	%xmm2, -49224(%rbp)     ## 8-byte Spill
 	mulss	LCPI14_3(%rip), %xmm3
 	cvttss2si	%xmm3, %esi
 	xorl	%eax, %eax
-	leaq	L_.str.28(%rip), %rdi
+	leaq	L_.str.29(%rip), %rdi
 	callq	_printf
-	testl	%r12d, %r12d
-	movl	%r12d, %ebx
+	testl	%r13d, %r13d
+	movl	%r13d, %ebx
 	jle	LBB14_46
 	.align	4, 0x90
-LBB14_50:                               ## %.lr.ph5.i.11
+LBB14_50:                               ## %.lr.ph5.i
                                         ##   Parent Loop BB14_14 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$61, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB14_50
 ## BB#45:                               ## %.preheader.i.10
                                         ##   in Loop: Header=BB14_14 Depth=1
-	cmpl	$49, %r12d
+	cmpl	$49, %r13d
 	jg	LBB14_48
-LBB14_46:                               ## %.lr.ph.i.14.preheader
+LBB14_46:                               ## %.lr.ph.i.13.preheader
                                         ##   in Loop: Header=BB14_14 Depth=1
 	movl	$50, %ebx
-	subl	%r12d, %ebx
+	subl	%r13d, %ebx
 	.align	4, 0x90
-LBB14_47:                               ## %.lr.ph.i.14
+LBB14_47:                               ## %.lr.ph.i.13
                                         ##   Parent Loop BB14_14 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$32, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB14_47
-LBB14_48:                               ## %._crit_edge.i.12
+LBB14_48:                               ## %._crit_edge.i.11
                                         ##   in Loop: Header=BB14_14 Depth=1
 	movb	$1, %al
-	leaq	L_.str.31(%rip), %rdi
+	leaq	L_.str.32(%rip), %rdi
 	movsd	-49224(%rbp), %xmm0     ## 8-byte Reload
                                         ## xmm0 = mem[0],zero
 	callq	_printf
 	movq	___stdoutp@GOTPCREL(%rip), %rax
 	movq	(%rax), %rdi
 	callq	_fflush
-	movq	%r13, %r12
-	leaq	-32816(%rbp), %r13
+	movq	%r12, %r13
+	leaq	-32816(%rbp), %r12
 LBB14_27:                               ## %loadBar.exit.backedge
                                         ##   in Loop: Header=BB14_14 Depth=1
 	movq	-49216(%rbp), %rbx      ## 8-byte Reload
 	movq	%rbx, %rdi
 	callq	_feof
 	testl	%eax, %eax
 	je	LBB14_14
 	jmp	LBB14_35
-LBB14_2:                                ## %loadBar.exit26.preheader
+LBB14_2:                                ## %loadBar.exit25.preheader
 	xorl	%r15d, %r15d
 	testl	%eax, %eax
 	movq	%r12, %rbx
 	movq	%rbx, -49216(%rbp)      ## 8-byte Spill
 	movq	%r13, %r14
 	jne	LBB14_35
 ## BB#3:
-	movq	_passPhrase@GOTPCREL(%rip), %r12
-	leaq	_scrambleAsciiTables(%rip), %r13
+	movq	_passPhrase@GOTPCREL(%rip), %r13
+	leaq	_scrambleAsciiTables(%rip), %r12
 	.align	4, 0x90
-LBB14_4:                                ## %.lr.ph51
+LBB14_4:                                ## %.lr.ph50
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB14_6 Depth 2
                                         ##     Child Loop BB14_11 Depth 2
                                         ##     Child Loop BB14_30 Depth 2
                                         ##     Child Loop BB14_44 Depth 2
@@ -1352,18 +1414,19 @@ LBB14_4:                                ## %.lr.ph51
 	movl	$16384, %edx            ## imm = 0x4000
 	movq	%r14, %rdi
 	movq	%rbx, %rcx
 	callq	_fread
 	testl	%eax, %eax
+	leaq	-32816(%rbp), %r11
 	jle	LBB14_8
 ## BB#5:                                ## %.lr.ph.i
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movq	_seed.0(%rip), %rdx
 	movq	_seed.1(%rip), %rcx
 	movq	_passIndex(%rip), %rsi
 	movl	%eax, %r8d
-	leaq	-32816(%rbp), %r9
+	movq	%r11, %r9
 	.align	4, 0x90
 LBB14_6:                                ##   Parent Loop BB14_4 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	leal	(%rdx,%rcx), %edi
 	xorq	%rdx, %rcx
@@ -1372,11 +1435,11 @@ LBB14_6:                                ##   Parent Loop BB14_4 Depth=1
 	movq	%rcx, %rdx
 	shlq	$14, %rdx
 	xorq	%rcx, %rdx
 	xorq	%rbx, %rdx
 	rolq	$36, %rcx
-	xorb	(%r12,%rsi), %dil
+	xorb	(%r13,%rsi), %dil
 	movb	%dil, (%r9)
 	incl	%esi
 	andl	$16383, %esi            ## imm = 0x3FFF
 	incq	%r9
 	decl	%r8d
@@ -1386,70 +1449,76 @@ LBB14_6:                                ##   Parent Loop BB14_4 Depth=1
 	movq	%rsi, _passIndex(%rip)
 	movq	%rdx, _seed.0(%rip)
 	movq	%rcx, _seed.1(%rip)
 LBB14_8:                                ## %fillBuffer.exit
                                         ##   in Loop: Header=BB14_4 Depth=1
-	movb	_isCodingInverted(%rip), %cl
+	movb	_usingKeyFile(%rip), %cl
 	andb	$1, %cl
+	movq	%r11, %rcx
+	leaq	_scramblingTablesOrder(%rip), %rdx
+	cmovneq	%rdx, %rcx
+	movb	_isCodingInverted(%rip), %dl
+	andb	$1, %dl
 	je	LBB14_9
 ## BB#28:                               ## %.preheader.i
                                         ##   in Loop: Header=BB14_4 Depth=1
 	testl	%eax, %eax
 	jle	LBB14_31
 ## BB#29:                               ## %.lr.ph.i.8.preheader
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movl	%eax, %r8d
-	movq	%r14, %rdx
-	leaq	-32816(%rbp), %rsi
-	leaq	-49200(%rbp), %rdi
+	movq	%r14, %rsi
+	movq	%r11, %rdi
+	leaq	-49200(%rbp), %rbx
 	.align	4, 0x90
 LBB14_30:                               ## %.lr.ph.i.8
                                         ##   Parent Loop BB14_4 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-	movzbl	(%rsi), %ebx
-	movb	(%rdx), %cl
-	xorb	%bl, %cl
-	movzbl	%cl, %ecx
-	andl	$15, %ebx
-	shlq	$8, %rbx
-	addq	%r13, %rbx
-	movb	(%rcx,%rbx), %cl
-	movb	%cl, (%rdi)
+	movb	(%rdi), %dl
+	xorb	(%rsi), %dl
+	movzbl	%dl, %r9d
+	movzbl	(%rcx), %edx
+	andl	$15, %edx
+	shlq	$8, %rdx
+	addq	%r12, %rdx
+	movb	(%r9,%rdx), %dl
+	movb	%dl, (%rbx)
+	incq	%rbx
 	incq	%rdi
 	incq	%rsi
-	incq	%rdx
+	incq	%rcx
 	decl	%r8d
 	jne	LBB14_30
 	jmp	LBB14_31
 	.align	4, 0x90
-LBB14_9:                                ## %.preheader1.i
+LBB14_9:                                ## %.preheader2.i
                                         ##   in Loop: Header=BB14_4 Depth=1
 	testl	%eax, %eax
 	jle	LBB14_31
-## BB#10:                               ## %.lr.ph5.i.preheader
+## BB#10:                               ## %.lr.ph6.i.preheader
                                         ##   in Loop: Header=BB14_4 Depth=1
-	movl	%eax, %ecx
-	movq	%r14, %rdx
-	leaq	-32816(%rbp), %rsi
-	leaq	-49200(%rbp), %rdi
+	movl	%eax, %r9d
+	movq	%r14, %r10
+	movq	%r11, %rdi
+	leaq	-49200(%rbp), %rsi
 	.align	4, 0x90
-LBB14_11:                               ## %.lr.ph5.i
+LBB14_11:                               ## %.lr.ph6.i
                                         ##   Parent Loop BB14_4 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-	movzbl	(%rdx), %r8d
-	movzbl	(%rsi), %r9d
-	movl	%r9d, %ebx
-	andl	$15, %ebx
-	shlq	$8, %rbx
-	addq	%r13, %rbx
-	movb	(%r8,%rbx), %bl
-	xorb	%r9b, %bl
-	movb	%bl, (%rdi)
-	incq	%rdi
+	movzbl	(%r10), %r8d
+	movzbl	(%rcx), %edx
+	andl	$15, %edx
+	shlq	$8, %rdx
+	addq	%r12, %rdx
+	movb	(%rdi), %bl
+	xorb	(%r8,%rdx), %bl
+	movb	%bl, (%rsi)
 	incq	%rsi
-	incq	%rdx
-	decl	%ecx
+	incq	%rdi
+	incq	%r10
+	incq	%rcx
+	decl	%r9d
 	jne	LBB14_11
 LBB14_31:                               ## %codingXOR.exit
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movslq	%eax, %rdx
 	movl	$1, %esi
@@ -1501,51 +1570,51 @@ LBB14_33:                               ##   in Loop: Header=BB14_4 Depth=1
 	mulsd	%xmm0, %xmm2
 	movsd	%xmm2, -49224(%rbp)     ## 8-byte Spill
 	mulss	LCPI14_3(%rip), %xmm3
 	cvttss2si	%xmm3, %esi
 	xorl	%eax, %eax
-	leaq	L_.str.28(%rip), %rdi
+	leaq	L_.str.29(%rip), %rdi
 	callq	_printf
 	testl	%r14d, %r14d
 	movl	%r14d, %ebx
 	jle	LBB14_40
 	.align	4, 0x90
-LBB14_44:                               ## %.lr.ph5.i.20
+LBB14_44:                               ## %.lr.ph5.i.19
                                         ##   Parent Loop BB14_4 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$61, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB14_44
-## BB#39:                               ## %.preheader.i.16
+## BB#39:                               ## %.preheader.i.15
                                         ##   in Loop: Header=BB14_4 Depth=1
 	cmpl	$49, %r14d
 	jg	LBB14_42
-LBB14_40:                               ## %.lr.ph.i.25.preheader
+LBB14_40:                               ## %.lr.ph.i.24.preheader
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movl	$50, %ebx
 	subl	%r14d, %ebx
 	.align	4, 0x90
-LBB14_41:                               ## %.lr.ph.i.25
+LBB14_41:                               ## %.lr.ph.i.24
                                         ##   Parent Loop BB14_4 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$32, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB14_41
-LBB14_42:                               ## %._crit_edge.i.21
+LBB14_42:                               ## %._crit_edge.i.20
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movb	$1, %al
-	leaq	L_.str.31(%rip), %rdi
+	leaq	L_.str.32(%rip), %rdi
 	movsd	-49224(%rbp), %xmm0     ## 8-byte Reload
                                         ## xmm0 = mem[0],zero
 	callq	_printf
 	movq	___stdoutp@GOTPCREL(%rip), %rax
 	movq	(%rax), %rdi
 	callq	_fflush
 	leaq	-16432(%rbp), %r14
-LBB14_34:                               ## %loadBar.exit26.backedge
+LBB14_34:                               ## %loadBar.exit25.backedge
                                         ##   in Loop: Header=BB14_4 Depth=1
 	movq	-49216(%rbp), %rbx      ## 8-byte Reload
 	movq	%rbx, %rdi
 	callq	_feof
 	testl	%eax, %eax
@@ -1592,13 +1661,13 @@ LBB14_37:
 	popq	%r14
 	popq	%r15
 	popq	%rbp
 	retq
 LBB14_52:
-	movq	%r15, %rdi
+	movq	%rbx, %rdi
 	callq	_perror
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movl	$1, %edi
 	callq	_exit
 LBB14_38:
 	callq	___stack_chk_fail
@@ -1655,13 +1724,13 @@ Ltmp73:
 	callq	_strlen
 	incl	%eax
 	addq	$15, %rax
 	movabsq	$8589934576, %rcx       ## imm = 0x1FFFFFFF0
 	andq	%rax, %rcx
-	movq	%rsp, %r12
-	subq	%rcx, %r12
-	movq	%r12, %rsp
+	movq	%rsp, %r15
+	subq	%rcx, %r15
+	movq	%r15, %rsp
 	leaq	-16432(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
 	callq	___bzero
 	leaq	-32816(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
@@ -1669,11 +1738,11 @@ Ltmp73:
 	leaq	-49200(%rbp), %rdi
 	movl	$16384, %esi            ## imm = 0x4000
 	callq	___bzero
 	leaq	_scrambleAsciiTables(%rip), %rax
 	xorl	%ebx, %ebx
-	leaq	_unscrambleAsciiTables(%rip), %r15
+	leaq	_unscrambleAsciiTables(%rip), %r12
 	.align	4, 0x90
 LBB15_1:                                ## %.preheader.i
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB15_2 Depth 2
 	movq	%rax, %rdx
@@ -1682,11 +1751,11 @@ LBB15_1:                                ## %.preheader.i
 LBB15_2:                                ##   Parent Loop BB15_1 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movzbl	(%rdx), %edi
 	movq	%rbx, %rcx
 	shlq	$8, %rcx
-	addq	%r15, %rcx
+	addq	%r12, %rcx
 	movb	%sil, (%rdi,%rcx)
 	incq	%rsi
 	incq	%rdx
 	cmpq	$256, %rsi              ## imm = 0x100
 	jne	LBB15_2
@@ -1694,30 +1763,30 @@ LBB15_2:                                ##   Parent Loop BB15_1 Depth=1
 	incq	%rbx
 	addq	$256, %rax              ## imm = 0x100
 	cmpq	$16, %rbx
 	jne	LBB15_1
 ## BB#4:                                ## %unscramble.exit
-	leaq	L_.str.4(%rip), %rcx
+	leaq	L_.str.5(%rip), %rcx
 	movl	$0, %esi
 	movq	$-1, %rdx
 	xorl	%eax, %eax
-	movq	%r12, %rdi
+	movq	%r15, %rdi
 	movq	%r14, %r8
 	callq	___sprintf_chk
 	leaq	_pathToMainFile(%rip), %r14
 	movl	$1000, %edx             ## imm = 0x3E8
 	movq	%r14, %rdi
-	movq	%r12, %rsi
+	movq	%r15, %rsi
 	callq	___strcat_chk
-	leaq	L_.str.1(%rip), %rsi
+	leaq	L_.str.2(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_fopen
 	movq	%rax, -49208(%rbp)      ## 8-byte Spill
 	testq	%rax, %rax
 	je	LBB15_54
 ## BB#5:
-	leaq	L_str.35(%rip), %rdi
+	leaq	L_str.37(%rip), %rdi
 	callq	_puts
 	movb	_scrambling(%rip), %bl
 	andb	$1, %bl
 	movq	%r13, %rdi
 	callq	_feof
@@ -1729,12 +1798,12 @@ LBB15_2:                                ##   Parent Loop BB15_1 Depth=1
 	testl	%eax, %eax
 	movq	%r13, %rbx
 	movq	%rbx, -49216(%rbp)      ## 8-byte Spill
 	jne	LBB15_39
 ## BB#17:
-	leaq	-16432(%rbp), %r12
-	leaq	-32816(%rbp), %r13
+	leaq	-16432(%rbp), %r13
+	leaq	-32816(%rbp), %r12
 	movq	_passPhrase@GOTPCREL(%rip), %r15
 	.align	4, 0x90
 LBB15_18:                               ## %.lr.ph
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB15_20 Depth 2
@@ -1742,22 +1811,22 @@ LBB15_18:                               ## %.lr.ph
                                         ##     Child Loop BB15_27 Depth 2
                                         ##     Child Loop BB15_52 Depth 2
                                         ##     Child Loop BB15_49 Depth 2
 	movl	$1, %esi
 	movl	$16384, %edx            ## imm = 0x4000
-	movq	%r12, %rdi
+	movq	%r13, %rdi
 	movq	%rbx, %rcx
 	callq	_fread
 	testl	%eax, %eax
 	jle	LBB15_28
-## BB#19:                               ## %.lr.ph.i.33
+## BB#19:                               ## %.lr.ph.i.32
                                         ##   in Loop: Header=BB15_18 Depth=1
 	movq	_seed.0(%rip), %rdx
 	movq	_seed.1(%rip), %rcx
 	movq	_passIndex(%rip), %rsi
 	movl	%eax, %r8d
-	movq	%r13, %r9
+	movq	%r12, %r9
 	.align	4, 0x90
 LBB15_20:                               ##   Parent Loop BB15_18 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	leal	(%rdx,%rcx), %edi
 	xorq	%rdx, %rcx
@@ -1773,11 +1842,11 @@ LBB15_20:                               ##   Parent Loop BB15_18 Depth=1
 	incl	%esi
 	andl	$16383, %esi            ## imm = 0x3FFF
 	incq	%r9
 	decl	%r8d
 	jne	LBB15_20
-## BB#21:                               ## %.lr.ph.i.44.preheader
+## BB#21:                               ## %.lr.ph.i.43.preheader
                                         ##   in Loop: Header=BB15_18 Depth=1
 	movq	%rsi, _passIndex(%rip)
 	movq	%rdx, _seed.0(%rip)
 	movq	%rcx, _seed.1(%rip)
 	leal	-1(%rax), %ecx
@@ -1799,12 +1868,12 @@ LBB15_20:                               ##   Parent Loop BB15_18 Depth=1
 	incq	%rsi
 	movl	%eax, %edx
 	andl	$15, %edx
 	subq	%rdx, %rsi
 	leaq	-49200(%rbp), %rdi
-	movq	%r13, %rbx
-	movq	%r12, %rdx
+	movq	%r12, %rbx
+	movq	%r13, %rdx
 	.align	4, 0x90
 LBB15_24:                               ## %vector.body
                                         ##   Parent Loop BB15_18 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movapd	(%rbx), %xmm0
@@ -1819,19 +1888,19 @@ LBB15_24:                               ## %vector.body
                                         ##   in Loop: Header=BB15_18 Depth=1
 	testq	%r8, %r8
 	movq	%rcx, %rbx
 	je	LBB15_28
 	.align	4, 0x90
-LBB15_26:                               ## %.lr.ph.i.44.preheader90
+LBB15_26:                               ## %.lr.ph.i.43.preheader89
                                         ##   in Loop: Header=BB15_18 Depth=1
 	leaq	-49200(%rbp,%rbx), %rcx
 	leaq	-32816(%rbp,%rbx), %rdx
 	leaq	-16432(%rbp,%rbx), %rsi
 	movl	%eax, %edi
 	subl	%ebx, %edi
 	.align	4, 0x90
-LBB15_27:                               ## %.lr.ph.i.44
+LBB15_27:                               ## %.lr.ph.i.43
                                         ##   Parent Loop BB15_18 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movb	(%rdx), %bl
 	xorb	(%rsi), %bl
 	movb	%bl, (%rcx)
@@ -1868,18 +1937,18 @@ LBB15_30:                               ##   in Loop: Header=BB15_18 Depth=1
 	cltd
 	idivl	%ecx
 	testl	%edx, %edx
 	jne	LBB15_31
 ## BB#51:                               ##   in Loop: Header=BB15_18 Depth=1
-	movq	%r12, %r13
+	movq	%r13, %r12
 	cvtsi2ssl	%r14d, %xmm1
 	cvtsi2ssl	%ebx, %xmm0
 	divss	%xmm0, %xmm1
 	movss	%xmm1, -49228(%rbp)     ## 4-byte Spill
 	movaps	%xmm1, %xmm0
 	mulss	LCPI15_0(%rip), %xmm0
-	cvttss2si	%xmm0, %r12d
+	cvttss2si	%xmm0, %r13d
 	xorl	%edi, %edi
 	callq	_time
 	movq	_loadBar.startingTime(%rip), %rsi
 	movq	%rax, %rdi
 	callq	_difftime
@@ -1893,14 +1962,14 @@ LBB15_30:                               ##   in Loop: Header=BB15_18 Depth=1
 	mulsd	%xmm0, %xmm2
 	movsd	%xmm2, -49224(%rbp)     ## 8-byte Spill
 	mulss	LCPI15_3(%rip), %xmm3
 	cvttss2si	%xmm3, %esi
 	xorl	%eax, %eax
-	leaq	L_.str.28(%rip), %rdi
+	leaq	L_.str.29(%rip), %rdi
 	callq	_printf
-	testl	%r12d, %r12d
-	movl	%r12d, %ebx
+	testl	%r13d, %r13d
+	movl	%r13d, %ebx
 	jle	LBB15_48
 	.align	4, 0x90
 LBB15_52:                               ## %.lr.ph5.i
                                         ##   Parent Loop BB15_18 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
@@ -1908,16 +1977,16 @@ LBB15_52:                               ## %.lr.ph5.i
 	callq	_putchar
 	decl	%ebx
 	jne	LBB15_52
 ## BB#47:                               ## %.preheader.i.3
                                         ##   in Loop: Header=BB15_18 Depth=1
-	cmpl	$49, %r12d
+	cmpl	$49, %r13d
 	jg	LBB15_50
 LBB15_48:                               ## %.lr.ph.i.preheader
                                         ##   in Loop: Header=BB15_18 Depth=1
 	movl	$50, %ebx
-	subl	%r12d, %ebx
+	subl	%r13d, %ebx
 	.align	4, 0x90
 LBB15_49:                               ## %.lr.ph.i
                                         ##   Parent Loop BB15_18 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$32, %edi
@@ -1925,37 +1994,37 @@ LBB15_49:                               ## %.lr.ph.i
 	decl	%ebx
 	jne	LBB15_49
 LBB15_50:                               ## %._crit_edge.i
                                         ##   in Loop: Header=BB15_18 Depth=1
 	movb	$1, %al
-	leaq	L_.str.31(%rip), %rdi
+	leaq	L_.str.32(%rip), %rdi
 	movsd	-49224(%rbp), %xmm0     ## 8-byte Reload
                                         ## xmm0 = mem[0],zero
 	callq	_printf
 	movq	___stdoutp@GOTPCREL(%rip), %rax
 	movq	(%rax), %rdi
 	callq	_fflush
-	movq	%r13, %r12
-	leaq	-32816(%rbp), %r13
+	movq	%r12, %r13
+	leaq	-32816(%rbp), %r12
 LBB15_31:                               ## %loadBar.exit.backedge
                                         ##   in Loop: Header=BB15_18 Depth=1
 	movq	-49216(%rbp), %rbx      ## 8-byte Reload
 	movq	%rbx, %rdi
 	callq	_feof
 	testl	%eax, %eax
 	je	LBB15_18
 	jmp	LBB15_39
-LBB15_6:                                ## %loadBar.exit29.preheader
-	xorl	%r12d, %r12d
+LBB15_6:                                ## %loadBar.exit28.preheader
+	xorl	%r15d, %r15d
 	testl	%eax, %eax
 	movq	%r13, %rbx
 	movq	%rbx, -49216(%rbp)      ## 8-byte Spill
 	jne	LBB15_39
 ## BB#7:
 	movq	_passPhrase@GOTPCREL(%rip), %r13
 	.align	4, 0x90
-LBB15_8:                                ## %.lr.ph54
+LBB15_8:                                ## %.lr.ph53
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB15_10 Depth 2
                                         ##     Child Loop BB15_15 Depth 2
                                         ##     Child Loop BB15_34 Depth 2
                                         ##     Child Loop BB15_46 Depth 2
@@ -1964,18 +2033,19 @@ LBB15_8:                                ## %.lr.ph54
 	movl	$16384, %edx            ## imm = 0x4000
 	movq	%r14, %rdi
 	movq	%rbx, %rcx
 	callq	_fread
 	testl	%eax, %eax
+	leaq	-32816(%rbp), %r11
 	jle	LBB15_12
 ## BB#9:                                ## %.lr.ph.i.5
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movq	_seed.0(%rip), %rdx
 	movq	_seed.1(%rip), %rcx
 	movq	_passIndex(%rip), %rsi
 	movl	%eax, %r8d
-	leaq	-32816(%rbp), %r9
+	movq	%r11, %r9
 	.align	4, 0x90
 LBB15_10:                               ##   Parent Loop BB15_8 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	leal	(%rdx,%rcx), %edi
 	xorq	%rdx, %rcx
@@ -1998,79 +2068,85 @@ LBB15_10:                               ##   Parent Loop BB15_8 Depth=1
 	movq	%rsi, _passIndex(%rip)
 	movq	%rdx, _seed.0(%rip)
 	movq	%rcx, _seed.1(%rip)
 LBB15_12:                               ## %fillBuffer.exit
                                         ##   in Loop: Header=BB15_8 Depth=1
-	movb	_isCodingInverted(%rip), %cl
+	movb	_usingKeyFile(%rip), %cl
 	andb	$1, %cl
+	movq	%r11, %rsi
+	leaq	_scramblingTablesOrder(%rip), %rcx
+	cmovneq	%rcx, %rsi
+	movb	_isCodingInverted(%rip), %dl
+	andb	$1, %dl
 	je	LBB15_13
 ## BB#32:                               ## %.preheader.i.11
                                         ##   in Loop: Header=BB15_8 Depth=1
 	testl	%eax, %eax
 	jle	LBB15_35
 ## BB#33:                               ## %.lr.ph.i.16.preheader
                                         ##   in Loop: Header=BB15_8 Depth=1
-	movl	%eax, %ecx
-	movq	%r14, %rdx
-	leaq	-32816(%rbp), %rsi
-	leaq	-49200(%rbp), %rdi
+	movl	%eax, %r9d
+	movq	%r14, %r10
+	movq	%r11, %rdi
+	leaq	-49200(%rbp), %rbx
 	.align	4, 0x90
 LBB15_34:                               ## %.lr.ph.i.16
                                         ##   Parent Loop BB15_8 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-	movzbl	(%rdx), %r8d
-	movzbl	(%rsi), %r9d
-	movl	%r9d, %ebx
-	andl	$15, %ebx
-	shlq	$8, %rbx
-	addq	%r15, %rbx
-	movb	(%r8,%rbx), %bl
-	xorb	%r9b, %bl
-	movb	%bl, (%rdi)
+	movzbl	(%r10), %r8d
+	movzbl	(%rsi), %edx
+	andl	$15, %edx
+	shlq	$8, %rdx
+	addq	%r12, %rdx
+	movb	(%rdi), %cl
+	xorb	(%r8,%rdx), %cl
+	movb	%cl, (%rbx)
+	incq	%rbx
 	incq	%rdi
+	incq	%r10
 	incq	%rsi
-	incq	%rdx
-	decl	%ecx
+	decl	%r9d
 	jne	LBB15_34
 	jmp	LBB15_35
 	.align	4, 0x90
-LBB15_13:                               ## %.preheader1.i
+LBB15_13:                               ## %.preheader2.i
                                         ##   in Loop: Header=BB15_8 Depth=1
 	testl	%eax, %eax
 	jle	LBB15_35
-## BB#14:                               ## %.lr.ph5.i.17.preheader
+## BB#14:                               ## %.lr.ph6.i.preheader
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movl	%eax, %r8d
-	movq	%r14, %rdx
-	leaq	-32816(%rbp), %rsi
-	leaq	-49200(%rbp), %rdi
+	movq	%r14, %rcx
+	movq	%r11, %rdi
+	leaq	-49200(%rbp), %rbx
 	.align	4, 0x90
-LBB15_15:                               ## %.lr.ph5.i.17
+LBB15_15:                               ## %.lr.ph6.i
                                         ##   Parent Loop BB15_8 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-	movzbl	(%rsi), %ebx
-	movb	(%rdx), %cl
-	xorb	%bl, %cl
-	movzbl	%cl, %ecx
-	andl	$15, %ebx
-	shlq	$8, %rbx
-	addq	%r15, %rbx
-	movb	(%rcx,%rbx), %cl
-	movb	%cl, (%rdi)
+	movb	(%rdi), %dl
+	xorb	(%rcx), %dl
+	movzbl	%dl, %r9d
+	movzbl	(%rsi), %edx
+	andl	$15, %edx
+	shlq	$8, %rdx
+	addq	%r12, %rdx
+	movb	(%r9,%rdx), %dl
+	movb	%dl, (%rbx)
+	incq	%rbx
 	incq	%rdi
+	incq	%rcx
 	incq	%rsi
-	incq	%rdx
 	decl	%r8d
 	jne	LBB15_15
 LBB15_35:                               ## %decodingXOR.exit
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movslq	%eax, %rdx
 	movl	$1, %esi
 	leaq	-49200(%rbp), %rdi
 	movq	-49208(%rbp), %rcx      ## 8-byte Reload
 	callq	_fwrite
-	incq	%r12
+	incq	%r15
 	movl	_numberOfBuffer(%rip), %ebx
 	movb	_loadBar.firstCall(%rip), %al
 	andb	$1, %al
 	jne	LBB15_37
 ## BB#36:                               ##   in Loop: Header=BB15_8 Depth=1
@@ -2083,17 +2159,17 @@ LBB15_37:                               ##   in Loop: Header=BB15_8 Depth=1
 	imulq	$1374389535, %rax, %rax ## imm = 0x51EB851F
 	movq	%rax, %rcx
 	sarq	$37, %rcx
 	shrq	$63, %rax
 	leal	1(%rcx,%rax), %ecx
-	movl	%r12d, %eax
+	movl	%r15d, %eax
 	cltd
 	idivl	%ecx
 	testl	%edx, %edx
 	jne	LBB15_38
 ## BB#45:                               ##   in Loop: Header=BB15_8 Depth=1
-	cvtsi2ssl	%r12d, %xmm1
+	cvtsi2ssl	%r15d, %xmm1
 	cvtsi2ssl	%ebx, %xmm0
 	divss	%xmm0, %xmm1
 	movss	%xmm1, -49228(%rbp)     ## 4-byte Spill
 	movaps	%xmm1, %xmm0
 	mulss	LCPI15_0(%rip), %xmm0
@@ -2113,51 +2189,51 @@ LBB15_37:                               ##   in Loop: Header=BB15_8 Depth=1
 	mulsd	%xmm0, %xmm2
 	movsd	%xmm2, -49224(%rbp)     ## 8-byte Spill
 	mulss	LCPI15_3(%rip), %xmm3
 	cvttss2si	%xmm3, %esi
 	xorl	%eax, %eax
-	leaq	L_.str.28(%rip), %rdi
+	leaq	L_.str.29(%rip), %rdi
 	callq	_printf
 	testl	%r14d, %r14d
 	movl	%r14d, %ebx
 	jle	LBB15_42
 	.align	4, 0x90
-LBB15_46:                               ## %.lr.ph5.i.23
+LBB15_46:                               ## %.lr.ph5.i.22
                                         ##   Parent Loop BB15_8 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$61, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB15_46
-## BB#41:                               ## %.preheader.i.19
+## BB#41:                               ## %.preheader.i.18
                                         ##   in Loop: Header=BB15_8 Depth=1
 	cmpl	$49, %r14d
 	jg	LBB15_44
-LBB15_42:                               ## %.lr.ph.i.28.preheader
+LBB15_42:                               ## %.lr.ph.i.27.preheader
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movl	$50, %ebx
 	subl	%r14d, %ebx
 	.align	4, 0x90
-LBB15_43:                               ## %.lr.ph.i.28
+LBB15_43:                               ## %.lr.ph.i.27
                                         ##   Parent Loop BB15_8 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
 	movl	$32, %edi
 	callq	_putchar
 	decl	%ebx
 	jne	LBB15_43
-LBB15_44:                               ## %._crit_edge.i.24
+LBB15_44:                               ## %._crit_edge.i.23
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movb	$1, %al
-	leaq	L_.str.31(%rip), %rdi
+	leaq	L_.str.32(%rip), %rdi
 	movsd	-49224(%rbp), %xmm0     ## 8-byte Reload
                                         ## xmm0 = mem[0],zero
 	callq	_printf
 	movq	___stdoutp@GOTPCREL(%rip), %rax
 	movq	(%rax), %rdi
 	callq	_fflush
 	leaq	-16432(%rbp), %r14
-LBB15_38:                               ## %loadBar.exit29.backedge
+LBB15_38:                               ## %loadBar.exit28.backedge
                                         ##   in Loop: Header=BB15_8 Depth=1
 	movq	-49216(%rbp), %rbx      ## 8-byte Reload
 	movq	%rbx, %rdi
 	callq	_feof
 	testl	%eax, %eax
@@ -2177,13 +2253,13 @@ LBB15_39:                               ## %.loopexit
 	popq	%r14
 	popq	%r15
 	popq	%rbp
 	retq
 LBB15_54:
-	movq	%r12, %rdi
+	movq	%r15, %rdi
 	callq	_perror
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movl	$1, %edi
 	callq	_exit
 LBB15_40:                               ## %.loopexit
 	callq	___stack_chk_fail
@@ -2220,18 +2296,18 @@ Ltmp76:
 LBB16_1:
 	callq	___error
 	cmpl	$2, (%rax)
 	jne	LBB16_4
 ## BB#2:
-	leaq	L_str.38(%rip), %rdi
+	leaq	L_str.40(%rip), %rdi
 	callq	_puts
 	jmp	LBB16_3
 LBB16_4:
-	leaq	L_.str.7(%rip), %rdi
+	leaq	L_.str.8(%rip), %rdi
 	callq	_perror
 LBB16_3:
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movl	$1, %edi
 	callq	_exit
 	.cfi_endproc
 
@@ -2290,97 +2366,99 @@ LBB17_2:
 LBB17_3:
 	cmpl	$1, %r15d
 	jle	LBB17_87
 ## BB#4:
 	cmpl	$5, %r15d
-	jge	LBB17_21
+	jge	LBB17_88
 ## BB#5:
 	movq	8(%r13), %rbx
-	leaq	L_.str.9(%rip), %rsi
+	leaq	L_.str.10(%rip), %rsi
 	movq	%rbx, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
-	je	LBB17_88
+	je	LBB17_89
 ## BB#6:
-	leaq	L_.str.10(%rip), %rsi
+	leaq	L_.str.11(%rip), %rsi
 	movq	%rbx, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
-	je	LBB17_88
+	je	LBB17_89
 ## BB#7:
 	xorl	%r14d, %r14d
 	cmpl	$3, %r15d
 	jl	LBB17_23
 ## BB#8:
 	movq	16(%r13), %r14
-	leaq	L_.str.11(%rip), %rsi
+	leaq	L_.str.12(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
 	je	LBB17_10
 ## BB#9:
-	leaq	L_.str.12(%rip), %rsi
+	leaq	L_.str.13(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
 	je	LBB17_10
-## BB#14:
-	leaq	L_.str.15(%rip), %rsi
+## BB#15:
+	leaq	L_.str.16(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
-	je	LBB17_16
-## BB#15:
-	leaq	L_.str.16(%rip), %rsi
+	je	LBB17_17
+## BB#16:
+	leaq	L_.str.17(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_strcmp
 	testl	%eax, %eax
-	je	LBB17_16
-## BB#18:
-	leaq	L_.str.13(%rip), %rsi
+	je	LBB17_17
+## BB#19:
+	leaq	L_.str.14(%rip), %rsi
 	movq	%r14, %rdi
 	callq	_fopen
 	movq	%rax, %r14
 	testq	%r14, %r14
-	je	LBB17_19
-## BB#20:
+	je	LBB17_20
+## BB#21:
 	cmpl	$4, %r15d
-	jl	LBB17_23
-LBB17_21:
-	leaq	L_str.50(%rip), %rdi
+	jl	LBB17_22
+LBB17_88:
+	leaq	L_str.52(%rip), %rdi
 	callq	_puts
 	movl	$1, %edi
 	callq	_usage
 LBB17_10:
 	movb	$1, _scrambling(%rip)
 	xorl	%r14d, %r14d
 	cmpl	$4, %r15d
 	jl	LBB17_23
 ## BB#11:
 	movq	24(%r13), %rdi
-	leaq	L_.str.13(%rip), %rsi
+	leaq	L_.str.14(%rip), %rsi
 	callq	_fopen
 	testq	%rax, %rax
 	je	LBB17_12
-## BB#22:
-	leaq	L_str.49(%rip), %rdi
+## BB#14:
+	leaq	L_str.51(%rip), %rdi
 	callq	_puts
 	xorl	%r14d, %r14d
 	jmp	LBB17_23
-LBB17_16:
+LBB17_17:
 	movb	$1, _isCodingInverted(%rip)
 	xorl	%r14d, %r14d
 	cmpl	$4, %r15d
 	jl	LBB17_23
-## BB#17:
+## BB#18:
 	movq	24(%r13), %rdi
-	leaq	L_.str.13(%rip), %rsi
+	leaq	L_.str.14(%rip), %rsi
 	callq	_fopen
 	movq	%rax, %r14
 	testq	%r14, %r14
 	je	LBB17_12
-LBB17_23:
+LBB17_22:
+	movb	$1, _usingKeyFile(%rip)
+LBB17_23:                               ## %.thread
 	movq	8(%r13), %rbx
 	movq	%rbx, %rdi
 	callq	_strlen
 	movzbl	-1(%rax,%rbx), %ecx
 	cmpl	$47, %ecx
@@ -2405,11 +2483,11 @@ LBB17_27:
 	je	LBB17_48
 ## BB#28:
 	leaq	-1056(%rbp), %rdi
 	movl	$1008, %esi             ## imm = 0x3F0
 	callq	___bzero
-	leaq	L_.str.18(%rip), %rdi
+	leaq	L_.str.19(%rip), %rdi
 	xorl	%eax, %eax
 	callq	_printf
 	movq	___stdoutp@GOTPCREL(%rip), %rax
 	movq	(%rax), %rdi
 	callq	_fflush
@@ -2512,11 +2590,11 @@ LBB17_36:
 	callq	_strlen
 	leaq	5(%rax), %rsi
 	movl	$1, %edi
 	callq	_calloc
 	movq	%rax, %r12
-	leaq	L_.str.19(%rip), %rcx
+	leaq	L_.str.20(%rip), %rcx
 	movl	$0, %esi
 	movq	$-1, %rdx
 	xorl	%eax, %eax
 	movq	%r12, %rdi
 	movq	%r15, %r8
@@ -2530,11 +2608,11 @@ LBB17_36:
 	movq	%r12, %rdi
 	callq	_processTarString
 	movq	%rax, %rbx
 	subq	$16, %rsp
 	movq	%r15, (%rsp)
-	leaq	L_.str.20(%rip), %rcx
+	leaq	L_.str.21(%rip), %rcx
 	leaq	-1056(%rbp), %r14
 	movl	$0, %esi
 	movl	$1008, %edx             ## imm = 0x3F0
 	xorl	%eax, %eax
 	movq	%r14, %rdi
@@ -2551,11 +2629,11 @@ LBB17_36:
 	movq	%r14, %rdi
 	callq	_system
 	testl	%eax, %eax
 	jne	LBB17_37
 ## BB#38:
-	leaq	L_str.42(%rip), %rdi
+	leaq	L_str.44(%rip), %rdi
 	callq	_puts
 	movq	%r12, _fileName(%rip)
 	leaq	_pathToMainFile(%rip), %r14
 	movq	%r14, %rdi
 	callq	_strlen
@@ -2566,35 +2644,35 @@ LBB17_36:
 	leaq	15(%rax,%rbx), %rax
 	andq	$-16, %rax
 	movq	%rsp, %r13
 	subq	%rax, %r13
 	movq	%r13, %rsp
-	leaq	L_.str.23(%rip), %rcx
+	leaq	L_.str.24(%rip), %rcx
 	movl	$0, %esi
 	movq	$-1, %rdx
 	xorl	%eax, %eax
 	movq	%r13, %rdi
 	movq	%r14, %r8
 	movq	%r12, %r9
 	callq	___sprintf_chk
-	leaq	L_.str.13(%rip), %rsi
+	leaq	L_.str.14(%rip), %rsi
 	movq	%r13, %rdi
 	callq	_fopen
 	movq	%rax, %rbx
 	testq	%rbx, %rbx
 	je	LBB17_47
-## BB#39:                               ## %.thread
+## BB#39:                               ## %.thread20
 	movq	%r12, -1080(%rbp)       ## 8-byte Spill
 	movq	%r15, %rsp
 	movq	-1088(%rbp), %r12       ## 8-byte Reload
 	movq	-1064(%rbp), %rcx       ## 8-byte Reload
 	jmp	LBB17_40
 LBB17_50:
 	movq	%r14, -1072(%rbp)       ## 8-byte Spill
 	movq	%rbx, _fileName(%rip)
 LBB17_51:
-	leaq	L_.str.13(%rip), %rsi
+	leaq	L_.str.14(%rip), %rsi
 	movq	%rbx, %rdi
 	callq	_fopen
 	movq	%rax, %rbx
 	xorl	%ecx, %ecx
 	testq	%rbx, %rbx
@@ -2627,14 +2705,14 @@ LBB17_40:
 	addq	%rax, %rcx
 	testq	%rcx, %rcx
 	movl	$1, %eax
 	cmovgq	%rcx, %rax
 	movq	%rax, _numberOfBuffer(%rip)
-	leaq	L_.str.24(%rip), %r14
+	leaq	L_.str.25(%rip), %r14
 	movq	___stdinp@GOTPCREL(%rip), %r15
 	leaq	-1056(%rbp), %rbx
-	leaq	L_.str.25(%rip), %r13
+	leaq	L_.str.26(%rip), %r13
 	xorl	%r12d, %r12d
 	.align	4, 0x90
 LBB17_41:                               ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB17_53 Depth 2
                                         ##     Child Loop BB17_56 Depth 2
@@ -2711,14 +2789,14 @@ LBB17_59:                               ## %readString.exit
 	je	LBB17_62
 ## BB#60:                               ## %readString.exit
                                         ##   in Loop: Header=BB17_41 Depth=1
 	cmpl	$99, %eax
 	jne	LBB17_41
-LBB17_61:                               ## %.thread20.loopexit
+LBB17_61:                               ## %.thread22.loopexit
 	movb	$1, %r12b
-LBB17_62:                               ## %.thread20
-	leaq	L_.str.26(%rip), %rdi
+LBB17_62:                               ## %.thread22
+	leaq	L_.str.27(%rip), %rdi
 	xorl	%ebx, %ebx
 	xorl	%eax, %eax
 	callq	_printf
 	movq	(%r15), %rdx
 	movq	_passPhrase@GOTPCREL(%rip), %r14
@@ -2766,11 +2844,11 @@ LBB17_69:                               ## %.preheader3.i.15
 ## BB#70:                               ## %.preheader3.i.15
                                         ##   in Loop: Header=BB17_69 Depth=1
 	cmpl	$10, %eax
 	jne	LBB17_71
 LBB17_73:                               ## %readString.exit19
-	leaq	L_.str.25(%rip), %rdi
+	leaq	L_.str.26(%rip), %rdi
 	xorl	%eax, %eax
 	callq	_printf
 	movw	(%r14), %di
 	testb	%dil, %dil
 	movabsq	$-7723592293110705685, %rax ## imm = 0x94D049BB133111EB
@@ -2839,11 +2917,11 @@ LBB17_79:
 	movq	-1088(%rbp), %rbx       ## 8-byte Reload
 	movq	%rbx, %rdi
 	callq	_decode
 LBB17_80:
 	movq	-1064(%rbp), %r14       ## 8-byte Reload
-	leaq	L_str.40(%rip), %rdi
+	leaq	L_str.42(%rip), %rdi
 	callq	_puts
 	movq	%rbx, %rdi
 	callq	_fclose
 	testq	%r15, %r15
 	je	LBB17_82
@@ -2860,11 +2938,11 @@ LBB17_84:
 	xorl	%eax, %eax
 LBB17_85:
 	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
 	movq	(%rcx), %rcx
 	cmpq	-48(%rbp), %rcx
-	jne	LBB17_89
+	jne	LBB17_90
 ## BB#86:
 	leaq	-40(%rbp), %rsp
 	popq	%rbx
 	popq	%r12
 	popq	%r13
@@ -2878,45 +2956,45 @@ LBB17_32:
 	movq	%rbx, -1064(%rbp)       ## 8-byte Spill
 	jmp	LBB17_36
 LBB17_47:
 	movq	%r13, %rdi
 	callq	_perror
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movq	%r15, %rsp
 	movl	$1, %eax
 	jmp	LBB17_85
 LBB17_52:
 	movq	8(%r13), %rdi
 	callq	_perror
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movl	$1, %eax
 	jmp	LBB17_85
-LBB17_88:
+LBB17_89:
 	xorl	%edi, %edi
 	callq	_usage
 LBB17_87:
 	movl	$1, %edi
 	callq	_usage
-LBB17_89:
+LBB17_90:
 	callq	___stack_chk_fail
 LBB17_37:
-	leaq	L_str.44(%rip), %rdi
+	leaq	L_str.46(%rip), %rdi
 	jmp	LBB17_26
 LBB17_25:
-	leaq	L_str.46(%rip), %rdi
+	leaq	L_str.48(%rip), %rdi
 LBB17_26:
 	callq	_puts
-	leaq	L_str.47(%rip), %rdi
+	leaq	L_str.49(%rip), %rdi
 	callq	_puts
 	movl	$1, %edi
 	callq	_exit
 LBB17_12:
 	movq	24(%r13), %rdi
 	jmp	LBB17_13
-LBB17_19:
+LBB17_20:
 	movq	16(%r13), %rdi
 LBB17_13:
 	callq	_perror
 	movl	$1, %edi
 	callq	_usage
@@ -2948,20 +3026,20 @@ Ltmp88:
 ## BB#1:
 	movq	%rdx, 24(%rsp)
 	movq	%rdx, 16(%rsp)
 	movq	%rdx, 8(%rsp)
 	movq	%rdx, (%rsp)
-	leaq	L_.str.32(%rip), %rsi
+	leaq	L_.str.33(%rip), %rsi
 	xorl	%eax, %eax
 	movq	%rdx, %r8
 	movq	%rdx, %r9
 	movq	%rdx, %rcx
 	callq	_fprintf
 	movl	%ebx, %edi
 	callq	_exit
 LBB18_2:
-	leaq	L_.str.33(%rip), %rsi
+	leaq	L_.str.34(%rip), %rsi
 	xorl	%eax, %eax
 	callq	_fprintf
 	movl	%ebx, %edi
 	callq	_exit
 	.cfi_endproc
@@ -2969,129 +3047,135 @@ LBB18_2:
 	.globl	_passIndex              ## @passIndex
 .zerofill __DATA,__common,_passIndex,8,3
 .zerofill __DATA,__bss,_seed.0,8,4      ## @seed.0
 .zerofill __DATA,__bss,_seed.1,8,3      ## @seed.1
 .zerofill __DATA,__bss,_scrambleAsciiTables,4096,4 ## @scrambleAsciiTables
+.zerofill __DATA,__bss,_usingKeyFile,1,0 ## @usingKeyFile
 	.comm	_passPhrase,16384,4     ## @passPhrase
+.zerofill __DATA,__bss,_scramblingTablesOrder,16384,4 ## @scramblingTablesOrder
 .zerofill __DATA,__bss,_unscrambleAsciiTables,4096,4 ## @unscrambleAsciiTables
 .zerofill __DATA,__bss,_isCodingInverted,1,0 ## @isCodingInverted
 .zerofill __DATA,__bss,_fileName,8,3    ## @fileName
 	.section	__TEXT,__cstring,cstring_literals
-L_.str:                                 ## @.str
+L_.str.1:                               ## @.str.1
 	.asciz	"%sx%s"
 
 	.section	__DATA,__data
 	.align	4                       ## @pathToMainFile
 _pathToMainFile:
 	.asciz	"./\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
 
 	.section	__TEXT,__cstring,cstring_literals
-L_.str.1:                               ## @.str.1
+L_.str.2:                               ## @.str.2
 	.asciz	"w+"
 
 .zerofill __DATA,__bss,_scrambling,1,0  ## @scrambling
 .zerofill __DATA,__bss,_numberOfBuffer,8,3 ## @numberOfBuffer
 .zerofill __DATA,__bss,__isADirectory,1,0 ## @_isADirectory
-L_.str.4:                               ## @.str.4
+L_.str.5:                               ## @.str.5
 	.asciz	"x%s"
 
-L_.str.7:                               ## @.str.7
+L_.str.8:                               ## @.str.8
 	.asciz	"stat"
 
 .zerofill __DATA,__bss,_progName,8,3    ## @progName
-L_.str.9:                               ## @.str.9
+L_.str.10:                              ## @.str.10
 	.asciz	"-h"
 
-L_.str.10:                              ## @.str.10
+L_.str.11:                              ## @.str.11
 	.asciz	"--help"
 
-L_.str.11:                              ## @.str.11
+L_.str.12:                              ## @.str.12
 	.asciz	"-s"
 
-L_.str.12:                              ## @.str.12
+L_.str.13:                              ## @.str.13
 	.asciz	"--standard"
 
-L_.str.13:                              ## @.str.13
+L_.str.14:                              ## @.str.14
 	.asciz	"r"
 
-L_.str.15:                              ## @.str.15
+L_.str.16:                              ## @.str.16
 	.asciz	"-i"
 
-L_.str.16:                              ## @.str.16
+L_.str.17:                              ## @.str.17
 	.asciz	"--inverted"
 
-L_.str.18:                              ## @.str.18
+L_.str.19:                              ## @.str.19
 	.asciz	"regrouping the folder in one file using tar, may be long..."
 
-L_.str.19:                              ## @.str.19
+L_.str.20:                              ## @.str.20
 	.asciz	"%s.tar"
 
-L_.str.20:                              ## @.str.20
+L_.str.21:                              ## @.str.21
 	.asciz	"cd %s && tar -cf %s %s &>/dev/null"
 
-L_.str.23:                              ## @.str.23
+L_.str.24:                              ## @.str.24
 	.asciz	"%s%s"
 
-L_.str.24:                              ## @.str.24
+L_.str.25:                              ## @.str.25
 	.asciz	"Crypt(C) or Decrypt(d):"
 
-L_.str.25:                              ## @.str.25
+L_.str.26:                              ## @.str.26
 	.asciz	"\033[F\033[J"
 
-L_.str.26:                              ## @.str.26
+L_.str.27:                              ## @.str.27
 	.asciz	"Password:"
 
 .zerofill __DATA,__bss,_loadBar.firstCall,1,0 ## @loadBar.firstCall
 .zerofill __DATA,__bss,_loadBar.startingTime,8,3 ## @loadBar.startingTime
-L_.str.28:                              ## @.str.28
+L_.str.29:                              ## @.str.29
 	.asciz	" %3d%% ["
 
-L_.str.31:                              ## @.str.31
-	.asciz	"] %.0f        \r"
-
 L_.str.32:                              ## @.str.32
-	.asciz	"%s(1)\t\t\tcopyright <Pierre-Fran\303\247ois Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de d\303\251chiffrer toutes les donn\303\251es entr\303\251es en param\303\250tre le mot de passe demand\303\251 au d\303\251but est hash\303\251 puis sert de graine pour le PRNG le PRNG permet de fournir une cl\303\251 unique \303\251gale \303\240 la longueur du fichier \303\240 coder. La cl\303\251 unique subit un xor avec le mot de passe (le mot de passe est r\303\251p\303\251t\303\251 autant de fois que n\303\251c\303\251ssaire). Le fichier subit un xor avec cette cl\303\251 Puis un brouilleur est utilis\303\251, il m\303\251lange la table des caract\303\250res (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n"
+	.asciz	"] %.0f        \r"
 
 L_.str.33:                              ## @.str.33
-	.asciz	"Usage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that generates the scrambler instead of the password\n"
+	.asciz	"%s(1)\t\t\tcopyright <Pierre-Fran\303\247ois Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de d\303\251chiffrer toutes les donn\303\251es entr\303\251es en param\303\250tre le mot de passe demand\303\251 au d\303\251but est hash\303\251 puis sert de graine pour le PRNG le PRNG permet de fournir une cl\303\251 unique \303\251gale \303\240 la longueur du fichier \303\240 coder. La cl\303\251 unique subit un xor avec le mot de passe (le mot de passe est r\303\251p\303\251t\303\251 autant de fois que n\303\251c\303\251ssaire). Le fichier subit un xor avec cette cl\303\251 Puis un brouilleur est utilis\303\251, il m\303\251lange la table des caract\303\250res (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\n\tKEYFILE    \tthe path to a file which will be used to scramble the substitution's tables and choose in which order they will be used instead of the PRNG only (starting at 2.5 ko for the keyfile is great, however not interesting to be too heavy) \n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n"
+
+L_.str.34:                              ## @.str.34
+	.asciz	"Version : 2.3\nUsage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that scrambles the substitution's tables and choose they order instead of the PRNG only\n"
 
 	.align	4                       ## @str
 L_str:
-	.asciz	"starting encryption..."
+	.asciz	"scrambling substitution's tables..."
 
 	.align	4                       ## @str.35
 L_str.35:
-	.asciz	"starting decryption..."
+	.asciz	"starting encryption..."
 
-	.align	4                       ## @str.38
-L_str.38:
-	.asciz	"error: file's path is not correct, one or several directories and or file are missing"
+	.align	4                       ## @str.37
+L_str.37:
+	.asciz	"starting decryption..."
 
 	.align	4                       ## @str.40
 L_str.40:
-	.asciz	"Done                                                                  "
+	.asciz	"error: file's path is not correct, one or several directories and or file are missing"
 
 	.align	4                       ## @str.42
 L_str.42:
-	.asciz	"\rregrouping the folder in one file using tar... Done          "
+	.asciz	"Done                                                                  "
 
 	.align	4                       ## @str.44
 L_str.44:
-	.asciz	"\nerror: unable to tar your file"
+	.asciz	"\rregrouping the folder in one file using tar... Done          "
 
 	.align	4                       ## @str.46
 L_str.46:
+	.asciz	"\nerror: unable to tar your file"
+
+	.align	4                       ## @str.48
+L_str.48:
 	.asciz	"error: several trailing '/' in the path of your file"
 
-L_str.47:                               ## @str.47
+L_str.49:                               ## @str.49
 	.asciz	"exiting"
 
-	.align	4                       ## @str.49
-L_str.49:
+	.align	4                       ## @str.51
+L_str.51:
 	.asciz	"Warning: with the -s|--standard option, the keyfile will not bu used"
 
-	.align	4                       ## @str.50
-L_str.50:
+	.align	4                       ## @str.52
+L_str.52:
 	.asciz	"Error: Too many arguments"
 
 
 .subsections_via_symbols

Vulnerable code: 			"%s(1)\t\t\tcopyright <Pierre-François Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de déchiffrer toutes les données entrées en paramètre le mot de passe demandé au début est hashé puis sert de graine pour le PRNG le PRNG permet de fournir une clé unique égale à la longueur du fichier à coder. La clé unique subit un xor avec le mot de passe (le mot de passe est répété autant de fois que nécéssaire). Le fichier subit un xor avec cette clé Puis un brouilleur est utilisé, il mélange la table des caractères (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n", progName, progName, progName, progName, progName, progName, progName, progName);
			"Usage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that generates the scrambler instead of the password\n", progName);
		if (keyFile != NULL){
					scrambleAsciiTables[j][i%256] = scrambleAsciiTables[j][(unsigned char)(extractedString[i])];
					scrambleAsciiTables[j][(unsigned char)(extractedString[i])] = temp;
			xoredString[i] = scrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
			xoredString[i] = scrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
			xoredString[i] = unscrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
			xoredString[i] = unscrambleAsciiTables[keyString[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
	returned value : the size of the data reed
	subq	$16408, %rsp            ## imm = 0x4018
	movq	%rdi, %r12
	xorl	%r13d, %r13d
	testq	%r12, %r12
	je	LBB8_8
## BB#1:
	leaq	_scrambleAsciiTables(%rip), %rax
	leaq	-16432(%rbp), %r14
	leaq	_scrambleAsciiTables(%rip), %r15
LBB8_2:                                 ## %vector.ph
                                        ##     Child Loop BB8_3 Depth 2
                                        ##       Child Loop BB8_7 Depth 3
	movq	%rax, -16440(%rbp)      ## 8-byte Spill
LBB8_3:                                 ## %vector.body
                                        ##   Parent Loop BB8_2 Depth=1
	jne	LBB8_3
## BB#4:                                ## %middle.block
                                        ##   in Loop: Header=BB8_2 Depth=1
	movq	%r14, %rdi
	jmp	LBB8_5
	.align	4, 0x90
LBB8_6:                                 ## %.lr.ph.preheader
                                        ##   in Loop: Header=BB8_5 Depth=2
	movl	%eax, %r8d
	xorl	%ecx, %ecx
LBB8_7:                                 ## %.lr.ph
                                        ##   Parent Loop BB8_2 Depth=1
                                        ##     Parent Loop BB8_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%ecx, %edx
	sarl	$31, %edx
	shrl	$24, %edx
	addl	%ecx, %edx
	andl	$-256, %edx
	movl	%ecx, %esi
	subl	%edx, %esi
	movslq	%esi, %rdx
	movq	%r13, %rsi
	shlq	$8, %rsi
	addq	%r15, %rsi
	movb	(%rdx,%rsi), %bl
	movzbl	-16432(%rbp,%rcx), %edi
	movb	(%rdi,%rsi), %al
	movb	%al, (%rdx,%rsi)
	movb	%bl, (%rdi,%rsi)
	incq	%rcx
	cmpl	%ecx, %r8d
	jne	LBB8_7
LBB8_5:                                 ## %.loopexit
                                        ##   Parent Loop BB8_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB8_7 Depth 3
	movq	%r14, %rdi
	movq	%r12, %rcx
	jg	LBB8_6
## BB#16:                               ## %._crit_edge
                                        ##   in Loop: Header=BB8_2 Depth=1
	movq	%r12, %rdi
	callq	_rewind
	incq	%r13
	movq	-16440(%rbp), %rax      ## 8-byte Reload
	addq	$256, %rax              ## imm = 0x100
	cmpq	$16, %r13
	pxor	%xmm1, %xmm1
	movdqa	LCPI8_0(%rip), %xmm2    ## xmm2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
	jne	LBB8_2
	jmp	LBB8_14
LBB8_8:                                 ## %.preheader5.us.preheader
	movq	_seed.1(%rip), %r15
	leaq	_scrambleAsciiTables(%rip), %r9
	movq	_passIndex(%rip), %r14
	xorl	%r11d, %r11d
	pxor	%xmm0, %xmm0
	movdqa	LCPI8_0(%rip), %xmm1    ## xmm1 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
	movq	_passPhrase@GOTPCREL(%rip), %r10
	movq	%r9, %rax
LBB8_9:                                 ## %vector.ph45
                                        ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB8_10 Depth 2
                                        ##     Child Loop BB8_11 Depth 2
	movq	%rax, -16440(%rbp)      ## 8-byte Spill
	movq	%rax, %rbx
	xorl	%edi, %edi
LBB8_10:                                ## %vector.body41
                                        ##   Parent Loop BB8_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movd	%edi, %xmm2
	pshufb	%xmm0, %xmm2
	paddb	%xmm1, %xmm2
	movdqa	%xmm2, (%rbx)
	addq	$16, %rdi
	addq	$16, %rbx
	xorl	%eax, %eax
	cmpq	$256, %rdi              ## imm = 0x100
	jne	LBB8_10
LBB8_11:                                ## %.preheader3.us
                                        ##   Parent Loop BB8_9 Depth=1
	leal	(%r15,%rdx), %r12d
	xorq	%rdx, %r15
	movq	%rdx, %rdi
	rolq	$55, %rdi
	movq	%r15, %rdx
	xorq	%r15, %rdx
	xorq	%rdi, %rdx
	rolq	$36, %r15
	movzbl	(%r10,%r14), %r13d
	incl	%r14d
	andl	$16383, %r14d           ## imm = 0x3FFF
	movl	%eax, %esi
	addl	%eax, %esi
	movl	%eax, %ecx
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	movq	%r11, %rsi
	shlq	$8, %rsi
	addq	%r9, %rsi
	movb	(%rcx,%rsi), %r8b
	movzbl	%r12b, %edi
	xorq	%r13, %rdi
	movb	(%rdi,%rsi), %bl
	movb	%bl, (%rcx,%rsi)
	movb	%r8b, (%rdi,%rsi)
	incl	%eax
	cmpl	$2560, %eax             ## imm = 0xA00
	jne	LBB8_11
## BB#12:                               ## %.loopexit4.us
                                        ##   in Loop: Header=BB8_9 Depth=1
	incq	%r11
	movq	-16440(%rbp), %rax      ## 8-byte Reload
	addq	$256, %rax              ## imm = 0x100
	cmpq	$16, %r11
	jne	LBB8_9
## BB#13:                               ## %.us-lcssa.us.loopexit
	movq	%r15, _seed.1(%rip)
	movq	%r14, _passIndex(%rip)
LBB8_14:                                ## %.us-lcssa.us
	jne	LBB8_17
## BB#15:                               ## %.us-lcssa.us
	addq	$16408, %rsp            ## imm = 0x4018
LBB8_17:                                ## %.us-lcssa.us
	movzbl	(%rsi), %r9d
	movb	(%rdi), %al
	xorb	%r9b, %al
	movzbl	%al, %eax
	andl	$15, %r9d
	shlq	$8, %r9
	addq	%r8, %r9
	movb	(%rax,%r9), %al
LBB10_1:                                ## %.preheader1
LBB10_3:                                ## %.lr.ph5
	movzbl	(%rdi), %r9d
	movzbl	(%rsi), %r10d
	movl	%r10d, %eax
	andl	$15, %eax
	shlq	$8, %rax
	addq	%r8, %rax
	movb	(%r9,%rax), %al
	xorb	%r10b, %al
	movzbl	(%rdi), %r9d
	movzbl	(%rsi), %r10d
	movl	%r10d, %eax
	andl	$15, %eax
	shlq	$8, %rax
	addq	%r8, %rax
	movb	(%r9,%rax), %al
	xorb	%r10b, %al
LBB11_1:                                ## %.preheader1
LBB11_3:                                ## %.lr.ph5
	movzbl	(%rsi), %r9d
	movb	(%rdi), %al
	xorb	%r9b, %al
	movzbl	%al, %eax
	andl	$15, %r9d
	shlq	$8, %r9
	addq	%r8, %r9
	movb	(%rax,%r9), %al
	movq	%rdi, %r14
	movq	_fileName(%rip), %rbx
	movq	%rbx, %rdi
	movq	%rsp, %r15
	subq	%rcx, %r15
	movq	%r15, %rsp
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	movq	%rbx, %r9
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	leaq	L_str(%rip), %rdi
	movq	%r14, %rdi
	movq	%r14, %r12
	leaq	-16432(%rbp), %r12
	leaq	-32816(%rbp), %r13
	movq	%r12, %rdi
## BB#15:                               ## %.lr.ph.i.30
	movq	%r13, %r9
## BB#17:                               ## %.lr.ph.i.41.preheader
	movq	%r13, %rbx
	movq	%r12, %rdx
LBB14_22:                               ## %.lr.ph.i.41.preheader87
LBB14_23:                               ## %.lr.ph.i.41
	movq	%r12, %r13
	cvttss2si	%xmm0, %r12d
	leaq	L_.str.28(%rip), %rdi
	testl	%r12d, %r12d
	movl	%r12d, %ebx
LBB14_50:                               ## %.lr.ph5.i.11
	cmpl	$49, %r12d
LBB14_46:                               ## %.lr.ph.i.14.preheader
	subl	%r12d, %ebx
LBB14_47:                               ## %.lr.ph.i.14
LBB14_48:                               ## %._crit_edge.i.12
	leaq	L_.str.31(%rip), %rdi
	movq	%r13, %r12
	leaq	-32816(%rbp), %r13
LBB14_2:                                ## %loadBar.exit26.preheader
	movq	_passPhrase@GOTPCREL(%rip), %r12
	leaq	_scrambleAsciiTables(%rip), %r13
LBB14_4:                                ## %.lr.ph51
	leaq	-32816(%rbp), %r9
	xorb	(%r12,%rsi), %dil
	movb	_isCodingInverted(%rip), %cl
	movq	%r14, %rdx
	leaq	-32816(%rbp), %rsi
	leaq	-49200(%rbp), %rdi
	movzbl	(%rsi), %ebx
	movb	(%rdx), %cl
	xorb	%bl, %cl
	movzbl	%cl, %ecx
	andl	$15, %ebx
	shlq	$8, %rbx
	addq	%r13, %rbx
	movb	(%rcx,%rbx), %cl
	movb	%cl, (%rdi)
	incq	%rdx
LBB14_9:                                ## %.preheader1.i
## BB#10:                               ## %.lr.ph5.i.preheader
	movl	%eax, %ecx
	movq	%r14, %rdx
	leaq	-32816(%rbp), %rsi
	leaq	-49200(%rbp), %rdi
LBB14_11:                               ## %.lr.ph5.i
	movzbl	(%rdx), %r8d
	movzbl	(%rsi), %r9d
	movl	%r9d, %ebx
	andl	$15, %ebx
	shlq	$8, %rbx
	addq	%r13, %rbx
	movb	(%r8,%rbx), %bl
	xorb	%r9b, %bl
	movb	%bl, (%rdi)
	incq	%rdi
	incq	%rdx
	decl	%ecx
	leaq	L_.str.28(%rip), %rdi
LBB14_44:                               ## %.lr.ph5.i.20
## BB#39:                               ## %.preheader.i.16
LBB14_40:                               ## %.lr.ph.i.25.preheader
LBB14_41:                               ## %.lr.ph.i.25
LBB14_42:                               ## %._crit_edge.i.21
	leaq	L_.str.31(%rip), %rdi
LBB14_34:                               ## %loadBar.exit26.backedge
	movq	%r15, %rdi
	leaq	L_str.47(%rip), %rdi
	movq	%rsp, %r12
	subq	%rcx, %r12
	movq	%r12, %rsp
	leaq	_unscrambleAsciiTables(%rip), %r15
	addq	%r15, %rcx
	leaq	L_.str.4(%rip), %rcx
	movq	%r12, %rdi
	movq	%r12, %rsi
	leaq	L_.str.1(%rip), %rsi
	leaq	L_str.35(%rip), %rdi
	leaq	-16432(%rbp), %r12
	leaq	-32816(%rbp), %r13
	movq	%r12, %rdi
## BB#19:                               ## %.lr.ph.i.33
	movq	%r13, %r9
## BB#21:                               ## %.lr.ph.i.44.preheader
	movq	%r13, %rbx
	movq	%r12, %rdx
LBB15_26:                               ## %.lr.ph.i.44.preheader90
LBB15_27:                               ## %.lr.ph.i.44
	movq	%r12, %r13
	cvttss2si	%xmm0, %r12d
	leaq	L_.str.28(%rip), %rdi
	testl	%r12d, %r12d
	movl	%r12d, %ebx
	cmpl	$49, %r12d
	subl	%r12d, %ebx
	leaq	L_.str.31(%rip), %rdi
	movq	%r13, %r12
	leaq	-32816(%rbp), %r13
LBB15_6:                                ## %loadBar.exit29.preheader
	xorl	%r12d, %r12d
LBB15_8:                                ## %.lr.ph54
	leaq	-32816(%rbp), %r9
	movb	_isCodingInverted(%rip), %cl
	movl	%eax, %ecx
	movq	%r14, %rdx
	leaq	-32816(%rbp), %rsi
	leaq	-49200(%rbp), %rdi
	movzbl	(%rdx), %r8d
	movzbl	(%rsi), %r9d
	movl	%r9d, %ebx
	andl	$15, %ebx
	shlq	$8, %rbx
	addq	%r15, %rbx
	movb	(%r8,%rbx), %bl
	xorb	%r9b, %bl
	movb	%bl, (%rdi)
	incq	%rdx
	decl	%ecx
LBB15_13:                               ## %.preheader1.i
## BB#14:                               ## %.lr.ph5.i.17.preheader
	movq	%r14, %rdx
	leaq	-32816(%rbp), %rsi
	leaq	-49200(%rbp), %rdi
LBB15_15:                               ## %.lr.ph5.i.17
	movzbl	(%rsi), %ebx
	movb	(%rdx), %cl
	xorb	%bl, %cl
	movzbl	%cl, %ecx
	andl	$15, %ebx
	shlq	$8, %rbx
	addq	%r15, %rbx
	movb	(%rcx,%rbx), %cl
	movb	%cl, (%rdi)
	incq	%rdx
	incq	%r12
	movl	%r12d, %eax
	cvtsi2ssl	%r12d, %xmm1
	leaq	L_.str.28(%rip), %rdi
LBB15_46:                               ## %.lr.ph5.i.23
## BB#41:                               ## %.preheader.i.19
LBB15_42:                               ## %.lr.ph.i.28.preheader
LBB15_43:                               ## %.lr.ph.i.28
LBB15_44:                               ## %._crit_edge.i.24
	leaq	L_.str.31(%rip), %rdi
LBB15_38:                               ## %loadBar.exit29.backedge
	movq	%r12, %rdi
	leaq	L_str.47(%rip), %rdi
	leaq	L_str.38(%rip), %rdi
	leaq	L_.str.7(%rip), %rdi
	leaq	L_str.47(%rip), %rdi
	jge	LBB17_21
	leaq	L_.str.9(%rip), %rsi
	je	LBB17_88
	leaq	L_.str.10(%rip), %rsi
	je	LBB17_88
	leaq	L_.str.11(%rip), %rsi
	leaq	L_.str.12(%rip), %rsi
## BB#14:
	leaq	L_.str.15(%rip), %rsi
	je	LBB17_16
## BB#15:
	leaq	L_.str.16(%rip), %rsi
	je	LBB17_16
## BB#18:
	leaq	L_.str.13(%rip), %rsi
	je	LBB17_19
## BB#20:
	jl	LBB17_23
LBB17_21:
	leaq	L_str.50(%rip), %rdi
	leaq	L_.str.13(%rip), %rsi
## BB#22:
	leaq	L_str.49(%rip), %rdi
LBB17_16:
## BB#17:
	leaq	L_.str.13(%rip), %rsi
LBB17_23:
	leaq	L_.str.18(%rip), %rdi
	leaq	L_.str.19(%rip), %rcx
	leaq	L_.str.20(%rip), %rcx
	leaq	L_str.42(%rip), %rdi
	leaq	L_.str.23(%rip), %rcx
	leaq	L_.str.13(%rip), %rsi
## BB#39:                               ## %.thread
	leaq	L_.str.13(%rip), %rsi
	leaq	L_.str.24(%rip), %r14
	leaq	L_.str.25(%rip), %r13
LBB17_61:                               ## %.thread20.loopexit
LBB17_62:                               ## %.thread20
	leaq	L_.str.26(%rip), %rdi
	leaq	L_.str.25(%rip), %rdi
	leaq	L_str.40(%rip), %rdi
	jne	LBB17_89
	leaq	L_str.47(%rip), %rdi
	leaq	L_str.47(%rip), %rdi
LBB17_88:
LBB17_89:
	leaq	L_str.44(%rip), %rdi
	leaq	L_str.46(%rip), %rdi
	leaq	L_str.47(%rip), %rdi
LBB17_19:
	leaq	L_.str.32(%rip), %rsi
	leaq	L_.str.33(%rip), %rsi
L_.str:                                 ## @.str
L_.str.1:                               ## @.str.1
L_.str.4:                               ## @.str.4
L_.str.7:                               ## @.str.7
L_.str.9:                               ## @.str.9
L_.str.10:                              ## @.str.10
L_.str.11:                              ## @.str.11
L_.str.12:                              ## @.str.12
L_.str.13:                              ## @.str.13
L_.str.15:                              ## @.str.15
L_.str.16:                              ## @.str.16
L_.str.18:                              ## @.str.18
L_.str.19:                              ## @.str.19
L_.str.20:                              ## @.str.20
L_.str.23:                              ## @.str.23
L_.str.24:                              ## @.str.24
L_.str.25:                              ## @.str.25
L_.str.26:                              ## @.str.26
L_.str.28:                              ## @.str.28
L_.str.31:                              ## @.str.31
	.asciz	"] %.0f        \r"

	.asciz	"%s(1)\t\t\tcopyright <Pierre-Fran\303\247ois Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de d\303\251chiffrer toutes les donn\303\251es entr\303\251es en param\303\250tre le mot de passe demand\303\251 au d\303\251but est hash\303\251 puis sert de graine pour le PRNG le PRNG permet de fournir une cl\303\251 unique \303\251gale \303\240 la longueur du fichier \303\240 coder. La cl\303\251 unique subit un xor avec le mot de passe (le mot de passe est r\303\251p\303\251t\303\251 autant de fois que n\303\251c\303\251ssaire). Le fichier subit un xor avec cette cl\303\251 Puis un brouilleur est utilis\303\251, il m\303\251lange la table des caract\303\250res (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n"
	.asciz	"Usage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that generates the scrambler instead of the password\n"
	.asciz	"starting encryption..."
	.asciz	"starting decryption..."
	.align	4                       ## @str.38
L_str.38:
	.asciz	"error: file's path is not correct, one or several directories and or file are missing"
	.asciz	"Done                                                                  "
	.asciz	"\rregrouping the folder in one file using tar... Done          "
	.asciz	"\nerror: unable to tar your file"
L_str.47:                               ## @str.47
	.align	4                       ## @str.49
L_str.49:
	.align	4                       ## @str.50
L_str.50:
Fixed code: static char usingKeyFile = 0;
static char scramblingTablesOrder[BUFFER_SIZE];
			"%s(1)\t\t\tcopyright <Pierre-François Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de déchiffrer toutes les données entrées en paramètre le mot de passe demandé au début est hashé puis sert de graine pour le PRNG le PRNG permet de fournir une clé unique égale à la longueur du fichier à coder. La clé unique subit un xor avec le mot de passe (le mot de passe est répété autant de fois que nécéssaire). Le fichier subit un xor avec cette clé Puis un brouilleur est utilisé, il mélange la table des caractères (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\n\tKEYFILE    \tthe path to a file which will be used to scramble the substitution's tables and choose in which order they will be used instead of the PRNG only (starting at 2.5 ko for the keyfile is great, however not interesting to be too heavy) \n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n", progName, progName, progName, progName, progName, progName, progName, progName);
			"Version : 2.3\nUsage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that scrambles the substitution's tables and choose they order instead of the PRNG only\n", progName);
	printf("scrambling substitution's tables...\n");
		if (usingKeyFile){
			unsigned char random256;
					random256 = generateNumber() ^ extractedString[i];
					scrambleAsciiTables[j][i%256] = scrambleAsciiTables[j][random256];
					scrambleAsciiTables[j][random256] = temp;
	if(usingKeyFile){
		int j = 0;
		char temp[BUFFER_SIZE];
		while(j < BUFFER_SIZE){
			int charactersRead = fread(temp, 1, BUFFER_SIZE, keyFile);
			if(charactersRead == 0){
				rewind(keyFile);
				continue;
			}
			for (int i = 0; i < charactersRead; ++i)
			{
				scramblingTablesOrder[j] = temp[i] & (1+2+4+8);
				j++;
				if(j == BUFFER_SIZE){
					break;
				}
			}
		}
	}
	char* tablenumber;

	if(usingKeyFile){
		tablenumber = scramblingTablesOrder;
	}else{
		tablenumber = keyString;
	}
			xoredString[i] = scrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
			xoredString[i] = scrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
	char* tablenumber;

	if(usingKeyFile){
		tablenumber = scramblingTablesOrder;
	}else{
		tablenumber = keyString;
	}
			xoredString[i] = unscrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)extractedString[i]] ^ keyString[i];
			xoredString[i] = unscrambleAsciiTables[tablenumber[i] & (1+2+4+8)][(unsigned char)(extractedString[i] ^ keyString[i])];
	returned value : the size of the data read

		if(keyFile != NULL){
			usingKeyFile = 1;
		}
	subq	$16424, %rsp            ## imm = 0x4028
	movq	%rdi, -16440(%rbp)      ## 8-byte Spill
	leaq	L_str(%rip), %rdi
	callq	_puts
	leaq	_scrambleAsciiTables(%rip), %r13
	xorl	%r14d, %r14d
	movq	_passPhrase@GOTPCREL(%rip), %rsi
	movq	%r13, %r12
LBB8_1:                                 ## %vector.ph
                                        ##     Child Loop BB8_2 Depth 2
                                        ##     Child Loop BB8_9 Depth 2
                                        ##       Child Loop BB8_11 Depth 3
	movq	%r12, %rax
LBB8_2:                                 ## %vector.body
                                        ##   Parent Loop BB8_1 Depth=1
	jne	LBB8_2
## BB#3:                                ## %middle.block
                                        ##   in Loop: Header=BB8_1 Depth=1
	movb	_usingKeyFile(%rip), %al
	andb	$1, %al
	je	LBB8_4
## BB#7:                                ##   in Loop: Header=BB8_1 Depth=1
	leaq	-16432(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$16384, %edx            ## imm = 0x4000
	movq	%rbx, %rdi
	jmp	LBB8_9
LBB8_8:                                 ## %.loopexit11
                                        ##   in Loop: Header=BB8_9 Depth=2
	movq	%rdx, _seed.0(%rip)
	movq	%rcx, _seed.1(%rip)
	leaq	-16432(%rbp), %rdi
LBB8_9:                                 ## %.loopexit11
                                        ##   Parent Loop BB8_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB8_11 Depth 3
	movq	-16440(%rbp), %rcx      ## 8-byte Reload
	jle	LBB8_12
## BB#10:                               ## %.lr.ph24
                                        ##   in Loop: Header=BB8_9 Depth=2
	movq	_seed.1(%rip), %rcx
	movl	%eax, %r8d
	xorl	%esi, %esi
LBB8_11:                                ##   Parent Loop BB8_1 Depth=1
                                        ##     Parent Loop BB8_9 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	leal	(%rcx,%rdx), %r9d
	xorq	%rdx, %rcx
	movq	%rdx, %rbx
	rolq	$55, %rbx
	movq	%rcx, %rdx
	shlq	$14, %rdx
	xorq	%rcx, %rdx
	xorq	%rbx, %rdx
	rolq	$36, %rcx
	movzbl	-16432(%rbp,%rsi), %r10d
	movl	%esi, %eax
	sarl	$31, %eax
	shrl	$24, %eax
	addl	%esi, %eax
	andl	$-256, %eax
	movl	%esi, %edi
	subl	%eax, %edi
	movslq	%edi, %r15
	movq	%r14, %rdi
	shlq	$8, %rdi
	addq	%r13, %rdi
	movb	(%r15,%rdi), %r11b
	movzbl	%r9b, %ebx
	xorq	%r10, %rbx
	movb	(%rbx,%rdi), %al
	movb	%al, (%r15,%rdi)
	movb	%r11b, (%rbx,%rdi)
	incq	%rsi
	cmpl	%esi, %r8d
	jne	LBB8_11
	jmp	LBB8_8
LBB8_4:                                 ## %.preheader12
                                        ##   in Loop: Header=BB8_1 Depth=1
	movq	%r12, -16448(%rbp)      ## 8-byte Spill
	movq	_seed.0(%rip), %rdx
	movq	_seed.1(%rip), %rax
	xorl	%r9d, %r9d
	movq	_passIndex(%rip), %r15
LBB8_5:                                 ##   Parent Loop BB8_1 Depth=1
	leal	(%rax,%rdx), %r8d
	xorq	%rdx, %rax
	movq	%rdx, %rbx
	rolq	$55, %rbx
	movq	%rax, %rdx
	xorq	%rax, %rdx
	xorq	%rbx, %rdx
	rolq	$36, %rax
	movzbl	(%rsi,%r15), %r10d
	incl	%r15d
	andl	$16383, %r15d           ## imm = 0x3FFF
	movq	%rsi, %r12
	movl	%r9d, %esi
	addl	%r9d, %esi
	movl	%r9d, %edi
	subl	%esi, %edi
	movslq	%edi, %rsi
	movq	%r14, %rdi
	shlq	$8, %rdi
	addq	%r13, %rdi
	movb	(%rsi,%rdi), %r11b
	movzbl	%r8b, %ebx
	xorq	%r10, %rbx
	movb	(%rbx,%rdi), %cl
	movb	%cl, (%rsi,%rdi)
	movq	%r12, %rsi
	movb	%r11b, (%rbx,%rdi)
	incl	%r9d
	cmpl	$2560, %r9d             ## imm = 0xA00
	jne	LBB8_5
## BB#6:                                ## %.loopexit13
                                        ##   in Loop: Header=BB8_1 Depth=1
	movq	%rax, _seed.1(%rip)
	movq	%r15, _passIndex(%rip)
	movq	-16448(%rbp), %r12      ## 8-byte Reload
	jmp	LBB8_13
	.align	4, 0x90
LBB8_12:                                ## %._crit_edge.25
                                        ##   in Loop: Header=BB8_1 Depth=1
	movq	-16440(%rbp), %rdi      ## 8-byte Reload
	callq	_rewind
	pxor	%xmm1, %xmm1
	movdqa	LCPI8_0(%rip), %xmm2    ## xmm2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
	movq	_passPhrase@GOTPCREL(%rip), %rsi
LBB8_13:                                ##   in Loop: Header=BB8_1 Depth=1
	incq	%r14
	addq	$256, %r12              ## imm = 0x100
	cmpq	$16, %r14
	jne	LBB8_1
## BB#14:
	movb	_usingKeyFile(%rip), %al
	andb	$1, %al
	je	LBB8_23
## BB#15:
	xorl	%ebx, %ebx
	leaq	-16432(%rbp), %r14
	leaq	_scramblingTablesOrder(%rip), %r15
	movq	-16440(%rbp), %r12      ## 8-byte Reload
	jmp	LBB8_18
	.align	4, 0x90
LBB8_17:                                ## %.lr.ph.split.us
                                        ##   in Loop: Header=BB8_18 Depth=1
	movq	%r12, %rdi
	callq	_rewind
LBB8_18:                                ## %.lr.ph.split.us
                                        ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB8_22 Depth 2
	movl	$1, %esi
	movl	$16384, %edx            ## imm = 0x4000
	movq	%r14, %rdi
	movq	%r12, %rcx
	callq	_fread
	testl	%eax, %eax
	je	LBB8_17
## BB#19:                               ## %.preheader
                                        ##   in Loop: Header=BB8_18 Depth=1
	testl	%eax, %eax
	jle	LBB8_16
## BB#20:                               ## %.lr.ph17.preheader
                                        ##   in Loop: Header=BB8_18 Depth=1
	cltq
	movslq	%ebx, %rbx
	xorl	%ecx, %ecx
	.align	4, 0x90
LBB8_22:                                ## %.lr.ph17
                                        ##   Parent Loop BB8_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movb	-16432(%rbp,%rcx), %dl
	andb	$15, %dl
	movb	%dl, (%rbx,%r15)
	cmpl	$16383, %ebx            ## imm = 0x3FFF
	je	LBB8_23
## BB#21:                               ##   in Loop: Header=BB8_22 Depth=2
	incq	%rcx
	incq	%rbx
	cmpq	%rax, %rcx
	jl	LBB8_22
LBB8_16:                                ## %.loopexit
                                        ##   in Loop: Header=BB8_18 Depth=1
	cmpl	$16383, %ebx            ## imm = 0x3FFF
	jle	LBB8_18
LBB8_23:
	jne	LBB8_25
## BB#24:
	addq	$16424, %rsp            ## imm = 0x4028
LBB8_25:
	movb	_usingKeyFile(%rip), %al
	andb	$1, %al
	leaq	_scramblingTablesOrder(%rip), %r9
	cmoveq	%rsi, %r9
	movb	(%rsi), %al
	xorb	(%rdi), %al
	movzbl	%al, %r10d
	movzbl	(%r9), %eax
	andl	$15, %eax
	shlq	$8, %rax
	addq	%r8, %rax
	movb	(%r10,%rax), %al
	incq	%r9
LBB10_1:                                ## %.preheader2
LBB10_3:                                ## %.lr.ph6
	movzbl	(%rdi), %r10d
	movzbl	(%r9), %r11d
	andl	$15, %r11d
	shlq	$8, %r11
	addq	%r8, %r11
	movb	(%rsi), %al
	xorb	(%r10,%r11), %al
	incq	%r9
	movb	_usingKeyFile(%rip), %al
	andb	$1, %al
	leaq	_scramblingTablesOrder(%rip), %r9
	cmoveq	%rsi, %r9
	movzbl	(%rdi), %r10d
	movzbl	(%r9), %r11d
	andl	$15, %r11d
	shlq	$8, %r11
	addq	%r8, %r11
	movb	(%rsi), %al
	xorb	(%r10,%r11), %al
	incq	%r9
LBB11_1:                                ## %.preheader2
LBB11_3:                                ## %.lr.ph6
	movb	(%rsi), %al
	xorb	(%rdi), %al
	movzbl	%al, %r10d
	movzbl	(%r9), %eax
	andl	$15, %eax
	shlq	$8, %rax
	addq	%r8, %rax
	movb	(%r10,%rax), %al
	incq	%r9
	movq	%rdi, %r15
	movq	_fileName(%rip), %r14
	movq	%r14, %rdi
	movq	%rsp, %rbx
	subq	%rcx, %rbx
	movq	%rbx, %rsp
	leaq	L_.str.1(%rip), %rcx
	movq	%rbx, %rdi
	movq	%r14, %r9
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	leaq	L_str.35(%rip), %rdi
	movq	%r15, %rdi
	movq	%r15, %r12
	leaq	-16432(%rbp), %r13
	leaq	-32816(%rbp), %r12
	movq	%r13, %rdi
## BB#15:                               ## %.lr.ph.i.29
	movq	%r12, %r9
## BB#17:                               ## %.lr.ph.i.40.preheader
	movq	%r12, %rbx
	movq	%r13, %rdx
LBB14_22:                               ## %.lr.ph.i.40.preheader86
LBB14_23:                               ## %.lr.ph.i.40
	movq	%r13, %r12
	cvttss2si	%xmm0, %r13d
	leaq	L_.str.29(%rip), %rdi
	testl	%r13d, %r13d
	movl	%r13d, %ebx
LBB14_50:                               ## %.lr.ph5.i
	cmpl	$49, %r13d
LBB14_46:                               ## %.lr.ph.i.13.preheader
	subl	%r13d, %ebx
LBB14_47:                               ## %.lr.ph.i.13
LBB14_48:                               ## %._crit_edge.i.11
	leaq	L_.str.32(%rip), %rdi
	movq	%r12, %r13
	leaq	-32816(%rbp), %r12
LBB14_2:                                ## %loadBar.exit25.preheader
	movq	_passPhrase@GOTPCREL(%rip), %r13
	leaq	_scrambleAsciiTables(%rip), %r12
LBB14_4:                                ## %.lr.ph50
	leaq	-32816(%rbp), %r11
	movq	%r11, %r9
	xorb	(%r13,%rsi), %dil
	movb	_usingKeyFile(%rip), %cl
	movq	%r11, %rcx
	leaq	_scramblingTablesOrder(%rip), %rdx
	cmovneq	%rdx, %rcx
	movb	_isCodingInverted(%rip), %dl
	andb	$1, %dl
	movq	%r14, %rsi
	movq	%r11, %rdi
	leaq	-49200(%rbp), %rbx
	movb	(%rdi), %dl
	xorb	(%rsi), %dl
	movzbl	%dl, %r9d
	movzbl	(%rcx), %edx
	andl	$15, %edx
	shlq	$8, %rdx
	addq	%r12, %rdx
	movb	(%r9,%rdx), %dl
	movb	%dl, (%rbx)
	incq	%rbx
	incq	%rcx
LBB14_9:                                ## %.preheader2.i
## BB#10:                               ## %.lr.ph6.i.preheader
	movl	%eax, %r9d
	movq	%r14, %r10
	movq	%r11, %rdi
	leaq	-49200(%rbp), %rsi
LBB14_11:                               ## %.lr.ph6.i
	movzbl	(%r10), %r8d
	movzbl	(%rcx), %edx
	andl	$15, %edx
	shlq	$8, %rdx
	addq	%r12, %rdx
	movb	(%rdi), %bl
	xorb	(%r8,%rdx), %bl
	movb	%bl, (%rsi)
	incq	%rdi
	incq	%r10
	incq	%rcx
	decl	%r9d
	leaq	L_.str.29(%rip), %rdi
LBB14_44:                               ## %.lr.ph5.i.19
## BB#39:                               ## %.preheader.i.15
LBB14_40:                               ## %.lr.ph.i.24.preheader
LBB14_41:                               ## %.lr.ph.i.24
LBB14_42:                               ## %._crit_edge.i.20
	leaq	L_.str.32(%rip), %rdi
LBB14_34:                               ## %loadBar.exit25.backedge
	movq	%rbx, %rdi
	leaq	L_str.49(%rip), %rdi
	movq	%rsp, %r15
	subq	%rcx, %r15
	movq	%r15, %rsp
	leaq	_unscrambleAsciiTables(%rip), %r12
	addq	%r12, %rcx
	leaq	L_.str.5(%rip), %rcx
	movq	%r15, %rdi
	movq	%r15, %rsi
	leaq	L_.str.2(%rip), %rsi
	leaq	L_str.37(%rip), %rdi
	leaq	-16432(%rbp), %r13
	leaq	-32816(%rbp), %r12
	movq	%r13, %rdi
## BB#19:                               ## %.lr.ph.i.32
	movq	%r12, %r9
## BB#21:                               ## %.lr.ph.i.43.preheader
	movq	%r12, %rbx
	movq	%r13, %rdx
LBB15_26:                               ## %.lr.ph.i.43.preheader89
LBB15_27:                               ## %.lr.ph.i.43
	movq	%r13, %r12
	cvttss2si	%xmm0, %r13d
	leaq	L_.str.29(%rip), %rdi
	testl	%r13d, %r13d
	movl	%r13d, %ebx
	cmpl	$49, %r13d
	subl	%r13d, %ebx
	leaq	L_.str.32(%rip), %rdi
	movq	%r12, %r13
	leaq	-32816(%rbp), %r12
LBB15_6:                                ## %loadBar.exit28.preheader
	xorl	%r15d, %r15d
LBB15_8:                                ## %.lr.ph53
	leaq	-32816(%rbp), %r11
	movq	%r11, %r9
	movb	_usingKeyFile(%rip), %cl
	movq	%r11, %rsi
	leaq	_scramblingTablesOrder(%rip), %rcx
	cmovneq	%rcx, %rsi
	movb	_isCodingInverted(%rip), %dl
	andb	$1, %dl
	movl	%eax, %r9d
	movq	%r14, %r10
	movq	%r11, %rdi
	leaq	-49200(%rbp), %rbx
	movzbl	(%r10), %r8d
	movzbl	(%rsi), %edx
	andl	$15, %edx
	shlq	$8, %rdx
	addq	%r12, %rdx
	movb	(%rdi), %cl
	xorb	(%r8,%rdx), %cl
	movb	%cl, (%rbx)
	incq	%rbx
	incq	%r10
	decl	%r9d
LBB15_13:                               ## %.preheader2.i
## BB#14:                               ## %.lr.ph6.i.preheader
	movq	%r14, %rcx
	movq	%r11, %rdi
	leaq	-49200(%rbp), %rbx
LBB15_15:                               ## %.lr.ph6.i
	movb	(%rdi), %dl
	xorb	(%rcx), %dl
	movzbl	%dl, %r9d
	movzbl	(%rsi), %edx
	andl	$15, %edx
	shlq	$8, %rdx
	addq	%r12, %rdx
	movb	(%r9,%rdx), %dl
	movb	%dl, (%rbx)
	incq	%rbx
	incq	%rcx
	incq	%r15
	movl	%r15d, %eax
	cvtsi2ssl	%r15d, %xmm1
	leaq	L_.str.29(%rip), %rdi
LBB15_46:                               ## %.lr.ph5.i.22
## BB#41:                               ## %.preheader.i.18
LBB15_42:                               ## %.lr.ph.i.27.preheader
LBB15_43:                               ## %.lr.ph.i.27
LBB15_44:                               ## %._crit_edge.i.23
	leaq	L_.str.32(%rip), %rdi
LBB15_38:                               ## %loadBar.exit28.backedge
	movq	%r15, %rdi
	leaq	L_str.49(%rip), %rdi
	leaq	L_str.40(%rip), %rdi
	leaq	L_.str.8(%rip), %rdi
	leaq	L_str.49(%rip), %rdi
	jge	LBB17_88
	leaq	L_.str.10(%rip), %rsi
	je	LBB17_89
	leaq	L_.str.11(%rip), %rsi
	je	LBB17_89
	leaq	L_.str.12(%rip), %rsi
	leaq	L_.str.13(%rip), %rsi
## BB#15:
	leaq	L_.str.16(%rip), %rsi
	je	LBB17_17
## BB#16:
	leaq	L_.str.17(%rip), %rsi
	je	LBB17_17
## BB#19:
	leaq	L_.str.14(%rip), %rsi
	je	LBB17_20
## BB#21:
	jl	LBB17_22
LBB17_88:
	leaq	L_str.52(%rip), %rdi
	leaq	L_.str.14(%rip), %rsi
## BB#14:
	leaq	L_str.51(%rip), %rdi
LBB17_17:
## BB#18:
	leaq	L_.str.14(%rip), %rsi
LBB17_22:
	movb	$1, _usingKeyFile(%rip)
LBB17_23:                               ## %.thread
	leaq	L_.str.19(%rip), %rdi
	leaq	L_.str.20(%rip), %rcx
	leaq	L_.str.21(%rip), %rcx
	leaq	L_str.44(%rip), %rdi
	leaq	L_.str.24(%rip), %rcx
	leaq	L_.str.14(%rip), %rsi
## BB#39:                               ## %.thread20
	leaq	L_.str.14(%rip), %rsi
	leaq	L_.str.25(%rip), %r14
	leaq	L_.str.26(%rip), %r13
LBB17_61:                               ## %.thread22.loopexit
LBB17_62:                               ## %.thread22
	leaq	L_.str.27(%rip), %rdi
	leaq	L_.str.26(%rip), %rdi
	leaq	L_str.42(%rip), %rdi
	jne	LBB17_90
	leaq	L_str.49(%rip), %rdi
	leaq	L_str.49(%rip), %rdi
LBB17_89:
LBB17_90:
	leaq	L_str.46(%rip), %rdi
	leaq	L_str.48(%rip), %rdi
	leaq	L_str.49(%rip), %rdi
LBB17_20:
	leaq	L_.str.33(%rip), %rsi
	leaq	L_.str.34(%rip), %rsi
.zerofill __DATA,__bss,_usingKeyFile,1,0 ## @usingKeyFile
.zerofill __DATA,__bss,_scramblingTablesOrder,16384,4 ## @scramblingTablesOrder
L_.str.1:                               ## @.str.1
L_.str.2:                               ## @.str.2
L_.str.5:                               ## @.str.5
L_.str.8:                               ## @.str.8
L_.str.10:                              ## @.str.10
L_.str.11:                              ## @.str.11
L_.str.12:                              ## @.str.12
L_.str.13:                              ## @.str.13
L_.str.14:                              ## @.str.14
L_.str.16:                              ## @.str.16
L_.str.17:                              ## @.str.17
L_.str.19:                              ## @.str.19
L_.str.20:                              ## @.str.20
L_.str.21:                              ## @.str.21
L_.str.24:                              ## @.str.24
L_.str.25:                              ## @.str.25
L_.str.26:                              ## @.str.26
L_.str.27:                              ## @.str.27
L_.str.29:                              ## @.str.29
	.asciz	"] %.0f        \r"
	.asciz	"%s(1)\t\t\tcopyright <Pierre-Fran\303\247ois Monville>\t\t\t%s(1)\n\nNAME\n\t%s -- crypt or decrypt any data\n\nSYNOPSIS\n\t%s [-h | --help] FILE [-s | --standard | KEYFILE]\n\nDESCRIPTION\n\t(FR) permet de chiffrer et de d\303\251chiffrer toutes les donn\303\251es entr\303\251es en param\303\250tre le mot de passe demand\303\251 au d\303\251but est hash\303\251 puis sert de graine pour le PRNG le PRNG permet de fournir une cl\303\251 unique \303\251gale \303\240 la longueur du fichier \303\240 coder. La cl\303\251 unique subit un xor avec le mot de passe (le mot de passe est r\303\251p\303\251t\303\251 autant de fois que n\303\251c\303\251ssaire). Le fichier subit un xor avec cette cl\303\251 Puis un brouilleur est utilis\303\251, il m\303\251lange la table des caract\303\250res (ascii) en utilisant le PRNG ou en utilisant le keyFile fourni.\n\t(EN) Can crypt and decrypt any data given in argument. The password asked is hashed to be used as a seed for the PRNG. The PRNG gives a unique key which has the same length as the source file. The key is xored with the password (the password is repeated as long as necessary). The file is then xored with this new key, then a scrambler is used. It scrambles the ascii table using the PRNG or the keyFile given\n\nOPTIONS\n\tthe options are as follows:\n\n\t-h | --help\tfurther help.\n\n\t-s | --standard\tput the scrambler on off.\n\n\t-i | --inverted\tinverts the coding/decoding process, first it xors then it scrambles.\n\n\tKEYFILE    \tthe path to a file which will be used to scramble the substitution's tables and choose in which order they will be used instead of the PRNG only (starting at 2.5 ko for the keyfile is great, however not interesting to be too heavy) \n\nEXIT STATUS\n\tthe %s program exits 0 on success, and anything else if an error occurs.\n\nEXAMPLES\n\tthe command:\t%s file1\n\n\tlets you choose between crypting or decrypting then it will prompt for a password that crypt/decrypt file1 as xfile1 in the same folder, file1 is not modified.\n\n\tthe command:\t%s file2 keyfile1\n\n\tlets you choose between crypting or decrypting, will prompt for the password that crypt/decrypt file2, uses keyfile1 to generate the scrambler then crypt/decrypt file2 as file2x in the same folder, file2 is not modified.\n\n\tthe command:\t%s file3 -s\n\n\tlets you choose between crypting or decrypting, will prompt for a password that crypt/decrypt the file without using the scrambler, resulting in using the unique key only.\n"

L_.str.34:                              ## @.str.34
	.asciz	"Version : 2.3\nUsage : %s [-h | --help] FILE [-s | --standard | -i | --inverted] [KEYFILE]\nOptions :\n  -h --help :\t\tfurther help\n  -s --standard :\tput the scrambler off\n  -i --inverted :\tinverts the coding/decoding process\n  KEYFILE :\t\tpath to a keyfile that scrambles the substitution's tables and choose they order instead of the PRNG only\n"
	.asciz	"scrambling substitution's tables..."
	.asciz	"starting encryption..."
	.align	4                       ## @str.37
L_str.37:
	.asciz	"starting decryption..."
	.asciz	"error: file's path is not correct, one or several directories and or file are missing"
	.asciz	"Done                                                                  "
	.asciz	"\rregrouping the folder in one file using tar... Done          "
	.asciz	"\nerror: unable to tar your file"

	.align	4                       ## @str.48
L_str.48:
L_str.49:                               ## @str.49
	.align	4                       ## @str.51
L_str.51:
	.align	4                       ## @str.52
L_str.52: