#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 aeEventLoop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ read(int, char *, int);
void file_cb(struct aeEventLoop *l, int fd, void *data, int mask) {
  char buf[51] = {0};
  read(fd, buf, 51);
  printf("I'm file_cb ,here [EventLoop: %p],[fd : %d],[data: %p],[mask: %d] \n",
         l, fd, data, mask);
  printf("get %s", buf);
}


x86 assembly (clang, -O0):
<file_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x33,%edx
call   1040 <memset@plt>
mov    -0xc(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x33,%edx
call   1050 <read@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_cb>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x2f(%rsp)
mov    %rsp,%r12
mov    %esi,%edi
mov    %r12,%rsi
mov    $0x33,%edx
call   1040 <read@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.aeEventLoop = type { i32 }
@.str = [68 x i8] c"I'm file_cb ,here [EventLoop: %p],[fd : %d],[data: %p],[mask: %d] \0A\00"
@.str.1 = [7 x i8] c"get %s\00"
define void @file_cb(%struct.aeEventLoop* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.aeEventLoop*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [51 x i8]
store %struct.aeEventLoop* %0, %struct.aeEventLoop** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = bitcast [51 x i8]* %9 to i8*
%11 = load i32, i32* %6
%12 = getelementptr inbounds [51 x i8], [51 x i8]* %9, i64 0, i64 0
%13 = call i32 @read(i32 %11, i8* %12, i32 51)
%14 = load %struct.aeEventLoop*, %struct.aeEventLoop** %5
%15 = bitcast %struct.aeEventLoop* %14 to i8*
%16 = load i32, i32* %6
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* %17, i32 %18)
%20 = getelementptr inbounds [51 x i8], [51 x i8]* %9, i64 0, i64 0
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %20)
ret void
}

LLVM IR (-O2):
%struct.aeEventLoop = type { i32 }
@.str = [68 x i8] c"I'm file_cb ,here [EventLoop: %p],[fd : %d],[data: %p],[mask: %d] \0A\00"
@.str.1 = [7 x i8] c"get %s\00"
define void @file_cb(%struct.aeEventLoop* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [51 x i8]
%6 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%7 = call i32 @read(i32 %1, i8* %6, i32 51)
%8 = bitcast %struct.aeEventLoop* %0 to i8*
%9 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %1, i8* %2, i32 %3)
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}