#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 */
char *calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *Requete_Pose_Bloc(int x, int y, int index) {
  char *Requete;
  char *req = calloc(30, sizeof(char));
  sprintf(req, "3,%d,%d,%d", x, y, index);
  Requete = calloc((strlen(req) + 1), sizeof(char));
  strcpy(Requete, req);
  return Requete;
}


x86 assembly (clang, -O0):
<Requete_Pose_Bloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe87(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Requete_Pose_Bloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    $0x1e,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbp
lea    0xe98(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"3,%d,%d,%d\00"
define i8* @Requete_Pose_Bloc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i8* @calloc(i32 30, i32 1)
store i8* %9, i8** %8
%10 = load i8*, i8** %8
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i8*, i8** %8
%16 = call i32 @strlen(i8* %15)
%17 = add nsw i32 %16, 1
%18 = call i8* @calloc(i32 %17, i32 1)
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @strcpy(i8* %19, i8* %20)
%22 = load i8*, i8** %7
ret i8* %22
}

LLVM IR (-O2):
@.str = [11 x i8] c"3,%d,%d,%d\00"
define i8* @Requete_Pose_Bloc(i32 %0, i32 %1, i32 %2) {
%4 = tail call dereferenceable_or_null(30) i8* @calloc(i32 30, i32 1)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @strlen(i8* %4)
%7 = add nsw i32 %6, 1
%8 = tail call i8* @calloc(i32 %7, i32 1)
%9 = tail call i32 @strcpy(i8* %8, i8* %4)
ret i8* %8
}