#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*/ SIGINT;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ psignal(int /*<<< orphan*/, char *);
char *strsignal(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  psignal(SIGKILL, "SIGKILL");
  psignal(SIGINT, "SIGINT");
  psignal(SIGQUIT, "SIGQUIT");
  printf("\n");
  printf("SIGKILL: %s\n", strsignal(SIGKILL));
  printf("SIGINT: %s\n", strsignal(SIGINT));
  printf("SIGQUIT: %s\n", strsignal(SIGQUIT));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1050 <psignal@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1050 <psignal@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1050 <psignal@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1040 <strsignal@plt>
mov    %rax,%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1040 <strsignal@plt>
mov    %rax,%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
call   1040 <strsignal@plt>
mov    %rax,%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2e84(%rip),%rbx
mov    (%rbx),%edi
lea    0xeab(%rip),%rsi
call   1060 <psignal@plt>
mov    0x2e87(%rip),%r15
mov    (%r15),%edi
lea    0xe9d(%rip),%rsi
call   1060 <psignal@plt>
mov    0x2e69(%rip),%r14
mov    (%r14),%edi
lea    0xe8e(%rip),%rsi
call   1060 <psignal@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <strsignal@plt>
lea    0xe79(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%edi
call   1050 <strsignal@plt>
lea    0xe6d(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%edi
call   1050 <strsignal@plt>
lea    0xe60(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
@.str = [8 x i8] c"SIGKILL\00"
@SIGINT = global i32 0
@.str.1 = [7 x i8] c"SIGINT\00"
@SIGQUIT = global i32 0
@.str.2 = [8 x i8] c"SIGQUIT\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [13 x i8] c"SIGKILL: %s\0A\00"
@.str.5 = [12 x i8] c"SIGINT: %s\0A\00"
@.str.6 = [13 x i8] c"SIGQUIT: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @SIGKILL
%7 = call i32 @psignal(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @SIGINT
%9 = call i32 @psignal(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @SIGQUIT
%11 = call i32 @psignal(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @SIGKILL
%14 = call i8* @strsignal(i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @SIGINT
%17 = call i8* @strsignal(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @SIGQUIT
%20 = call i8* @strsignal(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@.str = [8 x i8] c"SIGKILL\00"
@SIGINT = global i32 0
@.str.1 = [7 x i8] c"SIGINT\00"
@SIGQUIT = global i32 0
@.str.2 = [8 x i8] c"SIGQUIT\00"
@.str.4 = [13 x i8] c"SIGKILL: %s\0A\00"
@.str.5 = [12 x i8] c"SIGINT: %s\0A\00"
@.str.6 = [13 x i8] c"SIGQUIT: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGKILL
%4 = tail call i32 @psignal(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @SIGINT
%6 = tail call i32 @psignal(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @SIGQUIT
%8 = tail call i32 @psignal(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = load i32, i32* @SIGKILL
%11 = tail call i8* @strsignal(i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @SIGINT
%14 = tail call i8* @strsignal(i32 %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @SIGQUIT
%17 = tail call i8* @strsignal(i32 %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %17)
ret i32 0
}