#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free_variables();
int /*<<< orphan*/ show_variables();
int /*<<< orphan*/ strcmp(char const *, char *);
int handle_commands(const char *buffer) {
  if (!strcmp(buffer, "variables"))
    show_variables();
  else if (!strcmp(buffer, "quit"))
    exit(0);
  else if (!strcmp(buffer, "delete_vars"))
    free_variables();
  else
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<handle_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1171 <handle_commands+0x31>
mov    $0x0,%al
call   1030 <show_variables@plt>
jmp    11cc <handle_commands+0x8c>
mov    -0x10(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1191 <handle_commands+0x51>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b6 <handle_commands+0x76>
mov    $0x0,%al
call   1050 <free_variables@plt>
jmp    11c2 <handle_commands+0x82>
movl   $0x0,-0x4(%rbp)
jmp    11d3 <handle_commands+0x93>
jmp    11c7 <handle_commands+0x87>
jmp    11cc <handle_commands+0x8c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_commands>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1180 <handle_commands+0x40>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1197 <handle_commands+0x57>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1189 <handle_commands+0x49>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <show_variables@plt>
jmp    1190 <handle_commands+0x50>
xor    %eax,%eax
call   1050 <free_variables@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"variables\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [12 x i8] c"delete_vars\00"
define i32 @handle_commands(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @show_variables()
br label %24
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = call i32 (...) @free_variables()
br label %22
21: ; preds = %15
store i32 0, i32* %2
br label %25
22: ; preds = %19
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23, %7
store i32 1, i32* %2
br label %25
25: ; preds = %24, %21
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [10 x i8] c"variables\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [12 x i8] c"delete_vars\00"
define i32 @handle_commands(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @show_variables()
br label %16
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %6
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (...) @free_variables()
br label %16
16: ; preds = %4, %14, %11
%17 = phi i32 [ 0, %11 ], [ 1, %14 ], [ 1, %4 ]
ret i32 %17
}