#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 isCpuFreqValid(int *);
int /*<<< orphan*/ setValueToFile(char *, int);
void setCpuFreqLimits(int minCpuFreq, int maxCpuFreq) {
  if (((1) == isCpuFreqValid(&minCpuFreq)) &&
      ((1) == isCpuFreqValid(&maxCpuFreq))) {
    setValueToFile("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
                   minCpuFreq);
    setValueToFile("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
                   maxCpuFreq);
  }
}


x86 assembly (clang, -O0):
<setCpuFreqLimits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <isCpuFreqValid@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    117c <setCpuFreqLimits+0x5c>
lea    -0x8(%rbp),%rdi
call   1030 <isCpuFreqValid@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    117c <setCpuFreqLimits+0x5c>
mov    -0x4(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1040 <setValueToFile@plt>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1040 <setValueToFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCpuFreqLimits>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <isCpuFreqValid@plt>
cmp    $0x1,%eax
jne    1163 <setCpuFreqLimits+0x43>
mov    %rsp,%rdi
call   1030 <isCpuFreqValid@plt>
cmp    $0x1,%eax
jne    1163 <setCpuFreqLimits+0x43>
mov    0x4(%rsp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <setValueToFile@plt>
mov    (%rsp),%esi
lea    0xed8(%rip),%rdi
call   1040 <setValueToFile@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\00"
@.str.1 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq\00"
define void @setCpuFreqLimits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @isCpuFreqValid(i32* %3)
%6 = icmp eq i32 1, %5
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = call i32 @isCpuFreqValid(i32* %4)
%9 = icmp eq i32 1, %8
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @setValueToFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @setValueToFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\00"
@.str.1 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq\00"
define void @setCpuFreqLimits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @isCpuFreqValid(i32* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = call i32 @isCpuFreqValid(i32* %4)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @setValueToFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @setValueToFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10, %7, %2
ret void
}