#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  double rem;
};

/* Variables and functions */
TYPE_1__ ldiv(int, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double a, b;
  scanf("%lf%lf\n", &a, &b);
  printf("%d\n", (int)(a / b));
  printf("%ld\n", ldiv((int)a, (int)b).rem);
  printf("%lf\n", a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%edi
cvttsd2si -0x18(%rbp),%esi
call   1040 <ldiv@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si 0x10(%rsp),%edi
cvttsd2si 0x8(%rsp),%esi
call   1040 <ldiv@plt>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { double }
@.str = [8 x i8] c"%lf%lf\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [5 x i8] c"%ld\0A\00"
@.str.3 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca %struct.TYPE_2__
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %2
%13 = fptosi double %12 to i32
%14 = load double, double* %3
%15 = fptosi double %14 to i32
%16 = call double @ldiv(i32 %13, i32 %15)
%17 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
store double %16, double* %17
%18 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%19 = load double, double* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = load double, double* %2
%22 = load double, double* %3
%23 = fdiv double %21, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf%lf\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [5 x i8] c"%ld\0A\00"
@.str.3 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %1
%13 = fptosi double %12 to i32
%14 = load double, double* %2
%15 = fptosi double %14 to i32
%16 = call double @ldiv(i32 %13, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = load double, double* %1
%19 = load double, double* %2
%20 = fdiv double %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %20)
ret i32 0
}