#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*/ error_and_exit(char *, char *, int, char *);
int /*<<< orphan*/ setRatioColdLiquid(int);
int /*<<< orphan*/ setRatioFrozenLiquid(int);
int cmalloc_mallopt(int parameter_number, int parameter_value) {
  switch (parameter_number) {
  case 0:
    if (parameter_value < 0)
      error_and_exit("CMalloc: Error at %s:%d %s.\n",
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/"
                     "heads/master/sources/cmalloc.c",
                     212, "invalid paramteter value");
    setRatioColdLiquid(parameter_value);
    break;
  case 1:
    if (parameter_value < 0)
      error_and_exit("CMalloc: Error at %s:%d %s.\n",
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/"
                     "heads/master/sources/cmalloc.c",
                     218, "invalid paramteter value");
    setRatioFrozenLiquid(parameter_value);
    break;
  default:
    error_and_exit("CMalloc: Error at %s:%d %s.\n",
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/"
                   "heads/master/sources/cmalloc.c",
                   223, "invalid paramteter number");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmalloc_mallopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1162 <cmalloc_mallopt+0x32>
jmp    1151 <cmalloc_mallopt+0x21>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1198 <cmalloc_mallopt+0x68>
jmp    11ce <cmalloc_mallopt+0x9e>
cmpl   $0x0,-0xc(%rbp)
jge    118b <cmalloc_mallopt+0x5b>
lea    0xe8d(%rip),%rdi
lea    0xea3(%rip),%rsi
mov    $0xd4,%edx
lea    0xf27(%rip),%rcx
call   1040 <error_and_exit@plt>
mov    -0xc(%rbp),%edi
call   1030 <setRatioColdLiquid@plt>
jmp    11f9 <cmalloc_mallopt+0xc9>
cmpl   $0x0,-0xc(%rbp)
jge    11c1 <cmalloc_mallopt+0x91>
lea    0xe57(%rip),%rdi
lea    0xe6d(%rip),%rsi
mov    $0xda,%edx
lea    0xef1(%rip),%rcx
call   1040 <error_and_exit@plt>
mov    -0xc(%rbp),%edi
call   1050 <setRatioFrozenLiquid@plt>
jmp    11f9 <cmalloc_mallopt+0xc9>
lea    0xe2b(%rip),%rdi
lea    0xe41(%rip),%rsi
mov    $0xdf,%edx
lea    0xede(%rip),%rcx
call   1040 <error_and_exit@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1200 <cmalloc_mallopt+0xd0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc_mallopt>:
push   %rbx
mov    %esi,%ebx
cmp    $0x1,%edi
je     1168 <cmalloc_mallopt+0x38>
test   %edi,%edi
jne    1196 <cmalloc_mallopt+0x66>
test   %ebx,%ebx
jns    115f <cmalloc_mallopt+0x2f>
lea    0xeb9(%rip),%rdi
lea    0xecf(%rip),%rsi
lea    0xf58(%rip),%rcx
mov    $0xd4,%edx
call   1040 <error_and_exit@plt>
mov    %ebx,%edi
call   1030 <setRatioColdLiquid@plt>
jmp    1192 <cmalloc_mallopt+0x62>
test   %ebx,%ebx
jns    118b <cmalloc_mallopt+0x5b>
lea    0xe8d(%rip),%rdi
lea    0xea3(%rip),%rsi
lea    0xf2c(%rip),%rcx
mov    $0xda,%edx
call   1040 <error_and_exit@plt>
mov    %ebx,%edi
call   1050 <setRatioFrozenLiquid@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe63(%rip),%rdi
lea    0xe79(%rip),%rsi
lea    0xf1b(%rip),%rcx
mov    $0xdf,%edx
call   1040 <error_and_exit@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"CMalloc: Error at %s:%d %s.\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/heads/master/sources/cmalloc.c\00"
@.str.2 = [25 x i8] c"invalid paramteter value\00"
@.str.3 = [26 x i8] c"invalid paramteter number\00"
define i32 @cmalloc_mallopt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %23 [
i32 0, label %7
i32 1, label %15
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 212, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %5
%14 = call i32 @setRatioColdLiquid(i32 %13)
br label %25
15: ; preds = %2
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 218, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %5
%22 = call i32 @setRatioFrozenLiquid(i32 %21)
br label %25
23: ; preds = %2
%24 = call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 223, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %26
25: ; preds = %20, %12
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [29 x i8] c"CMalloc: Error at %s:%d %s.\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/heads/master/sources/cmalloc.c\00"
@.str.2 = [25 x i8] c"invalid paramteter value\00"
@.str.3 = [26 x i8] c"invalid paramteter number\00"
define i32 @cmalloc_mallopt(i32 %0, i32 %1) {
switch i32 %0, label %15 [
i32 0, label %3
i32 1, label %9
]
3: ; preds = %2
%4 = icmp slt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 212, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @setRatioColdLiquid(i32 %1)
br label %17
9: ; preds = %2
%10 = icmp slt i32 %1, 0
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = tail call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 218, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = tail call i32 @setRatioFrozenLiquid(i32 %1)
br label %17
15: ; preds = %2
%16 = tail call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 223, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %7, %13, %15
%18 = phi i32 [ -1, %15 ], [ 0, %13 ], [ 0, %7 ]
ret i32 %18
}