#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 */
char *do_nl_locale_name(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strcmp(char const *, char *);
const char *gnupg_messages_locale_name(void) {
  const char *s;
  s = do_nl_locale_name(0, "LC_MESSAGES");
  if (!s)
    s = "";
  else if (!strcmp(s, "C") || !strcmp(s, "POSIX"))
    s = "";
  return s;
}


x86 assembly (clang, -O0):
<gnupg_messages_locale_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    0xecf(%rip),%rsi
call   1040 <do_nl_locale_name@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1155 <gnupg_messages_locale_name+0x35>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1197 <gnupg_messages_locale_name+0x77>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1187 <gnupg_messages_locale_name+0x67>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1192 <gnupg_messages_locale_name+0x72>
lea    0xe7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1197 <gnupg_messages_locale_name+0x77>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnupg_messages_locale_name>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rsi
xor    %edi,%edi
call   1040 <do_nl_locale_name@plt>
lea    0xed4(%rip),%r14
test   %rax,%rax
je     1167 <gnupg_messages_locale_name+0x47>
mov    %rax,%rbx
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1167 <gnupg_messages_locale_name+0x47>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    116a <gnupg_messages_locale_name+0x4a>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"LC_MESSAGES\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [6 x i8] c"POSIX\00"
define i8* @gnupg_messages_locale_name() {
%1 = alloca i8*
%2 = call i8* @do_nl_locale_name(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %16
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8*, i8** %1
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %15
15: ; preds = %14, %10
br label %16
16: ; preds = %15, %5
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"LC_MESSAGES\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [6 x i8] c"POSIX\00"
define i8* @gnupg_messages_locale_name() {
%1 = tail call i8* @do_nl_locale_name(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %3
br label %10
10: ; preds = %0, %6, %9
%11 = phi i8* [ %1, %6 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %0 ]
ret i8* %11
}