#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*/ get_message();
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
int ecriture_s(int ta_socket) {
  char message[256];
  strcpy(message, get_message());
  int n = strlen(message);
  printf("%s de taille %d\n", message, n);
  write(ta_socket, message, n);
}


x86 assembly (clang, -O0):
<ecriture_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    $0x0,%al
call   1030 <get_message@plt>
mov    -0x120(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    -0x110(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
lea    0xe59(%rip),%rdi
call   1070 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1050 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecriture_s>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <get_message@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
lea    0xe7d(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1070 <printf@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <write@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s de taille %d\0A\00"
define i32 @ecriture_s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = call i32 (...) @get_message()
%8 = call i32 @strcpy(i8* %6, i32 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
%14 = load i32, i32* %3
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%16 = load i32, i32* %5
%17 = call i32 @write(i32 %14, i8* %15, i32 %16)
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s de taille %d\0A\00"
define i32 @ecriture_s(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @get_message()
%5 = call i32 @strcpy(i8* %3, i32 %4)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %6)
%8 = call i32 @write(i32 %0, i8* %3, i32 %6)
ret i32 undef
}