#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 */
typedef int /*<<< orphan*/ nl_catd;

/* Variables and functions */
char *_DtGetMessage(char *filename, int set, int n, char *s) {
  char *msg;
  char *lang;
  nl_catd catopen();
  char *catgets();
  static int first = 1;
  static nl_catd nlmsg_fd;
  ;
  if (first) {
    first = 0;
    nlmsg_fd = catopen(filename, 0);
  }
  msg = catgets(nlmsg_fd, set, n, s);
  ;
  return (msg);
}


x86 assembly (clang, -O0):
<_DtGetMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,0x2ef3(%rip)
je     1160 <_DtGetMessage+0x40>
movl   $0x0,0x2ee3(%rip)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <catopen@plt>
mov    %eax,0x2ed8(%rip)
mov    0x2ed2(%rip),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1040 <catgets@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtGetMessage>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %esi,%ebx
cmpb   $0x1,0x2f02(%rip)
jne    113c <_DtGetMessage+0x1c>
mov    0x2efe(%rip),%edi
jmp    1154 <_DtGetMessage+0x34>
movb   $0x1,0x2ef1(%rip)
xor    %esi,%esi
xor    %eax,%eax
call   1030 <catopen@plt>
mov    %eax,%edi
mov    %eax,0x2ee4(%rip)
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <catgets@plt>

LLVM IR (-O0):
@_DtGetMessage.first = internal global i32 1
@_DtGetMessage.nlmsg_fd = internal global i32 0
define i8* @_DtGetMessage(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%11 = load i32, i32* @_DtGetMessage.first
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %4
store i32 0, i32* @_DtGetMessage.first
%14 = load i8*, i8** %5
%15 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @catopen to i32 (i8*, i32, ...)*)(i8* %14, i32 0)
store i32 %15, i32* @_DtGetMessage.nlmsg_fd
br label %16
16: ; preds = %13, %4
%17 = load i32, i32* @_DtGetMessage.nlmsg_fd
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i8*, i8** %8
%21 = call i8* (i32, i32, i32, i8*, ...) bitcast (i8* (...)* @catgets to i8* (i32, i32, i32, i8*, ...)*)(i32 %17, i32 %18, i32 %19, i8* %20)
store i8* %21, i8** %9
%22 = load i8*, i8** %9
ret i8* %22
}

LLVM IR (-O2):
@_DtGetMessage.first = internal unnamed_addr global i1 false
@_DtGetMessage.nlmsg_fd = internal unnamed_addr global i32 0
define i8* @_DtGetMessage(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = load i1, i1* @_DtGetMessage.first
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = load i32, i32* @_DtGetMessage.nlmsg_fd
br label %10
8: ; preds = %4
store i1 true, i1* @_DtGetMessage.first
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @catopen to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
store i32 %9, i32* @_DtGetMessage.nlmsg_fd
br label %10
10: ; preds = %6, %8
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = tail call i8* (i32, i32, i32, i8*, ...) bitcast (i8* (...)* @catgets to i8* (i32, i32, i32, i8*, ...)*)(i32 %11, i32 %1, i32 %2, i8* %3)
ret i8* %12
}