#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 get_sym_alg_mode();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reset_sym_alg_mode();
int /*<<< orphan*/ skip(int);
extern void Symmetrically_Encrypted_Data_Packet(int len) {
  int mode = get_sym_alg_mode();
  switch (mode) {
  case 1:
    printf("\tEncrypted data [sym alg is IDEA, simple string-to-key]\n");
    break;
  case 2:
    printf("\tEncrypted data [sym alg is specified in sym-key encrypted "
           "session key]\n");
    break;
  case 3:
    printf("\tEncrypted data [sym alg is specified in pub-key encrypted "
           "session key]\n");
    break;
  }
  skip(len);
  reset_sym_alg_mode();
}


x86 assembly (clang, -O0):
<Symmetrically_Encrypted_Data_Packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1040 <get_sym_alg_mode@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     118b <Symmetrically_Encrypted_Data_Packet+0x4b>
jmp    1169 <Symmetrically_Encrypted_Data_Packet+0x29>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     119c <Symmetrically_Encrypted_Data_Packet+0x5c>
jmp    117a <Symmetrically_Encrypted_Data_Packet+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11ad <Symmetrically_Encrypted_Data_Packet+0x6d>
jmp    11b9 <Symmetrically_Encrypted_Data_Packet+0x79>
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
jmp    11b9 <Symmetrically_Encrypted_Data_Packet+0x79>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
jmp    11b9 <Symmetrically_Encrypted_Data_Packet+0x79>
lea    0xece(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <skip@plt>
mov    $0x0,%al
call   1060 <reset_sym_alg_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Symmetrically_Encrypted_Data_Packet>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <get_sym_alg_mode@plt>
add    $0xffffffff,%eax
cmp    $0x2,%eax
ja     1167 <Symmetrically_Encrypted_Data_Packet+0x27>
cltq
lea    0xf6d(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1030 <skip@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <reset_sym_alg_mode@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"\09Encrypted data [sym alg is IDEA, simple string-to-key]\0A\00"
@.str.1 = [73 x i8] c"\09Encrypted data [sym alg is specified in sym-key encrypted session key]\0A\00"
@.str.2 = [73 x i8] c"\09Encrypted data [sym alg is specified in pub-key encrypted session key]\0A\00"
define void @Symmetrically_Encrypted_Data_Packet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_sym_alg_mode()
store i32 %4, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %1, %10, %8, %6
%13 = load i32, i32* %2
%14 = call i32 @skip(i32 %13)
%15 = call i32 (...) @reset_sym_alg_mode()
ret void
}

LLVM IR (-O2):
@str = [72 x i8] c"\09Encrypted data [sym alg is specified in pub-key encrypted session key]\00"
@str.3 = [72 x i8] c"\09Encrypted data [sym alg is specified in sym-key encrypted session key]\00"
@str.4 = [56 x i8] c"\09Encrypted data [sym alg is IDEA, simple string-to-key]\00"
@reltable.Symmetrically_Encrypted_Data_Packet = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([56 x i8]* @str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.Symmetrically_Encrypted_Data_Packet to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([72 x i8]* @str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.Symmetrically_Encrypted_Data_Packet to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([72 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.Symmetrically_Encrypted_Data_Packet to i64)) to i32)]
define void @Symmetrically_Encrypted_Data_Packet(i32 %0) {
%2 = tail call i32 (...) @get_sym_alg_mode()
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.Symmetrically_Encrypted_Data_Packet to i8*), i64 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %1, %5
%11 = tail call i32 @skip(i32 %0)
%12 = tail call i32 (...) @reset_sym_alg_mode()
ret void
}