#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 */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ funcionAES(int);
int /*<<< orphan*/ funcionRSA(int);
int /*<<< orphan*/ funcionSHA(int);
int leerAlgoritmo(int);
int /*<<< orphan*/ printf(char *);
void serverTCP(int s, struct sockaddr_in clientaddr_in) {
  int retorno;
  printf("\x1B[32m           +---------------------------------------+\n");
  printf("           |    ~·~ SERVIDOR CRIPTOGRAFICO   ~·    |\n");
  printf("           +---------------------------------------+\x1B[0m\n");
  retorno = leerAlgoritmo(s);
  if (retorno == -1) {
    return;
  }
  switch (retorno) {
  case 1:
    funcionAES(s);
    break;
  case 2:
    funcionRSA(s);
    break;
  case 3:
    funcionSHA(s);
    break;
  }
}


x86 assembly (clang, -O0):
<serverTCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
lea    0xeca(%rip),%rdi
call   1050 <printf@plt>
lea    0xef6(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <leerAlgoritmo@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    119c <serverTCP+0x4c>
jmp    11f4 <serverTCP+0xa4>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11d2 <serverTCP+0x82>
jmp    11b0 <serverTCP+0x60>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11df <serverTCP+0x8f>
jmp    11c1 <serverTCP+0x71>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     11ec <serverTCP+0x9c>
jmp    11f4 <serverTCP+0xa4>
mov    -0xc(%rbp),%edi
call   1070 <funcionAES@plt>
jmp    11f4 <serverTCP+0xa4>
mov    -0xc(%rbp),%edi
call   1060 <funcionRSA@plt>
jmp    11f4 <serverTCP+0xa4>
mov    -0xc(%rbp),%edi
call   1040 <funcionSHA@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverTCP>:
push   %rbx
mov    %edi,%ebx
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <leerAlgoritmo@plt>
cmp    $0x3,%eax
je     1195 <serverTCP+0x45>
cmp    $0x2,%eax
je     119d <serverTCP+0x4d>
cmp    $0x1,%eax
jne    11a5 <serverTCP+0x55>
mov    %ebx,%edi
pop    %rbx
jmp    1070 <funcionAES@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <funcionSHA@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <funcionRSA@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@.str = [59 x i8] c"\1B[32m +---------------------------------------+\0A\00"
@.str.1 = [56 x i8] c" | ~\C2\B7~ SERVIDOR CRIPTOGRAFICO ~\C2\B7 |\0A\00"
@.str.2 = [58 x i8] c" +---------------------------------------+\1B[0m\0A\00"
define void @serverTCP(i32 %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %1, i32* %6
store i32 %0, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 @leerAlgoritmo(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
br label %26
15: ; preds = %2
%16 = load i32, i32* %5
switch i32 %16, label %26 [
i32 1, label %17
i32 2, label %20
i32 3, label %23
]
17: ; preds = %15
%18 = load i32, i32* %4
%19 = call i32 @funcionAES(i32 %18)
br label %26
20: ; preds = %15
%21 = load i32, i32* %4
%22 = call i32 @funcionRSA(i32 %21)
br label %26
23: ; preds = %15
%24 = load i32, i32* %4
%25 = call i32 @funcionSHA(i32 %24)
br label %26
26: ; preds = %14, %15, %23, %20, %17
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"\1B[32m +---------------------------------------+\00"
@str.3 = [55 x i8] c" | ~\C2\B7~ SERVIDOR CRIPTOGRAFICO ~\C2\B7 |\00"
@str.4 = [57 x i8] c" +---------------------------------------+\1B[0m\00"
define void @serverTCP(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @leerAlgoritmo(i32 %0)
switch i32 %6, label %13 [
i32 3, label %11
i32 1, label %7
i32 2, label %9
]
7: ; preds = %2
%8 = tail call i32 @funcionAES(i32 %0)
br label %13
9: ; preds = %2
%10 = tail call i32 @funcionRSA(i32 %0)
br label %13
11: ; preds = %2
%12 = tail call i32 @funcionSHA(i32 %0)
br label %13
13: ; preds = %7, %9, %11, %2
ret void
}