#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 */
struct sched_entity *cfs_rq_curr(struct cfs_rq *);
int /*<<< orphan*/ update_curr(struct cfs_rq *);
int /*<<< orphan*/ update_stats_wait_end(struct cfs_rq *,
                                         struct sched_entity *);
void update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) {
  update_curr(cfs_rq);
  if (se != cfs_rq_curr(cfs_rq))
    update_stats_wait_end(cfs_rq, se);
}


x86 assembly (clang, -O0):
<update_stats_dequeue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <update_curr@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cfs_rq_curr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1177 <update_stats_dequeue+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <update_stats_wait_end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_stats_dequeue>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <update_curr@plt>
mov    %rbx,%rdi
call   1050 <cfs_rq_curr@plt>
cmp    %r14,%rax
je     115e <update_stats_dequeue+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <update_stats_wait_end@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.cfs_rq = type { i32 }
%struct.sched_entity = type { i32 }
define void @update_stats_dequeue(%struct.cfs_rq* %0, %struct.sched_entity* %1) {
%3 = alloca %struct.cfs_rq*
%4 = alloca %struct.sched_entity*
store %struct.cfs_rq* %0, %struct.cfs_rq** %3
store %struct.sched_entity* %1, %struct.sched_entity** %4
%5 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%6 = call i32 @update_curr(%struct.cfs_rq* %5)
%7 = load %struct.sched_entity*, %struct.sched_entity** %4
%8 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%9 = call %struct.sched_entity* @cfs_rq_curr(%struct.cfs_rq* %8)
%10 = icmp ne %struct.sched_entity* %7, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%13 = load %struct.sched_entity*, %struct.sched_entity** %4
%14 = call i32 @update_stats_wait_end(%struct.cfs_rq* %12, %struct.sched_entity* %13)
br label %15
15: ; preds = %11, %2
ret void
}

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