#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*/ chr_arg(char *, char const *, char const *);
scalar_t__ strcmp(char const *, char *);
void enc_arg(char *enclosure, const char *option, const char *value) {
  if ((0 == strcmp(value, "auto")))
    *enclosure = '\0';
  else if ((0 == strcmp(value, "mixed")))
    *enclosure = '\xff';
  else if ((0 == strcmp(value, "none")) || (0 == strcmp(value, "no")))
    *enclosure = '\n';
  else
    chr_arg(enclosure, option, value);
}


x86 assembly (clang, -O0):
<enc_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    115e <enc_arg+0x3e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    11eb <enc_arg+0xcb>
mov    -0x18(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1188 <enc_arg+0x68>
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
jmp    11e6 <enc_arg+0xc6>
mov    -0x18(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     11c4 <enc_arg+0xa4>
mov    -0x18(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11d0 <enc_arg+0xb0>
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
jmp    11e1 <enc_arg+0xc1>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <chr_arg@plt>
jmp    11e6 <enc_arg+0xc6>
jmp    11eb <enc_arg+0xcb>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc_arg>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xecb(%rip),%rsi
mov    %rdx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1191 <enc_arg+0x71>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1197 <enc_arg+0x77>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119d <enc_arg+0x7d>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119d <enc_arg+0x7d>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <chr_arg@plt>
movb   $0x0,(%r14)
jmp    11a1 <enc_arg+0x81>
movb   $0xff,(%r14)
jmp    11a1 <enc_arg+0x81>
movb   $0xa,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"auto\00"
@.str.1 = [6 x i8] c"mixed\00"
@.str.2 = [5 x i8] c"none\00"
@.str.3 = [3 x i8] c"no\00"
define void @enc_arg(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i8 0, i8* %0
br label %20
7: ; preds = %3
%8 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 -1, i8* %0
br label %20
11: ; preds = %7
%12 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %11
store i8 10, i8* %0
br label %20
18: ; preds = %14
%19 = tail call i32 @chr_arg(i8* %0, i8* %1, i8* %2)
br label %20
20: ; preds = %10, %18, %17, %6
ret void
}