#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*/ decomposicao(double, long *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double numero, p_frac;
  long p_int;
  printf("Informe um numero: ");
  scanf("%lf", &numero);
  decomposicao(numero, &p_int, &p_frac);
  printf("Parte inteira....: %ld\n", p_int);
  printf("Parte fracionaria: %lf\n", p_frac);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <decomposicao@plt>
mov    -0x20(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
call   1060 <decomposicao@plt>
mov    (%rsp),%rsi
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Informe um numero: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [24 x i8] c"Parte inteira....: %ld\0A\00"
@.str.3 = [24 x i8] c"Parte fracionaria: %lf\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = load double, double* %2
%8 = call i32 @decomposicao(double %7, i64* %4, double* %3)
%9 = load i64, i64* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %9)
%11 = load double, double* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe um numero: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [24 x i8] c"Parte inteira....: %ld\0A\00"
@.str.3 = [24 x i8] c"Parte fracionaria: %lf\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i64
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%9 = load double, double* %1
%10 = call i32 @decomposicao(double %9, i64* %3, double* %2)
%11 = load i64, i64* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %11)
%13 = load double, double* %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}