#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*/ EINVAL;
int auth_address_register();
int auth_globus_register();
int auth_hostname_register();
int auth_kerberos_register();
int auth_ticket_register();
int auth_unix_register();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strcmp(char const *, char *);
int auth_register_byname(const char *name) {
  if (!strcmp(name, "kerberos"))
    return auth_kerberos_register();
  if (!strcmp(name, "globus"))
    return auth_globus_register();
  if (!strcmp(name, "unix"))
    return auth_unix_register();
  if (!strcmp(name, "hostname"))
    return auth_hostname_register();
  if (!strcmp(name, "address"))
    return auth_address_register();
  if (!strcmp(name, "ticket"))
    return auth_ticket_register();
  errno = EINVAL;
  return 0;
}


x86 assembly (clang, -O0):
<auth_register_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11a4 <auth_register_byname+0x34>
mov    $0x0,%al
call   1040 <auth_kerberos_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    -0x10(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11cc <auth_register_byname+0x5c>
mov    $0x0,%al
call   1050 <auth_globus_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    -0x10(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11f4 <auth_register_byname+0x84>
mov    $0x0,%al
call   1080 <auth_unix_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    -0x10(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    121c <auth_register_byname+0xac>
mov    $0x0,%al
call   1030 <auth_hostname_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    -0x10(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1244 <auth_register_byname+0xd4>
mov    $0x0,%al
call   1070 <auth_address_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    -0x10(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    126c <auth_register_byname+0xfc>
mov    $0x0,%al
call   1090 <auth_ticket_register@plt>
mov    %eax,-0x4(%rbp)
jmp    1285 <auth_register_byname+0x115>
mov    0x2d65(%rip),%rax
mov    (%rax),%ecx
mov    0x2d64(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auth_register_byname>:
push   %rbx
mov    %rdi,%rbx
lea    0xe85(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11f9 <auth_register_byname+0x89>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1201 <auth_register_byname+0x91>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1209 <auth_register_byname+0x99>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1211 <auth_register_byname+0xa1>
lea    0xe5a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1219 <auth_register_byname+0xa9>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1221 <auth_register_byname+0xb1>
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
mov    0x2ded(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1040 <auth_kerberos_register@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <auth_globus_register@plt>
xor    %eax,%eax
pop    %rbx
jmp    1080 <auth_unix_register@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <auth_hostname_register@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <auth_address_register@plt>
xor    %eax,%eax
pop    %rbx
jmp    1090 <auth_ticket_register@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"kerberos\00"
@.str.1 = [7 x i8] c"globus\00"
@.str.2 = [5 x i8] c"unix\00"
@.str.3 = [9 x i8] c"hostname\00"
@.str.4 = [8 x i8] c"address\00"
@.str.5 = [7 x i8] c"ticket\00"
@EINVAL = global i32 0
@errno = global i32 0
define i32 @auth_register_byname(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 ([9 x i8], [9 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 (...) @auth_kerberos_register()
store i32 %8, i32* %2
br label %41
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 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 (...) @auth_globus_register()
store i32 %14, i32* %2
br label %41
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 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 (...) @auth_unix_register()
store i32 %20, i32* %2
br label %41
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 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 = call i32 (...) @auth_hostname_register()
store i32 %26, i32* %2
br label %41
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = call i32 (...) @auth_address_register()
store i32 %32, i32* %2
br label %41
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = call i32 (...) @auth_ticket_register()
store i32 %38, i32* %2
br label %41
39: ; preds = %33
%40 = load i32, i32* @EINVAL
store i32 %40, i32* @errno
store i32 0, i32* %2
br label %41
41: ; preds = %39, %37, %31, %25, %19, %13, %7
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
@.str = [9 x i8] c"kerberos\00"
@.str.1 = [7 x i8] c"globus\00"
@.str.2 = [5 x i8] c"unix\00"
@.str.3 = [9 x i8] c"hostname\00"
@.str.4 = [8 x i8] c"address\00"
@.str.5 = [7 x i8] c"ticket\00"
@EINVAL = global i32 0
@errno = global i32 0
define i32 @auth_register_byname(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 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 (...) @auth_kerberos_register()
br label %33
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 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 (...) @auth_globus_register()
br label %33
11: ; preds = %6
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 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 (...) @auth_unix_register()
br label %33
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (...) @auth_hostname_register()
br label %33
21: ; preds = %16
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 (...) @auth_address_register()
br label %33
26: ; preds = %21
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 (...) @auth_ticket_register()
br label %33
31: ; preds = %26
%32 = load i32, i32* @EINVAL
store i32 %32, i32* @errno
br label %33
33: ; preds = %31, %29, %24, %19, %14, %9, %4
%34 = phi i32 [ 0, %31 ], [ %30, %29 ], [ %25, %24 ], [ %20, %19 ], [ %15, %14 ], [ %10, %9 ], [ %5, %4 ]
ret i32 %34
}