#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 */
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ signo_buf;
typedef int /*<<< orphan*/ sigbuf;

/* Variables and functions */
int _NSIG;
char *get_signal_name(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ sigismember(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ snprintf(char *, size_t, char *, ...);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int latrace_struct_to_str_sigset_t(sigset_t *obj, char *buf, size_t blen) {
  char sigbuf[512];
  int s, inverted = 0;
  size_t sig_tot = 0;
  if (obj == NULL)
    return -1;
  memset(sigbuf, 0, sizeof(sigbuf));
  for (s = 1; s < _NSIG; s++)
    sig_tot += sigismember(obj, s);
  if (_NSIG - sig_tot < 16)
    inverted = 1;
  if (sig_tot == _NSIG - 1)
    strcpy(sigbuf, "ALL SIGNALS");
  else if (!sig_tot)
    strcpy(sigbuf, "");
  else {
    for (s = 1; s < _NSIG; s++) {
      if ((!inverted && sigismember(obj, s)) ||
          (inverted && !sigismember(obj, s))) {
        char signo_buf[16];
        const char *signame = get_signal_name(s);
        if (!signame) {
          snprintf(signo_buf, sizeof(signo_buf), "%d", s);
          signame = signo_buf;
        }
        if (sigbuf[0])
          strcat(sigbuf, ",");
        strcat(sigbuf, signame);
      }
    }
  }
  if (sigbuf[0] && sigbuf[strlen(sigbuf) - 1] == ',')
    sigbuf[strlen(sigbuf) - 1] = 0;
  if (inverted)
    snprintf(buf, blen, "![%s]", sigbuf);
  else
    snprintf(buf, blen, "[%s]", sigbuf);
  return 0;
}


x86 assembly (clang, -O0):
<latrace_struct_to_str_sigset_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x228(%rbp)
movq   $0x0,-0x230(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b3 <latrace_struct_to_str_sigset_t+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1445 <latrace_struct_to_str_sigset_t+0x2d5>
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
movl   $0x1,-0x224(%rbp)
mov    -0x224(%rbp),%eax
mov    0x2e13(%rip),%rcx
cmp    (%rcx),%eax
jge    1216 <latrace_struct_to_str_sigset_t+0xa6>
mov    -0x10(%rbp),%rdi
mov    -0x224(%rbp),%esi
call   1080 <sigismember@plt>
add    -0x230(%rbp),%rax
mov    %rax,-0x230(%rbp)
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    11d0 <latrace_struct_to_str_sigset_t+0x60>
mov    0x2dd3(%rip),%rax
movslq (%rax),%rax
sub    -0x230(%rbp),%rax
cmp    $0x10,%rax
jae    123b <latrace_struct_to_str_sigset_t+0xcb>
movl   $0x1,-0x228(%rbp)
mov    -0x230(%rbp),%rax
mov    0x2da7(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jne    1272 <latrace_struct_to_str_sigset_t+0x102>
lea    -0x220(%rbp),%rdi
lea    0xd98(%rip),%rsi
call   1030 <strcpy@plt>
jmp    13a7 <latrace_struct_to_str_sigset_t+0x237>
cmpq   $0x0,-0x230(%rbp)
jne    1298 <latrace_struct_to_str_sigset_t+0x128>
lea    -0x220(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1030 <strcpy@plt>
jmp    13a2 <latrace_struct_to_str_sigset_t+0x232>
movl   $0x1,-0x224(%rbp)
mov    -0x224(%rbp),%eax
mov    0x2d41(%rip),%rcx
cmp    (%rcx),%eax
jge    139d <latrace_struct_to_str_sigset_t+0x22d>
cmpl   $0x0,-0x228(%rbp)
jne    12dd <latrace_struct_to_str_sigset_t+0x16d>
mov    -0x10(%rbp),%rdi
mov    -0x224(%rbp),%esi
call   1080 <sigismember@plt>
cmp    $0x0,%rax
jne    1303 <latrace_struct_to_str_sigset_t+0x193>
cmpl   $0x0,-0x228(%rbp)
je     1384 <latrace_struct_to_str_sigset_t+0x214>
mov    -0x10(%rbp),%rdi
mov    -0x224(%rbp),%esi
call   1080 <sigismember@plt>
cmp    $0x0,%rax
jne    1384 <latrace_struct_to_str_sigset_t+0x214>
mov    -0x224(%rbp),%edi
call   1090 <get_signal_name@plt>
mov    %rax,-0x248(%rbp)
cmpq   $0x0,-0x248(%rbp)
jne    1351 <latrace_struct_to_str_sigset_t+0x1e1>
lea    -0x240(%rbp),%rdi
mov    -0x224(%rbp),%ecx
mov    $0x10,%esi
lea    0xcd0(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
lea    -0x240(%rbp),%rax
mov    %rax,-0x248(%rbp)
cmpb   $0x0,-0x220(%rbp)
je     1371 <latrace_struct_to_str_sigset_t+0x201>
lea    -0x220(%rbp),%rdi
lea    0xca3(%rip),%rsi
call   1070 <strcat@plt>
lea    -0x220(%rbp),%rdi
mov    -0x248(%rbp),%rsi
call   1070 <strcat@plt>
jmp    1389 <latrace_struct_to_str_sigset_t+0x219>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    12a2 <latrace_struct_to_str_sigset_t+0x132>
jmp    13a2 <latrace_struct_to_str_sigset_t+0x232>
jmp    13a7 <latrace_struct_to_str_sigset_t+0x237>
movsbl -0x220(%rbp),%eax
cmp    $0x0,%eax
je     13f2 <latrace_struct_to_str_sigset_t+0x282>
lea    -0x220(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x2c,%eax
jne    13f2 <latrace_struct_to_str_sigset_t+0x282>
lea    -0x220(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x220(%rbp,%rax,1)
cmpl   $0x0,-0x228(%rbp)
je     1421 <latrace_struct_to_str_sigset_t+0x2b1>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x220(%rbp),%rcx
lea    0xbfc(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    143e <latrace_struct_to_str_sigset_t+0x2ce>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x220(%rbp),%rcx
lea    0xbdb(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latrace_struct_to_str_sigset_t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
test   %rdi,%rdi
je     1207 <latrace_struct_to_str_sigset_t+0x97>
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,%r15
lea    0x20(%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
mov    0x2e43(%rip),%r14
mov    (%r14),%eax
cmp    $0x2,%eax
mov    %r12,0x8(%rsp)
mov    %rbp,(%rsp)
jl     11e7 <latrace_struct_to_str_sigset_t+0x77>
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %ebp,%esi
call   1080 <sigismember@plt>
add    %rax,%rbx
add    $0x1,%ebp
mov    (%r14),%eax
cmp    %eax,%ebp
jl     11d0 <latrace_struct_to_str_sigset_t+0x60>
movslq %eax,%rcx
mov    %rcx,%r12
sub    %rbx,%r12
add    $0xffffffff,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rbx
jne    1211 <latrace_struct_to_str_sigset_t+0xa1>
lea    0xdfe(%rip),%rsi
jmp    12bc <latrace_struct_to_str_sigset_t+0x14c>
mov    $0xffffffff,%ebx
jmp    1324 <latrace_struct_to_str_sigset_t+0x1b4>
test   %rbx,%rbx
je     12b5 <latrace_struct_to_str_sigset_t+0x145>
cmp    $0x2,%eax
jl     12c6 <latrace_struct_to_str_sigset_t+0x156>
mov    $0x1,%ebp
lea    0x20(%rsp),%rbx
jmp    1247 <latrace_struct_to_str_sigset_t+0xd7>
nop
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <strcat@plt>
add    $0x1,%ebp
cmp    (%r14),%ebp
jge    12c6 <latrace_struct_to_str_sigset_t+0x156>
mov    %r15,%rdi
mov    %ebp,%esi
call   1080 <sigismember@plt>
cmp    $0x10,%r12
jae    1260 <latrace_struct_to_str_sigset_t+0xf0>
test   %rax,%rax
jne    123b <latrace_struct_to_str_sigset_t+0xcb>
jmp    1265 <latrace_struct_to_str_sigset_t+0xf5>
xchg   %ax,%ax
test   %rax,%rax
je     123b <latrace_struct_to_str_sigset_t+0xcb>
mov    %ebp,%edi
call   1090 <get_signal_name@plt>
mov    %rax,%r13
test   %rax,%rax
je     127d <latrace_struct_to_str_sigset_t+0x10d>
cmpb   $0x0,0x20(%rsp)
jne    12a1 <latrace_struct_to_str_sigset_t+0x131>
jmp    1230 <latrace_struct_to_str_sigset_t+0xc0>
mov    $0x10,%esi
lea    0x10(%rsp),%r13
mov    %r13,%rdi
lea    0xd7b(%rip),%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <snprintf@plt>
cmpb   $0x0,0x20(%rsp)
je     1230 <latrace_struct_to_str_sigset_t+0xc0>
mov    %rbx,%rdi
lea    0xd64(%rip),%rsi
call   1070 <strcat@plt>
jmp    1230 <latrace_struct_to_str_sigset_t+0xc0>
lea    0xd54(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
cmpb   $0x0,0x20(%rsp)
je     12f7 <latrace_struct_to_str_sigset_t+0x187>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0x2c,-0x1(%rax,%rbx,1)
jne    12f7 <latrace_struct_to_str_sigset_t+0x187>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
cmp    $0x10,%r12
lea    0xd0f(%rip),%rax
lea    0xd09(%rip),%rdx
cmovb  %rax,%rdx
xor    %ebx,%ebx
lea    0x20(%rsp),%rcx
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <snprintf@plt>
mov    %ebx,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@_NSIG = global i32 0
@.str = [12 x i8] c"ALL SIGNALS\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [6 x i8] c"![%s]\00"
@.str.5 = [5 x i8] c"[%s]\00"
define i32 @latrace_struct_to_str_sigset_t(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca [512 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca [16 x i8]
%13 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 0, i32* %10
store i64 0, i64* %11
%14 = load i32*, i32** %5
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 -1, i32* %4
br label %137
17: ; preds = %3
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%19 = call i32 @memset(i8* %18, i32 0, i32 512)
store i32 1, i32* %9
br label %20
20: ; preds = %30, %17
%21 = load i32, i32* %9
%22 = load i32, i32* @_NSIG
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %33
24: ; preds = %20
%25 = load i32*, i32** %5
%26 = load i32, i32* %9
%27 = call i64 @sigismember(i32* %25, i32 %26)
%28 = load i64, i64* %11
%29 = add i64 %28, %27
store i64 %29, i64* %11
br label %30
30: ; preds = %24
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %20
33: ; preds = %20
%34 = load i32, i32* @_NSIG
%35 = sext i32 %34 to i64
%36 = load i64, i64* %11
%37 = sub i64 %35, %36
%38 = icmp ult i64 %37, 16
br i1 %38, label %39, label %40
39: ; preds = %33
store i32 1, i32* %10
br label %40
40: ; preds = %39, %33
%41 = load i64, i64* %11
%42 = load i32, i32* @_NSIG
%43 = sub nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = icmp eq i64 %41, %44
br i1 %45, label %46, label %49
46: ; preds = %40
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%48 = call i32 @strcpy(i8* %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %103
49: ; preds = %40
%50 = load i64, i64* %11
%51 = icmp ne i64 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%54 = call i32 @strcpy(i8* %53, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %102
55: ; preds = %49
store i32 1, i32* %9
br label %56
56: ; preds = %98, %55
%57 = load i32, i32* %9
%58 = load i32, i32* @_NSIG
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %101
60: ; preds = %56
%61 = load i32, i32* %10
%62 = icmp ne i32 %61, 0
br i1 %62, label %68, label %63
63: ; preds = %60
%64 = load i32*, i32** %5
%65 = load i32, i32* %9
%66 = call i64 @sigismember(i32* %64, i32 %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %76, label %68
68: ; preds = %63, %60
%69 = load i32, i32* %10
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %97
71: ; preds = %68
%72 = load i32*, i32** %5
%73 = load i32, i32* %9
%74 = call i64 @sigismember(i32* %72, i32 %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %97, label %76
76: ; preds = %71, %63
%77 = load i32, i32* %9
%78 = call i8* @get_signal_name(i32 %77)
store i8* %78, i8** %13
%79 = load i8*, i8** %13
%80 = icmp ne i8* %79, null
br i1 %80, label %86, label %81
81: ; preds = %76
%82 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%83 = load i32, i32* %9
%84 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %82, i64 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
store i8* %85, i8** %13
br label %86
86: ; preds = %81, %76
%87 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%88 = load i8, i8* %87
%89 = icmp ne i8 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%92 = call i32 @strcat(i8* %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %93
93: ; preds = %90, %86
%94 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%95 = load i8*, i8** %13
%96 = call i32 @strcat(i8* %94, i8* %95)
br label %97
97: ; preds = %93, %71, %68
br label %98
98: ; preds = %97
%99 = load i32, i32* %9
%100 = add nsw i32 %99, 1
store i32 %100, i32* %9
br label %56
101: ; preds = %56
br label %102
102: ; preds = %101, %52
br label %103
103: ; preds = %102, %46
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %123
108: ; preds = %103
%109 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%110 = call i32 @strlen(i8* %109)
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 44
br i1 %116, label %117, label %123
117: ; preds = %108
%118 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%119 = call i32 @strlen(i8* %118)
%120 = sub nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 %121
store i8 0, i8* %122
br label %123
123: ; preds = %117, %108, %103
%124 = load i32, i32* %10
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %131
126: ; preds = %123
%127 = load i8*, i8** %6
%128 = load i64, i64* %7
%129 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%130 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %127, i64 %128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %129)
br label %136
131: ; preds = %123
%132 = load i8*, i8** %6
%133 = load i64, i64* %7
%134 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%135 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %132, i64 %133, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %134)
br label %136
136: ; preds = %131, %126
store i32 0, i32* %4
br label %137
137: ; preds = %136, %16
%138 = load i32, i32* %4
ret i32 %138
}

LLVM IR (-O2):
@_NSIG = global i32 0
@.str = [12 x i8] c"ALL SIGNALS\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [6 x i8] c"![%s]\00"
@.str.5 = [5 x i8] c"[%s]\00"
define i32 @latrace_struct_to_str_sigset_t(i32* %0, i8* nocapture writeonly %1, i64 %2) {
%4 = alloca [512 x i8]
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32* %0, null
br i1 %7, label %79, label %8
8: ; preds = %3
%9 = call i32 @memset(i8* %6, i32 0, i32 512)
%10 = load i32, i32* @_NSIG
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %20
12: ; preds = %8, %12
%13 = phi i64 [ %16, %12 ], [ 0, %8 ]
%14 = phi i32 [ %17, %12 ], [ 1, %8 ]
%15 = call i64 @sigismember(i32* %0, i32 %14)
%16 = add i64 %15, %13
%17 = add nuw nsw i32 %14, 1
%18 = load i32, i32* @_NSIG
%19 = icmp slt i32 %17, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %8
%21 = phi i64 [ 0, %8 ], [ %16, %12 ]
%22 = phi i32 [ %10, %8 ], [ %18, %12 ]
%23 = sext i32 %22 to i64
%24 = sub i64 %23, %21
%25 = icmp ult i64 %24, 16
%26 = add nsw i32 %22, -1
%27 = sext i32 %26 to i64
%28 = icmp eq i64 %21, %27
br i1 %28, label %58, label %29
29: ; preds = %20
%30 = icmp eq i64 %21, 0
br i1 %30, label %58, label %31
31: ; preds = %29
%32 = icmp sgt i32 %22, 1
br i1 %32, label %33, label %61
33: ; preds = %31
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
br label %35
35: ; preds = %33, %54
%36 = phi i32 [ 1, %33 ], [ %55, %54 ]
%37 = call i64 @sigismember(i32* %0, i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %25, label %40, label %39
39: ; preds = %35
br i1 %38, label %54, label %41
40: ; preds = %35
br i1 %38, label %41, label %54
41: ; preds = %40, %39
%42 = call i8* @get_signal_name(i32 %36)
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %34, i64 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %46
46: ; preds = %44, %41
%47 = phi i8* [ %42, %41 ], [ %34, %44 ]
%48 = load i8, i8* %6
%49 = icmp eq i8 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
%53 = call i32 @strcat(i8* %6, i8* %47)
br label %54
54: ; preds = %39, %40, %52
%55 = add nuw nsw i32 %36, 1
%56 = load i32, i32* @_NSIG
%57 = icmp slt i32 %55, %56
br i1 %57, label %35, label %61
58: ; preds = %29, %20
%59 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %20 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %29 ]
%60 = call i32 @strcpy(i8* %6, i8* %59)
br label %61
61: ; preds = %54, %58, %31
%62 = load i8, i8* %6
%63 = icmp eq i8 %62, 0
br i1 %63, label %76, label %64
64: ; preds = %61
%65 = call i32 @strlen(i8* %6)
%66 = add nsw i32 %65, -1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 44
br i1 %70, label %71, label %76
71: ; preds = %64
%72 = call i32 @strlen(i8* %6)
%73 = add nsw i32 %72, -1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 %74
store i8 0, i8* %75
br label %76
76: ; preds = %71, %64, %61
%77 = select i1 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0)
%78 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %1, i64 %2, i8* %77, i8* %6)
br label %79
79: ; preds = %76, %3
%80 = phi i32 [ -1, %3 ], [ 0, %76 ]
ret i32 %80
}