// File: /workspace/github_c_makefile_star2_O0/zecoxao[P]ps3_decrypt_tools/lib/des.c
// Function: des_crypt_ecb
int des_crypt_ecb(des_context *ctx,
        const unsigned char input[8],
        unsigned char output[8]) {
    int i;
    uint32_t X, Y, T, *SK;

    SK = ctx->sk;

    GET_UINT32_BE(X, input, 0);
    GET_UINT32_BE(Y, input, 4);

    DES_IP(X, Y);

    for (i = 0; i < 8; i++) {
        DES_ROUND(Y, X);
        DES_ROUND(X, Y);
    }

    DES_FP(Y, X);

    PUT_UINT32_BE(Y, output, 0);
    PUT_UINT32_BE(X, output, 4);

    return ( 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
shll $0x18, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %eax
shll $0x18, %eax
movq -0x10(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
shrl $0x4, %eax
xorl -0x24(%rbp), %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
shll $0x4, %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
shrl $0x10, %eax
xorl -0x24(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
shll $0x10, %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
shrl $0x2, %eax
xorl -0x20(%rbp), %eax
andl $0x33333333, %eax       # imm = 0x33333333
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
shll $0x2, %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x8, %eax
xorl -0x20(%rbp), %eax
andl $0xff00ff, %eax         # imm = 0xFF00FF
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
shll $0x8, %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shll %eax
movl -0x24(%rbp), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
andl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
xorl -0x24(%rbp), %eax
andl $0xaaaaaaaa, %eax       # imm = 0xAAAAAAAA
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
shll %eax
movl -0x20(%rbp), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
andl $-0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x847e
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl (%rax), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x80fa(%rip), %rax      # 0x103a0
movl (%rax,%rcx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x8, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x81e3(%rip), %rcx      # 0x104a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x82cc(%rip), %rcx      # 0x105a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x18, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x83b5(%rip), %rcx      # 0x106a0
xorl (%rcx,%rdx,4), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl (%rax), %eax
movl -0x24(%rbp), %ecx
shll $0x1c, %ecx
movl -0x24(%rbp), %edx
shrl $0x4, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x8477(%rip), %rax      # 0x107a0
movl (%rax,%rcx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x8, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8560(%rip), %rcx      # 0x108a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8649(%rip), %rcx      # 0x109a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x18, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8732(%rip), %rcx      # 0x10aa0
xorl (%rcx,%rdx,4), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl (%rax), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x8001(%rip), %rax      # 0x103a0
movl (%rax,%rcx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x8, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x80ea(%rip), %rcx      # 0x104a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x81d3(%rip), %rcx      # 0x105a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x18, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x82bc(%rip), %rcx      # 0x106a0
xorl (%rcx,%rdx,4), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl (%rax), %eax
movl -0x20(%rbp), %ecx
shll $0x1c, %ecx
movl -0x20(%rbp), %edx
shrl $0x4, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x837e(%rip), %rax      # 0x107a0
movl (%rax,%rcx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x8, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8467(%rip), %rcx      # 0x108a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8550(%rip), %rcx      # 0x109a0
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rbp), %ecx
shrl $0x18, %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x8639(%rip), %rcx      # 0x10aa0
xorl (%rcx,%rdx,4), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8274
movl -0x24(%rbp), %eax
shll $0x1f, %eax
movl -0x24(%rbp), %ecx
shrl %ecx
orl %ecx, %eax
andl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
xorl -0x20(%rbp), %eax
andl $0xaaaaaaaa, %eax       # imm = 0xAAAAAAAA
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
shll $0x1f, %eax
movl -0x20(%rbp), %ecx
shrl %ecx
orl %ecx, %eax
andl $-0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
shrl $0x8, %eax
xorl -0x24(%rbp), %eax
andl $0xff00ff, %eax         # imm = 0xFF00FF
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
shll $0x8, %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
shrl $0x2, %eax
xorl -0x24(%rbp), %eax
andl $0x33333333, %eax       # imm = 0x33333333
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
shll $0x2, %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
xorl -0x20(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
shll $0x10, %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x4, %eax
xorl -0x20(%rbp), %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
shll $0x4, %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x24(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x20(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x4(%rax)
movl -0x20(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x5(%rax)
movl -0x20(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x6(%rax)
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x7(%rax)
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)