#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 /*<<< orphan*/ printf(char *, ...);
void evs_confchg_fn(unsigned int *member_list, int member_list_entries,
                    unsigned int *left_list, int left_list_entries,
                    unsigned int *joined_list, int joined_list_entries) {
  int i;
  printf("CONFIGURATION CHANGE\n");
  printf("--------------------\n");
  printf("New configuration\n");
  for (i = 0; i < member_list_entries; i++) {
    printf("%x\n", member_list[i]);
  }
  printf("Members Left:\n");
  for (i = 0; i < left_list_entries; i++) {
    printf("%x\n", left_list[i]);
  }
  printf("Members Joined:\n");
  for (i = 0; i < joined_list_entries; i++) {
    printf("%x\n", joined_list[i]);
  }
}


x86 assembly (clang, -O0):
<evs_confchg_fn>:
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    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <evs_confchg_fn+0x82>
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    115f <evs_confchg_fn+0x4f>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11da <evs_confchg_fn+0xca>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11a7 <evs_confchg_fn+0x97>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1222 <evs_confchg_fn+0x112>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ef <evs_confchg_fn+0xdf>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evs_confchg_fn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8,%r12
mov    %ecx,(%rsp)
mov    %rdx,%r14
mov    %esi,%r13d
mov    %rdi,%rbx
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
test   %r13d,%r13d
jle    1197 <evs_confchg_fn+0x77>
mov    %r13d,%ebp
lea    0xe8e(%rip),%r13
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r15,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbp
jne    1180 <evs_confchg_fn+0x60>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    11d7 <evs_confchg_fn+0xb7>
mov    %eax,%ebp
lea    0xe4d(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <evs_confchg_fn+0xa0>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1217 <evs_confchg_fn+0xf7>
mov    %eax,%ebp
lea    0xe0c(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1200 <evs_confchg_fn+0xe0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"CONFIGURATION CHANGE\0A\00"
@.str.1 = [22 x i8] c"--------------------\0A\00"
@.str.2 = [19 x i8] c"New configuration\0A\00"
@.str.3 = [4 x i8] c"%x\0A\00"
@.str.4 = [15 x i8] c"Members Left:\0A\00"
@.str.5 = [17 x i8] c"Members Joined:\0A\00"
define void @evs_confchg_fn(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %13
br label %17
17: ; preds = %28, %6
%18 = load i32, i32* %13
%19 = load i32, i32* %8
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i32*, i32** %7
%23 = load i32, i32* %13
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %13
%30 = add nsw i32 %29, 1
store i32 %30, i32* %13
br label %17
31: ; preds = %17
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %13
br label %33
33: ; preds = %44, %31
%34 = load i32, i32* %13
%35 = load i32, i32* %10
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %47
37: ; preds = %33
%38 = load i32*, i32** %9
%39 = load i32, i32* %13
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %37
%45 = load i32, i32* %13
%46 = add nsw i32 %45, 1
store i32 %46, i32* %13
br label %33
47: ; preds = %33
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %13
br label %49
49: ; preds = %60, %47
%50 = load i32, i32* %13
%51 = load i32, i32* %12
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i32*, i32** %11
%55 = load i32, i32* %13
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %13
%62 = add nsw i32 %61, 1
store i32 %62, i32* %13
br label %49
63: ; preds = %49
ret void
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"%x\0A\00"
@str = [21 x i8] c"CONFIGURATION CHANGE\00"
@str.6 = [21 x i8] c"--------------------\00"
@str.7 = [18 x i8] c"New configuration\00"
@str.8 = [14 x i8] c"Members Left:\00"
@str.9 = [16 x i8] c"Members Joined:\00"
define void @evs_confchg_fn(i32* nocapture %0, i32 %1, i32* nocapture %2, i32 %3, i32* nocapture %4, i32 %5) {
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%10 = icmp sgt i32 %1, 0
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = zext i32 %1 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %18, %13 ]
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %12
br i1 %19, label %20, label %13
20: ; preds = %13, %6
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%22 = icmp sgt i32 %3, 0
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = zext i32 %3 to i64
br label %25
25: ; preds = %23, %25
%26 = phi i64 [ 0, %23 ], [ %30, %25 ]
%27 = getelementptr inbounds i32, i32* %2, i64 %26
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i64 %26, 1
%31 = icmp eq i64 %30, %24
br i1 %31, label %32, label %25
32: ; preds = %25, %20
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.9, i64 0, i64 0))
%34 = icmp sgt i32 %5, 0
br i1 %34, label %35, label %44
35: ; preds = %32
%36 = zext i32 %5 to i64
br label %37
37: ; preds = %35, %37
%38 = phi i64 [ 0, %35 ], [ %42, %37 ]
%39 = getelementptr inbounds i32, i32* %4, i64 %38
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = add nuw nsw i64 %38, 1
%43 = icmp eq i64 %42, %36
br i1 %43, label %44, label %37
44: ; preds = %37, %32
ret void
}