#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*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *, char *);
void serv_chat_warn(int id, char *user, int anon) {
  char send[256];
  snprintf(send, 255, "toc_chat_evil %d %s %s", id, user,
           ((anon) ? "anon" : "norm"));
  sflap_send(send, -1, 2);
}


x86 assembly (clang, -O0):
<serv_chat_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%edx
lea    0xecf(%rip),%r9
lea    0xec3(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%r9
mov    $0xff,%esi
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x120(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_chat_warn>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
test   %edx,%edx
lea    0xee6(%rip),%rax
lea    0xeda(%rip),%r9
cmove  %rax,%r9
lea    0xeb8(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"toc_chat_evil %d %s %s\00"
@.str.1 = [5 x i8] c"anon\00"
@.str.2 = [5 x i8] c"norm\00"
define void @serv_chat_warn(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [256 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @snprintf(i8* %8, i32 255, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%17 = call i32 @sflap_send(i8* %16, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"toc_chat_evil %d %s %s\00"
@.str.1 = [5 x i8] c"anon\00"
@.str.2 = [5 x i8] c"norm\00"
define void @serv_chat_warn(i32 %0, i8* %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @snprintf(i8* %5, i32 255, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %7)
%9 = call i32 @sflap_send(i8* %5, i32 -1, i32 2)
ret void
}