#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 *, double, double, float);
void module1_section2_topic1() {
  int number_1 = 6;
  int number_2 = 9;
  int result_1 = number_1 * 10 + number_2;
  printf("%d * 10 + %d == %d", number_1, number_2, result_1);
  float result_2 = number_1 / number_2;
  printf("%d * 10 + %d == %f", number_1, number_2, result_2);
  double result_3 = result_2 - result_1;
  printf("%f - 10 + %d == %lf", result_2, result_1, result_3);
  float result_4 = result_3 / result_3;
  printf("%lf / %lf == %f", result_3, result_3, result_4);
}


x86 assembly (clang, -O0):
<module1_section2_topic1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
imul   $0xa,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
cvtsd2ss %xmm2,%xmm2
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module1_section2_topic1>:
push   %rax
lea    0xf14(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movss  0xef0(%rip),%xmm2
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
xorps  %xmm2,%xmm2
movsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
movsd  0xead(%rip),%xmm1
movss  0xeb9(%rip),%xmm2
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
movsd  0xe96(%rip),%xmm0
movss  0xe9e(%rip),%xmm2
movaps %xmm0,%xmm1
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%d * 10 + %d == %d\00"
@.str.1 = [19 x i8] c"%d * 10 + %d == %f\00"
@.str.2 = [20 x i8] c"%f - 10 + %d == %lf\00"
@.str.3 = [16 x i8] c"%lf / %lf == %f\00"
define void @module1_section2_topic1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca double
%6 = alloca float
store i32 6, i32* %1
store i32 9, i32* %2
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 10
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %1
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to float
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %12, double %14, float %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = sdiv i32 %18, %19
%21 = sitofp i32 %20 to float
store float %21, float* %4
%22 = load i32, i32* %1
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to double
%26 = load float, float* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %23, double %25, float %26)
%28 = load float, float* %4
%29 = load i32, i32* %3
%30 = sitofp i32 %29 to float
%31 = fsub float %28, %30
%32 = fpext float %31 to double
store double %32, double* %5
%33 = load float, float* %4
%34 = fpext float %33 to double
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to double
%37 = load double, double* %5
%38 = fptrunc double %37 to float
%39 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %34, double %36, float %38)
%40 = load double, double* %5
%41 = load double, double* %5
%42 = fdiv double %40, %41
%43 = fptrunc double %42 to float
store float %43, float* %6
%44 = load double, double* %5
%45 = load double, double* %5
%46 = load float, float* %6
%47 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %44, double %45, float %46)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d * 10 + %d == %d\00"
@.str.1 = [19 x i8] c"%d * 10 + %d == %f\00"
@.str.2 = [20 x i8] c"%f - 10 + %d == %lf\00"
@.str.3 = [16 x i8] c"%lf / %lf == %f\00"
define void @module1_section2_topic1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 6.000000e+00, double 9.000000e+00, float 6.900000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+00, double 9.000000e+00, float 0.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00, double 6.900000e+01, float -6.900000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double -6.900000e+01, double -6.900000e+01, float 1.000000e+00)
ret void
}