#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, int, float);
main() {
  int num1 = 15, num2 = 10;
  float result = 0;
  result = num1 + num2;
  printf("%d + %d = %f\n", num1, num2, result);
  result = num1 - num2;
  printf("%d - %d = %f\n", num1, num2, result);
  result = num1 * num2;
  printf("%d * %d = %f\n", num1, num2, result);
  result = num1 / num2;
  printf("%d / %d = %f\n", num1, num2, result);
  result = num1 % num2;
  printf("(%d / %d)[remainder] = %f\n", num1, num2, result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xf,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0xf,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
movss  0xec6(%rip),%xmm0
mov    $0xf,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
movss  0xeac(%rip),%xmm0
mov    $0xf,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
movss  0xe92(%rip),%xmm0
mov    $0xf,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0xf,%esi
mov    $0xa,%edx
movss  0xe62(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %f\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %f\0A\00"
@.str.2 = [14 x i8] c"%d * %d = %f\0A\00"
@.str.3 = [14 x i8] c"%d / %d = %f\0A\00"
@.str.4 = [27 x i8] c"(%d / %d)[remainder] = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 15, i32* %1
store i32 10, i32* %2
store float 0.000000e+00, float* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = sitofp i32 %6 to float
store float %7, float* %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, float %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
%15 = sitofp i32 %14 to float
store float %15, float* %3
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = load float, float* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17, float %18)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = mul nsw i32 %20, %21
%23 = sitofp i32 %22 to float
store float %23, float* %3
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = load float, float* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 %25, float %26)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = sdiv i32 %28, %29
%31 = sitofp i32 %30 to float
store float %31, float* %3
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = load float, float* %3
%35 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %32, i32 %33, float %34)
%36 = load i32, i32* %1
%37 = load i32, i32* %2
%38 = srem i32 %36, %37
%39 = sitofp i32 %38 to float
store float %39, float* %3
%40 = load i32, i32* %1
%41 = load i32, i32* %2
%42 = load float, float* %3
%43 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %40, i32 %41, float %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %f\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %f\0A\00"
@.str.2 = [14 x i8] c"%d * %d = %f\0A\00"
@.str.3 = [14 x i8] c"%d / %d = %f\0A\00"
@.str.4 = [27 x i8] c"(%d / %d)[remainder] = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 15, i32 10, float 2.500000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 15, i32 10, float 5.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 10, float 1.500000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 15, i32 10, float 1.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 15, i32 10, float 5.000000e+00)
ret i32 0
}