#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 */
typedef int /*<<< orphan*/ buf2;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ escape_text(char *);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
void serv_set_dir(char *first, char *middle, char *last, char *maiden,
                  char *city, char *state, char *country, char *email,
                  int web) {
  char buf2[2048], buf[2048];
  snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, middle, last,
           maiden, city, state, country, (web == 1) ? "Y" : "");
  escape_text(buf2);
  snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2);
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_set_dir>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x1060,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
lea    -0x840(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r14
mov    -0x38(%rbp),%rbx
mov    -0x40(%rbp),%r11
mov    0x10(%rbp),%r10
mov    0x20(%rbp),%esi
lea    0xe8b(%rip),%rax
lea    0xe83(%rip),%rdx
cmp    $0x1,%esi
cmove  %rdx,%rax
mov    $0x800,%esi
lea    0xe58(%rip),%rdx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    -0x840(%rbp),%rdi
call   1050 <escape_text@plt>
lea    -0x1040(%rbp),%rdi
lea    -0x840(%rbp),%rcx
mov    $0x800,%esi
lea    0xe2d(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    -0x1040(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x1060,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_set_dir>:
push   %r15
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %r9,%r15
mov    %r8,%r10
mov    %rcx,%r11
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
cmpl   $0x1,0x1030(%rsp)
01
lea    0xebb(%rip),%rax
lea    0xeb5(%rip),%rbx
cmove  %rax,%rbx
sub    $0x8,%rsp
lea    0xe8d(%rip),%rdx
lea    0x808(%rsp),%r14
mov    %r14,%rdi
mov    $0x800,%esi
xor    %eax,%eax
push   %rbx
push   0x1030(%rsp)
push   %r15
push   %r10
push   %r11
call   1030 <snprintf@plt>
add    $0x30,%rsp
mov    %r14,%rdi
call   1050 <escape_text@plt>
lea    0xe6f(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%s:%s:%s:%s:%s:%s:%s:%s\00"
@.str.1 = [2 x i8] c"Y\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"toc_set_dir %s\00"
define void @serv_set_dir(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca [2048 x i8]
%20 = alloca [2048 x i8]
store i8* %0, i8** %10
store i8* %1, i8** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i32 %8, i32* %18
%21 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 0
%22 = load i8*, i8** %10
%23 = load i8*, i8** %11
%24 = load i8*, i8** %12
%25 = load i8*, i8** %13
%26 = load i8*, i8** %14
%27 = load i8*, i8** %15
%28 = load i8*, i8** %16
%29 = load i32, i32* %18
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i64
%32 = select i1 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%33 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %21, i32 2048, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23, i8* %24, i8* %25, i8* %26, i8* %27, i8* %28, i8* %32)
%34 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 0
%35 = call i32 @escape_text(i8* %34)
%36 = getelementptr inbounds [2048 x i8], [2048 x i8]* %20, i64 0, i64 0
%37 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 0
%38 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %36, i32 2048, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = getelementptr inbounds [2048 x i8], [2048 x i8]* %20, i64 0, i64 0
%40 = call i32 @sflap_send(i8* %39, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s:%s:%s:%s:%s:%s:%s:%s\00"
@.str.1 = [2 x i8] c"Y\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"toc_set_dir %s\00"
define void @serv_set_dir(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* nocapture readnone %7, i32 %8) {
%10 = alloca [2048 x i8]
%11 = alloca [2048 x i8]
%12 = getelementptr inbounds [2048 x i8], [2048 x i8]* %10, i64 0, i64 0
%13 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%14 = icmp eq i32 %8, 1
%15 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%16 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %12, i32 2048, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %15)
%17 = call i32 @escape_text(i8* %12)
%18 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %13, i32 2048, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%19 = call i32 @sflap_send(i8* %13, i32 -1, i32 2)
ret void
}