#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 */
scalar_t__ strcmp(char const *, char *);
bool parse_status(const char *param, int *status) {
  if (strcmp(param, "enable") == 0) {
    *status = 1;
    return true;
  } else if (strcmp(param, "disable") == 0) {
    *status = 0;
    return true;
  } else if (strcmp(param, "auto") == 0) {
    *status = 2;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<parse_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1150 <parse_status+0x40>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11c1 <parse_status+0xb1>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1180 <parse_status+0x70>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11c1 <parse_status+0xb1>
mov    -0x10(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b0 <parse_status+0xa0>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11c1 <parse_status+0xb1>
jmp    11b5 <parse_status+0xa5>
jmp    11ba <parse_status+0xaa>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_status>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ecx
test   %rax,%rax
je     1166 <parse_status+0x56>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1164 <parse_status+0x54>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    116e <parse_status+0x5e>
mov    $0x2,%ecx
jmp    1166 <parse_status+0x56>
xor    %ecx,%ecx
mov    %ecx,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"enable\00"
@.str.1 = [8 x i8] c"disable\00"
@.str.2 = [5 x i8] c"auto\00"
define i32 @parse_status(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %5, %2
%12 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 2, %8 ]
store i32 %12, i32* %1
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ 0, %8 ], [ 1, %11 ]
ret i32 %14
}