#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, int, int, int, float);
void do_arithemetic(int x, int y) {
  int a, s, m;
  float d;
  a = x + y;
  s = x - y;
  m = x * y;
  d = (float)x / y;
  printf("\nThe arithemetic calculation of %d and %d \n Add: %d, \n Subtract: "
         "%d, \n Multiply: %d, \n Divide: %.2f",
         x, y, a, s, m, d);
}


x86 assembly (clang, -O0):
<do_arithemetic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
movss  -0x18(%rbp),%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_arithemetic>:
mov    %esi,%edx
cvtsi2ss %edi,%xmm0
lea    (%rdx,%rdi,1),%ecx
mov    %esi,%r9d
cvtsi2ss %esi,%xmm1
imul   %edi,%r9d
mov    %edi,%r8d
sub    %esi,%r8d
divss  %xmm1,%xmm0
lea    0xecb(%rip),%rax
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [100 x i8] c"\0AThe arithemetic calculation of %d and %d \0A Add: %d, \0A Subtract: %d, \0A Multiply: %d, \0A Divide: %.2f\00"
define void @do_arithemetic(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %3
%19 = sitofp i32 %18 to float
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to float
%22 = fdiv float %19, %21
store float %22, float* %8
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = load float, float* %8
%29 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, float %28)
ret void
}

LLVM IR (-O2):
@.str = [100 x i8] c"\0AThe arithemetic calculation of %d and %d \0A Add: %d, \0A Subtract: %d, \0A Multiply: %d, \0A Divide: %.2f\00"
define void @do_arithemetic(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sub nsw i32 %0, %1
%5 = mul nsw i32 %1, %0
%6 = sitofp i32 %0 to float
%7 = sitofp i32 %1 to float
%8 = fdiv float %6, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3, i32 %4, i32 %5, float %8)
ret void
}