#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 uint8_t;
struct rc4hash {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ rc4hash_pack(struct rc4hash const *, int *);
void rc4hash_print(const struct rc4hash *hash, FILE *out) {
  uint8_t packed[26];
  rc4hash_pack(hash, packed);
  for (int i = 0; i < 26; i++) {
    fprintf(out, "%02x", packed[i]);
  }
}


x86 assembly (clang, -O0):
<rc4hash_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <rc4hash_pack@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x1a,-0x84(%rbp)
jge    1186 <rc4hash_print+0x66>
mov    -0x10(%rbp),%rdi
movslq -0x84(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%edx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    114a <rc4hash_print+0x2a>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc4hash_print>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%r15
mov    %rsp,%rsi
call   1040 <rc4hash_pack@plt>
xor    %ebx,%ebx
lea    0xec3(%rip),%r14
nopl   (%rax)
mov    (%rsp,%rbx,4),%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1140 <rc4hash_print+0x20>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.rc4hash = type { i32 }
@.str = [5 x i8] c"%02x\00"
define void @rc4hash_print(%struct.rc4hash* %0, i32* %1) {
%3 = alloca %struct.rc4hash*
%4 = alloca i32*
%5 = alloca [26 x i32]
%6 = alloca i32
store %struct.rc4hash* %0, %struct.rc4hash** %3
store i32* %1, i32** %4
%7 = load %struct.rc4hash*, %struct.rc4hash** %3
%8 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 0
%9 = call i32 @rc4hash_pack(%struct.rc4hash* %7, i32* %8)
store i32 0, i32* %6
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 26
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.rc4hash = type { i32 }
@.str = [5 x i8] c"%02x\00"
define void @rc4hash_print(%struct.rc4hash* %0, i32* nocapture %1) {
%3 = alloca [26 x i32]
%4 = bitcast [26 x i32]* %3 to i8*
%5 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%6 = call i32 @rc4hash_pack(%struct.rc4hash* %0, i32* %5)
br label %8
7: ; preds = %8
ret void
8: ; preds = %2, %8
%9 = phi i64 [ 0, %2 ], [ %13, %8 ]
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, 26
br i1 %14, label %7, label %8
}