#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 msgs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FENDNULL(char *);
scalar_t__ is_seq_private(struct msgs *, int);
int /*<<< orphan*/ printf(char *, char *, char *, int /*<<< orphan*/);
int seq_getnum(struct msgs *, char *);
char *seq_list(struct msgs *, char *);
void seq_print(struct msgs *mp, char *seqname) {
  int i;
  char *list;
  i = seq_getnum(mp, seqname);
  list = seq_list(mp, seqname);
  printf("%s%s: %s\n", seqname,
         (i == -1)               ? ""
         : is_seq_private(mp, i) ? " (private)"
                                 : "",
         FENDNULL(list));
}


x86 assembly (clang, -O0):
<seq_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <seq_getnum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <seq_list@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    11a3 <seq_print+0x53>
lea    0xe6f(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    11cc <seq_print+0x7c>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <is_seq_private@plt>
mov    %rax,%rdx
lea    0xe50(%rip),%rax
lea    0xe4a(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <FENDNULL@plt>
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    %eax,%ecx
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_print>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
call   1060 <seq_getnum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <seq_list@plt>
mov    %rax,%r14
cmp    $0xffffffff,%ebp
je     1198 <seq_print+0x48>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <is_seq_private@plt>
test   %rax,%rax
lea    0xe7e(%rip),%rax
lea    0xe78(%rip),%rbx
cmove  %rax,%rbx
jmp    119f <seq_print+0x4f>
lea    0xe6a(%rip),%rbx
mov    %r14,%rdi
call   1070 <FENDNULL@plt>
lea    0xe52(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.msgs = type { i32 }
@.str = [10 x i8] c"%s%s: %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [11 x i8] c" (private)\00"
define void @seq_print(%struct.msgs* %0, i8* %1) {
%3 = alloca %struct.msgs*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store %struct.msgs* %0, %struct.msgs** %3
store i8* %1, i8** %4
%7 = load %struct.msgs*, %struct.msgs** %3
%8 = load i8*, i8** %4
%9 = call i32 @seq_getnum(%struct.msgs* %7, i8* %8)
store i32 %9, i32* %5
%10 = load %struct.msgs*, %struct.msgs** %3
%11 = load i8*, i8** %4
%12 = call i8* @seq_list(%struct.msgs* %10, i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %2
br label %24
17: ; preds = %2
%18 = load %struct.msgs*, %struct.msgs** %3
%19 = load i32, i32* %5
%20 = call i64 @is_seq_private(%struct.msgs* %18, i32 %19)
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
br label %24
24: ; preds = %17, %16
%25 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %16 ], [ %23, %17 ]
%26 = load i8*, i8** %6
%27 = call i32 @FENDNULL(i8* %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %25, i32 %27)
ret void
}

LLVM IR (-O2):
%struct.msgs = type { i32 }
@.str = [10 x i8] c"%s%s: %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [11 x i8] c" (private)\00"
define void @seq_print(%struct.msgs* %0, i8* %1) {
%3 = tail call i32 @seq_getnum(%struct.msgs* %0, i8* %1)
%4 = tail call i8* @seq_list(%struct.msgs* %0, i8* %1)
%5 = icmp eq i32 %3, -1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @is_seq_private(%struct.msgs* %0, i32 %3)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
%12 = tail call i32 @FENDNULL(i8* %4)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %11, i32 %12)
ret void
}