#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*/ FILE;

/* Variables and functions */
char *escape_character(char *, char *, char);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, char *,
                           char *, ...);
void appaserver_user_insert_stream(FILE *output_pipe, char *login_name,
                                   char *database_password,
                                   char *person_full_name,
                                   char *frameset_menu_horizontal_yn,
                                   char *user_date_format) {
  char entity_buffer[128];
  if (frameset_menu_horizontal_yn && *frameset_menu_horizontal_yn) {
    fprintf(output_pipe, "%s^%s^%s^%s^%s\n", login_name,
            (database_password) ? database_password : "",
            escape_character(entity_buffer, person_full_name, '\''),
            frameset_menu_horizontal_yn, user_date_format);
  } else {
    fprintf(output_pipe, "%s^%s^%s^%s\n", login_name,
            (database_password) ? database_password : "",
            escape_character(entity_buffer, person_full_name, '\''),
            user_date_format);
  }
}


x86 assembly (clang, -O0):
<appaserver_user_insert_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11fc <appaserver_user_insert_stream+0xdc>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11fc <appaserver_user_insert_stream+0xdc>
mov    -0x8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118f <appaserver_user_insert_stream+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
jmp    11a2 <appaserver_user_insert_stream+0x82>
lea    0xe79(%rip),%rax
mov    %rax,-0xc8(%rbp)
jmp    11a2 <appaserver_user_insert_stream+0x82>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x27,%edx
call   1030 <escape_character@plt>
mov    -0xc0(%rbp),%rdi
mov    -0xb8(%rbp),%rdx
mov    -0xd0(%rbp),%rcx
mov    %rax,%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
lea    0xe14(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    128d <appaserver_user_insert_stream+0x16d>
mov    -0x8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xd8(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     122d <appaserver_user_insert_stream+0x10d>
mov    -0x18(%rbp),%rax
mov    %rax,-0xe8(%rbp)
jmp    1240 <appaserver_user_insert_stream+0x120>
lea    0xddb(%rip),%rax
mov    %rax,-0xe8(%rbp)
jmp    1240 <appaserver_user_insert_stream+0x120>
mov    -0xe8(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x27,%edx
call   1030 <escape_character@plt>
mov    -0xe0(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    -0xf0(%rbp),%rcx
mov    %rax,%r8
mov    -0x30(%rbp),%r9
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_user_insert_stream>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x90,%rsp
mov    %r9,%r14
mov    %rsi,%r15
mov    %rdi,%r12
test   %r8,%r8
je     1183 <appaserver_user_insert_stream+0x63>
mov    %r8,%rbx
cmpb   $0x0,(%r8)
je     1183 <appaserver_user_insert_stream+0x63>
test   %rdx,%rdx
lea    0xebe(%rip),%r13
cmovne %rdx,%r13
lea    0x10(%rsp),%rdi
mov    %rcx,%rsi
mov    $0x27,%edx
call   1030 <escape_character@plt>
mov    %r14,(%rsp)
lea    0xe8e(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %r13,%rcx
mov    %rax,%r8
mov    %rbx,%r9
jmp    11b9 <appaserver_user_insert_stream+0x99>
test   %rdx,%rdx
lea    0xe82(%rip),%rbx
cmovne %rdx,%rbx
lea    0x10(%rsp),%rdi
mov    %rcx,%rsi
mov    $0x27,%edx
call   1030 <escape_character@plt>
lea    0xe59(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
mov    %r14,%r9
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s^%s^%s^%s^%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"%s^%s^%s^%s\0A\00"
define void @appaserver_user_insert_stream(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [128 x i8]
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%14 = load i8*, i8** %11
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %37
16: ; preds = %6
%17 = load i8*, i8** %11
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %37
21: ; preds = %16
%22 = load i32*, i32** %7
%23 = load i8*, i8** %8
%24 = load i8*, i8** %9
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = load i8*, i8** %9
br label %29
28: ; preds = %21
br label %29
29: ; preds = %28, %26
%30 = phi i8* [ %27, %26 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %28 ]
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%32 = load i8*, i8** %10
%33 = call i8* @escape_character(i8* %31, i8* %32, i8 signext 39)
%34 = load i8*, i8** %11
%35 = load i8*, i8** %12
%36 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %30, i8* %33, i8* %34, i8* %35)
br label %52
37: ; preds = %16, %6
%38 = load i32*, i32** %7
%39 = load i8*, i8** %8
%40 = load i8*, i8** %9
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = load i8*, i8** %9
br label %45
44: ; preds = %37
br label %45
45: ; preds = %44, %42
%46 = phi i8* [ %43, %42 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %44 ]
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%48 = load i8*, i8** %10
%49 = call i8* @escape_character(i8* %47, i8* %48, i8 signext 39)
%50 = load i8*, i8** %12
%51 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %39, i8* %46, i8* %49, i8* %50)
br label %52
52: ; preds = %45, %29
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s^%s^%s^%s^%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"%s^%s^%s^%s\0A\00"
define void @appaserver_user_insert_stream(i32* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca [128 x i8]
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = icmp eq i8* %4, null
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %4
%12 = icmp eq i8 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = icmp eq i8* %2, null
%15 = select i1 %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %2
%16 = call i8* @escape_character(i8* %8, i8* %3, i8 signext 39)
%17 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %15, i8* %16, i8* %4, i8* %5)
br label %23
18: ; preds = %10, %6
%19 = icmp eq i8* %2, null
%20 = select i1 %19, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %2
%21 = call i8* @escape_character(i8* %8, i8* %3, i8 signext 39)
%22 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %20, i8* %21, i8* %5)
br label %23
23: ; preds = %18, %13
ret void
}