#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 */
unsigned char rotor_encipher(unsigned char, unsigned char,
                             unsigned char const *);
unsigned char encipher(const unsigned char *rotors[6],
                       const unsigned char *reflector, unsigned char fast,
                       unsigned char mid, unsigned char slow, unsigned char n) {
  n = rotor_encipher(n, fast, rotors[0]);
  n = rotor_encipher(n, mid, rotors[1]);
  n = rotor_encipher(n, slow, rotors[2]);
  n = reflector[n];
  n = rotor_encipher(n, slow, rotors[3]);
  n = rotor_encipher(n, mid, rotors[4]);
  n = rotor_encipher(n, fast, rotors[5]);
  return n;
}


x86 assembly (clang, -O0):
<encipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x2c(%rbp)
mov    %ecx,%eax
mov    -0x2c(%rbp),%ecx
mov    %eax,-0x28(%rbp)
mov    %edx,%eax
mov    -0x28(%rbp),%edx
mov    %eax,-0x24(%rbp)
mov    %rsi,%rax
mov    -0x24(%rbp),%esi
mov    %rax,-0x20(%rbp)
mov    %rdi,%r8
mov    -0x20(%rbp),%rdi
mov    %r9b,%al
mov    %r8,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %dl,-0x12(%rbp)
mov    %cl,-0x13(%rbp)
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x11(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x12(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    0x8(%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x13(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    0x10(%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x13(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    0x18(%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x12(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    0x20(%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%cl
mov    -0x11(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    0x28(%rdx),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <rotor_encipher@plt>
mov    %al,-0x14(%rbp)
movzbl -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encipher>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%ebp
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%rbx
mov    (%rdi),%rdx
mov    %r9d,%edi
mov    %r14d,%esi
call   1030 <rotor_encipher@plt>
mov    0x8(%rbx),%rdx
movzbl %al,%edi
mov    %r15d,%esi
call   1030 <rotor_encipher@plt>
mov    0x10(%rbx),%rdx
movzbl %al,%edi
mov    %ebp,%esi
call   1030 <rotor_encipher@plt>
movzbl %al,%eax
movzbl (%r12,%rax,1),%edi
mov    0x18(%rbx),%rdx
mov    %ebp,%esi
call   1030 <rotor_encipher@plt>
mov    0x20(%rbx),%rdx
movzbl %al,%edi
mov    %r15d,%esi
call   1030 <rotor_encipher@plt>
mov    0x28(%rbx),%rdx
movzbl %al,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <rotor_encipher@plt>

LLVM IR (-O0):
define zeroext i8 @encipher(i8** %0, i8* %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8** %0, i8*** %7
store i8* %1, i8** %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%13 = load i8, i8* %12
%14 = load i8, i8* %9
%15 = load i8**, i8*** %7
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call zeroext i8 @rotor_encipher(i8 zeroext %13, i8 zeroext %14, i8* %17)
store i8 %18, i8* %12
%19 = load i8, i8* %12
%20 = load i8, i8* %10
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call zeroext i8 @rotor_encipher(i8 zeroext %19, i8 zeroext %20, i8* %23)
store i8 %24, i8* %12
%25 = load i8, i8* %12
%26 = load i8, i8* %11
%27 = load i8**, i8*** %7
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call zeroext i8 @rotor_encipher(i8 zeroext %25, i8 zeroext %26, i8* %29)
store i8 %30, i8* %12
%31 = load i8*, i8** %8
%32 = load i8, i8* %12
%33 = zext i8 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
store i8 %35, i8* %12
%36 = load i8, i8* %12
%37 = load i8, i8* %11
%38 = load i8**, i8*** %7
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call zeroext i8 @rotor_encipher(i8 zeroext %36, i8 zeroext %37, i8* %40)
store i8 %41, i8* %12
%42 = load i8, i8* %12
%43 = load i8, i8* %10
%44 = load i8**, i8*** %7
%45 = getelementptr inbounds i8*, i8** %44, i64 4
%46 = load i8*, i8** %45
%47 = call zeroext i8 @rotor_encipher(i8 zeroext %42, i8 zeroext %43, i8* %46)
store i8 %47, i8* %12
%48 = load i8, i8* %12
%49 = load i8, i8* %9
%50 = load i8**, i8*** %7
%51 = getelementptr inbounds i8*, i8** %50, i64 5
%52 = load i8*, i8** %51
%53 = call zeroext i8 @rotor_encipher(i8 zeroext %48, i8 zeroext %49, i8* %52)
store i8 %53, i8* %12
%54 = load i8, i8* %12
ret i8 %54
}

LLVM IR (-O2):
define zeroext i8 @encipher(i8** nocapture %0, i8* nocapture %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = load i8*, i8** %0
%8 = tail call zeroext i8 @rotor_encipher(i8 zeroext %5, i8 zeroext %2, i8* %7)
%9 = getelementptr inbounds i8*, i8** %0, i64 1
%10 = load i8*, i8** %9
%11 = tail call zeroext i8 @rotor_encipher(i8 zeroext %8, i8 zeroext %3, i8* %10)
%12 = getelementptr inbounds i8*, i8** %0, i64 2
%13 = load i8*, i8** %12
%14 = tail call zeroext i8 @rotor_encipher(i8 zeroext %11, i8 zeroext %4, i8* %13)
%15 = zext i8 %14 to i64
%16 = getelementptr inbounds i8, i8* %1, i64 %15
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8*, i8** %0, i64 3
%19 = load i8*, i8** %18
%20 = tail call zeroext i8 @rotor_encipher(i8 zeroext %17, i8 zeroext %4, i8* %19)
%21 = getelementptr inbounds i8*, i8** %0, i64 4
%22 = load i8*, i8** %21
%23 = tail call zeroext i8 @rotor_encipher(i8 zeroext %20, i8 zeroext %3, i8* %22)
%24 = getelementptr inbounds i8*, i8** %0, i64 5
%25 = load i8*, i8** %24
%26 = tail call zeroext i8 @rotor_encipher(i8 zeroext %23, i8 zeroext %2, i8* %25)
ret i8 %26
}