#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 */
int /*<<< orphan*/ update_keys(unsigned long *, unsigned long const *, int);
void init_keys(char const *passwd, unsigned long *pkeys,
               const unsigned long *pcrc_32_tab) {
  *(pkeys + 0) = 305419896L;
  *(pkeys + 1) = 591751049L;
  *(pkeys + 2) = 878082192L;
  while (*passwd != '\0') {
    update_keys(pkeys, pcrc_32_tab, (int)*passwd);
    passwd++;
  }
}


x86 assembly (clang, -O0):
<init_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x12345678,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x23456789,0x8(%rax)
23
mov    -0x10(%rbp),%rax
movq   $0x34567890,0x10(%rax)
34
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117c <init_keys+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
call   1030 <update_keys@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <init_keys+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_keys>:
push   %r15
push   %r14
push   %rbx
movaps 0xee4(%rip),%xmm0
movups %xmm0,(%rsi)
movq   $0x34567890,0x10(%rsi)
34
mov    (%rdi),%al
test   %al,%al
je     1159 <init_keys+0x49>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <update_keys@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <init_keys+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @init_keys(i8* %0, i64* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %5
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 305419896, i64* %8
%9 = load i64*, i64** %5
%10 = getelementptr inbounds i64, i64* %9, i64 1
store i64 591751049, i64* %10
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 2
store i64 878082192, i64* %12
br label %13
13: ; preds = %18, %3
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %13
%19 = load i64*, i64** %5
%20 = load i64*, i64** %6
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i32 @update_keys(i64* %19, i64* %20, i32 %23)
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %13
27: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @init_keys(i8* nocapture %0, i64* %1, i64* %2) {
%4 = bitcast i64* %1 to <2 x i64>*
store <2 x i64> <i64 305419896, i64 591751049>, <2 x i64>* %4
%5 = getelementptr inbounds i64, i64* %1, i64 2
store i64 878082192, i64* %5
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %3, %8
%9 = phi i8 [ %14, %8 ], [ %6, %3 ]
%10 = phi i8* [ %13, %8 ], [ %0, %3 ]
%11 = sext i8 %9 to i32
%12 = tail call i32 @update_keys(i64* %1, i64* %2, i32 %11)
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %3
ret void
}