#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 *, ...);
int main(int argc, char **argv) {
  int a = 5;
  int b = 2;
  int c = 3;
  double x = 5.0;
  double y = 2.0;
  double z = 3.0;
  printf("Integer arithmetic:\n");
  printf("a = %d\n", a);
  printf("b = %d\n", b);
  printf("c = %d\n", c);
  printf("a + b = %d\n", a + b);
  printf("c * b = %d\n", c * b);
  printf("c - a * (a + b) = %d\n", c - a * (a + b));
  printf("a / b = %d\n", a / b);
  printf("b / c = %d\n", b / c);
  printf("\n");
  printf("Floating-point arithmetic:\n");
  printf("x = %g\n", x);
  printf("y = %g\n", y);
  printf("z = %g\n", z);
  printf("x + y = %g\n", x + y);
  printf("z * y = %g\n", z * y);
  printf("z - x * (x + y) = %g\n", z - x * (x + y));
  printf("x / y = %g\n", x / y);
  printf("y / z = %g\n", y / z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
imul   -0x18(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
imul   %ecx,%eax
sub    %eax,%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xe76(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
lea    0xe20(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
lea    0xe14(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xddf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
lea    0xddd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfa4(%rip),%rdi
call   1040 <puts@plt>
lea    0xefc(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0xffffffe0,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf0d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9f(%rip),%rdi
movsd  0xe09(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xea1(%rip),%rdi
movsd  0xdfb(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
movsd  0xded(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe65(%rip),%rdi
movsd  0xddf(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe5b(%rip),%rdi
movsd  0xdd1(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe51(%rip),%rdi
movsd  0xdc3(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe51(%rip),%rdi
movsd  0xdb5(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe47(%rip),%rdi
movsd  0xda7(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Integer arithmetic:\0A\00"
@.str.1 = [8 x i8] c"a = %d\0A\00"
@.str.2 = [8 x i8] c"b = %d\0A\00"
@.str.3 = [8 x i8] c"c = %d\0A\00"
@.str.4 = [12 x i8] c"a + b = %d\0A\00"
@.str.5 = [12 x i8] c"c * b = %d\0A\00"
@.str.6 = [22 x i8] c"c - a * (a + b) = %d\0A\00"
@.str.7 = [12 x i8] c"a / b = %d\0A\00"
@.str.8 = [12 x i8] c"b / c = %d\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [28 x i8] c"Floating-point arithmetic:\0A\00"
@.str.11 = [8 x i8] c"x = %g\0A\00"
@.str.12 = [8 x i8] c"y = %g\0A\00"
@.str.13 = [8 x i8] c"z = %g\0A\00"
@.str.14 = [12 x i8] c"x + y = %g\0A\00"
@.str.15 = [12 x i8] c"z * y = %g\0A\00"
@.str.16 = [22 x i8] c"z - x * (x + y) = %g\0A\00"
@.str.17 = [12 x i8] c"x / y = %g\0A\00"
@.str.18 = [12 x i8] c"y / z = %g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 2, i32* %7
store i32 3, i32* %8
store double 5.000000e+00, double* %9
store double 2.000000e+00, double* %10
store double 3.000000e+00, double* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = add nsw i32 %29, %30
%32 = mul nsw i32 %28, %31
%33 = sub nsw i32 %27, %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = sdiv i32 %35, %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = sdiv i32 %39, %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%45 = load double, double* %9
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), double %45)
%47 = load double, double* %10
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), double %47)
%49 = load double, double* %11
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), double %49)
%51 = load double, double* %9
%52 = load double, double* %10
%53 = fadd double %51, %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), double %53)
%55 = load double, double* %11
%56 = load double, double* %10
%57 = fmul double %55, %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), double %57)
%59 = load double, double* %11
%60 = load double, double* %9
%61 = load double, double* %9
%62 = load double, double* %10
%63 = fadd double %61, %62
%64 = fneg double %60
%65 = call double @llvm.fmuladd.f64(double %64, double %63, double %59)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), double %65)
%67 = load double, double* %9
%68 = load double, double* %10
%69 = fdiv double %67, %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), double %69)
%71 = load double, double* %10
%72 = load double, double* %11
%73 = fdiv double %71, %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), double %73)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"a = %d\0A\00"
@.str.2 = [8 x i8] c"b = %d\0A\00"
@.str.3 = [8 x i8] c"c = %d\0A\00"
@.str.4 = [12 x i8] c"a + b = %d\0A\00"
@.str.5 = [12 x i8] c"c * b = %d\0A\00"
@.str.6 = [22 x i8] c"c - a * (a + b) = %d\0A\00"
@.str.7 = [12 x i8] c"a / b = %d\0A\00"
@.str.8 = [12 x i8] c"b / c = %d\0A\00"
@.str.11 = [8 x i8] c"x = %g\0A\00"
@.str.12 = [8 x i8] c"y = %g\0A\00"
@.str.13 = [8 x i8] c"z = %g\0A\00"
@.str.14 = [12 x i8] c"x + y = %g\0A\00"
@.str.15 = [12 x i8] c"z * y = %g\0A\00"
@.str.16 = [22 x i8] c"z - x * (x + y) = %g\0A\00"
@.str.17 = [12 x i8] c"x / y = %g\0A\00"
@.str.18 = [12 x i8] c"y / z = %g\0A\00"
@str = [20 x i8] c"Integer arithmetic:\00"
@str.19 = [27 x i8] c"Floating-point arithmetic:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 7)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 6)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 -32)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 2)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 0)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.19, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), double 5.000000e+00)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), double 2.000000e+00)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), double 3.000000e+00)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), double 7.000000e+00)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), double 6.000000e+00)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), double -3.200000e+01)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), double 2.500000e+00)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), double 0x3FE5555555555555)
ret i32 0
}