#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 */
struct student_detail {
  int dummy;
};

/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ print_struct(struct student_detail *);
int get(struct student_detail **record, char *seed) {
  int hashKey;
  hashKey = hash(seed);
  struct student_detail *student;
  student = record[hashKey];
  if (!student)
    return 0;
  print_struct(student);
  return 1;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <hash@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1163 <get+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1173 <get+0x53>
mov    -0x28(%rbp),%rdi
call   1030 <print_struct@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <hash@plt>
cltq
mov    (%rbx,%rax,8),%rdi
test   %rdi,%rdi
je     1143 <get+0x23>
call   1030 <print_struct@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.student_detail = type { i32 }
define i32 @get(%struct.student_detail** %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.student_detail**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.student_detail*
store %struct.student_detail** %0, %struct.student_detail*** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @hash(i8* %8)
store i32 %9, i32* %6
%10 = load %struct.student_detail**, %struct.student_detail*** %4
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds %struct.student_detail*, %struct.student_detail** %10, i64 %12
%14 = load %struct.student_detail*, %struct.student_detail** %13
store %struct.student_detail* %14, %struct.student_detail** %7
%15 = load %struct.student_detail*, %struct.student_detail** %7
%16 = icmp ne %struct.student_detail* %15, null
br i1 %16, label %18, label %17
17: ; preds = %2
store i32 0, i32* %3
br label %21
18: ; preds = %2
%19 = load %struct.student_detail*, %struct.student_detail** %7
%20 = call i32 @print_struct(%struct.student_detail* %19)
store i32 1, i32* %3
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.student_detail = type { i32 }
define i32 @get(%struct.student_detail** nocapture %0, i8* %1) {
%3 = tail call i32 @hash(i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds %struct.student_detail*, %struct.student_detail** %0, i64 %4
%6 = load %struct.student_detail*, %struct.student_detail** %5
%7 = icmp eq %struct.student_detail* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @print_struct(%struct.student_detail* %6)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %11
}