#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 long _dl_elf_hash(char *);
unsigned long elf_hash(char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  while (!feof(stdin)) {
    char buf[1024];
    scanf("%1024s", buf);
    unsigned long ehash1 = elf_hash(buf);
    unsigned long ehash2 = _dl_elf_hash(buf);
    printf("%lu\t %lu \n", ehash1, ehash2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1185 <main+0x35>
jmp    11dd <main+0x8d>
lea    -0x410(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x410(%rbp),%rdi
call   1070 <elf_hash@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <_dl_elf_hash@plt>
mov    %rax,-0x420(%rbp)
mov    -0x418(%rbp),%rsi
mov    -0x420(%rbp),%rdx
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    0x2e81(%rip),%r13
mov    0x0(%r13),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    11c9 <main+0x79>
lea    0xe85(%rip),%r14
mov    %rsp,%r12
lea    0xe82(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    %r12,%rdi
call   1070 <elf_hash@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1050 <_dl_elf_hash@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    0x0(%r13),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1190 <main+0x40>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [7 x i8] c"%1024s\00"
@.str.1 = [11 x i8] c"%lu\09 %lu \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* @stdin
%7 = call i32 @feof(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%14 = call i64 @elf_hash(i8* %13)
store i64 %14, i64* %3
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%16 = call i64 @_dl_elf_hash(i8* %15)
store i64 %16, i64* %4
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 %17, i64 %18)
br label %5
20: ; preds = %5
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [7 x i8] c"%1024s\00"
@.str.1 = [11 x i8] c"%lu\09 %lu \0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = load i32, i32* @stdin
%3 = call i32 @feof(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
br label %7
7: ; preds = %5, %7
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i64 @elf_hash(i8* %6)
%10 = call i64 @_dl_elf_hash(i8* %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 %9, i64 %10)
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}