#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 *,
                          char *);
void cgiMakeButtonWithOnClick(char *name, char *value, char *msg,
                              char *onClick) {
  printf(
      "<input type=\"submit\" name=\"%s\" value=\"%s\" onclick=\"%s\" %s%s%s>",
      name, value, onClick, (msg ? " TITLE=\"" : ""), (msg ? msg : ""),
      (msg ? "\"" : ""));
}


x86 assembly (clang, -O0):
<cgiMakeButtonWithOnClick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xefc(%rip),%rax
lea    0xeed(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1176 <cgiMakeButtonWithOnClick+0x66>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1186 <cgiMakeButtonWithOnClick+0x76>
lea    0xeca(%rip),%rax
mov    %rax,-0x48(%rbp)
jmp    1186 <cgiMakeButtonWithOnClick+0x76>
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%r9
mov    -0x18(%rbp),%r10
lea    0xea2(%rip),%rax
lea    0xe9a(%rip),%rdi
cmp    $0x0,%r10
cmovne %rdi,%rax
lea    0xe45(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeButtonWithOnClick>:
push   %rax
mov    %rdx,%r9
test   %rdx,%rdx
lea    0xf29(%rip),%rax
lea    0xf1a(%rip),%r8
cmove  %rax,%r8
cmove  %rax,%r9
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xf0c(%rip),%rdi
cmove  %rax,%rdi
mov    %rdi,(%rsp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [63 x i8] c"<input type=\22submit\22 name=\22%s\22 value=\22%s\22 onclick=\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 @cgiMakeButtonWithOnClick(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i64
%15 = select i1 %13, 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)
%16 = load i8*, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i8*, i8** %7
br label %21
20: ; preds = %4
br label %21
21: ; preds = %20, %18
%22 = phi i8* [ %19, %18 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %20 ]
%23 = load i8*, i8** %7
%24 = icmp ne i8* %23, null
%25 = zext i1 %24 to i64
%26 = select i1 %24, 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)
%27 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %15, i8* %22, i8* %26)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"<input type=\22submit\22 name=\22%s\22 value=\22%s\22 onclick=\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 @cgiMakeButtonWithOnClick(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %2, null
%6 = select i1 %5, 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)
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %2
%8 = select i1 %5, 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)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %3, i8* %6, i8* %7, i8* %8)
ret void
}