#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 snprintf(char *, int, char *, char *, int, char *);
int err2reason_phrase(int ser_error, int *sip_error, char *phrase, int etl,
                      char *signature) {
  char *error_txt;
  switch (ser_error) {
  case -473:
    error_txt = "Filtered destination";
    *sip_error = -ser_error;
    break;
  case -477:
    error_txt = "Send failed";
    *sip_error = -ser_error;
    break;
  case -476:
    error_txt = "Unresolvable destination";
    *sip_error = -ser_error;
    break;
  case -400:
    error_txt = "Bad Request";
    *sip_error = -ser_error;
    break;
  case -475:
    error_txt = "Bad URI";
    *sip_error = -ser_error;
    break;
  case -9:
    error_txt = "Transaction tuple incomplete";
    *sip_error = - -400;
    break;
  case -13:
    error_txt = "Bad To";
    *sip_error = - -400;
    break;
  case -11:
    error_txt = "Error in external logic";
    *sip_error = - -500;
    break;
  case -12:
    error_txt = "Forking capacity exceeded";
    *sip_error = - -500;
    break;
  case -15:
    error_txt = "Invalid character in q parameter";
    *sip_error = - -400;
    break;
  case -16:
    error_txt = "Empty q parameter";
    *sip_error = - -400;
    break;
    ;
  case -17:
    error_txt = "q parameter too big";
    *sip_error = - -400;
    break;
  case -18:
    error_txt = "Decimal part missing in q";
    *sip_error = - -400;
    break;
  case -19:
    error_txt = "No destination available";
    *sip_error = - -500;
    break;
  case -2:
  default:
    error_txt = "Server error occurred";
    *sip_error = - -500;
    break;
  }
  return snprintf(phrase, etl, "%s (%d/%s)", error_txt, -ser_error, signature);
}


