#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 u_char;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void wep_40keyprint(u_char *keys) {
  int i;
  char sepchar;
  for (i = 0; i < (5 * 4); i++) {
    if (i % 5 == 0)
      printf("%d: ", i / 5);
    sepchar = (i % 5 == 5 - 1) ? '\n' : ':';
    printf("%02x%c", keys[i], sepchar);
  }
  return;
}


x86 assembly (clang, -O0):
<wep_40keyprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    11a5 <wep_40keyprint+0x95>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <wep_40keyprint+0x4c>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    $0x3a,%eax
mov    $0xa,%ecx
cmp    $0x4,%edx
cmove  %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
movsbl -0xd(%rbp),%edx
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <wep_40keyprint+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wep_40keyprint>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r12
lea    0xedd(%rip),%r14
lea    0xedb(%rip),%r15
xor    %ebx,%ebx
jmp    1144 <wep_40keyprint+0x34>
xchg   %ax,%ax
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x14,%rbx
je     118a <wep_40keyprint+0x7a>
movzbl %bl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%ecx
neg    %ecx
movzbl %cl,%r13d
lea    (%rbx,%r13,1),%rcx
test   %cl,%cl
jne    116e <wep_40keyprint+0x5e>
movzbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%r13,1),%rax
add    $0xfffffffffffffffc,%rax
mov    (%r12,%rbx,4),%esi
mov    $0xa,%edx
test   %al,%al
je     1130 <wep_40keyprint+0x20>
mov    $0x3a,%edx
jmp    1130 <wep_40keyprint+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d: \00"
@.str.1 = [7 x i8] c"%02x%c\00"
define void @wep_40keyprint(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %31, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %34
8: ; preds = %5
%9 = load i32, i32* %3
%10 = srem i32 %9, 5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 5
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %3
%18 = srem i32 %17, 5
%19 = icmp eq i32 %18, 4
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 10, i32 58
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
%23 = load i32*, i32** %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %29)
br label %31
31: ; preds = %16
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %5
34: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d: \00"
@.str.1 = [7 x i8] c"%02x%c\00"
define void @wep_40keyprint(i32* nocapture %0) {
br label %2
2: ; preds = %1, %11
%3 = phi i64 [ 0, %1 ], [ %17, %11 ]
%4 = trunc i64 %3 to i8
%5 = urem i8 %4, 5
%6 = udiv i8 %4, 5
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = zext i8 %6 to i32
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %2
%12 = icmp eq i8 %5, 4
%13 = getelementptr inbounds i32, i32* %0, i64 %3
%14 = load i32, i32* %13
%15 = select i1 %12, i32 10, i32 58
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
%17 = add nuw nsw i64 %3, 1
%18 = icmp eq i64 %17, 20
br i1 %18, label %19, label %2
19: ; preds = %11
ret void
}