#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*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strsignal(int);
void psignal(int signum, register const char *message) {
  register const char *sep;
  sep = ": ";
  if (!(message && *message)) {
    message = (sep += 2);
  }
  fprintf(stderr, "%s%s%s\n", message, sep, strsignal(signum));
}


x86 assembly (clang, -O0):
<psignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <psignal+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1165 <psignal+0x45>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strsignal@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe65(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psignal>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
je     113a <psignal+0x1a>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
je     113a <psignal+0x1a>
lea    0xec8(%rip),%r14
jmp    1144 <psignal+0x24>
lea    0xec1(%rip),%rbx
mov    %rbx,%r14
mov    0x2e95(%rip),%rax
mov    (%rax),%ebp
call   1040 <strsignal@plt>
lea    0xeaa(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"%s%s%s\0A\00"
define void @psignal(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8, %2
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8* %15, i8** %5
store i8* %15, i8** %4
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = load i32, i32* %3
%21 = call i32 @strsignal(i32 %20)
%22 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"%s%s%s\0A\00"
define void @psignal(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %7, %4
%9 = phi i8* [ %1, %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 2), %7 ]
%10 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 2), %7 ]
%11 = load i32, i32* @stderr
%12 = tail call i32 @strsignal(i32 %0)
%13 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10, i32 %12)
ret void
}