#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 */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ powercap_sysfs_constraint_get_name(char *,
                                                      int /*<<< orphan*/ *, int,
                                                      int /*<<< orphan*/,
                                                      char *, size_t);
ssize_t rapl_sysfs_constraint_get_name(uint32_t zone, uint32_t sz, int is_sz,
                                       uint32_t constraint, char *buf,
                                       size_t size) {
  uint32_t zones[2];
  zones[0] = zone;
  zones[1] = sz;
  ;
  return powercap_sysfs_constraint_get_name(
      "intel-rapl", zones, (is_sz ? 2 : 1), constraint, buf, size);
}


x86 assembly (clang, -O0):
<rapl_sysfs_constraint_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
mov    $0x2,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe9f(%rip),%rdi
call   1030 <powercap_sysfs_constraint_get_name@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_sysfs_constraint_get_name>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
cmp    $0x1,%edx
mov    $0x2,%edx
sbb    $0x0,%edx
lea    0xed6(%rip),%rdi
mov    %rsp,%rsi
call   1030 <powercap_sysfs_constraint_get_name@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_constraint_get_name(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i64 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca [2 x i32]
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%14 = load i32, i32* %7
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
store i32 %16, i32* %17
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%19 = load i32, i32* %9
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 2, i32 1
%23 = load i32, i32* %10
%24 = load i8*, i8** %11
%25 = load i64, i64* %12
%26 = call i32 @powercap_sysfs_constraint_get_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %18, i32 %22, i32 %23, i8* %24, i64 %25)
ret i32 %26
}

LLVM IR (-O2):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_constraint_get_name(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i64 %5) {
%7 = alloca [2 x i32]
%8 = bitcast [2 x i32]* %7 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %0, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %1, i32* %10
%11 = icmp eq i32 %2, 0
%12 = select i1 %11, i32 1, i32 2
%13 = call i32 @powercap_sysfs_constraint_get_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %9, i32 %12, i32 %3, i8* %4, i64 %5)
ret i32 %13
}