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


x86 assembly (clang, -O0):
<module1_section2_topic6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
cvtsi2ssl -0x10(%rbp),%xmm3
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movss  0xe84(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe73(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe65(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe54(%rip),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe46(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe30(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe23(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xe0d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module1_section2_topic6>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
movss  0xec6(%rip),%xmm0
movss  0xec2(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
pop    %rax
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_topic6() {
%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 1, i32* %1
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 2
store i32 %10, i32* %1
store i32 1, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 2
store i32 %12, i32* %2
store i32 1, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 2
store i32 %14, i32* %3
store i32 1, i32* %4
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 2
store i32 %16, i32* %4
%17 = load i32, i32* %1
%18 = sitofp i32 %17 to float
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to float
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = load i32, i32* %4
%24 = sitofp i32 %23 to float
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %18, float %20, float %22, float %24)
store float 1.000000e+00, float* %5
%26 = load float, float* %5
%27 = fmul float %26, 2.000000e+00
store float %27, float* %5
store float 1.000000e+00, float* %6
%28 = load float, float* %6
%29 = fmul float %28, 2.000000e+00
store float %29, float* %6
store float 1.000000e+00, float* %7
%30 = load float, float* %7
%31 = fdiv float %30, 2.000000e+00
store float %31, float* %7
store float 1.000000e+00, float* %8
%32 = load float, float* %8
%33 = fdiv float %32, 2.000000e+00
store float %33, float* %8
%34 = load float, float* %5
%35 = load float, float* %6
%36 = load float, float* %7
%37 = load float, float* %8
%38 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %34, float %35, float %36, float %37)
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_topic6() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 3.000000e+00, float 3.000000e+00, float -1.000000e+00, float -1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float 2.000000e+00, float 2.000000e+00, float 5.000000e-01, float 5.000000e-01)
ret void
}