#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void error_exit(char *errmsg, int errno) {
  printf("%s \n", errmsg);
  if (errno < 15) {
    printf("Usage: 'life3d <input file> <generations>' \n");
    printf("       input file must exist in the same directory and have a .in "
           "extension, \n");
    printf("       generations must be a non-zero integer. \n");
  }
  exit(errno);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xf,-0xc(%rbp)
jge    1175 <error_exit+0x55>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xe,%ebx
jg     116d <error_exit+0x3d>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [45 x i8] c"Usage: 'life3d <input file> <generations>' \0A\00"
@.str.2 = [79 x i8] c" input file must exist in the same directory and have a .in extension, \0A\00"
@.str.3 = [49 x i8] c" generations must be a non-zero integer. \0A\00"
define void @error_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 15
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %4
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
@str = [44 x i8] c"Usage: 'life3d <input file> <generations>' \00"
@str.4 = [78 x i8] c" input file must exist in the same directory and have a .in extension, \00"
@str.5 = [48 x i8] c" generations must be a non-zero integer. \00"
define void @error_exit(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp slt i32 %1, 15
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.4, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.5, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
%10 = tail call i32 @exit(i32 %1)
unreachable
}