#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*/ F(int, unsigned char *, unsigned char *, unsigned char *,
                     unsigned char *);
int /*<<< orphan*/ _ip(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ compress0(unsigned char *, unsigned char *);
int /*<<< orphan*/ ip(unsigned char *, unsigned char *, unsigned char *);
void discrypt0(unsigned char *mtext, unsigned char *text) {
  unsigned char ll[64], rr[64], LL[64], RR[64];
  unsigned char tmp[64];
  int i, j;
  ip(mtext, ll, rr);
  for (i = 16; i > 0; i--) {
    F(i, ll, rr, LL, RR);
    for (j = 0; j < 32; j++) {
      ll[j] = LL[j];
      rr[j] = RR[j];
    }
  }
  _ip(tmp, rr, ll);
  compress0(tmp, text);
}


x86 assembly (clang, -O0):
<discrypt0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1060 <ip@plt>
movl   $0x10,-0x154(%rbp)
cmpl   $0x0,-0x154(%rbp)
jle    121b <discrypt0+0xdb>
mov    -0x154(%rbp),%edi
lea    -0x50(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    -0x110(%rbp),%r8
call   1030 <F@plt>
movl   $0x0,-0x158(%rbp)
cmpl   $0x20,-0x158(%rbp)
jge    1202 <discrypt0+0xc2>
movslq -0x158(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%cl
movslq -0x158(%rbp),%rax
mov    %cl,-0x50(%rbp,%rax,1)
movslq -0x158(%rbp),%rax
mov    -0x110(%rbp,%rax,1),%cl
movslq -0x158(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    11ac <discrypt0+0x6c>
jmp    1207 <discrypt0+0xc7>
mov    -0x154(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x154(%rbp)
jmp    1171 <discrypt0+0x31>
lea    -0x150(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <_ip@plt>
lea    -0x150(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <compress0@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrypt0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %rsi,%r14
lea    0x40(%rsp),%r15
mov    %rsp,%r12
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <ip@plt>
mov    $0x11,%ebp
lea    0xc0(%rsp),%r13
lea    0x80(%rsp),%rbx
nopl   0x0(%rax)
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1030 <F@plt>
movaps 0xc0(%rsp),%xmm0
movaps 0xd0(%rsp),%xmm1
movaps %xmm0,0x40(%rsp)
movaps %xmm1,0x50(%rsp)
movaps 0x80(%rsp),%xmm0
movaps 0x90(%rsp),%xmm1
movaps %xmm0,(%rsp)
movaps %xmm1,0x10(%rsp)
cmp    $0x1,%ebp
ja     1180 <discrypt0+0x40>
lea    0x100(%rsp),%rbx
mov    %rsp,%rsi
lea    0x40(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <_ip@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <compress0@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @discrypt0(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [64 x i8]
%6 = alloca [64 x i8]
%7 = alloca [64 x i8]
%8 = alloca [64 x i8]
%9 = alloca [64 x i8]
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%15 = call i32 @ip(i8* %12, i8* %13, i8* %14)
store i32 16, i32* %10
br label %16
16: ; preds = %48, %2
%17 = load i32, i32* %10
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %51
19: ; preds = %16
%20 = load i32, i32* %10
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%22 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%23 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%25 = call i32 @F(i32 %20, i8* %21, i8* %22, i8* %23, i8* %24)
store i32 0, i32* %11
br label %26
26: ; preds = %44, %19
%27 = load i32, i32* %11
%28 = icmp slt i32 %27, 32
br i1 %28, label %29, label %47
29: ; preds = %26
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 %35
store i8 %33, i8* %36
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 %42
store i8 %40, i8* %43
br label %44
44: ; preds = %29
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %26
47: ; preds = %26
br label %48
48: ; preds = %47
%49 = load i32, i32* %10
%50 = add nsw i32 %49, -1
store i32 %50, i32* %10
br label %16
51: ; preds = %16
%52 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%53 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%54 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%55 = call i32 @_ip(i8* %52, i8* %53, i8* %54)
%56 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%57 = load i8*, i8** %4
%58 = call i32 @compress0(i8* %56, i8* %57)
ret void
}

LLVM IR (-O2):
define void @discrypt0(i8* %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = alloca [64 x i8]
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = alloca [64 x i8]
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%11 = alloca [64 x i8]
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%17 = call i32 @ip(i8* %0, i8* %12, i8* %13)
br label %18
18: ; preds = %2, %18
%19 = phi i32 [ 16, %2 ], [ %21, %18 ]
%20 = call i32 @F(i32 %19, i8* %12, i8* %13, i8* %14, i8* %15)
%21 = add nsw i32 %19, -1
%22 = icmp ugt i32 %19, 1
br i1 %22, label %18, label %23
23: ; preds = %18
%24 = call i32 @_ip(i8* %16, i8* %13, i8* %12)
%25 = call i32 @compress0(i8* %16, i8* %1)
ret void
}