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

/* Variables and functions */
scalar_t__ FormSendMsg(char *, char *, char *);
int /*<<< orphan*/ SendMsgToUser(struct IRCAllUsers *, char *, char *);
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int FormPongMsg(struct IRCAllUsers *users, char *raw_msg, char *nick) {
  char send_msg[512];
  memset(&send_msg, 0, 512);
  raw_msg[1] = 'O';
  if (FormSendMsg(send_msg, raw_msg, nick) == 0)
    SendMsgToUser(users, nick, send_msg);
  return 0;
}


x86 assembly (clang, -O0):
<FormPongMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
movb   $0x4f,0x1(%rax)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <FormSendMsg@plt>
cmp    $0x0,%rax
jne    1194 <FormPongMsg+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1050 <SendMsgToUser@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FormPongMsg>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1030 <memset@plt>
movb   $0x4f,0x1(%rbx)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <FormSendMsg@plt>
test   %rax,%rax
jne    117e <FormPongMsg+0x4e>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <SendMsgToUser@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.IRCAllUsers = type { i32 }
define i32 @FormPongMsg(%struct.IRCAllUsers* %0, i8* %1, i8* %2) {
%4 = alloca %struct.IRCAllUsers*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [512 x i8]
store %struct.IRCAllUsers* %0, %struct.IRCAllUsers** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [512 x i8]* %7 to i8**
%9 = call i32 @memset(i8** %8, i32 0, i32 512)
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 79, i8* %11
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i64 @FormSendMsg(i8* %12, i8* %13, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %3
%18 = load %struct.IRCAllUsers*, %struct.IRCAllUsers** %4
%19 = load i8*, i8** %6
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%21 = call i32 @SendMsgToUser(%struct.IRCAllUsers* %18, i8* %19, i8* %20)
br label %22
22: ; preds = %17, %3
ret i32 0
}

LLVM IR (-O2):
%struct.IRCAllUsers = type { i32 }
define i32 @FormPongMsg(%struct.IRCAllUsers* %0, i8* %1, i8* %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = bitcast [512 x i8]* %4 to i8**
%7 = call i32 @memset(i8** %6, i32 0, i32 512)
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 79, i8* %8
%9 = call i64 @FormSendMsg(i8* %5, i8* %1, i8* %2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @SendMsgToUser(%struct.IRCAllUsers* %0, i8* %2, i8* %5)
br label %13
13: ; preds = %11, %3
ret i32 0
}