#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 /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
char *logtime();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ put(char *);
void segv(int sig) {
  put("An error has occured in the Net Tamagotchi server.\n");
  put("Please report the circumstances which caused this to "
      "algernon@debian.org\n");
  put("Thank you.\n");
  printf("%s Segmentation violation. Client handler exiting.\n", logtime());
  fflush(NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<segv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <put@plt>
lea    0xec6(%rip),%rdi
call   1030 <put@plt>
lea    0xf04(%rip),%rdi
call   1030 <put@plt>
mov    $0x0,%al
call   1050 <logtime@plt>
mov    %rax,%rsi
lea    0xefa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<segv>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <put@plt>
lea    0xed0(%rip),%rdi
call   1030 <put@plt>
lea    0xf0e(%rip),%rdi
call   1030 <put@plt>
xor    %eax,%eax
call   1050 <logtime@plt>
lea    0xf07(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"An error has occured in the Net Tamagotchi server.\0A\00"
@.str.1 = [74 x i8] c"Please report the circumstances which caused this to algernon@debian.org\0A\00"
@.str.2 = [12 x i8] c"Thank you.\0A\00"
@.str.3 = [52 x i8] c"%s Segmentation violation. Client handler exiting.\0A\00"
define void @segv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @put(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = call i8* (...) @logtime()
%7 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = call i32 @fflush(i32* null)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"An error has occured in the Net Tamagotchi server.\0A\00"
@.str.1 = [74 x i8] c"Please report the circumstances which caused this to algernon@debian.org\0A\00"
@.str.2 = [12 x i8] c"Thank you.\0A\00"
@.str.3 = [52 x i8] c"%s Segmentation violation. Client handler exiting.\0A\00"
define void @segv(i32 %0) {
%2 = tail call i32 @put(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @put(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* (...) @logtime()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = tail call i32 @fflush(i32* null)
%8 = tail call i32 @exit(i32 0)
unreachable
}