#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*/ show_double(double);
int /*<<< orphan*/ show_float(float);
int /*<<< orphan*/ show_int(int);
int /*<<< orphan*/ show_long(long);
int /*<<< orphan*/ show_pointer(int *);
int /*<<< orphan*/ show_short(short);
void test_show_bytes(int val) {
  int ival = val;
  float fval = (float)ival;
  int *pval = &ival;
  show_int(ival);
  show_float(fval);
  show_pointer(pval);
  short sval = (short)ival;
  long lval = (long)ival;
  double dval = (double)ival;
  show_short(sval);
  show_long(lval);
  show_double(dval);
}


x86 assembly (clang, -O0):
<test_show_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <show_int@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <show_float@plt>
mov    -0x18(%rbp),%rdi
call   1070 <show_pointer@plt>
mov    -0x8(%rbp),%eax
mov    %ax,-0x1a(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movswl -0x1a(%rbp),%edi
call   1050 <show_short@plt>
mov    -0x28(%rbp),%rdi
call   1030 <show_long@plt>
movsd  -0x30(%rbp),%xmm0
call   1080 <show_double@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_show_bytes>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x4(%rsp)
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x8(%rsp)
call   1060 <show_int@plt>
movss  0x8(%rsp),%xmm0
call   1040 <show_float@plt>
lea    0x4(%rsp),%rdi
call   1070 <show_pointer@plt>
movslq 0x4(%rsp),%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x8(%rsp)
movswl %bx,%edi
call   1050 <show_short@plt>
mov    %rbx,%rdi
call   1030 <show_long@plt>
movsd  0x8(%rsp),%xmm0
call   1080 <show_double@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32*
%6 = alloca i16
%7 = alloca i64
%8 = alloca double
store i32 %0, i32* %2
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
store float %11, float* %4
store i32* %3, i32** %5
%12 = load i32, i32* %3
%13 = call i32 @show_int(i32 %12)
%14 = load float, float* %4
%15 = call i32 @show_float(float %14)
%16 = load i32*, i32** %5
%17 = call i32 @show_pointer(i32* %16)
%18 = load i32, i32* %3
%19 = trunc i32 %18 to i16
store i16 %19, i16* %6
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
store i64 %21, i64* %7
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
store double %23, double* %8
%24 = load i16, i16* %6
%25 = call i32 @show_short(i16 signext %24)
%26 = load i64, i64* %7
%27 = call i32 @show_long(i64 %26)
%28 = load double, double* %8
%29 = call i32 @show_double(double %28)
ret void
}

LLVM IR (-O2):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = sitofp i32 %0 to float
%5 = tail call i32 @show_int(i32 %0)
%6 = tail call i32 @show_float(float %4)
%7 = call i32 @show_pointer(i32* %2)
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i16
%10 = sext i32 %8 to i64
%11 = sitofp i32 %8 to double
%12 = call i32 @show_short(i16 signext %9)
%13 = call i32 @show_long(i64 %10)
%14 = call i32 @show_double(double %11)
ret void
}