#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*/ fonction(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void dechiffrement(unsigned char *xi, unsigned char *xo,
                   unsigned char Kn[16][48]) {
  unsigned char r[32], l[32], rp[32], lp[32];
  int i;
  int n;
  memcpy(l, &xi[0], 32);
  memcpy(r, &xi[32], 32);
  for (n = 0; n < 16; n++) {
    memcpy(lp, r, 32);
    fonction(Kn[15 - n], r, rp);
    for (i = 0; i < 32; i++) {
      r[i] = ((l[i]) ^ (rp[i]));
    }
    memcpy(l, lp, 32);
  }
  memcpy(&xo[0], r, 32);
  memcpy(&xo[32], l, 32);
}


x86 assembly (clang, -O0):
<dechiffrement>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0xa8(%rbp)
cmpl   $0x10,-0xa8(%rbp)
jge    122b <dechiffrement+0x10b>
lea    -0xa0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
mov    $0xf,%eax
sub    -0xa8(%rbp),%eax
cltq
imul   $0x30,%rax,%rax
add    %rax,%rdi
lea    -0x40(%rbp),%rsi
lea    -0x80(%rbp),%rdx
call   1030 <fonction@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x20,-0xa4(%rbp)
jge    1202 <dechiffrement+0xe2>
movslq -0xa4(%rbp),%rax
movzbl -0x60(%rbp,%rax,1),%eax
movslq -0xa4(%rbp),%rcx
movzbl -0x80(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %al,%cl
movslq -0xa4(%rbp),%rax
mov    %cl,-0x40(%rbp,%rax,1)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    11ba <dechiffrement+0x9a>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1169 <dechiffrement+0x49>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
lea    -0x60(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dechiffrement>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%r12
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0x20,%rbx
lea    0x30(%rsp),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    $0x2d0,%r14d
lea    0x70(%rsp),%rbx
lea    0x50(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
lea    (%r12,%r14,1),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1030 <fonction@plt>
movaps 0x50(%rsp),%xmm0
movaps 0x60(%rsp),%xmm1
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
xorps  0x20(%rsp),%xmm1
movaps %xmm1,0x40(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0xffffffffffffffd0,%r14
cmp    $0xffffffffffffffd0,%r14
jne    1180 <dechiffrement+0x60>
lea    0x30(%rsp),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0x20,%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dechiffrement(i8* %0, i8* %1, [48 x i8]* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [48 x i8]*
%7 = alloca [32 x i8]
%8 = alloca [32 x i8]
%9 = alloca [32 x i8]
%10 = alloca [32 x i8]
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store [48 x i8]* %2, [48 x i8]** %6
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = call i32 @memcpy(i8* %13, i8* %15, i32 32)
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 32
%20 = call i32 @memcpy(i8* %17, i8* %19, i32 32)
store i32 0, i32* %12
br label %21
21: ; preds = %63, %3
%22 = load i32, i32* %12
%23 = icmp slt i32 %22, 16
br i1 %23, label %24, label %66
24: ; preds = %21
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%27 = call i32 @memcpy(i8* %25, i8* %26, i32 32)
%28 = load [48 x i8]*, [48 x i8]** %6
%29 = load i32, i32* %12
%30 = sub nsw i32 15, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [48 x i8], [48 x i8]* %28, i64 %31
%33 = getelementptr inbounds [48 x i8], [48 x i8]* %32, i64 0, i64 0
%34 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%36 = call i32 @fonction(i8* %33, i8* %34, i8* %35)
store i32 0, i32* %11
br label %37
37: ; preds = %56, %24
%38 = load i32, i32* %11
%39 = icmp slt i32 %38, 32
br i1 %39, label %40, label %59
40: ; preds = %37
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i32, i32* %11
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = xor i32 %45, %50
%52 = trunc i32 %51 to i8
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 %54
store i8 %52, i8* %55
br label %56
56: ; preds = %40
%57 = load i32, i32* %11
%58 = add nsw i32 %57, 1
store i32 %58, i32* %11
br label %37
59: ; preds = %37
%60 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%61 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%62 = call i32 @memcpy(i8* %60, i8* %61, i32 32)
br label %63
63: ; preds = %59
%64 = load i32, i32* %12
%65 = add nsw i32 %64, 1
store i32 %65, i32* %12
br label %21
66: ; preds = %21
%67 = load i8*, i8** %5
%68 = getelementptr inbounds i8, i8* %67, i64 0
%69 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%70 = call i32 @memcpy(i8* %68, i8* %69, i32 32)
%71 = load i8*, i8** %5
%72 = getelementptr inbounds i8, i8* %71, i64 32
%73 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%74 = call i32 @memcpy(i8* %72, i8* %73, i32 32)
ret void
}

LLVM IR (-O2):
define void @dechiffrement(i8* %0, i8* %1, [48 x i8]* %2) {
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = alloca [32 x i8]
%7 = alloca [32 x i8]
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%12 = call i32 @memcpy(i8* %9, i8* %0, i32 32)
%13 = getelementptr inbounds i8, i8* %0, i64 32
%14 = call i32 @memcpy(i8* %8, i8* %13, i32 32)
%15 = bitcast [32 x i8]* %5 to <16 x i8>*
%16 = bitcast [32 x i8]* %6 to <16 x i8>*
%17 = bitcast [32 x i8]* %4 to <16 x i8>*
%18 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 16
%19 = bitcast i8* %18 to <16 x i8>*
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 16
%21 = bitcast i8* %20 to <16 x i8>*
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 16
%23 = bitcast i8* %22 to <16 x i8>*
br label %24
24: ; preds = %3, %24
%25 = phi i64 [ 0, %3 ], [ %37, %24 ]
%26 = call i32 @memcpy(i8* %11, i8* %8, i32 32)
%27 = sub nuw nsw i64 15, %25
%28 = getelementptr inbounds [48 x i8], [48 x i8]* %2, i64 %27, i64 0
%29 = call i32 @fonction(i8* %28, i8* %8, i8* %10)
%30 = load <16 x i8>, <16 x i8>* %15
%31 = load <16 x i8>, <16 x i8>* %16
%32 = xor <16 x i8> %31, %30
store <16 x i8> %32, <16 x i8>* %17
%33 = load <16 x i8>, <16 x i8>* %19
%34 = load <16 x i8>, <16 x i8>* %21
%35 = xor <16 x i8> %34, %33
store <16 x i8> %35, <16 x i8>* %23
%36 = call i32 @memcpy(i8* %9, i8* %11, i32 32)
%37 = add nuw nsw i64 %25, 1
%38 = icmp eq i64 %37, 16
br i1 %38, label %39, label %24
39: ; preds = %24
%40 = call i32 @memcpy(i8* %1, i8* %8, i32 32)
%41 = getelementptr inbounds i8, i8* %1, i64 32
%42 = call i32 @memcpy(i8* %41, i8* %9, i32 32)
ret void
}