#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*/ setBusUtilizationTracingEnable(int);
int /*<<< orphan*/ setDiskTracingEnabled(int);
int /*<<< orphan*/ setFrequencyTracingEnable(int);
int /*<<< orphan*/ setGlobalClockEnable(int);
int /*<<< orphan*/ setGovernorLoadTracingEnable(int);
int /*<<< orphan*/ setSchedSwitchTracingEnable(int);
int /*<<< orphan*/ setSyncTracingEnabled(int);
int /*<<< orphan*/ setTraceOverwriteEnable(int);
int /*<<< orphan*/ setTracingEnabled(int);
int /*<<< orphan*/ setWorkqueueTracingEnabled(int);
void stopTrace(bool isRoot) {
  setTracingEnabled(false);
  setTraceOverwriteEnable(true);
  setSchedSwitchTracingEnable(false);
  setFrequencyTracingEnable(false);
  setGovernorLoadTracingEnable(false);
  setGlobalClockEnable(false);
  if (isRoot) {
    setBusUtilizationTracingEnable(false);
    setSyncTracingEnabled(false);
    setWorkqueueTracingEnabled(false);
    setDiskTracingEnabled(false);
  }
}


x86 assembly (clang, -O0):
<stopTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setTracingEnabled@plt>
mov    $0x1,%edi
call   1070 <setTraceOverwriteEnable@plt>
xor    %edi,%edi
call   1050 <setSchedSwitchTracingEnable@plt>
xor    %edi,%edi
call   1060 <setFrequencyTracingEnable@plt>
xor    %edi,%edi
call   1030 <setGovernorLoadTracingEnable@plt>
xor    %edi,%edi
call   10b0 <setGlobalClockEnable@plt>
cmpl   $0x0,-0x4(%rbp)
je     11fe <stopTrace+0x5e>
xor    %edi,%edi
call   1080 <setBusUtilizationTracingEnable@plt>
xor    %edi,%edi
call   10c0 <setSyncTracingEnabled@plt>
xor    %edi,%edi
call   10a0 <setWorkqueueTracingEnabled@plt>
xor    %edi,%edi
call   1090 <setDiskTracingEnabled@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopTrace>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <setTracingEnabled@plt>
mov    $0x1,%edi
call   1070 <setTraceOverwriteEnable@plt>
xor    %edi,%edi
call   1050 <setSchedSwitchTracingEnable@plt>
xor    %edi,%edi
call   1060 <setFrequencyTracingEnable@plt>
xor    %edi,%edi
call   1030 <setGovernorLoadTracingEnable@plt>
xor    %edi,%edi
call   10b0 <setGlobalClockEnable@plt>
test   %ebx,%ebx
je     11f1 <stopTrace+0x51>
xor    %edi,%edi
call   1080 <setBusUtilizationTracingEnable@plt>
xor    %edi,%edi
call   10c0 <setSyncTracingEnabled@plt>
xor    %edi,%edi
call   10a0 <setWorkqueueTracingEnabled@plt>
xor    %edi,%edi
pop    %rbx
jmp    1090 <setDiskTracingEnabled@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @stopTrace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @setTracingEnabled(i32 0)
%4 = call i32 @setTraceOverwriteEnable(i32 1)
%5 = call i32 @setSchedSwitchTracingEnable(i32 0)
%6 = call i32 @setFrequencyTracingEnable(i32 0)
%7 = call i32 @setGovernorLoadTracingEnable(i32 0)
%8 = call i32 @setGlobalClockEnable(i32 0)
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = call i32 @setBusUtilizationTracingEnable(i32 0)
%13 = call i32 @setSyncTracingEnabled(i32 0)
%14 = call i32 @setWorkqueueTracingEnabled(i32 0)
%15 = call i32 @setDiskTracingEnabled(i32 0)
br label %16
16: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @stopTrace(i32 %0) {
%2 = tail call i32 @setTracingEnabled(i32 0)
%3 = tail call i32 @setTraceOverwriteEnable(i32 1)
%4 = tail call i32 @setSchedSwitchTracingEnable(i32 0)
%5 = tail call i32 @setFrequencyTracingEnable(i32 0)
%6 = tail call i32 @setGovernorLoadTracingEnable(i32 0)
%7 = tail call i32 @setGlobalClockEnable(i32 0)
%8 = icmp eq i32 %0, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = tail call i32 @setBusUtilizationTracingEnable(i32 0)
%11 = tail call i32 @setSyncTracingEnabled(i32 0)
%12 = tail call i32 @setWorkqueueTracingEnabled(i32 0)
%13 = tail call i32 @setDiskTracingEnabled(i32 0)
br label %14
14: ; preds = %9, %1
ret void
}