#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 *, int);
void init_keys(unsigned long keys[3], const char *passwd) {
  keys[0] = 305419896L;
  keys[1] = 591751049L;
  keys[2] = 878082192L;
  while (*passwd) {
    update_keys(keys, (int)*passwd);
    passwd++;
  }
}


x86 assembly (clang, -O0):
<init_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x12345678,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x23456789,0x8(%rax)
23
mov    -0x8(%rbp),%rax
movq   $0x34567890,0x10(%rax)
34
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <init_keys+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <update_keys@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <init_keys+0x33>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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