#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int favoritenumber, userage;
  float sum, product, quotient, difference, modulus;
  printf("What is your favorite whole number? \n");
  scanf("%d", &favoritenumber);
  printf("How old are you? \n");
  scanf("%d", &userage);
  sum = (favoritenumber + userage);
  printf("The sum of your favorite number and your age is %.1f \n", sum);
  difference = (favoritenumber - userage);
  printf("The difference between your favorite number and your age is %.1f \n",
         difference);
  product = (favoritenumber * userage);
  printf("The product of your favorite number and your age is %.1f \n",
         product);
  quotient = (userage / favoritenumber);
  printf("The quotient between your favorite number and your age is %d \n",
         quotient);
  modulus = (favoritenumber % userage);
  printf("The remainder between your favorite number and your age is %.1f \n",
         modulus);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xef3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xffd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1002(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
sub    0x8(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
cltd
idivl  0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
cltd
idivl  0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeeb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"What is your favorite whole number? \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"How old are you? \0A\00"
@.str.3 = [55 x i8] c"The sum of your favorite number and your age is %.1f \0A\00"
@.str.4 = [67 x i8] c"The difference between your favorite number and your age is %.1f \0A\00"
@.str.5 = [59 x i8] c"The product of your favorite number and your age is %.1f \0A\00"
@.str.6 = [63 x i8] c"The quotient between your favorite number and your age is %d \0A\00"
@.str.7 = [66 x i8] c"The remainder between your favorite number and your age is %.1f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = sitofp i32 %15 to float
store float %16, float* %4
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), double %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = sub nsw i32 %20, %21
%23 = sitofp i32 %22 to float
store float %23, float* %7
%24 = load float, float* %7
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), double %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = mul nsw i32 %27, %28
%30 = sitofp i32 %29 to float
store float %30, float* %5
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %32)
%34 = load i32, i32* %3
%35 = load i32, i32* %2
%36 = sdiv i32 %34, %35
%37 = sitofp i32 %36 to float
store float %37, float* %6
%38 = load float, float* %6
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), double %39)
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = srem i32 %41, %42
%44 = sitofp i32 %43 to float
store float %44, float* %8
%45 = load float, float* %8
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), double %46)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [55 x i8] c"The sum of your favorite number and your age is %.1f \0A\00"
@.str.4 = [67 x i8] c"The difference between your favorite number and your age is %.1f \0A\00"
@.str.5 = [59 x i8] c"The product of your favorite number and your age is %.1f \0A\00"
@.str.6 = [63 x i8] c"The quotient between your favorite number and your age is %d \0A\00"
@.str.7 = [66 x i8] c"The remainder between your favorite number and your age is %.1f \0A\00"
@str = [37 x i8] c"What is your favorite whole number? \00"
@str.8 = [18 x i8] c"How old are you? \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = sub nsw i32 %15, %16
%18 = sitofp i32 %17 to float
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), double %19)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, %21
%24 = sitofp i32 %23 to float
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %1
%29 = sdiv i32 %27, %28
%30 = sitofp i32 %29 to float
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), double %31)
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = srem i32 %33, %34
%36 = sitofp i32 %35 to float
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), double %37)
ret i32 0
}