#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  uintptr_t st_value;
};
typedef TYPE_1__ Elf32_Sym;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, long, unsigned int,
                          unsigned int);
uintptr_t la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
                       uintptr_t *defcook, unsigned int *flags,
                       const char *symname) {
  printf("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n", symname,
         (long int)sym->st_value, ndx, *flags);
  return sym->st_value;
}


x86 assembly (clang, -O0):
<la_symbind32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<la_symbind32>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    (%rdi),%rdx
mov    (%r8),%r8d
lea    0xedd(%rip),%rdi
mov    %r9,%rsi
call   1030 <printf@plt>
mov    (%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@.str = [56 x i8] c"symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\0A\00"
define i64 @la_symbind32(%struct.TYPE_3__* %0, i32 %1, i64* %2, i64* %3, i32* %4, i8* %5) {
%7 = alloca %struct.TYPE_3__*
%8 = alloca i32
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32*
%12 = alloca i8*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %7
store i32 %1, i32* %8
store i64* %2, i64** %9
store i64* %3, i64** %10
store i32* %4, i32** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %12
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = load i32, i32* %8
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %13, i64 %16, i32 %17, i32 %19)
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 0
%23 = load i64, i64* %22
ret i64 %23
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@.str = [56 x i8] c"symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\0A\00"
define i64 @la_symbind32(%struct.TYPE_3__* nocapture %0, i32 %1, i64* nocapture readnone %2, i64* nocapture readnone %3, i32* nocapture %4, i8* %5) {
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%8 = load i64, i64* %7
%9 = load i32, i32* %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %8, i32 %1, i32 %9)
%11 = load i64, i64* %7
ret i64 %11
}