#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*/ free(char *);
int /*<<< orphan*/ outplain(char *);
int /*<<< orphan*/ strmcat(char **, char *);
int /*<<< orphan*/ strmreplace(char **, char *, char *);
void showHelp(char *app_name, char *app_help) {
  char *buffer = NULL;
  strmcat(&buffer, "%1  for Linux, BSD and Windows\nuse: %1 %2\n\n");
  strmreplace(&buffer, "%1", app_name);
  strmreplace(&buffer, "%1", app_name);
  strmreplace(&buffer, "%2", app_help);
  outplain(buffer);
  free(buffer);
}


x86 assembly (clang, -O0):
<showHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <strmcat@plt>
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strmreplace@plt>
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1050 <strmreplace@plt>
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1050 <strmreplace@plt>
mov    -0x18(%rbp),%rdi
call   1040 <outplain@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showHelp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
lea    0xea3(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1060 <strmcat@plt>
lea    0xebd(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <strmreplace@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <strmreplace@plt>
lea    0xe9d(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1050 <strmreplace@plt>
mov    (%rsp),%rdi
call   1040 <outplain@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"%1 for Linux, BSD and Windows\0Ause: %1 %2\0A\0A\00"
@.str.1 = [3 x i8] c"%1\00"
@.str.2 = [3 x i8] c"%2\00"
define void @showHelp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = call i32 @strmcat(i8** %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @strmreplace(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @strmreplace(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @strmreplace(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @outplain(i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"%1 for Linux, BSD and Windows\0Ause: %1 %2\0A\0A\00"
@.str.1 = [3 x i8] c"%1\00"
@.str.2 = [3 x i8] c"%2\00"
define void @showHelp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @strmcat(i8** %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strmreplace(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = call i32 @strmreplace(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = call i32 @strmreplace(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%9 = load i8*, i8** %3
%10 = call i32 @outplain(i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
ret void
}