#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*/ set_message(char *);
int /*<<< orphan*/ strcat(char *, char *);
int banniere(char *nom) {
  char message[256] = "";
  if (nom == NULL) {
    nom = "sombre inconnu";
  }
  strcat(message, "Bienvenue ");
  strcat(message, nom);
  strcat(message, "\n");
  strcat(message, "--------\n\n");
  set_message(message);
}


x86 assembly (clang, -O0):
<banniere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1168 <banniere+0x38>
lea    0xe9c(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x110(%rbp),%rdi
call   1040 <set_message@plt>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<banniere>:
push   %r14
push   %rbx
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
test   %rdi,%rdi
lea    0xe62(%rip),%rbx
cmovne %rdi,%rbx
lea    0xe66(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
lea    0xe5d(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
lea    0xe45(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
mov    %r14,%rdi
call   1030 <set_message@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sombre inconnu\00"
@.str.1 = [11 x i8] c"Bienvenue \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [11 x i8] c"--------\0A\0A\00"
define i32 @banniere(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
store i8* %0, i8** %3
%5 = bitcast [256 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = load i8*, i8** %3
%14 = call i32 @strcat(i8* %12, i8* %13)
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%20 = call i32 @set_message(i8* %19)
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [15 x i8] c"sombre inconnu\00"
@.str.1 = [11 x i8] c"Bienvenue \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [11 x i8] c"--------\0A\0A\00"
define i32 @banniere(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0
%6 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strcat(i8* %3, i8* %5)
%8 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @set_message(i8* %3)
ret i32 undef
}