#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*/ printf(char *, char *, char *, char *, char *, char *);
void cgiMakeButtonWithMsg(char *name, char *value, char *msg) {
  printf("<INPUT TYPE=SUBMIT NAME=\"%s\" VALUE=\"%s\" %s%s%s>", name, value,
         (msg ? " TITLE=\"" : ""), (msg ? msg : ""), (msg ? "\"" : ""));
}


x86 assembly (clang, -O0):
<cgiMakeButtonWithMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xef9(%rip),%rax
lea    0xeea(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <cgiMakeButtonWithMsg+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    117a <cgiMakeButtonWithMsg+0x6a>
lea    0xec7(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    117a <cgiMakeButtonWithMsg+0x6a>
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%r8
mov    -0x18(%rbp),%rdi
lea    0xea3(%rip),%r9
lea    0xe9b(%rip),%rax
cmp    $0x0,%rdi
cmovne %rax,%r9
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeButtonWithMsg>:
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %r8,%r8
lea    0xf15(%rip),%rax
lea    0xf06(%rip),%rcx
cmove  %rax,%rcx
cmove  %rax,%r8
lea    0xefe(%rip),%r9
cmove  %rax,%r9
lea    0xebc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"<INPUT TYPE=SUBMIT NAME=\22%s\22 VALUE=\22%s\22 %s%s%s>\00"
@.str.1 = [9 x i8] c" TITLE=\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"\22\00"
define void @cgiMakeButtonWithMsg(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i8*, i8** %6
br label %18
17: ; preds = %3
br label %18
18: ; preds = %17, %15
%19 = phi i8* [ %16, %15 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %17 ]
%20 = load i8*, i8** %6
%21 = icmp ne i8* %20, null
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%24 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %12, i8* %19, i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"<INPUT TYPE=SUBMIT NAME=\22%s\22 VALUE=\22%s\22 %s%s%s>\00"
@.str.1 = [9 x i8] c" TITLE=\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"\22\00"
define void @cgiMakeButtonWithMsg(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %2
%7 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %5, i8* %6, i8* %7)
ret void
}