x86 assembly (clang, -O0):
<err2reason_phrase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0xfffffe23,%eax
je     1251 <err2reason_phrase+0x141>
jmp    1140 <err2reason_phrase+0x30>
mov    -0x34(%rbp),%eax
sub    $0xfffffe24,%eax
je     126c <err2reason_phrase+0x15c>
jmp    1153 <err2reason_phrase+0x43>
mov    -0x34(%rbp),%eax
sub    $0xfffffe25,%eax
je     12a2 <err2reason_phrase+0x192>
jmp    1166 <err2reason_phrase+0x56>
mov    -0x34(%rbp),%eax
sub    $0xfffffe27,%eax
je     1236 <err2reason_phrase+0x126>
jmp    1179 <err2reason_phrase+0x69>
mov    -0x34(%rbp),%eax
sub    $0xfffffe70,%eax
je     1287 <err2reason_phrase+0x177>
jmp    118c <err2reason_phrase+0x7c>
mov    -0x34(%rbp),%eax
sub    $0xffffffed,%eax
je     138d <err2reason_phrase+0x27d>
jmp    119d <err2reason_phrase+0x8d>
mov    -0x34(%rbp),%eax
sub    $0xffffffee,%eax
je     1373 <err2reason_phrase+0x263>
jmp    11ae <err2reason_phrase+0x9e>
mov    -0x34(%rbp),%eax
sub    $0xffffffef,%eax
je     1359 <err2reason_phrase+0x249>
jmp    11bf <err2reason_phrase+0xaf>
mov    -0x34(%rbp),%eax
sub    $0xfffffff0,%eax
je     133f <err2reason_phrase+0x22f>
jmp    11d0 <err2reason_phrase+0xc0>
mov    -0x34(%rbp),%eax
sub    $0xfffffff1,%eax
je     1325 <err2reason_phrase+0x215>
jmp    11e1 <err2reason_phrase+0xd1>
mov    -0x34(%rbp),%eax
sub    $0xfffffff3,%eax
je     12d7 <err2reason_phrase+0x1c7>
jmp    11f2 <err2reason_phrase+0xe2>
mov    -0x34(%rbp),%eax
sub    $0xfffffff4,%eax
je     130b <err2reason_phrase+0x1fb>
jmp    1203 <err2reason_phrase+0xf3>
mov    -0x34(%rbp),%eax
sub    $0xfffffff5,%eax
je     12f1 <err2reason_phrase+0x1e1>
jmp    1214 <err2reason_phrase+0x104>
mov    -0x34(%rbp),%eax
sub    $0xfffffff7,%eax
je     12bd <err2reason_phrase+0x1ad>
jmp    1225 <err2reason_phrase+0x115>
mov    -0x34(%rbp),%eax
sub    $0xfffffffe,%eax
je     13a7 <err2reason_phrase+0x297>
jmp    13ac <err2reason_phrase+0x29c>
lea    0xdc3(%rip),%rax
mov    %rax,-0x30(%rbp)
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xdbd(%rip),%rax
mov    %rax,-0x30(%rbp)
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xdae(%rip),%rax
mov    %rax,-0x30(%rbp)
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xdac(%rip),%rax
mov    %rax,-0x30(%rbp)
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd9d(%rip),%rax
mov    %rax,-0x30(%rbp)
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd8a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd8d(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd7a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1f4,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd78(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1f4,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd78(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd7f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd77(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd71(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
lea    0xd71(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1f4,(%rax)
jmp    13c1 <err2reason_phrase+0x2b1>
jmp    13ac <err2reason_phrase+0x29c>
lea    0xd6b(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1f4,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rcx
xor    %r8d,%r8d
sub    -0x4(%rbp),%r8d
mov    -0x28(%rbp),%r9
lea    0xd56(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err2reason_phrase>:
mov    %r8,%r9
mov    %rdx,%r10
mov    %edi,%r8d
lea    0x13(%r8),%eax
cmp    $0xa,%eax
ja     113e <err2reason_phrase+0x2e>
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
lea    0x100c(%rip),%rax
jmp    11ea <err2reason_phrase+0xda>
lea    0x1dd(%r8),%edi
cmp    $0x4,%edi
ja     1174 <err2reason_phrase+0x64>
lea    0xeef(%rip),%rax
mov    $0x1d9,%edx
lea    0xea3(%rip),%r11
movslq (%r11,%rdi,4),%rdi
add    %r11,%rdi
jmp    *%rdi
lea    0xee8(%rip),%rax
mov    $0x1dd,%edx
jmp    11ef <err2reason_phrase+0xdf>
cmp    $0xfffffe70,%r8d
jne    118b <err2reason_phrase+0x7b>
lea    0xef6(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xfcc(%rip),%rax
jmp    11ea <err2reason_phrase+0xda>
lea    0xf90(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xf6e(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xf4e(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xf1f(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xed8(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xee9(%rip),%rax
jmp    11ea <err2reason_phrase+0xda>
lea    0xec8(%rip),%rax
mov    $0x1f4,%edx
mov    %edx,(%rsi)
neg    %r8d
lea    0xf79(%rip),%rdx
mov    %r10,%rdi
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <snprintf@plt>
lea    0xe7f(%rip),%rax
mov    $0x190,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xe44(%rip),%rax
mov    $0x1dc,%edx
jmp    11ef <err2reason_phrase+0xdf>
lea    0xe5b(%rip),%rax
mov    $0x1db,%edx
jmp    11ef <err2reason_phrase+0xdf>

LLVM IR (-O0):
@.str = [21 x i8] c"Filtered destination\00"
@.str.1 = [12 x i8] c"Send failed\00"
@.str.2 = [25 x i8] c"Unresolvable destination\00"
@.str.3 = [12 x i8] c"Bad Request\00"
@.str.4 = [8 x i8] c"Bad URI\00"
@.str.5 = [29 x i8] c"Transaction tuple incomplete\00"
@.str.6 = [7 x i8] c"Bad To\00"
@.str.7 = [24 x i8] c"Error in external logic\00"
@.str.8 = [26 x i8] c"Forking capacity exceeded\00"
@.str.9 = [33 x i8] c"Invalid character in q parameter\00"
@.str.10 = [18 x i8] c"Empty q parameter\00"
@.str.11 = [20 x i8] c"q parameter too big\00"
@.str.12 = [26 x i8] c"Decimal part missing in q\00"
@.str.13 = [25 x i8] c"No destination available\00"
@.str.14 = [22 x i8] c"Server error occurred\00"
@.str.15 = [11 x i8] c"%s (%d/%s)\00"
define i32 @err2reason_phrase(i32 %0, i32* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i32, i32* %6
switch i32 %12, label %52 [
i32 -473, label %13
i32 -477, label %17
i32 -476, label %21
i32 -400, label %25
i32 -475, label %29
i32 -9, label %33
i32 -13, label %35
i32 -11, label %37
i32 -12, label %39
i32 -15, label %41
i32 -16, label %43
i32 -17, label %45
i32 -18, label %47
i32 -19, label %49
i32 -2, label %51
]
13: ; preds = %5
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %11
%14 = load i32, i32* %6
%15 = sub nsw i32 0, %14
%16 = load i32*, i32** %7
store i32 %15, i32* %16
br label %54
17: ; preds = %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %11
%18 = load i32, i32* %6
%19 = sub nsw i32 0, %18
%20 = load i32*, i32** %7
store i32 %19, i32* %20
br label %54
21: ; preds = %5
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8** %11
%22 = load i32, i32* %6
%23 = sub nsw i32 0, %22
%24 = load i32*, i32** %7
store i32 %23, i32* %24
br label %54
25: ; preds = %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %11
%26 = load i32, i32* %6
%27 = sub nsw i32 0, %26
%28 = load i32*, i32** %7
store i32 %27, i32* %28
br label %54
29: ; preds = %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %11
%30 = load i32, i32* %6
%31 = sub nsw i32 0, %30
%32 = load i32*, i32** %7
store i32 %31, i32* %32
br label %54
33: ; preds = %5
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8** %11
%34 = load i32*, i32** %7
store i32 400, i32* %34
br label %54
35: ; preds = %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %11
%36 = load i32*, i32** %7
store i32 400, i32* %36
br label %54
37: ; preds = %5
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8** %11
%38 = load i32*, i32** %7
store i32 500, i32* %38
br label %54
39: ; preds = %5
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8** %11
%40 = load i32*, i32** %7
store i32 500, i32* %40
br label %54
41: ; preds = %5
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8** %11
%42 = load i32*, i32** %7
store i32 400, i32* %42
br label %54
43: ; preds = %5
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8** %11
%44 = load i32*, i32** %7
store i32 400, i32* %44
br label %54
45: ; preds = %5
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8** %11
%46 = load i32*, i32** %7
store i32 400, i32* %46
br label %54
47: ; preds = %5
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8** %11
%48 = load i32*, i32** %7
store i32 400, i32* %48
br label %54
49: ; preds = %5
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i8** %11
%50 = load i32*, i32** %7
store i32 500, i32* %50
br label %54
51: ; preds = %5
br label %52
52: ; preds = %5, %51
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8** %11
%53 = load i32*, i32** %7
store i32 500, i32* %53
br label %54
54: ; preds = %52, %49, %47, %45, %43, %41, %39, %37, %35, %33, %29, %25, %21, %17, %13
%55 = load i8*, i8** %8
%56 = load i32, i32* %9
%57 = load i8*, i8** %11
%58 = load i32, i32* %6
%59 = sub nsw i32 0, %58
%60 = load i8*, i8** %10
%61 = call i32 @snprintf(i8* %55, i32 %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* %57, i32 %59, i8* %60)
ret i32 %61
}

LLVM IR (-O2):
@.str = [21 x i8] c"Filtered destination\00"
@.str.1 = [12 x i8] c"Send failed\00"
@.str.2 = [25 x i8] c"Unresolvable destination\00"
@.str.3 = [12 x i8] c"Bad Request\00"
@.str.4 = [8 x i8] c"Bad URI\00"
@.str.5 = [29 x i8] c"Transaction tuple incomplete\00"
@.str.6 = [7 x i8] c"Bad To\00"
@.str.7 = [24 x i8] c"Error in external logic\00"
@.str.8 = [26 x i8] c"Forking capacity exceeded\00"
@.str.9 = [33 x i8] c"Invalid character in q parameter\00"
@.str.10 = [18 x i8] c"Empty q parameter\00"
@.str.11 = [20 x i8] c"q parameter too big\00"
@.str.12 = [26 x i8] c"Decimal part missing in q\00"
@.str.13 = [25 x i8] c"No destination available\00"
@.str.14 = [22 x i8] c"Server error occurred\00"
@.str.15 = [11 x i8] c"%s (%d/%s)\00"
define i32 @err2reason_phrase(i32 %0, i32* nocapture writeonly %1, i8* %2, i32 %3, i8* %4) {
switch i32 %0, label %19 [
i32 -473, label %20
i32 -477, label %6
i32 -476, label %7
i32 -400, label %8
i32 -475, label %9
i32 -9, label %10
i32 -13, label %11
i32 -11, label %12
i32 -12, label %13
i32 -15, label %14
i32 -16, label %15
i32 -17, label %16
i32 -18, label %17
i32 -19, label %18
]
6: ; preds = %5
br label %20
7: ; preds = %5
br label %20
8: ; preds = %5
br label %20
9: ; preds = %5
br label %20
10: ; preds = %5
br label %20
11: ; preds = %5
br label %20
12: ; preds = %5
br label %20
13: ; preds = %5
br label %20
14: ; preds = %5
br label %20
15: ; preds = %5
br label %20
16: ; preds = %5
br label %20
17: ; preds = %5
br label %20
18: ; preds = %5
br label %20
19: ; preds = %5
br label %20
20: ; preds = %5, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%21 = phi i32 [ 500, %19 ], [ 500, %18 ], [ 400, %17 ], [ 400, %16 ], [ 400, %15 ], [ 400, %14 ], [ 500, %13 ], [ 500, %12 ], [ 400, %11 ], [ 400, %10 ], [ 475, %9 ], [ 400, %8 ], [ 476, %7 ], [ 477, %6 ], [ 473, %5 ]
%22 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), %19 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), %18 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), %17 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), %16 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), %15 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), %14 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), %13 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %9 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %5 ]
store i32 %21, i32* %1
%23 = sub nsw i32 0, %0
%24 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* %22, i32 %23, i8* %4)
ret i32 %24
}