#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 */
typedef int /*<<< orphan*/ uint16_t;
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ skipjack_a_inv(int /*<<< orphan*/ *, int, void *);
int /*<<< orphan*/ skipjack_b_inv(int /*<<< orphan*/ *, int, void *);
void skipjack_dec(void *block, void *key) {
  int8_t k;
  for (k = 31; k >= 0; --k) {
    if (k & 0x08) {
      skipjack_b_inv((uint16_t *)block, k, key);
    } else {
      skipjack_a_inv((uint16_t *)block, k, key);
    }
  }
}


x86 assembly (clang, -O0):
<skipjack_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1f,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1188 <skipjack_dec+0x68>
mov    -0x14(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1165 <skipjack_dec+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <skipjack_b_inv@plt>
jmp    1175 <skipjack_dec+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <skipjack_a_inv@plt>
jmp    117a <skipjack_dec+0x5a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <skipjack_dec+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipjack_dec>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1f,%ebp
jmp    114a <skipjack_dec+0x2a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <skipjack_a_inv@plt>
add    $0xffffffff,%ebp
jae    1162 <skipjack_dec+0x42>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
test   $0x8,%bpl
je     1140 <skipjack_dec+0x20>
call   1040 <skipjack_b_inv@plt>
add    $0xffffffff,%ebp
jb     114a <skipjack_dec+0x2a>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @skipjack_dec(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 31, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %6
%10 = load i32, i32* %5
%11 = and i32 %10, 8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %5
%17 = load i8*, i8** %4
%18 = call i32 @skipjack_b_inv(i32* %15, i32 %16, i8* %17)
br label %25
19: ; preds = %9
%20 = load i8*, i8** %3
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %5
%23 = load i8*, i8** %4
%24 = call i32 @skipjack_a_inv(i32* %21, i32 %22, i8* %23)
br label %25
25: ; preds = %19, %13
br label %26
26: ; preds = %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, -1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @skipjack_dec(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32*
br label %4
4: ; preds = %2, %12
%5 = phi i32 [ 31, %2 ], [ %13, %12 ]
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @skipjack_b_inv(i32* %3, i32 %5, i8* %1)
br label %12
10: ; preds = %4
%11 = tail call i32 @skipjack_a_inv(i32* %3, i32 %5, i8* %1)
br label %12
12: ; preds = %8, %10
%13 = add nsw i32 %5, -1
%14 = icmp eq i32 %5, 0
br i1 %14, label %15, label %4
15: ; preds = %12
ret void
}