void __cyg_profile_func_enter(void *this, void *callsite) {
  record_fun(this, 'E');
  {
    unsigned int *pt;
    unsigned long ebp = 0;
    get_ebp(&ebp);
    pt = (unsigned int *)ebp;
    unsigned int *pv;
    ebp = *(unsigned int *)ebp;
    pv = *(unsigned int *)ebp;
    unsigned int argv_addr = (unsigned int)(pt) + 8;
    printf("--->argv[0].address=%08x\n", argv_addr);
    pv = *(unsigned int *)ebp + 8;
    printf("--->argv[0].value=%d\n", (unsigned int)(*pv));
  }
}


x86 assembly (clang, -O0):
<__cyg_profile_func_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x45,%esi
mov    $0x0,%al
call   1030 <record_fun@plt>
movq   $0x0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <get_ebp@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
push   %rax
mov    $0x45,%esi
xor    %eax,%eax
call   1030 <record_fun@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <get_ebp@plt>
mov    (%rsp),%rsi
mov    (%rsi),%eax
mov    %rax,(%rsp)
add    $0x8,%esi
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%eax
add    $0x8,%eax
mov    (%rax),%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"--->argv[0].address=%08x\0A\00"
@.str.1 = [22 x i8] c"--->argv[0].value=%d\0A\00"
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @record_fun to i32 (i8*, i32, ...)*)(i8* %9, i32 69)
store i64 0, i64* %6
%11 = call i32 (i64*, ...) bitcast (i32 (...)* @get_ebp to i32 (i64*, ...)*)(i64* %6)
%12 = load i64, i64* %6
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i64, i64* %6
%15 = inttoptr i64 %14 to i32*
%16 = load i32, i32* %15
%17 = zext i32 %16 to i64
store i64 %17, i64* %6
%18 = load i64, i64* %6
%19 = inttoptr i64 %18 to i32*
%20 = load i32, i32* %19
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store i32* %22, i32** %7
%23 = load i32*, i32** %5
%24 = ptrtoint i32* %23 to i32
%25 = add i32 %24, 8
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = load i64, i64* %6
%29 = inttoptr i64 %28 to i32*
%30 = load i32, i32* %29
%31 = add i32 %30, 8
%32 = zext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store i32* %33, i32** %7
%34 = load i32*, i32** %7
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"--->argv[0].address=%08x\0A\00"
@.str.1 = [22 x i8] c"--->argv[0].value=%d\0A\00"
define void @__cyg_profile_func_enter(i8* %0, i8* nocapture readnone %1) {
%3 = alloca i64
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @record_fun to i32 (i8*, i32, ...)*)(i8* %0, i32 69)
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = call i32 (i64*, ...) bitcast (i32 (...)* @get_ebp to i32 (i64*, ...)*)(i64* %3)
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i32*
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
store i64 %10, i64* %3
%11 = trunc i64 %7 to i32
%12 = add i32 %11, 8
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i64, i64* %3
%15 = inttoptr i64 %14 to i32*
%16 = load i32, i32* %15
%17 = add i32 %16, 8
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret void
}