#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 */
double fmod(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double Fmod(double a, double b, double resultado) {
  printf("Enter the divisor: ");
  scanf("%lf", &a);
  printf("Enter the dividend: ");
  scanf("%lf", &b);
  resultado = fmod(a, b);
  printf("Residue of %f / %f is %lf\n", a, b, resultado);
  return (resultado);
}


x86 assembly (clang, -O0):
<Fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xe80(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fmod>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <fmod@plt>
movaps %xmm0,%xmm2
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xe82(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the divisor: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"Enter the dividend: \00"
@.str.3 = [27 x i8] c"Residue of %f / %f is %lf\0A\00"
define double @Fmod(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 (i8*, ...) @printf(i8* 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* %4)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @fmod(double %11, double %12)
store double %13, double* %6
%14 = load double, double* %4
%15 = load double, double* %5
%16 = load double, double* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %14, double %15, double %16)
%18 = load double, double* %6
ret double %18
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter the divisor: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"Enter the dividend: \00"
@.str.3 = [27 x i8] c"Residue of %f / %f is %lf\0A\00"
define double @Fmod(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call double @fmod(double %10, double %11)
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %13, double %14, double %12)
ret double %12
}