#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*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ refresh();
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ system(char *);
void nrerror(char error_text[]) {
  void printnuke(void);
  extern char device[];
  extern int (*pfunc)(const char *, ...);
  pfunc("Numerical Recipes run-time error...\n");
  pfunc("%s\n", error_text);
  pfunc("...now exiting to system...\n");
  pfunc("\n");
  printnuke();
  pfunc("GALFIT crashed probably because one of the parameters\n");
  pfunc("has gotten too crazy.  For example, check that the\n");
  pfunc("Nuker parameter alpha, or the Gaussian magnitude has \n");
  pfunc("not gotten too big. \n");
  if (strncmp(device, "regular", 7) != 0) {
    refresh();
    system("sleep 5");
    endwin();
  };
  printf("%c", 7);
  exit(100);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe7d(%rip),%rdi
mov    0x2e56(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
mov    0x2e4b(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   *%rcx
lea    0xe7b(%rip),%rdi
mov    0x2e2b(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
lea    0xf3c(%rip),%rdi
mov    0x2e19(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
call   1060 <printnuke@plt>
lea    0xe6f(%rip),%rdi
mov    0x2e02(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
lea    0xe94(%rip),%rdi
mov    0x2df0(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
lea    0xeb6(%rip),%rdi
mov    0x2dde(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
lea    0xedb(%rip),%rdi
mov    0x2dcc(%rip),%rcx
mov    $0x0,%al
call   *(%rcx)
mov    0x2db1(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1254 <nrerror+0xe4>
mov    $0x0,%al
call   1070 <refresh@plt>
lea    0xebe(%rip),%rdi
call   1040 <system@plt>
mov    $0x0,%al
call   1080 <endwin@plt>
lea    0xeb3(%rip),%rdi
mov    $0x7,%esi
call   1050 <printf@plt>
mov    $0x64,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e62(%rip),%rbx
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
lea    0xe95(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   *(%rbx)
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
lea    0xf53(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
call   1060 <printnuke@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
lea    0xf0e(%rip),%rdi
xor    %eax,%eax
call   *(%rbx)
mov    0x2deb(%rip),%rdi
lea    0xf12(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1215 <nrerror+0xa5>
xor    %eax,%eax
call   1070 <refresh@plt>
lea    0xefd(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1080 <endwin@plt>
lea    0xef2(%rip),%rdi
mov    $0x7,%esi
call   1050 <printf@plt>
mov    $0x64,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@pfunc = external global i32 (i8*, ...)*
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [55 x i8] c"GALFIT crashed probably because one of the parameters\0A\00"
@.str.5 = [52 x i8] c"has gotten too crazy. For example, check that the\0A\00"
@.str.6 = [55 x i8] c"Nuker parameter alpha, or the Gaussian magnitude has \0A\00"
@.str.7 = [22 x i8] c"not gotten too big. \0A\00"
@device = external global [0 x i8]
@.str.8 = [8 x i8] c"regular\00"
@.str.9 = [8 x i8] c"sleep 5\00"
@.str.10 = [3 x i8] c"%c\00"
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%4 = call i32 (i8*, ...) %3(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) %5(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%9 = call i32 (i8*, ...) %8(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%11 = call i32 (i8*, ...) %10(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%13 = call i32 (i8*, ...) %12(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%15 = call i32 (i8*, ...) %14(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%17 = call i32 (i8*, ...) %16(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%19 = call i32 (i8*, ...) %18(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%20 = call i64 @strncmp(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @device, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %1
%23 = call i32 (...) @refresh()
%24 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%25 = call i32 (...) @endwin()
br label %26
26: ; preds = %22, %1
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 7)
%28 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@pfunc = external global i32 (i8*, ...)*
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [55 x i8] c"GALFIT crashed probably because one of the parameters\0A\00"
@.str.5 = [52 x i8] c"has gotten too crazy. For example, check that the\0A\00"
@.str.6 = [55 x i8] c"Nuker parameter alpha, or the Gaussian magnitude has \0A\00"
@.str.7 = [22 x i8] c"not gotten too big. \0A\00"
@device = external global [0 x i8]
@.str.8 = [8 x i8] c"regular\00"
@.str.9 = [8 x i8] c"sleep 5\00"
@.str.10 = [3 x i8] c"%c\00"
define void @nrerror(i8* %0) {
%2 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%3 = tail call i32 (i8*, ...) %2(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%5 = tail call i32 (i8*, ...) %4(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%7 = tail call i32 (i8*, ...) %6(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%9 = tail call i32 (i8*, ...) %8(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
tail call void @printnuke()
%10 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%11 = tail call i32 (i8*, ...) %10(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%13 = tail call i32 (i8*, ...) %12(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%15 = tail call i32 (i8*, ...) %14(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32 (i8*, ...)*, i32 (i8*, ...)** @pfunc
%17 = tail call i32 (i8*, ...) %16(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%18 = tail call i64 @strncmp(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @device, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %1
%21 = tail call i32 (...) @refresh()
%22 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%23 = tail call i32 (...) @endwin()
br label %24
24: ; preds = %20, %1
%25 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 7)
%26 = tail call i32 @exit(i32 100)
unreachable
}