#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*/ isup_get_number(char *, unsigned char *, int, int);
int /*<<< orphan*/ ss7_message(struct ss7 *, char *, char *);
int((subs_num_dump))(struct ss7 *ss7, int messagetype, unsigned char *parm,
                     int len) {
  int oddeven = (parm[0] >> 7) & 0x1;
  char numbuf[64];
  isup_get_number(numbuf, &parm[1], len - 1, oddeven);
  ss7_message(ss7, "\t\t\tSubsequent signals: %s\n", numbuf);
  return len;
}


x86 assembly (clang, -O0):
<subs_num_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
sar    $0x7,%eax
and    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
mov    -0x20(%rbp),%ecx
call   1030 <isup_get_number@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1040 <ss7_message@plt>
mov    -0x1c(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_num_dump>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %ecx,%ebx
mov    %rdi,%r14
movzbl (%rdx),%ecx
shr    $0x7,%ecx
lea    0x1(%rdx),%rsi
lea    -0x1(%rbx),%edx
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <isup_get_number@plt>
lea    0xeb3(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1040 <ss7_message@plt>
mov    %ebx,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [27 x i8] c"\09\09\09Subsequent signals: %s\0A\00"
define i32 @subs_num_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 i32
%10 = alloca [64 x 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
%14 = zext i8 %13 to i32
%15 = ashr i32 %14, 7
%16 = and i32 %15, 1
store i32 %16, i32* %9
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i32, i32* %8
%21 = sub nsw i32 %20, 1
%22 = load i32, i32* %9
%23 = call i32 @isup_get_number(i8* %17, i8* %19, i32 %21, i32 %22)
%24 = load %struct.ss7*, %struct.ss7** %5
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%26 = call i32 @ss7_message(%struct.ss7* %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = load i32, i32* %8
ret i32 %27
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str = [27 x i8] c"\09\09\09Subsequent signals: %s\0A\00"
define i32 @subs_num_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 returned %3) {
%5 = alloca [64 x i8]
%6 = load i8, i8* %2
%7 = lshr i8 %6, 7
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %2, i64 1
%11 = add nsw i32 %3, -1
%12 = call i32 @isup_get_number(i8* %9, i8* %10, i32 %11, i32 %8)
%13 = call i32 @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 %3
}