#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 *, ...);
void setPoids(unsigned char *trame, float *ptPoids) {
  int i = 7;
  float poids = *ptPoids;
  unsigned char *pds = (unsigned char *)&poids;
  trame[7] = pds[0];
  trame[8] = pds[1];
  trame[9] = pds[2];
  trame[10] = pds[3];
  trame[11] = pds[4];
  trame[12] = pds[5];
  trame[13] = pds[6];
  trame[14] = pds[7];
  printf("poids       = ");
  while (i < 11) {
    printf("%2.2X ", trame[i]);
    i++;
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<setPoids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x20(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x20(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xb(%rax)
mov    -0x20(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xc(%rax)
mov    -0x20(%rbp),%rax
mov    0x6(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xd(%rax)
mov    -0x20(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xe(%rax)
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xb,-0x14(%rbp)
jge    11eb <setPoids+0xdb>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b9 <setPoids+0xa9>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPoids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rsi),%eax
mov    %eax,0x7(%rdi)
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x7(%rbx),%esi
lea    0xeca(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"poids = \00"
@.str.1 = [7 x i8] c"%2.2X \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @setPoids(i8* %0, float* %1) {
%3 = alloca i8*
%4 = alloca float*
%5 = alloca i32
%6 = alloca float
%7 = alloca i8*
store i8* %0, i8** %3
store float* %1, float** %4
store i32 7, i32* %5
%8 = load float*, float** %4
%9 = load float, float* %8
store float %9, float* %6
%10 = bitcast float* %6 to i8*
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 7
store i8 %13, i8* %15
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 8
store i8 %18, i8* %20
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 9
store i8 %23, i8* %25
%26 = load i8*, i8** %7
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 10
store i8 %28, i8* %30
%31 = load i8*, i8** %7
%32 = getelementptr inbounds i8, i8* %31, i64 4
%33 = load i8, i8* %32
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 11
store i8 %33, i8* %35
%36 = load i8*, i8** %7
%37 = getelementptr inbounds i8, i8* %36, i64 5
%38 = load i8, i8* %37
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 12
store i8 %38, i8* %40
%41 = load i8*, i8** %7
%42 = getelementptr inbounds i8, i8* %41, i64 6
%43 = load i8, i8* %42
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 13
store i8 %43, i8* %45
%46 = load i8*, i8** %7
%47 = getelementptr inbounds i8, i8* %46, i64 7
%48 = load i8, i8* %47
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i64 14
store i8 %48, i8* %50
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %52
52: ; preds = %55, %2
%53 = load i32, i32* %5
%54 = icmp slt i32 %53, 11
br i1 %54, label %55, label %65
55: ; preds = %52
%56 = load i8*, i8** %3
%57 = load i32, i32* %5
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %56, i64 %58
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %52
65: ; preds = %52
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"poids = \00"
@.str.1 = [7 x i8] c"%2.2X \00"
@str = [2 x i8] c"\0A\00"
define void @setPoids(i8* nocapture %0, float* nocapture %1) {
%3 = bitcast float* %1 to i32*
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %5, i8* %6
%7 = lshr i32 %4, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %8, i8* %9
%10 = lshr i32 %4, 16
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %11, i8* %12
%13 = lshr i32 %4, 24
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %14, i8* %15
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i8, i8* %12
%24 = zext i8 %23 to i32
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i8, i8* %15
%27 = zext i8 %26 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}