#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 sched_entity {
  int dummy;
};
struct cfs_rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __enqueue_entity(struct cfs_rq *, struct sched_entity *);
int /*<<< orphan*/ enqueue_sleeper(struct cfs_rq *, struct sched_entity *);
int /*<<< orphan*/ update_curr(struct cfs_rq *);
int /*<<< orphan*/ update_stats_enqueue(struct cfs_rq *, struct sched_entity *);
void enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
                    int wakeup) {
  update_curr(cfs_rq);
  if (wakeup)
    enqueue_sleeper(cfs_rq, se);
  update_stats_enqueue(cfs_rq, se);
  __enqueue_entity(cfs_rq, se);
}


x86 assembly (clang, -O0):
<enqueue_entity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <update_curr@plt>
cmpl   $0x0,-0x14(%rbp)
je     1173 <enqueue_entity+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <enqueue_sleeper@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <update_stats_enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <__enqueue_entity@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enqueue_entity>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <update_curr@plt>
test   %ebp,%ebp
je     1160 <enqueue_entity+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <enqueue_sleeper@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <update_stats_enqueue@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <__enqueue_entity@plt>

LLVM IR (-O0):
%struct.cfs_rq = type { i32 }
%struct.sched_entity = type { i32 }
define void @enqueue_entity(%struct.cfs_rq* %0, %struct.sched_entity* %1, i32 %2) {
%4 = alloca %struct.cfs_rq*
%5 = alloca %struct.sched_entity*
%6 = alloca i32
store %struct.cfs_rq* %0, %struct.cfs_rq** %4
store %struct.sched_entity* %1, %struct.sched_entity** %5
store i32 %2, i32* %6
%7 = load %struct.cfs_rq*, %struct.cfs_rq** %4
%8 = call i32 @update_curr(%struct.cfs_rq* %7)
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load %struct.cfs_rq*, %struct.cfs_rq** %4
%13 = load %struct.sched_entity*, %struct.sched_entity** %5
%14 = call i32 @enqueue_sleeper(%struct.cfs_rq* %12, %struct.sched_entity* %13)
br label %15
15: ; preds = %11, %3
%16 = load %struct.cfs_rq*, %struct.cfs_rq** %4
%17 = load %struct.sched_entity*, %struct.sched_entity** %5
%18 = call i32 @update_stats_enqueue(%struct.cfs_rq* %16, %struct.sched_entity* %17)
%19 = load %struct.cfs_rq*, %struct.cfs_rq** %4
%20 = load %struct.sched_entity*, %struct.sched_entity** %5
%21 = call i32 @__enqueue_entity(%struct.cfs_rq* %19, %struct.sched_entity* %20)
ret void
}

LLVM IR (-O2):
%struct.cfs_rq = type { i32 }
%struct.sched_entity = type { i32 }
define void @enqueue_entity(%struct.cfs_rq* %0, %struct.sched_entity* %1, i32 %2) {
%4 = tail call i32 @update_curr(%struct.cfs_rq* %0)
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @enqueue_sleeper(%struct.cfs_rq* %0, %struct.sched_entity* %1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @update_stats_enqueue(%struct.cfs_rq* %0, %struct.sched_entity* %1)
%10 = tail call i32 @__enqueue_entity(%struct.cfs_rq* %0, %struct.sched_entity* %1)
ret void
}