#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 IP_PMTUDISC_DO;
int IP_PMTUDISC_DONT;
int IP_PMTUDISC_PROBE;
int IP_PMTUDISC_WANT;
int /*<<< orphan*/ strcmp(char *, char *);
int pmtudisc_val(char *s) {
  if (!strcmp(s, "want"))
    return IP_PMTUDISC_WANT;
  if (!strcmp(s, "dont"))
    return IP_PMTUDISC_DONT;
  if (!strcmp(s, "do"))
    return IP_PMTUDISC_DO;
  if (!strcmp(s, "probe"))
    return IP_PMTUDISC_PROBE;
  return -1;
}


x86 assembly (clang, -O0):
<pmtudisc_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1146 <pmtudisc_val+0x36>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11cb <pmtudisc_val+0xbb>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1170 <pmtudisc_val+0x60>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11cb <pmtudisc_val+0xbb>
mov    -0x10(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    119a <pmtudisc_val+0x8a>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11cb <pmtudisc_val+0xbb>
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c4 <pmtudisc_val+0xb4>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11cb <pmtudisc_val+0xbb>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmtudisc_val>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1168 <pmtudisc_val+0x58>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1171 <pmtudisc_val+0x61>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     117a <pmtudisc_val+0x6a>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    0x2e88(%rip),%rcx
neg    %eax
sbb    %eax,%eax
or     (%rcx),%eax
pop    %rbx
ret
mov    0x2e59(%rip),%rax
jmp    1181 <pmtudisc_val+0x71>
mov    0x2e68(%rip),%rax
jmp    1181 <pmtudisc_val+0x71>
mov    0x2e4f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"want\00"
@IP_PMTUDISC_WANT = global i32 0
@.str.1 = [5 x i8] c"dont\00"
@IP_PMTUDISC_DONT = global i32 0
@.str.2 = [3 x i8] c"do\00"
@IP_PMTUDISC_DO = global i32 0
@.str.3 = [6 x i8] c"probe\00"
@IP_PMTUDISC_PROBE = global i32 0
define i32 @pmtudisc_val(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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32, i32* @IP_PMTUDISC_WANT
store i32 %8, i32* %2
br label %28
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 = load i32, i32* @IP_PMTUDISC_DONT
store i32 %14, i32* %2
br label %28
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 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 = load i32, i32* @IP_PMTUDISC_DO
store i32 %20, i32* %2
br label %28
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = load i32, i32* @IP_PMTUDISC_PROBE
store i32 %26, i32* %2
br label %28
27: ; preds = %21
store i32 -1, i32* %2
br label %28
28: ; preds = %27, %25, %19, %13, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@.str = [5 x i8] c"want\00"
@IP_PMTUDISC_WANT = global i32 0
@.str.1 = [5 x i8] c"dont\00"
@IP_PMTUDISC_DONT = global i32 0
@.str.2 = [3 x i8] c"do\00"
@IP_PMTUDISC_DO = global i32 0
@.str.3 = [6 x i8] c"probe\00"
@IP_PMTUDISC_PROBE = global i32 0
define i32 @pmtudisc_val(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* @IP_PMTUDISC_WANT
br label %21
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 = load i32, i32* @IP_PMTUDISC_DONT
br label %21
11: ; preds = %6
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 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 = load i32, i32* @IP_PMTUDISC_DO
br label %21
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = load i32, i32* @IP_PMTUDISC_PROBE
%20 = select i1 %18, i32 %19, i32 -1
br label %21
21: ; preds = %16, %14, %9, %4
%22 = phi i32 [ %15, %14 ], [ %10, %9 ], [ %5, %4 ], [ %20, %16 ]
ret i32 %22
}