#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Base64Decode(char *, char **);
int /*<<< orphan*/ HKDF(char *, char *, int, char **);
int /*<<< orphan*/ PRBG_RSA(char **, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_mac_adress(char **);
int /*<<< orphan*/ hash_function(char *, char **);
int interpretor(char **, int *, int *, char **, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sha256(char *, char **);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int k_iter;
  int hkdf_iter;
  int borne_start;
  int borne_stop;
  char *to_valid;
  char *key_init;
  char *key;
  char *Ns;
  char *code;
  int space = 6;
  int i, j;
  char *userID;
  if (argc < 2) {
    printf("./%s <your code>", argv[0]);
    return 1;
  }
  to_valid = (char *)malloc(sizeof(char) * 2048);
  key_init = (char *)malloc(sizeof(char) * 65);
  key = (char *)malloc(sizeof(char) * 65);
  Ns = (char *)malloc(sizeof(char) * 2048);
  code = (char *)malloc(sizeof(char) * 2048);
  userID = (char *)malloc(sizeof(char) * 65);
  memset(to_valid, 0, 2048);
  memset(code, 1, 2048);
  memset(key, 0, 65);
  memset(key_init, 0, 65);
  memset(Ns, 0, 2048);
  memset(userID, 0, 65);
  strcpy(userID, "guest");
  printf("Heap avant Overflow :");
  for (j = 0; j < 23; j++) {
    printf(" %d", code[(2045 + j) * sizeof(char)]);
  }
  printf("\n");
  strcpy(code, argv[1]);
  printf("Heap après Overflow :");
  for (j = 0; j < 23; j++) {
    printf(" %d", code[(2045 + j) * sizeof(char)]);
  }
  printf("\n");
  i = interpretor(&code, &k_iter, &hkdf_iter, &to_valid, space);
  if (i > 0) {
    return 2;
  }
  if (1) {
    memset(code, 0, 2048);
    Base64Decode(to_valid, &code);
  } else {
    strcpy(code, to_valid);
  }
  memset(to_valid, 0, 2048);
  PRBG_RSA(&to_valid, k_iter);
  hash_function(to_valid, &key_init);
  get_mac_adress(&Ns);
  HKDF(key_init, Ns, hkdf_iter, &key);
  printf("Key : %s\nCode: %s\n", key, code);
  if (strcmp(key, code) == 0) {
    printf("Your code is OK !!\\o/\n");
    sha256(code, &userID);
  } else {
    printf("Bad code...\n");
  }
  if (strcmp(userID, "guest") == 0) {
    printf("Welcome guest...\n");
  } else {
    printf("Welcome registered user : %s !\n", userID);
  }
  free(to_valid);
  free(key_init);
  free(key);
  free(Ns);
  free(code);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x6,-0x4c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1218 <main+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1515 <main+0x345>
mov    $0x800,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x41,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x41,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x800,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x800,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0x41,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1090 <memset@plt>
mov    -0x48(%rbp),%rdi
mov    $0x1,%esi
mov    $0x800,%edx
call   1090 <memset@plt>
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1090 <memset@plt>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1090 <memset@plt>
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1090 <memset@plt>
mov    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1090 <memset@plt>
mov    -0x60(%rbp),%rdi
lea    0xd37(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x17,-0x54(%rbp)
jge    1332 <main+0x162>
mov    -0x48(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x7fd,%ecx
movslq %ecx,%rcx
shl    $0x0,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12f4 <main+0x124>
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x17,-0x54(%rbp)
jge    13a4 <main+0x1d4>
mov    -0x48(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x7fd,%ecx
movslq %ecx,%rcx
shl    $0x0,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1366 <main+0x196>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x4c(%rbp),%r8d
lea    -0x48(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1070 <interpretor@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jle    13e4 <main+0x214>
movl   $0x2,-0x4(%rbp)
jmp    1515 <main+0x345>
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1090 <memset@plt>
mov    -0x28(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   10c0 <Base64Decode@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1090 <memset@plt>
mov    -0x14(%rbp),%esi
lea    -0x28(%rbp),%rdi
call   10e0 <PRBG_RSA@plt>
mov    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10f0 <hash_function@plt>
lea    -0x40(%rbp),%rdi
call   1050 <get_mac_adress@plt>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    -0x38(%rbp),%rcx
call   1060 <HKDF@plt>
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%rdx
lea    0xbf2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1494 <main+0x2c4>
lea    0xbe0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x48(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   10a0 <sha256@plt>
jmp    14a2 <main+0x2d2>
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x60(%rbp),%rdi
lea    0xb64(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    14cf <main+0x2ff>
lea    0xbbc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14e1 <main+0x311>
mov    -0x60(%rbp),%rsi
lea    0xbb7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x1,%edi
jg     121e <main+0x2e>
mov    (%rsi),%rsi
lea    0xdf3(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0x1,%eax
jmp    17b4 <main+0x5c4>
mov    $0x800,%edi
mov    %rsi,0x40(%rsp)
call   10f0 <malloc@plt>
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
mov    $0x41,%edi
call   10f0 <malloc@plt>
mov    %rax,%r15
mov    %rax,0x30(%rsp)
mov    $0x41,%edi
call   10f0 <malloc@plt>
mov    %rax,%r14
mov    %rax,0x18(%rsp)
mov    $0x800,%edi
call   10f0 <malloc@plt>
mov    %rax,%r13
mov    %rax,0x28(%rsp)
mov    $0x800,%edi
call   10f0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
mov    $0x41,%edi
call   10f0 <malloc@plt>
mov    %rax,%r12
mov    %rax,0x20(%rsp)
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   10b0 <memset@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x800,%edx
call   10b0 <memset@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   10b0 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   10b0 <memset@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   10b0 <memset@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   10b0 <memset@plt>
lea    0xd1e(%rip),%rsi
mov    %r12,%rdi
call   1050 <strcpy@plt>
lea    0xd15(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7fd(%rbx),%esi
lea    0xd16(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7fe(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7ff(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x800(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x801(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x802(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x803(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x804(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x805(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x806(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x807(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x808(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x809(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80a(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80b(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80d(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80e(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80f(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x810(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x811(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x812(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x813(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%rbx
mov    0x40(%rsp),%rax
mov    0x8(%rax),%rsi
mov    %rbx,%rdi
call   1050 <strcpy@plt>
lea    0xb73(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7fd(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7fe(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x7ff(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x800(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x801(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x802(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x803(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x804(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x805(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x806(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x807(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x808(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x809(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80a(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80b(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80d(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80e(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x80f(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x810(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x811(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x812(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movsbl 0x813(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x8(%rsp),%rdi
lea    0x3c(%rsp),%rsi
lea    0x38(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x6,%r8d
call   1090 <interpretor@plt>
mov    %eax,%ecx
mov    $0x2,%eax
test   %ecx,%ecx
jg     17b4 <main+0x5c4>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   10b0 <memset@plt>
mov    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   10e0 <Base64Decode@plt>
mov    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   10b0 <memset@plt>
mov    0x3c(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1100 <PRBG_RSA@plt>
mov    0x10(%rsp),%rdi
lea    0x30(%rsp),%rsi
call   1110 <hash_function@plt>
lea    0x28(%rsp),%rdi
call   1060 <get_mac_adress@plt>
mov    0x30(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x38(%rsp),%edx
lea    0x18(%rsp),%rcx
call   1080 <HKDF@plt>
mov    0x18(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0x943(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x18(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     172e <main+0x53e>
lea    0x954(%rip),%rdi
call   1070 <puts@plt>
jmp    1749 <main+0x559>
lea    0x963(%rip),%rdi
call   1070 <puts@plt>
mov    0x8(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   10c0 <sha256@plt>
mov    0x20(%rsp),%rdi
lea    0x8bc(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1774 <main+0x584>
mov    0x20(%rsp),%rsi
lea    0x8f0(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1780 <main+0x590>
lea    0x90c(%rip),%rdi
call   1070 <puts@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"./%s <your code>\00"
@.str.1 = [6 x i8] c"guest\00"
@.str.2 = [22 x i8] c"Heap avant Overflow :\00"
@.str.3 = [4 x i8] c" %d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [23 x i8] c"Heap apr\C3\A8s Overflow :\00"
@.str.6 = [19 x i8] c"Key : %s\0ACode: %s\0A\00"
@.str.7 = [23 x i8] c"Your code is OK !!\\o/\0A\00"
@.str.8 = [13 x i8] c"Bad code...\0A\00"
@.str.9 = [18 x i8] c"Welcome guest...\0A\00"
@.str.10 = [32 x i8] c"Welcome registered user : %s !\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 6, i32* %15
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 2
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 1, i32* %3
br label %150
26: ; preds = %2
%27 = call i64 @malloc(i32 2048)
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %10
%29 = call i64 @malloc(i32 65)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %11
%31 = call i64 @malloc(i32 65)
%32 = inttoptr i64 %31 to i8*
store i8* %32, i8** %12
%33 = call i64 @malloc(i32 2048)
%34 = inttoptr i64 %33 to i8*
store i8* %34, i8** %13
%35 = call i64 @malloc(i32 2048)
%36 = inttoptr i64 %35 to i8*
store i8* %36, i8** %14
%37 = call i64 @malloc(i32 65)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %18
%39 = load i8*, i8** %10
%40 = call i32 @memset(i8* %39, i32 0, i32 2048)
%41 = load i8*, i8** %14
%42 = call i32 @memset(i8* %41, i32 1, i32 2048)
%43 = load i8*, i8** %12
%44 = call i32 @memset(i8* %43, i32 0, i32 65)
%45 = load i8*, i8** %11
%46 = call i32 @memset(i8* %45, i32 0, i32 65)
%47 = load i8*, i8** %13
%48 = call i32 @memset(i8* %47, i32 0, i32 2048)
%49 = load i8*, i8** %18
%50 = call i32 @memset(i8* %49, i32 0, i32 65)
%51 = load i8*, i8** %18
%52 = call i32 @strcpy(i8* %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %17
br label %54
54: ; preds = %67, %26
%55 = load i32, i32* %17
%56 = icmp slt i32 %55, 23
br i1 %56, label %57, label %70
57: ; preds = %54
%58 = load i8*, i8** %14
%59 = load i32, i32* %17
%60 = add nsw i32 2045, %59
%61 = sext i32 %60 to i64
%62 = mul i64 %61, 1
%63 = getelementptr inbounds i8, i8* %58, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %57
%68 = load i32, i32* %17
%69 = add nsw i32 %68, 1
store i32 %69, i32* %17
br label %54
70: ; preds = %54
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%72 = load i8*, i8** %14
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32 @strcpy(i8* %72, i8* %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %17
br label %78
78: ; preds = %91, %70
%79 = load i32, i32* %17
%80 = icmp slt i32 %79, 23
br i1 %80, label %81, label %94
81: ; preds = %78
%82 = load i8*, i8** %14
%83 = load i32, i32* %17
%84 = add nsw i32 2045, %83
%85 = sext i32 %84 to i64
%86 = mul i64 %85, 1
%87 = getelementptr inbounds i8, i8* %82, i64 %86
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %81
%92 = load i32, i32* %17
%93 = add nsw i32 %92, 1
store i32 %93, i32* %17
br label %78
94: ; preds = %78
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%96 = load i32, i32* %15
%97 = call i32 @interpretor(i8** %14, i32* %6, i32* %7, i8** %10, i32 %96)
store i32 %97, i32* %16
%98 = load i32, i32* %16
%99 = icmp sgt i32 %98, 0
br i1 %99, label %100, label %101
100: ; preds = %94
store i32 2, i32* %3
br label %150
101: ; preds = %94
%102 = load i8*, i8** %14
%103 = call i32 @memset(i8* %102, i32 0, i32 2048)
%104 = load i8*, i8** %10
%105 = call i32 @Base64Decode(i8* %104, i8** %14)
%106 = load i8*, i8** %10
%107 = call i32 @memset(i8* %106, i32 0, i32 2048)
%108 = load i32, i32* %6
%109 = call i32 @PRBG_RSA(i8** %10, i32 %108)
%110 = load i8*, i8** %10
%111 = call i32 @hash_function(i8* %110, i8** %11)
%112 = call i32 @get_mac_adress(i8** %13)
%113 = load i8*, i8** %11
%114 = load i8*, i8** %13
%115 = load i32, i32* %7
%116 = call i32 @HKDF(i8* %113, i8* %114, i32 %115, i8** %12)
%117 = load i8*, i8** %12
%118 = load i8*, i8** %14
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %117, i8* %118)
%120 = load i8*, i8** %12
%121 = load i8*, i8** %14
%122 = call i64 @strcmp(i8* %120, i8* %121)
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %128
124: ; preds = %101
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%126 = load i8*, i8** %14
%127 = call i32 @sha256(i8* %126, i8** %18)
br label %130
128: ; preds = %101
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %130
130: ; preds = %128, %124
%131 = load i8*, i8** %18
%132 = call i64 @strcmp(i8* %131, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %130
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %139
136: ; preds = %130
%137 = load i8*, i8** %18
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8* %137)
br label %139
139: ; preds = %136, %134
%140 = load i8*, i8** %10
%141 = call i32 @free(i8* %140)
%142 = load i8*, i8** %11
%143 = call i32 @free(i8* %142)
%144 = load i8*, i8** %12
%145 = call i32 @free(i8* %144)
%146 = load i8*, i8** %13
%147 = call i32 @free(i8* %146)
%148 = load i8*, i8** %14
%149 = call i32 @free(i8* %148)
store i32 0, i32* %3
br label %150
150: ; preds = %139, %100, %21
%151 = load i32, i32* %3
ret i32 %151
}

LLVM IR (-O2):
@.str = [17 x i8] c"./%s <your code>\00"
@.str.1 = [6 x i8] c"guest\00"
@.str.2 = [22 x i8] c"Heap avant Overflow :\00"
@.str.3 = [4 x i8] c" %d\00"
@.str.5 = [23 x i8] c"Heap apr\C3\A8s Overflow :\00"
@.str.6 = [19 x i8] c"Key : %s\0ACode: %s\0A\00"
@.str.10 = [32 x i8] c"Welcome registered user : %s !\0A\00"
@str = [12 x i8] c"Bad code...\00"
@str.11 = [17 x i8] c"Welcome guest...\00"
@str.12 = [22 x i8] c"Your code is OK !!\\o/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i8** %5 to i8*
%14 = bitcast i8** %6 to i8*
%15 = bitcast i8** %7 to i8*
%16 = bitcast i8** %8 to i8*
%17 = bitcast i8** %9 to i8*
%18 = bitcast i8** %10 to i8*
%19 = icmp slt i32 %0, 2
br i1 %19, label %20, label %23
20: ; preds = %2
%21 = load i8*, i8** %1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %286
23: ; preds = %2
%24 = tail call i64 @malloc(i32 2048)
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %5
%26 = tail call i64 @malloc(i32 65)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %6
%28 = tail call i64 @malloc(i32 65)
%29 = inttoptr i64 %28 to i8*
store i8* %29, i8** %7
%30 = tail call i64 @malloc(i32 2048)
%31 = inttoptr i64 %30 to i8*
store i8* %31, i8** %8
%32 = tail call i64 @malloc(i32 2048)
%33 = inttoptr i64 %32 to i8*
store i8* %33, i8** %9
%34 = tail call i64 @malloc(i32 65)
%35 = inttoptr i64 %34 to i8*
store i8* %35, i8** %10
%36 = tail call i32 @memset(i8* %25, i32 0, i32 2048)
%37 = tail call i32 @memset(i8* %33, i32 1, i32 2048)
%38 = tail call i32 @memset(i8* %29, i32 0, i32 65)
%39 = tail call i32 @memset(i8* %27, i32 0, i32 65)
%40 = tail call i32 @memset(i8* %31, i32 0, i32 2048)
%41 = tail call i32 @memset(i8* %35, i32 0, i32 65)
%42 = tail call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%44 = getelementptr inbounds i8, i8* %33, i64 2045
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds i8, i8* %33, i64 2046
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds i8, i8* %33, i64 2047
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds i8, i8* %33, i64 2048
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds i8, i8* %33, i64 2049
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds i8, i8* %33, i64 2050
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds i8, i8* %33, i64 2051
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %70)
%72 = getelementptr inbounds i8, i8* %33, i64 2052
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds i8, i8* %33, i64 2053
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds i8, i8* %33, i64 2054
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %82)
%84 = getelementptr inbounds i8, i8* %33, i64 2055
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds i8, i8* %33, i64 2056
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %90)
%92 = getelementptr inbounds i8, i8* %33, i64 2057
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %94)
%96 = getelementptr inbounds i8, i8* %33, i64 2058
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds i8, i8* %33, i64 2059
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %102)
%104 = getelementptr inbounds i8, i8* %33, i64 2060
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %106)
%108 = getelementptr inbounds i8, i8* %33, i64 2061
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %110)
%112 = getelementptr inbounds i8, i8* %33, i64 2062
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds i8, i8* %33, i64 2063
%117 = load i8, i8* %116
%118 = sext i8 %117 to i32
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %118)
%120 = getelementptr inbounds i8, i8* %33, i64 2064
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %122)
%124 = getelementptr inbounds i8, i8* %33, i64 2065
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %126)
%128 = getelementptr inbounds i8, i8* %33, i64 2066
%129 = load i8, i8* %128
%130 = sext i8 %129 to i32
%131 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %130)
%132 = getelementptr inbounds i8, i8* %33, i64 2067
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %134)
%136 = tail call i32 @putchar(i32 10)
%137 = load i8*, i8** %9
%138 = getelementptr inbounds i8*, i8** %1, i64 1
%139 = load i8*, i8** %138
%140 = tail call i32 @strcpy(i8* %137, i8* %139)
%141 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%142 = getelementptr inbounds i8, i8* %137, i64 2045
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %144)
%146 = getelementptr inbounds i8, i8* %137, i64 2046
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %148)
%150 = getelementptr inbounds i8, i8* %137, i64 2047
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %152)
%154 = getelementptr inbounds i8, i8* %137, i64 2048
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %156)
%158 = getelementptr inbounds i8, i8* %137, i64 2049
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %160)
%162 = getelementptr inbounds i8, i8* %137, i64 2050
%163 = load i8, i8* %162
%164 = sext i8 %163 to i32
%165 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %164)
%166 = getelementptr inbounds i8, i8* %137, i64 2051
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %168)
%170 = getelementptr inbounds i8, i8* %137, i64 2052
%171 = load i8, i8* %170
%172 = sext i8 %171 to i32
%173 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %172)
%174 = getelementptr inbounds i8, i8* %137, i64 2053
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %176)
%178 = getelementptr inbounds i8, i8* %137, i64 2054
%179 = load i8, i8* %178
%180 = sext i8 %179 to i32
%181 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %180)
%182 = getelementptr inbounds i8, i8* %137, i64 2055
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
%185 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %184)
%186 = getelementptr inbounds i8, i8* %137, i64 2056
%187 = load i8, i8* %186
%188 = sext i8 %187 to i32
%189 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %188)
%190 = getelementptr inbounds i8, i8* %137, i64 2057
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %192)
%194 = getelementptr inbounds i8, i8* %137, i64 2058
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %196)
%198 = getelementptr inbounds i8, i8* %137, i64 2059
%199 = load i8, i8* %198
%200 = sext i8 %199 to i32
%201 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %200)
%202 = getelementptr inbounds i8, i8* %137, i64 2060
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %204)
%206 = getelementptr inbounds i8, i8* %137, i64 2061
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %208)
%210 = getelementptr inbounds i8, i8* %137, i64 2062
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %212)
%214 = getelementptr inbounds i8, i8* %137, i64 2063
%215 = load i8, i8* %214
%216 = sext i8 %215 to i32
%217 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %216)
%218 = getelementptr inbounds i8, i8* %137, i64 2064
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %220)
%222 = getelementptr inbounds i8, i8* %137, i64 2065
%223 = load i8, i8* %222
%224 = sext i8 %223 to i32
%225 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %224)
%226 = getelementptr inbounds i8, i8* %137, i64 2066
%227 = load i8, i8* %226
%228 = sext i8 %227 to i32
%229 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %228)
%230 = getelementptr inbounds i8, i8* %137, i64 2067
%231 = load i8, i8* %230
%232 = sext i8 %231 to i32
%233 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %232)
%234 = tail call i32 @putchar(i32 10)
%235 = call i32 @interpretor(i8** %9, i32* %3, i32* %4, i8** %5, i32 6)
%236 = icmp sgt i32 %235, 0
br i1 %236, label %286, label %237
237: ; preds = %23
%238 = load i8*, i8** %9
%239 = call i32 @memset(i8* %238, i32 0, i32 2048)
%240 = load i8*, i8** %5
%241 = call i32 @Base64Decode(i8* %240, i8** %9)
%242 = load i8*, i8** %5
%243 = call i32 @memset(i8* %242, i32 0, i32 2048)
%244 = load i32, i32* %3
%245 = call i32 @PRBG_RSA(i8** %5, i32 %244)
%246 = load i8*, i8** %5
%247 = call i32 @hash_function(i8* %246, i8** %6)
%248 = call i32 @get_mac_adress(i8** %8)
%249 = load i8*, i8** %6
%250 = load i8*, i8** %8
%251 = load i32, i32* %4
%252 = call i32 @HKDF(i8* %249, i8* %250, i32 %251, i8** %7)
%253 = load i8*, i8** %7
%254 = load i8*, i8** %9
%255 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %253, i8* %254)
%256 = load i8*, i8** %7
%257 = load i8*, i8** %9
%258 = call i64 @strcmp(i8* %256, i8* %257)
%259 = icmp eq i64 %258, 0
br i1 %259, label %260, label %264
260: ; preds = %237
%261 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.12, i64 0, i64 0))
%262 = load i8*, i8** %9
%263 = call i32 @sha256(i8* %262, i8** %10)
br label %266
264: ; preds = %237
%265 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %266
266: ; preds = %264, %260
%267 = load i8*, i8** %10
%268 = call i64 @strcmp(i8* %267, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%269 = icmp eq i64 %268, 0
br i1 %269, label %270, label %272
270: ; preds = %266
%271 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0))
br label %275
272: ; preds = %266
%273 = load i8*, i8** %10
%274 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8* %273)
br label %275
275: ; preds = %272, %270
%276 = load i8*, i8** %5
%277 = call i32 @free(i8* %276)
%278 = load i8*, i8** %6
%279 = call i32 @free(i8* %278)
%280 = load i8*, i8** %7
%281 = call i32 @free(i8* %280)
%282 = load i8*, i8** %8
%283 = call i32 @free(i8* %282)
%284 = load i8*, i8** %9
%285 = call i32 @free(i8* %284)
br label %286
286: ; preds = %23, %275, %20
%287 = phi i32 [ 1, %20 ], [ 0, %275 ], [ 2, %23 ]
ret i32 %287
}