// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/mksignal.c
// Function: main
int main(void) {
    int maxsig = NUMSIG-1;
    int s;
    struct signaming *snp;
    FILE *outf;

    for (snp = signamings; snp->signo; ++snp)
	if (snp->signo > maxsig)
	    maxsig = snp->signo;

    outf = fopen("sigmsgs.h", "w");
    if (!outf) barf("could not open sigmsgs.h for writing");
    fprintf(outf, "typedef struct {\n");
    fprintf(outf, "\tchar *name, *msg;\n");
    fprintf(outf, "} Sigmsgs;\n");
    fprintf(outf, "extern Sigmsgs signals[];\n");
    fprintf(outf, "#define NUMOFSIGNALS %d\n", maxsig+1);
    if (fclose(outf) == EOF)  barf("could not fclose sigmsgs.h after writing");

    outf = fopen("sigmsgs.c", "w");
    if (!outf) barf("could not open sigmsgs.c for writing");
    fprintf(outf, "#include \"sigmsgs.h\"\n\n");
    fprintf(outf, "Sigmsgs signals[] = {\n");
    fprintf(outf, "\t{\"\",\t\"\"},\n");

    /* yes, we could avoid the quadratic searching with an aux array. fap. */
    for (s = 1; s <= maxsig; ++s) {
	for (snp = signamings; snp->signo && snp->signo != s; ++snp)
	    /* */;
	if (snp->signo)
	    fprintf(outf, "\t{\"%s\",\t\"%s\"},\n",
		    snp->signame, snp->sigmsg);
#if defined(SIGRTMIN) && defined(SIGRTMAX)
	else if (s >= SIGRTMIN && s <= SIGRTMAX)
	    fprintf(outf, "\t{\"sigrt%d\",\t\"real-time signal %d\"},\n",
		    s - SIGRTMIN, s - SIGRTMIN);
#endif
	else
	    fprintf(outf, "\t{\"sig%d\",\t\"unknown signal %d\"},\n",
		    s, s);
    }
    fprintf(outf, "};\n");
    if (fclose(outf) == EOF) barf("could not fclose sigmsgs.c after writing");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl $0x40, -0x8(%rbp)
leaq 0x2eb3(%rip), %rax      # 0x4060
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x11de
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jle 0x11ce
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8(%rbp)
jmp 0x11d0
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
jmp 0x11b1
leaq 0xe1f(%rip), %rdi       # 0x2004
leaq 0xe22(%rip), %rsi       # 0x200e
callq 0x1050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1208
leaq 0xe0d(%rip), %rdi       # 0x2010
callq 0x1430
movq -0x20(%rbp), %rdi
leaq 0xe22(%rip), %rsi       # 0x2035
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
leaq 0xe22(%rip), %rsi       # 0x2047
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
leaq 0xe24(%rip), %rsi       # 0x205b
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
leaq 0xe1e(%rip), %rsi       # 0x2067
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %edx
addl $0x1, %edx
leaq 0xe21(%rip), %rsi       # 0x2082
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x1030
cmpl $-0x1, %eax
jne 0x1282
leaq 0xe1e(%rip), %rdi       # 0x209b
callq 0x1430
leaq 0xe3b(%rip), %rdi       # 0x20c4
leaq 0xd7e(%rip), %rsi       # 0x200e
callq 0x1050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12ac
leaq 0xe27(%rip), %rdi       # 0x20ce
callq 0x1430
movq -0x20(%rbp), %rdi
leaq 0xe3c(%rip), %rsi       # 0x20f3
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
leaq 0xe41(%rip), %rsi       # 0x210a
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
leaq 0xe46(%rip), %rsi       # 0x2121
movb $0x0, %al
callq 0x1040
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jg 0x13fc
leaq 0x2d64(%rip), %rax      # 0x4060
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, -0x21(%rbp)
je 0x131d
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x1326
jmp 0x1336
jmp 0x1328
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
jmp 0x1300
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1366
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0xdd3(%rip), %rsi       # 0x212d
movb $0x0, %al
callq 0x1040
jmp 0x13ec
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
callq 0x1060
movl %eax, %ecx
movl -0x28(%rbp), %eax
cmpl %ecx, %eax
jl 0x13d2
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
callq 0x1080
movl %eax, %ecx
movl -0x2c(%rbp), %eax
cmpl %ecx, %eax
jg 0x13d2
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x40(%rbp)
callq 0x1060
movl %eax, %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
callq 0x1060
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %edx
subl %eax, %ecx
leaq 0xd74(%rip), %rsi       # 0x213d
movb $0x0, %al
callq 0x1040
jmp 0x13ea
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
leaq 0xd80(%rip), %rsi       # 0x2163
movb $0x0, %al
callq 0x1040
jmp 0x13ec
jmp 0x13ee
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x12e9
movq -0x20(%rbp), %rdi
leaq 0xd7e(%rip), %rsi       # 0x2185
movb $0x0, %al
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x1030
cmpl $-0x1, %eax
jne 0x1428
leaq 0xd66(%rip), %rdi       # 0x2189
callq 0x1430
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq