#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;
scalar_t__ strcasecmp(char const *, char *);
char *bind_textdomain_codeset(const char *domainname, const char *codeset) {
  if (!domainname || !*domainname ||
      (codeset && strcasecmp(codeset, "UTF-8"))) {
    errno = EINVAL;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<bind_textdomain_codeset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <bind_textdomain_codeset+0x4d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <bind_textdomain_codeset+0x4d>
cmpq   $0x0,-0x10(%rbp)
je     116f <bind_textdomain_codeset+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     116f <bind_textdomain_codeset+0x5f>
mov    0x2e74(%rip),%rax
mov    (%rax),%ecx
mov    0x2e73(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_textdomain_codeset>:
push   %rax
test   %rdi,%rdi
je     1137 <bind_textdomain_codeset+0x27>
cmpb   $0x0,(%rdi)
je     1137 <bind_textdomain_codeset+0x27>
test   %rsi,%rsi
je     1149 <bind_textdomain_codeset+0x39>
lea    0xed9(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1149 <bind_textdomain_codeset+0x39>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    0x2e99(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
@EINVAL = global i32 0
@errno = global i32 0
define i8* @bind_textdomain_codeset(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i8*, i8** %4
%16 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14, %7, %2
%19 = load i32, i32* @EINVAL
store i32 %19, i32* @errno
br label %20
20: ; preds = %18, %14, %11
ret i8* null
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
@EINVAL = global i32 0
@errno = global i32 0
define noalias i8* @bind_textdomain_codeset(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = icmp eq i8* %1, null
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9, %4, %2
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
br label %14
14: ; preds = %12, %9, %7
ret i8* null
}