#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 */
unsigned int crc32__(unsigned int, unsigned int);
void update_keys(unsigned *keys, unsigned char c) {
  keys[0] = crc32__(keys[0], c);
  keys[1] = (keys[1] + (unsigned char)keys[0]) * 134775813 + 1;
  keys[2] = crc32__(keys[2], keys[1] >> 24);
}


x86 assembly (clang, -O0):
<update_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
movzbl -0x9(%rbp),%esi
call   1030 <crc32__@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
movzbl %cl,%ecx
add    %ecx,%eax
imul   $0x8088405,%eax,%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
shr    $0x18,%esi
call   1030 <crc32__@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_keys>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <crc32__@plt>
mov    %eax,(%rbx)
movzbl %al,%eax
add    0x4(%rbx),%eax
imul   $0x8088405,%eax,%esi
add    $0x1,%esi
mov    %esi,0x4(%rbx)
mov    0x8(%rbx),%edi
shr    $0x18,%esi
call   1030 <crc32__@plt>
mov    %eax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @update_keys(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = call i32 @crc32__(i32 %7, i32 %9)
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = trunc i32 %18 to i8
%20 = zext i8 %19 to i32
%21 = add i32 %15, %20
%22 = mul i32 %21, 134775813
%23 = add i32 %22, 1
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 1
store i32 %23, i32* %25
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i64 2
%28 = load i32, i32* %27
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 1
%31 = load i32, i32* %30
%32 = lshr i32 %31, 24
%33 = call i32 @crc32__(i32 %28, i32 %32)
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 2
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @update_keys(i32* nocapture %0, i8 zeroext %1) {
%3 = load i32, i32* %0
%4 = zext i8 %1 to i32
%5 = tail call i32 @crc32__(i32 %3, i32 %4)
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = and i32 %5, 255
%9 = add i32 %7, %8
%10 = mul i32 %9, 134775813
%11 = add i32 %10, 1
store i32 %11, i32* %6
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = lshr i32 %11, 24
%15 = tail call i32 @crc32__(i32 %13, i32 %14)
store i32 %15, i32* %12
ret void
}