#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 *, ...);
void math_homework_solver() {
  printf("math_homework_solver app\n");
  double problem0 = (6 + 9) / 3;
  double problem1 = 3 * 10 - 12;
  double problem2 = 7 - 9 + 3 * 7;
  double problem3 = 40 + 3 + (-3) * 6;
  double problem4 = 1 + 2 - 10;
  double problem5 = 3 / (6 + 9);
  double problem6 = (6 + 6 / 9) * 3;
  double problem7 = 6 * 9 - 3;
  double problem8 = (6 + 9) * 5 + 3;
  double problem9 = 10 - (6 + 9) / 3;
  printf("%lf\n", problem0);
  printf("%lf\n", problem1);
  printf("%lf\n", problem2);
  printf("%lf\n", problem3);
  printf("%lf\n", problem4);
  printf("%lf\n", problem5);
  printf("%lf\n", problem6);
  printf("%lf\n", problem7);
  printf("%lf\n", problem8);
  printf("%lf\n", problem9);
}


x86 assembly (clang, -O0):
<math_homework_solver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe62(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe57(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe44(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xe31(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xe1e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xe0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm0
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_homework_solver>:
push   %rbx
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rbx
movsd  0xec4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xeba(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xea6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe9c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
movsd  0xe62(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe73(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe69(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
movsd  0xe24(%rip),%xmm0
mov    $0x1,%al
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"math_homework_solver app\0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define void @math_homework_solver() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store double 5.000000e+00, double* %1
store double 1.800000e+01, double* %2
store double 1.900000e+01, double* %3
store double 2.500000e+01, double* %4
store double -7.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 1.800000e+01, double* %7
store double 5.100000e+01, double* %8
store double 7.800000e+01, double* %9
store double 5.000000e+00, double* %10
%12 = load double, double* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = load double, double* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = load double, double* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load double, double* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load double, double* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = load double, double* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = load double, double* %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %24)
%26 = load double, double* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = load double, double* %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %28)
%30 = load double, double* %10
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %30)
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%lf\0A\00"
@str = [25 x i8] c"math_homework_solver app\00"
define void @math_homework_solver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+01)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 1.900000e+01)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 2.500000e+01)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double -7.000000e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+01)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 5.100000e+01)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 7.800000e+01)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00)
ret void
}