#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 */

/* Variables and functions */
int /*<<< orphan*/ find_or_add_task(char const *, int);
char *get_arg_str(void *, char *);
scalar_t__ get_arg_u64(void *, char *);
void sched_stat_runtime_process(const char *modname, int pass, double clock,
                                int cpu, void *args) {
  const char *comm;
  int tid;
  if (pass == 1) {
    comm = get_arg_str(args, "comm");
    tid = (int)get_arg_u64(args, "tid");
    (void)find_or_add_task(comm, tid);
  }
}


x86 assembly (clang, -O0):
<sched_stat_runtime_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1188 <sched_stat_runtime_process+0x58>
mov    -0x28(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1030 <get_arg_str@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1050 <get_arg_u64@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <find_or_add_task@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_stat_runtime_process>:
cmp    $0x1,%esi
jne    116e <sched_stat_runtime_process+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
lea    0xebd(%rip),%rsi
mov    %rcx,%rdi
call   1030 <get_arg_str@plt>
mov    %rax,%r14
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <get_arg_u64@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <find_or_add_task@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"comm\00"
@.str.1 = [4 x i8] c"tid\00"
define void @sched_stat_runtime_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store double %2, double* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %24
15: ; preds = %5
%16 = load i8*, i8** %10
%17 = call i8* @get_arg_str(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %11
%18 = load i8*, i8** %10
%19 = call i64 @get_arg_u64(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = trunc i64 %19 to i32
store i32 %20, i32* %12
%21 = load i8*, i8** %11
%22 = load i32, i32* %12
%23 = call i32 @find_or_add_task(i8* %21, i32 %22)
br label %24
24: ; preds = %15, %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"comm\00"
@.str.1 = [4 x i8] c"tid\00"
define void @sched_stat_runtime_process(i8* nocapture readnone %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = icmp eq i32 %1, 1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = tail call i8* @get_arg_str(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = tail call i64 @get_arg_u64(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = trunc i64 %9 to i32
%11 = tail call i32 @find_or_add_task(i8* %8, i32 %10)
br label %12
12: ; preds = %7, %5
ret void
}