#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 /*<<< orphan*/ errno;
char *bindtextdomain(const char *domainname, const char *dirname) {
  static const char dir[] = "/";
  if (!domainname || !*domainname ||
      (dirname && ((dirname[0] != '/') || dirname[1]))) {
    errno = EINVAL;
    return NULL;
  }
  return (char *)dir;
}


x86 assembly (clang, -O0):
<bindtextdomain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <bindtextdomain+0x50>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <bindtextdomain+0x50>
cmpq   $0x0,-0x18(%rbp)
je     116f <bindtextdomain+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1150 <bindtextdomain+0x50>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     116f <bindtextdomain+0x6f>
mov    0x2e81(%rip),%rax
mov    (%rax),%ecx
mov    0x2e80(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    117a <bindtextdomain+0x7a>
lea    0xe8a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindtextdomain>:
test   %rdi,%rdi
je     1121 <bindtextdomain+0x21>
cmpb   $0x0,(%rdi)
je     1121 <bindtextdomain+0x21>
lea    0xeef(%rip),%rax
test   %rsi,%rsi
je     1135 <bindtextdomain+0x35>
cmpb   $0x2f,(%rsi)
jne    1121 <bindtextdomain+0x21>
cmpb   $0x0,0x1(%rsi)
je     1135 <bindtextdomain+0x35>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    0x2eaf(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@bindtextdomain.dir = internal constant [2 x i8] c"/\00"
@EINVAL = global i32 0
@errno = global i32 0
define i8* @bindtextdomain(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %27
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 47
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %21, %15, %8, %2
%28 = load i32, i32* @EINVAL
store i32 %28, i32* @errno
store i8* null, i8** %3
br label %30
29: ; preds = %21, %12
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @bindtextdomain.dir, i64 0, i64 0), i8** %3
br label %30
30: ; preds = %29, %27
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
@bindtextdomain.dir = internal constant [2 x i8] c"/\00"
@EINVAL = global i32 0
@errno = global i32 0
define i8* @bindtextdomain(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = icmp eq i8* %1, null
br i1 %8, label %18, label %9
9: ; preds = %7
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 47
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %1, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12, %9, %4, %2
%17 = load i32, i32* @EINVAL
store i32 %17, i32* @errno
br label %18
18: ; preds = %7, %12, %16
%19 = phi i8* [ null, %16 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @bindtextdomain.dir, i64 0, i64 0), %12 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @bindtextdomain.dir, i64 0, i64 0), %7 ]
ret i8* %19
}