#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 FD_SETSIZE;
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void GlobalMessage(int servsockfd, char *message) {
  int fdptr;
  for (fdptr = 0; fdptr < FD_SETSIZE; fdptr++) {
    if (fdptr != servsockfd)
      send(fdptr, message, strlen(message), 0);
  }
}


x86 assembly (clang, -O0):
<GlobalMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
jge    118e <GlobalMessage+0x6e>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     117b <GlobalMessage+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
jmp    1180 <GlobalMessage+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <GlobalMessage+0x16>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GlobalMessage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2eb2(%rip),%r15
mov    (%r15),%eax
test   %eax,%eax
jle    1166 <GlobalMessage+0x46>
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
jmp    1147 <GlobalMessage+0x27>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    %eax,%ebx
jge    1166 <GlobalMessage+0x46>
cmp    %ebx,%ebp
je     1140 <GlobalMessage+0x20>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    (%r15),%eax
jmp    1140 <GlobalMessage+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@FD_SETSIZE = global i32 0
define void @GlobalMessage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* @FD_SETSIZE
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i8*, i8** %4
%17 = load i8*, i8** %4
%18 = call i32 @strlen(i8* %17)
%19 = call i32 @send(i32 %15, i8* %16, i32 %18, i32 0)
br label %20
20: ; preds = %14, %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
@FD_SETSIZE = global i32 0
define void @GlobalMessage(i32 %0, i8* %1) {
%3 = load i32, i32* @FD_SETSIZE
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %2, %13
%6 = phi i32 [ %14, %13 ], [ %3, %2 ]
%7 = phi i32 [ %15, %13 ], [ 0, %2 ]
%8 = icmp eq i32 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i32 @strlen(i8* %1)
%11 = tail call i32 @send(i32 %7, i8* %1, i32 %10, i32 0)
%12 = load i32, i32* @FD_SETSIZE
br label %13
13: ; preds = %5, %9
%14 = phi i32 [ %6, %5 ], [ %12, %9 ]
%15 = add nuw nsw i32 %7, 1
%16 = icmp slt i32 %15, %14
br i1 %16, label %5, label %17
17: ; preds = %13, %2
ret void
}