#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 *, char *, int);
int((suspend_resume_ind_dump))(struct ss7 *ss7, int messagetype,
                               unsigned char *parm, int len) {
  int indicator = parm[0] & 1;
  ss7_message(ss7, "\t\t\tSUS/RES indicator: %s (%d)",
              indicator ? "Network initiated" : "ISDN Sudirriber initiated",
              indicator);
  return 1;
}


x86 assembly (clang, -O0):
<suspend_resume_ind_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%ecx
lea    0xeef(%rip),%rdx
lea    0xed6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x20(%rbp),%ecx
lea    0xea7(%rip),%rsi
call   1030 <ss7_message@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suspend_resume_ind_dump>:
push   %rax
movzbl (%rdx),%ecx
and    $0x1,%ecx
lea    0xf12(%rip),%rax
lea    0xef9(%rip),%rdx
cmove  %rax,%rdx
lea    0xed0(%rip),%rsi
call   1030 <ss7_message@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [30 x i8] c"\09\09\09SUS/RES indicator: %s (%d)\00"
@.str.1 = [18 x i8] c"Network initiated\00"
@.str.2 = [26 x i8] c"ISDN Sudirriber initiated\00"
define i32 @suspend_resume_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 i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 1
store i32 %14, i32* %9
%15 = load %struct.ss7*, %struct.ss7** %5
%16 = load i32, i32* %9
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0)
%20 = load i32, i32* %9
%21 = call i32 @ss7_message(%struct.ss7* %15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str = [30 x i8] c"\09\09\09SUS/RES indicator: %s (%d)\00"
@.str.1 = [18 x i8] c"Network initiated\00"
@.str.2 = [26 x i8] c"ISDN Sudirriber initiated\00"
define i32 @suspend_resume_ind_dump(%struct.ss7* %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = load i8, i8* %2
%6 = and i8 %5, 1
%7 = zext i8 %6 to i32
%8 = icmp eq i8 %6, 0
%9 = select i1 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %7)
ret i32 1
}