#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 *, float, float, float, float);
void module1_section2_topic5() {
  int a = 1 + 2;
  int b = 1 - 2;
  int c = 1 * 2;
  int d = 1 / 2;
  printf("%d, %d, %d, %d\n", a, b, c, d);
  float w = 1 + 2;
  float x = 1 - 2;
  float y = 1 * 2;
  float z = 1 / 2;
  printf("%f, %f, %f, %f\n", w, x, y, z);
  w = 1 + 2.0;
  x = 1 - 2.0;
  y = 1 * 2.0;
  z = 1 / 2.0;
  printf("%f, %f, %f, %f\n", w, x, y, z);
  w = (float)1 + 2;
  x = (float)1 - 2;
  y = (float)1 * 2;
  z = (float)1 / 2;
  printf("%f, %f, %f, %f\n", w, x, y, z);
}


x86 assembly (clang, -O0):
<module1_section2_topic5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
cvtsi2ssl -0x10(%rbp),%xmm3
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movss  0xeb0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe9f(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe8e(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movss  0xe61(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe50(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe3f(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe2e(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xdfc(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xdeb(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xdda(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module1_section2_topic5>:
push   %rbx
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movss  0xed8(%rip),%xmm2
xorps  %xmm3,%xmm3
call   1030 <printf@plt>
lea    0xee1(%rip),%rbx
xorps  %xmm3,%xmm3
mov    %rbx,%rdi
movss  0xeb3(%rip),%xmm0
movss  0xeaf(%rip),%xmm1
movss  0xeab(%rip),%xmm2
call   1030 <printf@plt>
movss  0xea2(%rip),%xmm3
mov    %rbx,%rdi
movss  0xe8b(%rip),%xmm0
movss  0xe87(%rip),%xmm1
movss  0xe83(%rip),%xmm2
call   1030 <printf@plt>
mov    %rbx,%rdi
movss  0xe6b(%rip),%xmm0
movss  0xe67(%rip),%xmm1
movss  0xe63(%rip),%xmm2
movss  0xe5f(%rip),%xmm3
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%d, %d, %d, %d\0A\00"
@.str.1 = [16 x i8] c"%f, %f, %f, %f\0A\00"
define void @module1_section2_topic5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 3, i32* %1
store i32 -1, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to float
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to float
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %10, float %12, float %14, float %16)
store float 3.000000e+00, float* %5
store float -1.000000e+00, float* %6
store float 2.000000e+00, float* %7
store float 0.000000e+00, float* %8
%18 = load float, float* %5
%19 = load float, float* %6
%20 = load float, float* %7
%21 = load float, float* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %18, float %19, float %20, float %21)
store float 3.000000e+00, float* %5
store float -1.000000e+00, float* %6
store float 2.000000e+00, float* %7
store float 5.000000e-01, float* %8
%23 = load float, float* %5
%24 = load float, float* %6
%25 = load float, float* %7
%26 = load float, float* %8
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %23, float %24, float %25, float %26)
store float 3.000000e+00, float* %5
store float -1.000000e+00, float* %6
store float 2.000000e+00, float* %7
store float 5.000000e-01, float* %8
%28 = load float, float* %5
%29 = load float, float* %6
%30 = load float, float* %7
%31 = load float, float* %8
%32 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %28, float %29, float %30, float %31)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d, %d, %d, %d\0A\00"
@.str.1 = [16 x i8] c"%f, %f, %f, %f\0A\00"
define void @module1_section2_topic5() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 3.000000e+00, float -1.000000e+00, float 2.000000e+00, float 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00, float -1.000000e+00, float 2.000000e+00, float 0.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00, float -1.000000e+00, float 2.000000e+00, float 5.000000e-01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00, float -1.000000e+00, float 2.000000e+00, float 5.000000e-01)
ret void
}