#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 */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ss7_message(struct ss7 *, char *, ...);
int((nature_of_connection_ind_dump))(struct ss7 *ss7, int messagetype,
                                     unsigned char *parm, int len) {
  unsigned char con = parm[0];
  char *continuity = "";
  ss7_message(ss7, "\t\t\tSatellites in connection: %d\n", con & 0x03);
  con >>= 2;
  switch (con & 0x03) {
  case 0:
    continuity = "Check not required";
    break;
  case 1:
    continuity = "Check required on this circuit";
    break;
  case 2:
    continuity = "Check performed on a previous circuit";
    break;
  case 3:
    continuity = "spare";
    break;
  }
  ss7_message(ss7, "\t\t\tContinuity Check: %s (%d)\n", continuity, con & 0x3);
  con >>= 2;
  con &= 0x01;
  ss7_message(ss7, "\t\t\tOutgoing half echo control device: %s (%d)\n",
              con ? "included" : "not included", con);
  return 1;
}


x86 assembly (clang, -O0):
<nature_of_connection_ind_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1d(%rbp)
lea    0xfa5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x1d(%rbp),%edx
and    $0x3,%edx
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1030 <ss7_message@plt>
movzbl -0x1d(%rbp),%eax
shr    $0x2,%eax
mov    %al,-0x1d(%rbp)
movzbl -0x1d(%rbp),%eax
and    $0x3,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x3,%eax
ja     11c2 <nature_of_connection_ind_dump+0xb2>
mov    -0x30(%rbp),%rax
lea    0xe82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea3(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11c2 <nature_of_connection_ind_dump+0xb2>
lea    0xea6(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11c2 <nature_of_connection_ind_dump+0xb2>
lea    0xeb5(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11c2 <nature_of_connection_ind_dump+0xb2>
lea    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movzbl -0x1d(%rbp),%ecx
and    $0x3,%ecx
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1030 <ss7_message@plt>
movzbl -0x1d(%rbp),%eax
sar    $0x2,%eax
mov    %al,-0x1d(%rbp)
movzbl -0x1d(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x1d(%rbp),%ecx
lea    0xeda(%rip),%rdx
lea    0xed7(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
movzbl -0x1d(%rbp),%ecx
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1030 <ss7_message@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nature_of_connection_ind_dump>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movzbl (%rdx),%ebx
mov    %ebx,%edx
and    $0x3,%edx
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <ss7_message@plt>
mov    %ebx,%ecx
shr    $0x2,%ecx
and    $0x3,%ecx
lea    0xfa0(%rip),%rax
movslq (%rax,%rcx,4),%rdx
add    %rax,%rdx
lea    0xf35(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <ss7_message@plt>
shr    $0x4,%ebx
and    $0x1,%ebx
lea    0xf6b(%rip),%rax
lea    0xf68(%rip),%rdx
cmove  %rax,%rdx
lea    0xf2a(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <ss7_message@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [33 x i8] c"\09\09\09Satellites in connection: %d\0A\00"
@.str.2 = [19 x i8] c"Check not required\00"
@.str.3 = [31 x i8] c"Check required on this circuit\00"
@.str.4 = [38 x i8] c"Check performed on a previous circuit\00"
@.str.5 = [6 x i8] c"spare\00"
@.str.6 = [30 x i8] c"\09\09\09Continuity Check: %s (%d)\0A\00"
@.str.7 = [47 x i8] c"\09\09\09Outgoing half echo control device: %s (%d)\0A\00"
@.str.8 = [9 x i8] c"included\00"
@.str.9 = [13 x i8] c"not included\00"
define i32 @nature_of_connection_ind_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8*
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
store i8 %13, i8* %9
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %10
%14 = load %struct.ss7*, %struct.ss7** %5
%15 = load i8, i8* %9
%16 = zext i8 %15 to i32
%17 = and i32 %16, 3
%18 = call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 2
%22 = trunc i32 %21 to i8
store i8 %22, i8* %9
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %24, 3
switch i32 %25, label %30 [
i32 0, label %26
i32 1, label %27
i32 2, label %28
i32 3, label %29
]
26: ; preds = %4
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %10
br label %30
27: ; preds = %4
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8** %10
br label %30
28: ; preds = %4
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8** %10
br label %30
29: ; preds = %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %10
br label %30
30: ; preds = %4, %29, %28, %27, %26
%31 = load %struct.ss7*, %struct.ss7** %5
%32 = load i8*, i8** %10
%33 = load i8, i8* %9
%34 = zext i8 %33 to i32
%35 = and i32 %34, 3
%36 = call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %32, i32 %35)
%37 = load i8, i8* %9
%38 = zext i8 %37 to i32
%39 = ashr i32 %38, 2
%40 = trunc i32 %39 to i8
store i8 %40, i8* %9
%41 = load i8, i8* %9
%42 = zext i8 %41 to i32
%43 = and i32 %42, 1
%44 = trunc i32 %43 to i8
store i8 %44, i8* %9
%45 = load %struct.ss7*, %struct.ss7** %5
%46 = load i8, i8* %9
%47 = zext i8 %46 to i32
%48 = icmp ne i32 %47, 0
%49 = zext i1 %48 to i64
%50 = select i1 %48, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0)
%51 = load i8, i8* %9
%52 = zext i8 %51 to i32
%53 = call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %45, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i8* %50, i32 %52)
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str.1 = [33 x i8] c"\09\09\09Satellites in connection: %d\0A\00"
@.str.2 = [19 x i8] c"Check not required\00"
@.str.3 = [31 x i8] c"Check required on this circuit\00"
@.str.4 = [38 x i8] c"Check performed on a previous circuit\00"
@.str.5 = [6 x i8] c"spare\00"
@.str.6 = [30 x i8] c"\09\09\09Continuity Check: %s (%d)\0A\00"
@.str.7 = [47 x i8] c"\09\09\09Outgoing half echo control device: %s (%d)\0A\00"
@.str.8 = [9 x i8] c"included\00"
@.str.9 = [13 x i8] c"not included\00"
@reltable.nature_of_connection_ind_dump = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.nature_of_connection_ind_dump to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.nature_of_connection_ind_dump to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.nature_of_connection_ind_dump to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.nature_of_connection_ind_dump to i64)) to i32)]
define i32 @nature_of_connection_ind_dump(%struct.ss7* %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = load i8, i8* %2
%6 = and i8 %5, 3
%7 = zext i8 %6 to i32
%8 = tail call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = lshr i8 %5, 2
%10 = and i8 %9, 3
%11 = zext i8 %10 to i32
%12 = zext i8 %10 to i64
%13 = shl i64 %12, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.nature_of_connection_ind_dump to i8*), i64 %13)
%15 = tail call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %14, i32 %11)
%16 = lshr i8 %5, 4
%17 = and i8 %16, 1
%18 = zext i8 %17 to i32
%19 = icmp eq i8 %17, 0
%20 = select i1 %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0)
%21 = tail call i32 (%struct.ss7*, i8*, ...) @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i8* %20, i32 %18)
ret i32 1
}